2#include "EmcRec/EmcRecShowerEnergy.h"
3#include "EmcRec/EmcRecNeighbor.h"
4#include "EmcRec/EmcRecParameter.h"
8 RecEmcFractionMap::const_iterator cit;
25 vector<RecEmcEnergy> eVec;
26 vector<RecEmcEnergy>::const_iterator ciVec;
28 tmpNearCell.push_back(CellId);
29 tmpNextNearCell.push_back(CellId);
31 cit=aShower.
Find(CellId);
33 e1=(cit->second.getEnergy())*(cit->second.getFraction());
34 e9+=(cit->second.getEnergy())*(cit->second.getFraction());
35 e25+=(cit->second.getEnergy())*(cit->second.getFraction());
38 for(pNearCell=NearCell.begin();
39 pNearCell!=NearCell.end();
41 cit=aShower.
Find(*pNearCell);
42 if(cit!=aShower.
End()) {
43 tmpNearCell.push_back(*pNearCell);
44 tmpNextNearCell.push_back(*pNearCell);
45 e9+=cit->second.getEnergy()*cit->second.getFraction();
46 e25+=cit->second.getEnergy()*cit->second.getFraction();
51 for(pNextNearCell=NextNearCell.begin();
52 pNextNearCell!=NextNearCell.end();
54 cit=aShower.
Find(*pNextNearCell);
55 if(cit!=aShower.
End()) {
56 tmpNextNearCell.push_back(*pNextNearCell);
57 e25+=cit->second.getEnergy()*cit->second.getFraction();
62 for(cit=aShower.
Begin();cit!=aShower.
End();++cit) {
63 eall+=(cit->second.getEnergy())*(cit->second.getFraction());
64 eVec.push_back(cit->second.getEnergy()*cit->second.getFraction());
74 sort(eVec.begin(), eVec.end(), greater<RecEmcEnergy>());
76 for(ciVec=eVec.begin();ciVec!=eVec.end();ciVec++) {
88 if(getthetaid>21)getthetaid=43-getthetaid;
89 if(getmodule==1)getthetaid=getthetaid+6;
90 double dthetaid=double(getthetaid);
91 double eCorr = Para.
ECorrMC(e25,dthetaid);
95 de1 = Para.
SigE(0)/eCorr;
96 de2 = Para.
SigE(1)/pow(eCorr,0.25);
98 de = sqrt(de1*de1+de2*de2+de3*de3)*perCent*eCorr;
100 double err = Para.
ErrMC(e25,dthetaid);
101 if(err>0) de = err*e25;
127 if(eIn>3.)
return eIn;
133 for(
int i=0;i<4;i++) {
134 par[i]=Para.
ECorr(i);
137 eOut = eIn/(par[0]+par[1]*eIn+par[2]*eIn*eIn+par[3]*eIn*eIn*eIn);
150 eOut *= 1.843/Para.
Peak(ntheta);
151 }
else if(npart==0) {
152 eOut *= 1.843/Para.
Peak(ntheta+44);
153 }
else if(npart==2) {
154 eOut *= 1.843/Para.
Peak(ntheta+50);
RecEmcIDVector::iterator i_RecEmcIDVector
vector< RecEmcID > RecEmcIDVector
void setE3x3(double e3x3)
void setESeed(double eSeed)
void setTrackId(int trackId)
void setE5x5(double e5x5)
static unsigned int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0)
static unsigned int theta_module(const Identifier &id)
RecEmcIDVector GetNeighbors(const Identifier &id)
RecEmcIDVector GetNextNeighbors(const Identifier &id)
double ECorr(int n) const
double ECorrMC(double eg, double theid) const
static EmcRecParameter & GetInstance()
double HitNb(int n) const
double ErrMC(double eg, double theid) const
RecEmcEnergy ECorrection(const RecEmcEnergy eIn)
RecEmcEnergy ECorrTheta(const RecEmcEnergy eIn, const RecEmcID &id)
void Energy(RecEmcShower &aShower)
RecEmcFractionMap::const_iterator End() const
void CellId3x3(RecEmcIDVector &id3x3)
RecEmcEnergy EAll(RecEmcEnergy e)
RecEmcEnergy ELepton(RecEmcEnergy e)
RecEmcID getShowerId() const
RecEmcFractionMap::const_iterator Begin() const
RecEmcFractionMap::const_iterator Find(const RecEmcID &CellId) const
unsigned int getSize() const
void CellId5x5(RecEmcIDVector &id5x5)