  A simulation study of energy resolution, position resolution, and
$\pi^0$-$\gamma$ separation using multivariate methods of a sampling
calorimeter is presented. As a realistic example, the geometry of the
calorimeter is taken from the design geometry of the Shashlik calorimeter which
was considered as a candidate for CMS endcap for the phase II of LHC running.
The methods proposed in this paper can be easily adapted to various geometrical
layouts of a sampling calorimeter. Energy resolution is studied for different
layouts and different absorber-scintillator combinations of the Shashlik
detector. It is shown that a boosted decision tree using fine grained
information of the calorimeter can perform three times better than a cut-based
method for separation of $\pi^0$ from $\gamma$ over a large energy range of 20
GeV-200 GeV.
