5 #ifndef EEmcGeomSimple_h
6 #define EEmcGeomSimple_h
20 #include <StMessMgr.h>
26 enum Chiral_t { CounterClockwise=-1, Clockwise=1, Undefined=0};
38 TVector3
getTowerCenter(
const UInt_t sec,
const UInt_t sub,
const UInt_t etabin)
const;
47 TVector3
getDirection (
const Float_t detaBin,
const Float_t dphiBin)
const;
57 bool getTower(
const TVector3& r,
int &sec,
int &sub,
int &etabin, Float_t &dphi, Float_t &deta)
const;
65 bool getTower(
const TVector3& r,
int &sec,
int &sub,
int &etabin)
const {
67 return getTower(r,sec,sub,etabin,dphi,deta);
70 const Float_t *getEtaBinRangeArray()
const {
return mEtaBin;}
73 inline Float_t
getZ1()
const {
return mZ1; };
75 inline Float_t
getZ2()
const {
return mZ2; };
77 inline Float_t
getZSMD()
const {
return mZSMD;};
79 inline Float_t
getEtaMin()
const {
return mEtaBin[0]; };
81 inline Float_t
getEtaMax()
const {
return mEtaBin[mNumEta]; };
87 LOG_ERROR <<
"getEtaHalfWidth: invalid eta index " << eta << endm;
90 return 0.5 * ( mEtaBin[eta] + mEtaBin[eta+1] );
98 LOG_ERROR <<
"getEtaHalfWidth: invalid eta index" << eta << endm;
101 return 0.5 * fabs( mEtaBin[eta] - mEtaBin[eta+1] );
109 const double dPhi= TMath::TwoPi()/mNumSec;
111 LOG_ERROR <<
"getPhiMean: invalid sector index" << sec << endm;
114 return AdjustAngle(mClock*(sec+0.5L)*dPhi+mPhi0);
123 const double dPhi=TMath::TwoPi()/mNumSec;
125 LOG_ERROR <<
"getPhiMean: invalid sector index " << sec << endm;
127 }
else if(mNumSSec<=ssec) {
128 LOG_ERROR <<
"getPhiMean: invalid subsector index " << ssec << endm;
131 return AdjustAngle(mClock*(Double_t(sec)+(ssec+0.5L)/mNumSSec)*dPhi+mPhi0);
140 const double dPhi=TMath::TwoPi()/mNumSec;
142 LOG_ERROR <<
"getPhiMean: invalid sector index " << sec << endm;
144 }
else if(mNumSSec<=ssec) {
145 LOG_ERROR <<
"getPhiMean: invalid subsector index " << ssec << endm;
148 return (Float_t)(0.5L/mNumSSec*dPhi);
154 return (Float_t)(0.5L*(mZ1+mZ2));
159 return (Float_t)(0.5L*fabs(mZ1-mZ2));
171 inline Float_t
getPhi0()
const {
return mPhi0; };
173 inline Bool_t
isClockwise()
const {
return ( mClock == Clockwise ); };
193 void useDefaultGeometry();
196 static inline double AdjustAngle(
double alpha) {
197 while(alpha<-TMath::Pi() ) alpha += TMath::TwoPi();
198 while(alpha> TMath::Pi() ) alpha -= TMath::TwoPi();
Bool_t isClockwise() const
is endcap labeling clockwise?
Int_t getNumberOfSectors() const
gets number of sectors
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 getZ1() const
gets lower Z edge of EEMC (preshower)
Float_t getZ2() const
gets upper Z edge of EEMC (postshower)
Float_t getEtaMin() const
gets lower eta limit
static EEmcGeomSimple & Instance()
returns a reference to a static instance of EEmcGeomSimple
Chiral_t
chirality defined
bool getTower(const TVector3 &r, int &sec, int &sub, int &etabin) const
Float_t getEtaHalfWidth(UInt_t eta) const
Float_t getZMean() const
returns the center of EEMC in z direction
EEmcGeomSimple()
default constructor
Int_t getNumberOfEtas() const
gets number of tiles (eta bins)
virtual ~EEmcGeomSimple()
the destructor
Float_t getPhiMean(UInt_t sec) const
Float_t getZSMD() const
gets z-depth of the SMD layer in EEMC
TVector3 getDirection(const Float_t detaBin, const Float_t dphiBin) const
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 getEtaMax() const
gets upper eta bound
Float_t getPhiMean(UInt_t sec, UInt_t ssec) const
Int_t getNumberOfSubSectors() const
gets number of subsectors
Bool_t isCounterClockwise() const
is endcap labeling clockwise?
Float_t getEtaMean(UInt_t eta) const