BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EmcRecShowerShape Class Reference

#include <EmcRecShowerShape.h>

Public Member Functions

void CalculateMoment (RecEmcShower &aShower) const
void SecondMoment (RecEmcShower &aShower) const
void LatMoment (RecEmcShower &aShower) const
void A20Moment (RecEmcShower &aShower) const
void A42Moment (RecEmcShower &aShower) const
void CalculateMoment (RecEmcShower &aShower) const
void SecondMoment (RecEmcShower &aShower) const
void LatMoment (RecEmcShower &aShower) const
void A20Moment (RecEmcShower &aShower) const
void A42Moment (RecEmcShower &aShower) const
void CalculateMoment (RecEmcShower &aShower) const
void SecondMoment (RecEmcShower &aShower) const
void LatMoment (RecEmcShower &aShower) const
void A20Moment (RecEmcShower &aShower) const
void A42Moment (RecEmcShower &aShower) const

Detailed Description

Member Function Documentation

◆ A20Moment() [1/3]

void EmcRecShowerShape::A20Moment ( RecEmcShower & aShower) const

Definition at line 127 of file EmcRecShowerShape.cxx.

127 {
128 double a20 = 0;
129 const double R0 = 15.6;
130 Hep3Vector r0( aShower.position() ); // shower center
131 RecEmcFractionMap fracMap = aShower.getFractionMap5x5();
132 RecEmcFractionMap::const_iterator it;
133 for ( it = fracMap.begin(); it != fracMap.end(); it++ )
134 {
135 double energy = it->second.getEnergy() * it->second.getFraction();
136 HepPoint3D pos( it->second.getFrontCenter() ); // digi front center
137
138 Hep3Vector r = pos - r0;
139 r = r - r.dot( r0 ) * r0 / ( r0.mag() * r0.mag() );
140
141 a20 += ( energy / aShower.e5x5() ) * ( 2 * pow( r.mag() / R0, 2. ) - 1 );
142 }
143
144 aShower.setA20Moment( fabs( a20 ) );
145}
HepGeom::Point3D< double > HepPoint3D
map< RecEmcID, RecEmcFraction, less< RecEmcID > > RecEmcFractionMap
************Class m_ypar INTEGER m_KeyWgt INTEGER m_KeyIHVP INTEGER m_KeyGPS INTEGER m_IsBeamPolarized INTEGER m_EvtGenInterface DOUBLE PRECISION m_Emin DOUBLE PRECISION m_sphot DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_q2 DOUBLE PRECISION m_PolBeam2 DOUBLE PRECISION m_xErrPb *COMMON c_KK2f $ !CMS energy average $ !Spin Polarization vector first beam $ !Spin Polarization vector second beam $ !Beam energy spread[GeV] $ !minimum hadronization energy[GeV] $ !input READ never touch them !$ !debug facility $ !maximum weight $ !inverse alfaQED $ !minimum real photon energy
Definition KK2f.h:50
RecEmcFractionMap getFractionMap5x5() const

Referenced by CalculateMoment().

◆ A20Moment() [2/3]

void EmcRecShowerShape::A20Moment ( RecEmcShower & aShower) const

◆ A20Moment() [3/3]

void EmcRecShowerShape::A20Moment ( RecEmcShower & aShower) const

◆ A42Moment() [1/3]

void EmcRecShowerShape::A42Moment ( RecEmcShower & aShower) const

Definition at line 147 of file EmcRecShowerShape.cxx.

147 {
148 complex<double> a42( 0., 0. );
149 const double R0 = 15.6;
150 Hep3Vector r0( aShower.position() ); // shower center
151 RecEmcFractionMap fracMap = aShower.getFractionMap5x5();
152 RecEmcFractionMap::const_iterator it;
153 for ( it = fracMap.begin(); it != fracMap.end(); it++ )
154 {
155 double energy = it->second.getEnergy() * it->second.getFraction();
156 HepPoint3D pos( it->second.getFrontCenter() ); // digi front center
157
158 Hep3Vector r = pos - r0;
159 r = r - r.dot( r0 ) * r0 / ( r0.mag() * r0.mag() );
160
161 complex<double> a( 0., 2. * r.phi() );
162
163 a42 += ( energy / aShower.e5x5() ) *
164 ( 4. * pow( r.mag() / R0, 4. ) - 3. * pow( r.mag() / R0, 2. ) ) * exp( a );
165 }
166
167 aShower.setA42Moment( abs( a42 ) );
168}
EvtComplex exp(const EvtComplex &c)

Referenced by CalculateMoment().

◆ A42Moment() [2/3]

void EmcRecShowerShape::A42Moment ( RecEmcShower & aShower) const

◆ A42Moment() [3/3]

void EmcRecShowerShape::A42Moment ( RecEmcShower & aShower) const

◆ CalculateMoment() [1/3]

void EmcRecShowerShape::CalculateMoment ( RecEmcShower & aShower) const

Definition at line 12 of file EmcRecShowerShape.cxx.

12 {
13
14 SecondMoment( aShower );
15 LatMoment( aShower );
16 A20Moment( aShower );
17 A42Moment( aShower );
18}
void SecondMoment(RecEmcShower &aShower) const
void LatMoment(RecEmcShower &aShower) const
void A20Moment(RecEmcShower &aShower) const
void A42Moment(RecEmcShower &aShower) const

◆ CalculateMoment() [2/3]

void EmcRecShowerShape::CalculateMoment ( RecEmcShower & aShower) const

◆ CalculateMoment() [3/3]

void EmcRecShowerShape::CalculateMoment ( RecEmcShower & aShower) const

◆ LatMoment() [1/3]

void EmcRecShowerShape::LatMoment ( RecEmcShower & aShower) const

Definition at line 62 of file EmcRecShowerShape.cxx.

62 {
63 RecEmcFractionMap fracMap = aShower.getFractionMap5x5();
64 if ( fracMap.size() < 2 )
65 {
66 aShower.setLatMoment( 0 );
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 // find the largest 2 energy
76 partial_sort( aFractionVec.begin(), aFractionVec.begin() + 2, aFractionVec.end(),
77 greater<RecEmcFraction>() );
78
79 // caculate LAT
80 vector<RecEmcFraction>::iterator iVec;
81 double numerator = 0;
82 double denominator = 0;
83 int n = 0;
84 for ( iVec = aFractionVec.begin(); iVec != aFractionVec.end(); iVec++ )
85 {
86 n++;
87 HepPoint3D pos( ( *iVec ).getFrontCenter() ); // digi front center
88
89 //////////////////////////
90 EmcRecParameter& Para = EmcRecParameter::GetInstance();
91 if ( Para.DataMode() == 1 )
92 {
93
94 RecEmcID id = ( *iVec ).getCellId();
95 const unsigned int module = EmcID::barrel_ec( id );
96 const unsigned int thetaModule = EmcID::theta_module( id );
97 const unsigned int phiModule = EmcID::phi_module( id );
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 // cout<<module<<"\t"<<thetaModule<<"\t"<<phiModule<< " "<< posDataCorPar<<endl;
105 pos.setTheta( pos.theta() - posDataCorPar / lengthemc );
106 // cout<<"poscor"<<pos<< " "<<endl;
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
124 aShower.setLatMoment( lat );
125}
const Int_t n
static unsigned int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0).
Definition EmcID.cxx:36
static unsigned int theta_module(const Identifier &id)
Definition EmcID.cxx:41
static unsigned int phi_module(const Identifier &id)
Definition EmcID.cxx:46
static EmcRecParameter & GetInstance()
double EastPosDataCor(int ntheta, int nphi) const
double WestPosDataCor(int ntheta, int nphi) const
double BarrPosDataCor(int ntheta, int nphi) const
double DataMode() const

Referenced by CalculateMoment().

◆ LatMoment() [2/3]

void EmcRecShowerShape::LatMoment ( RecEmcShower & aShower) const

◆ LatMoment() [3/3]

void EmcRecShowerShape::LatMoment ( RecEmcShower & aShower) const

◆ SecondMoment() [1/3]

void EmcRecShowerShape::SecondMoment ( RecEmcShower & aShower) const

Definition at line 20 of file EmcRecShowerShape.cxx.

20 {
21 double etot = 0;
22 double sum = 0;
23 HepPoint3D center( aShower.position() );
24 RecEmcFractionMap fracMap = aShower.getFractionMap5x5();
25
26 RecEmcFractionMap::const_iterator it;
27 for ( it = fracMap.begin(); it != fracMap.end(); it++ )
28 {
29 HepPoint3D pos( it->second.getFrontCenter() ); // digi front center
30
31 //////////////////////////
32 EmcRecParameter& Para = EmcRecParameter::GetInstance();
33 if ( Para.DataMode() == 1 )
34 {
35
36 RecEmcID id = it->second.getCellId();
37 const unsigned int module = EmcID::barrel_ec( id );
38 const unsigned int thetaModule = EmcID::theta_module( id );
39 const unsigned int phiModule = EmcID::phi_module( id );
40 double lengthemc; //
41 lengthemc = abs( pos.z() / cos( pos.theta() ) ); //
42 double posDataCorPar = 0.0;
43 if ( module == 1 ) posDataCorPar = Para.BarrPosDataCor( thetaModule, phiModule );
44 if ( module == 0 ) posDataCorPar = Para.EastPosDataCor( thetaModule, phiModule );
45 if ( module == 2 ) posDataCorPar = Para.WestPosDataCor( thetaModule, phiModule );
46 // cout<<module<<"\t"<<thetaModule<<"\t"<<phiModule<< " "<< posDataCorPar<<endl;
47 pos.setTheta( pos.theta() - posDataCorPar / lengthemc );
48 // cout<<"poscor"<<pos<< " "<<endl;
49 }
50
51 ///////////////////////////////////
52
53 etot += it->second.getEnergy() * it->second.getFraction();
54 sum += it->second.getEnergy() * it->second.getFraction() * pos.distance2( center );
55 }
56
57 if ( etot > 0 ) { sum /= etot; }
58
59 aShower.setSecondMoment( sum );
60}
Double_t etot
void setSecondMoment(double secondMoment)

Referenced by CalculateMoment().

◆ SecondMoment() [2/3]

void EmcRecShowerShape::SecondMoment ( RecEmcShower & aShower) const

◆ SecondMoment() [3/3]

void EmcRecShowerShape::SecondMoment ( RecEmcShower & aShower) const

The documentation for this class was generated from the following files: