Carrot Cake with Cream Cheese Frosting

Ingredients:
1 tablespoon unsalted butter, for greasing the pans
2 cups unbleached all-purpose flour
1 teaspoon baking powder
3/4 teaspoon baking soda
3/4 teaspoon fine sea salt or table salt
2 teaspoons ground cinnamon
1/2 teaspoon freshly grated nutmeg
1/4 teaspoon ground allspice
2 cups packed light brown sugar
4 large eggs, at room temperature
1 cup safflower or canola oil
1 pound carrots, trimmed, peeled, and coarsely grated on the largest holes of a box grater or the fine grating blade of food processor (about 3 lightly packed cups total)
2/3 cup walnuts or pecans, coarsely chopped, plus more lightly toasted nuts for garnish
2/3 cup dark or golden raisins
2 (8-ounce) packages cream cheese, chilled
11 tablespoons unsalted butter, softened at room temperature
"1 1/3 cup confectioners sugar, sifted after measuring", 1 tablespoon pure vanilla extract
Equipment: 2 (9-inch-round
2-inch-deep) cake pans or 1 (9- by 13-inch) baking pan; parchment paper; stand mixer fitted with the paddle attachment; 1 to 2 wire cooling racks

Instructions:
Position a rack in the middle of the oven and preheat to 375°F. Butter the bottom and sides of 2 (9-inch-round, 2-inch-deep) cake pans and line the bottoms with parchment paper.
In a large bowl, whisk together the flour, baking powder, baking soda, salt, cinnamon, nutmeg, and allspice.
In the bowl of a stand mixer fitted with the paddle attachment, mix the brown sugar on the lowest speed to break up any lumps. Add 1 egg and continue to mix on low until smooth and incorporated. Add the remaining eggs, one at a time, and mix on low until smooth and incorporated. Shut off the mixer and scrape down the bowl and paddle. Return the mixer to low then add the oil in a thin steady stream and continue to beat until fully incorporated.
Add the flour mixture in 3 batches, using a large rubber spatula to fold the mixture together until just incorporated. Fold in the carrots, along with the nuts and raisins, if using.
Divide the batter between the prepared pans and smooth the tops. Bake until the layers are firm and risen and the tip of a paring knife inserted in the center of the cake emerges clean, about 40 minutes. Transfer to a wire rack to let cool for 5 minutes then invert the cake layers onto the rack and peel off the parchment paper. Use another rack or a large plate to invert the cake layers again then slide them back on to the rack so they are right side up. Let the cake layers cool completely. DO AHEAD: The cakes can be baked ahead, cooled, wrapped in a double layer of plastic wrap, and refrigerated for up to 2 days, or frozen up to 1 month.
In the bowl of a stand mixer fitted with the paddle attachment, combine the cream cheese and butter and beat on medium until smooth, 30 seconds to 1 minute. Shut off the mixer and scrape down the bowl and paddle. Add the confectioners' sugar and vanilla, and beat on medium, scraping down the bowl and paddle as necessary, until light and fluffy, about 2 minutes.
Place 1 cake layer on a large plate and cover the top with about 1/3 of the frosting. Invert the second layer on top of the frosted bottom layer so that the flat side (the bottom) is on top. Spread the remaining frosting on the sides and top of the cake. If you used walnuts or pecans in the cake, sprinkle the frosting with a few tablespoons of lightly toasted chopped nuts. Keep at cool room temperature until serving time. DO AHEAD: Carrot cake can be baked and frosted ahead and kept, in an airtight cake dome, at cool room temperature, for 2 to 3 days.