18 #include "SystemOfUnits.h"
19 #include "StThreeVectorD.hh"
20 #include "StPhysicalHelixD.hh"
22 #include "StEmcRawHit.h"
23 #include "StTrackGeometry.h"
27 #include "EEmcGeomDefs.h"
28 #include "EEmcGeomSimple.h"
64 if(mEtaBin)
delete [] mEtaBin;
75 EEmcGeomSimple::useDefaultGeometry()
79 static const Float_t defaultEtaBin[] = {
81 1.9008 , 1.8065 , 1.7168 , 1.6317 , 1.5507 , 1.4738 ,
82 1.4007 , 1.3312 , 1.2651 , 1.2023 , 1.1427 , 1.086 ,
86 mNumSec = kEEmcNumSectors;
87 mNumSSec = kEEmcNumSubSectors;
88 mNumEta = kEEmcNumEtas;
91 if(mEtaBin)
delete [] mEtaBin;
92 mEtaBin =
new Float_t[mNumEta+1];
93 for(UInt_t i=0;i<=mNumEta && defaultEtaBin[i]>0.0 ;i++) mEtaBin[i] = defaultEtaBin[i];
98 mPhi0 = 75.0*M_PI/180.0;
99 mClock = CounterClockwise;
114 LOG_ERROR <<
"invalid eta " << eta << endm;
115 return TVector3(0, 0, 0);
118 rho = z*tan(2.0*atan(exp(-1.0*eta)));
120 return TVector3(rho*cos(phi),rho*sin(phi),z);
127 int ietaBin=(int)(xetaBin+0.5);
128 int iphiBin=(int)(xphiBin+0.5);
130 int isec=iphiBin/kEEmcNumSubSectors;
131 int isub=iphiBin%kEEmcNumSubSectors;
138 LOG_ERROR <<
"invalid eta " << eta << endm;
139 return TVector3(0, 0, 0);
142 Double_t rho = z/sinh(eta);
145 return TVector3(rho*cos(phi),rho*sin(phi),z);
160 int &sec ,
int &sub,
int &eta,
161 Float_t &dphi, Float_t &deta)
const
163 const double dPhiSec = 2.0*M_PI/mNumSec;
164 const double dPhiSub = dPhiSec/mNumSSec;
168 double rEta = r.Eta();
169 double rPhi = r.Phi();
170 double rPhi0 = r.Phi() - mPhi0;
177 if(rEta<mEtaBin[mNumEta] || mEtaBin[0]<rEta )
return false;
183 for(eta=mNumEta;eta>=0;eta--)
if(rEta<mEtaBin[eta])
break;
189 if( mEtaBin[eta]<rEta)
199 int k =
isClockwise() ? (int)floor(rPhi0/dPhiSec) : (int) ceil(rPhi0/dPhiSec);
201 while(sec<0) sec+=mNumSec;
206 int m =
isClockwise() ? (int)floor(rPhi0/dPhiSub) : (int) ceil(rPhi0/dPhiSub);
208 while(sub<0) sub+=mNumSSec*mNumSec;
215 if(xxx>TMath::Pi()) xxx=TMath::TwoPi()-xxx;
216 else if(xxx<-TMath::Pi()) xxx=TMath::TwoPi()+xxx;
228 EEmcGeomSimple::direction2tower( TVector3 r,
229 int &iSec,
int &iSub,
int &iEta,
float &rPhi ,
float &rEta )
236 float phiDeg=180.*r.Phi()/3.14159;
237 float phi=phiDeg -75;
245 rPhi =phi-iSec*30-iSub*5 -2.5;
247 Float_t *dEB= mEtaBin;
250 for(
int i=0;i<13;i++){
252 if(eta<dEB[i])
continue;
254 if(i>0 && i<=12) rEta= -(dEB[i]+dEB[i-1]-2*eta)/2./(dEB[i]-dEB[i-1]);
273 Float_t deta, Float_t dphi, Float_t dz)
const
278 if( fabs(tc.z() -pt.z() ) > (1.0+dz)*
getZHalfWidth() )
return kFALSE;
280 if( fabs(tc.phi()-pt.phi()) > (1.0+dphi)*
getPhiHalfWidth() )
return kFALSE;
282 if( fabs(tc.pseudoRapidity()-pt.pseudoRapidity()) >
297 Double_t rho = z*tan(2.0*atan(exp(-1.0*eta)));
311 EEmcGeomSimple::getTrackPoint(
const StTrack&
track, Double_t z)
const
315 double s = ( z - helix.
origin().z() ) / sin( helix.dipAngle()) ;
Bool_t isClockwise() const
is endcap labeling clockwise?
TVector3 getTowerCenter(const UInt_t sec, const UInt_t sub, const UInt_t etabin) const
Float_t getZHalfWidth() const
returns the half-width of EEMC (in z-direction)
Float_t getEtaHalfWidth(UInt_t eta) const
Float_t getZMean() const
returns the center of EEMC in z direction
virtual ~EEmcGeomSimple()
the destructor
Float_t getPhiMean(UInt_t sec) const
TVector3 getDirection(const Float_t detaBin, const Float_t dphiBin) const
const StThreeVector< double > & origin() const
-sign(q*B);
Float_t getPhiHalfWidth(UInt_t sec=0, UInt_t ssec=0) const
bool getTower(const TVector3 &r, int &sec, int &sub, int &etabin, Float_t &dphi, Float_t &deta) const
Float_t getEtaMean(UInt_t eta) const