#include <EmcRecTofMatch.h>
Public Member Functions | |
EmcRecTofMatch () | |
~EmcRecTofMatch () | |
void | Match (RecEmcShowerMap &aShowerMap, RecEmcTofHitMap &tofHitMap) |
RecEmcEnergy | ECorrection (const RecEmcEnergy eIn) |
Definition at line 11 of file EmcRecTofMatch.h.
EmcRecTofMatch::EmcRecTofMatch | ( | ) |
EmcRecTofMatch::~EmcRecTofMatch | ( | ) |
RecEmcEnergy EmcRecTofMatch::ECorrection | ( | const RecEmcEnergy | eIn | ) |
Definition at line 98 of file EmcRecTofMatch.cxx.
References EmcRecParameter::ECorr(), EmcRecParameter::GetInstance(), and genRecEmupikp::i.
Referenced by Match().
00099 { 00100 EmcRecParameter& Para=EmcRecParameter::GetInstance(); 00101 00102 RecEmcEnergy eOut=0; 00103 double par[4]; 00104 for(int i=0;i<4;i++) { 00105 par[i]=Para.ECorr(i); 00106 } 00107 00108 eOut = eIn/(par[0]+par[1]*eIn+par[2]*eIn*eIn+par[3]*eIn*eIn*eIn); 00109 return eOut; 00110 }
void EmcRecTofMatch::Match | ( | RecEmcShowerMap & | aShowerMap, | |
RecEmcTofHitMap & | tofHitMap | |||
) |
Definition at line 15 of file EmcRecTofMatch.cxx.
References ECorrection(), genRecEmupikp::i, and boss::pos.
00017 { 00018 RecEmcShowerMap::iterator iShowerMap; 00019 for(iShowerMap=aShowerMap.begin(); 00020 iShowerMap!=aShowerMap.end(); 00021 iShowerMap++) { 00022 00023 // calculate matching window 00024 double eShower = iShowerMap->second.e5x5(); 00025 double matWindow = 0; 00026 if(eShower>0) { 00027 matWindow = 0.01277+0.004268/sqrt(eShower); 00028 } 00029 00030 double phi = iShowerMap->second.phi(); 00031 phi = phi < 0 ? phi+CLHEP::twopi : phi; 00032 00033 int nphi1 = (int)(phi*88./CLHEP::twopi); //tof layer1 number 00034 int nphi2 = (int)(phi*88./CLHEP::twopi+0.5); //tof layer2 number 00035 nphi2 += 88; 00036 00037 //find max energy in both layer of tof 00038 int nphi1max=nphi1; 00039 double emax=tofHitMap[nphi1].Energy(); 00040 if(tofHitMap[nphi1-1].Energy() > emax) { 00041 emax = tofHitMap[nphi1-1].Energy(); 00042 nphi1max = nphi1-1; 00043 } 00044 if(tofHitMap[nphi1+1].Energy() > emax) { 00045 emax = tofHitMap[nphi1+1].Energy(); 00046 nphi1max = nphi1+1; 00047 } 00048 nphi1 = nphi1max; 00049 00050 int nphi2max=nphi2; 00051 emax=tofHitMap[nphi2].Energy(); 00052 if(tofHitMap[nphi2-1].Energy() > emax) { 00053 emax = tofHitMap[nphi2-1].Energy(); 00054 nphi2max = nphi2-1; 00055 } 00056 if(tofHitMap[nphi2+1].Energy() > emax) { 00057 emax = tofHitMap[nphi2+1].Energy(); 00058 nphi2max = nphi2+1; 00059 } 00060 nphi2 = nphi2max; 00061 00062 double etof2x1=0; 00063 double etof2x3=0; 00064 int nphi[6] = { nphi1-1, nphi1, nphi1+1, nphi2-1, nphi2, nphi2+1 }; 00065 00066 for(int i=0;i<6;i++) { 00067 00068 if(tofHitMap[nphi[i]].Energy()<=0) continue; 00069 00070 HepPoint3D pos=tofHitMap[nphi[i]].Position(); 00071 /*if(i<1) { 00072 //tof layer1 center 00073 pos = HepPoint3D(0,838.5,tofHitMap[nphi[i]].ZPosition()); 00074 } else { 00075 //tof layer2 center 00076 pos = HepPoint3D(0,895.5,tofHitMap[nphi[i]].ZPosition()); 00077 }*/ 00078 00079 //matching window 00080 if(fabs(pos.theta()-iShowerMap->second.theta())<3*matWindow) { 00081 etof2x3 += tofHitMap[nphi[i]].Energy(); 00082 if( i==1 || i==4 ) { 00083 etof2x1 += tofHitMap[nphi[i]].Energy(); 00084 } 00085 } 00086 00087 tofHitMap[nphi[i]].Energy(0); 00088 } 00089 00090 double ecorr = iShowerMap->second.e5x5() + etof2x3/GeV; 00091 00092 iShowerMap->second.ETof2x3(etof2x3/GeV); 00093 iShowerMap->second.ETof2x1(etof2x1/GeV); 00094 iShowerMap->second.setEnergy(ECorrection(ecorr)); 00095 } 00096 }