#include <EmcRecShowerShape.h>
Public Member Functions | |
void | A20Moment (RecEmcShower &aShower) const |
void | A20Moment (RecEmcShower &aShower) const |
void | A42Moment (RecEmcShower &aShower) const |
void | A42Moment (RecEmcShower &aShower) const |
void | CalculateMoment (RecEmcShower &aShower) const |
void | CalculateMoment (RecEmcShower &aShower) const |
void | LatMoment (RecEmcShower &aShower) const |
void | LatMoment (RecEmcShower &aShower) const |
void | SecondMoment (RecEmcShower &aShower) const |
void | SecondMoment (RecEmcShower &aShower) const |
|
|
|
00088 { 00089 double a20=0; 00090 const double R0=15.6; 00091 Hep3Vector r0(aShower.position()); //shower center 00092 RecEmcFractionMap fracMap=aShower.getFractionMap5x5(); 00093 RecEmcFractionMap::const_iterator it; 00094 for(it=fracMap.begin(); 00095 it!=fracMap.end(); 00096 it++){ 00097 double energy=it->second.getEnergy()*it->second.getFraction(); 00098 HepPoint3D pos(it->second.getFrontCenter()); //digi front center 00099 00100 Hep3Vector r=pos-r0; 00101 r=r-r.dot(r0)*r0/(r0.mag()*r0.mag()); 00102 00103 a20+=(energy/aShower.e5x5())*(2*pow(r.mag()/R0,2.)-1); 00104 } 00105 00106 aShower.setA20Moment(fabs(a20)); 00107 }
|
|
|
|
00110 { 00111 complex<double> a42(0.,0.); 00112 const double R0=15.6; 00113 Hep3Vector r0(aShower.position()); //shower center 00114 RecEmcFractionMap fracMap=aShower.getFractionMap5x5(); 00115 RecEmcFractionMap::const_iterator it; 00116 for(it=fracMap.begin(); 00117 it!=fracMap.end(); 00118 it++){ 00119 double energy=it->second.getEnergy()*it->second.getFraction(); 00120 HepPoint3D pos(it->second.getFrontCenter()); //digi front center 00121 00122 Hep3Vector r=pos-r0; 00123 r=r-r.dot(r0)*r0/(r0.mag()*r0.mag()); 00124 00125 complex<double> a(0.,2.*r.phi()); 00126 00127 a42+=(energy/aShower.e5x5())*(4.*pow(r.mag()/R0,4.)-3.*pow(r.mag()/R0,2.))*exp(a); 00128 } 00129 00130 aShower.setA42Moment(abs(a42)); 00131 }
|
|
|
|
00009 { 00010 SecondMoment(aShower); 00011 LatMoment(aShower); 00012 A20Moment(aShower); 00013 A42Moment(aShower); 00014 }
|
|
|
|
00040 { 00041 RecEmcFractionMap fracMap=aShower.getFractionMap5x5(); 00042 if(fracMap.size()<2) { 00043 aShower.setLatMoment(0); 00044 return; 00045 } 00046 00047 vector<RecEmcFraction> aFractionVec; 00048 RecEmcFractionMap::const_iterator it; 00049 for(it=fracMap.begin(); 00050 it!=fracMap.end(); 00051 it++){ 00052 aFractionVec.push_back(it->second); 00053 } 00054 00055 //find the largest 2 energy 00056 partial_sort(aFractionVec.begin(), 00057 aFractionVec.begin()+2, 00058 aFractionVec.end(), 00059 greater<RecEmcFraction>()); 00060 00061 //caculate LAT 00062 vector<RecEmcFraction>::iterator iVec; 00063 double numerator=0; 00064 double denominator=0; 00065 int n=0; 00066 for(iVec=aFractionVec.begin(); 00067 iVec!=aFractionVec.end(); 00068 iVec++) { 00069 n++; 00070 HepPoint3D pos((*iVec).getFrontCenter()); //digi front center 00071 double r=pos.mag()*sin(aShower.position().angle(pos)); 00072 00073 double energy=(*iVec).getEnergy()*(*iVec).getFraction(); 00074 if(n<3) { 00075 denominator+=5.2*5.2*energy; 00076 } else { 00077 numerator+=r*r*energy; 00078 denominator+=r*r*energy; 00079 } 00080 } 00081 double lat=-99; 00082 if(denominator>0) lat=numerator/denominator; 00083 00084 aShower.setLatMoment(lat); 00085 }
|
|
|
|
00017 { 00018 double etot=0; 00019 double sum=0; 00020 HepPoint3D center(aShower.position()); 00021 00022 RecEmcFractionMap fracMap=aShower.getFractionMap5x5(); 00023 RecEmcFractionMap::const_iterator it; 00024 for(it=fracMap.begin(); 00025 it!=fracMap.end(); 00026 it++){ 00027 HepPoint3D pos(it->second.getFrontCenter()); //digi front center 00028 etot+=it->second.getEnergy()*it->second.getFraction(); 00029 sum+=it->second.getEnergy()*it->second.getFraction()*pos.distance2(center); 00030 } 00031 00032 if(etot>0) { 00033 sum/=etot; 00034 } 00035 00036 aShower.setSecondMoment(sum); 00037 }
|