18 RecEmcShowerMap::iterator iShowerMap;
19 for(iShowerMap=aShowerMap.begin();
20 iShowerMap!=aShowerMap.end();
24 double eShower = iShowerMap->second.e5x5();
27 matWindow = 0.01277+0.004268/sqrt(eShower);
30 double phi = iShowerMap->second.phi();
31 phi = phi < 0 ? phi+CLHEP::twopi : phi;
33 int nphi1 = (int)(phi*88./CLHEP::twopi);
34 int nphi2 = (int)(phi*88./CLHEP::twopi+0.5);
39 double emax=tofHitMap[nphi1].Energy();
40 if(tofHitMap[nphi1-1].Energy() > emax) {
41 emax = tofHitMap[nphi1-1].Energy();
44 if(tofHitMap[nphi1+1].Energy() > emax) {
45 emax = tofHitMap[nphi1+1].Energy();
51 emax=tofHitMap[nphi2].Energy();
52 if(tofHitMap[nphi2-1].Energy() > emax) {
53 emax = tofHitMap[nphi2-1].Energy();
56 if(tofHitMap[nphi2+1].Energy() > emax) {
57 emax = tofHitMap[nphi2+1].Energy();
64 int nphi[6] = { nphi1-1, nphi1, nphi1+1, nphi2-1, nphi2, nphi2+1 };
66 for(
int i=0;i<6;i++) {
68 if(tofHitMap[nphi[i]].Energy()<=0)
continue;
80 if(fabs(pos.theta()-iShowerMap->second.theta())<3*matWindow) {
81 etof2x3 += tofHitMap[nphi[i]].Energy();
83 etof2x1 += tofHitMap[nphi[i]].Energy();
87 tofHitMap[nphi[i]].Energy(0);
90 double ecorr = iShowerMap->second.e5x5() + etof2x3/GeV;
92 iShowerMap->second.ETof2x3(etof2x3/GeV);
93 iShowerMap->second.ETof2x1(etof2x1/GeV);