62 {
64 if ( fracMap.size() < 2 )
65 {
67 return;
68 }
69
70 vector<RecEmcFraction> aFractionVec;
71 RecEmcFractionMap::const_iterator it;
72 for ( it = fracMap.begin(); it != fracMap.end(); it++ )
73 { aFractionVec.push_back( it->second ); }
74
75
76 partial_sort( aFractionVec.begin(), aFractionVec.begin() + 2, aFractionVec.end(),
77 greater<RecEmcFraction>() );
78
79
80 vector<RecEmcFraction>::iterator iVec;
81 double numerator = 0;
82 double denominator = 0;
84 for ( iVec = aFractionVec.begin(); iVec != aFractionVec.end(); iVec++ )
85 {
88
89
92 {
93
98 double lengthemc;
99 lengthemc =
abs( pos.z() /
cos( pos.theta() ) );
100 double posDataCorPar = 0.0;
101 if ( module == 1 ) posDataCorPar = Para.
BarrPosDataCor( thetaModule, phiModule );
102 if ( module == 0 ) posDataCorPar = Para.
EastPosDataCor( thetaModule, phiModule );
103 if ( module == 2 ) posDataCorPar = Para.
WestPosDataCor( thetaModule, phiModule );
104
105 pos.setTheta( pos.theta() - posDataCorPar / lengthemc );
106
107 }
108
109
110
111 double r = pos.mag() *
sin( aShower.
position().angle( pos ) );
112
113 double energy = ( *iVec ).getEnergy() * ( *iVec ).getFraction();
114 if (
n < 3 ) { denominator += 5.2 * 5.2 *
energy; }
115 else
116 {
117 numerator += r * r *
energy;
118 denominator += r * r *
energy;
119 }
120 }
121 double lat = -99;
122 if ( denominator > 0 ) lat = numerator / denominator;
123
125}
double sin(const BesAngle a)
double cos(const BesAngle a)
void setLatMoment(double latMoment)
static unsigned int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0).
static unsigned int theta_module(const Identifier &id)
static unsigned int phi_module(const Identifier &id)
static EmcRecParameter & GetInstance()
double EastPosDataCor(int ntheta, int nphi) const
double WestPosDataCor(int ntheta, int nphi) const
double BarrPosDataCor(int ntheta, int nphi) const