#include <EmcStructure.h>
Public Member Functions | |
EmcStructure () | |
~EmcStructure () | |
long | getIndex (unsigned int thetaIndex, unsigned int phiIndex) const |
bool | isOutofAccep (unsigned int thetaIndex, unsigned int phiIndex) const |
unsigned int | getNumberOfTheRings () |
unsigned int | getNumberOfXtals () |
unsigned int | startingTheta () |
unsigned int | crystalsInRing (unsigned int theta) const |
void | setEmcStruc () |
long | getThisThetaMaxIndex (int Theta) const |
unsigned int | getPartId (long Index) const |
unsigned int | getTheta (long Index) const |
unsigned int | getPhi (long Index) const |
int | getGeomIndex (unsigned int PartId, unsigned int ThetaIndex, unsigned int PhiIndex) const |
Private Attributes | |
EmcID * | aEmcId |
long | m_ThetaMaxIndex [56] |
unsigned int | m_partID [6240] |
unsigned int | m_thetaIndex [6240] |
unsigned int | m_phiIndex [6240] |
Static Private Attributes | |
static const unsigned int | numberOfOneEndcapRings = 2 |
static const unsigned int | numberOfTwoEndcapRings = 2 |
static const unsigned int | numberOfThreeEndcapRings = 2 |
Definition at line 5 of file EmcStructure.h.
EmcStructure::EmcStructure | ( | ) |
EmcStructure::~EmcStructure | ( | ) |
unsigned int EmcStructure::crystalsInRing | ( | unsigned int | theta | ) | const |
Definition at line 151 of file EmcStructure.cxx.
References aEmcId, EmcID::getPHI_BARREL_MAX(), and EmcID::getPHI_ENDCAP_MAX().
Referenced by EmcSelBhaEvent::initGeom(), and setEmcStruc().
00152 { 00153 //The theta index is defined by Endcap_east(0-5),Barrel(6-49),Endcap_west(50-55) 00154 //in Emc Bhabha Calibration 00155 unsigned int theXtalInRing; 00156 00157 if (theta==0 || theta==1 || theta==55 || theta==54) 00158 { 00159 theXtalInRing= aEmcId->getPHI_ENDCAP_MAX(0)+1; 00160 } 00161 00162 if (theta==2 || theta==3 || theta==53 || theta==52) 00163 { 00164 theXtalInRing=aEmcId->getPHI_ENDCAP_MAX(2)+1; 00165 } 00166 00167 if (theta==4 || theta==5 || theta==51 || theta==50) 00168 { 00169 theXtalInRing=aEmcId->getPHI_ENDCAP_MAX(4)+1; 00170 } 00171 00172 if (theta>=6 && theta<=49) 00173 { 00174 theXtalInRing=aEmcId->getPHI_BARREL_MAX()+1; 00175 } 00176 00177 // if (theta<0 || theta>55) theXtalInRing= 0; 00178 if (theta>55) 00179 { 00180 theXtalInRing= 0; 00181 } 00182 00183 return theXtalInRing; 00184 }
int EmcStructure::getGeomIndex | ( | unsigned int | PartId, | |
unsigned int | ThetaIndex, | |||
unsigned int | PhiIndex | |||
) | const |
Definition at line 53 of file EmcStructure.cxx.
References getIndex(), and isOutofAccep().
Referenced by EmcCalibConstSvc::getIndex(), and BesEmcParameter::GetLightOutput().
00056 { 00057 if (PartId>2){ 00058 cout<<"PartId is out of EMC"<<endl; 00059 return -1; 00060 } else { 00061 unsigned int newThetaIndex; 00062 //The newThetaIndex is defined by Endcap_east(0-5),Barrel(6-49),Endcap_west(50-55) 00063 if (PartId==0) newThetaIndex = ThetaIndex; 00064 if (PartId==1) newThetaIndex = ThetaIndex + 6; 00065 if (PartId==2) newThetaIndex = 55 - ThetaIndex; 00066 00067 if ( isOutofAccep(newThetaIndex, PhiIndex) ) 00068 { 00069 return -1; 00070 } else { 00071 00072 int index; 00073 index = getIndex(newThetaIndex,PhiIndex); 00074 00075 return index; 00076 } 00077 } 00078 }
long EmcStructure::getIndex | ( | unsigned int | thetaIndex, | |
unsigned int | phiIndex | |||
) | const |
Definition at line 81 of file EmcStructure.cxx.
References getThisThetaMaxIndex().
Referenced by getGeomIndex(), EmcSelBhaEvent::initGeom(), and setEmcStruc().
00082 { 00083 long index = -1; 00084 if(thetaIndex==0){ 00085 index=phiIndex; 00086 } else { 00087 index = getThisThetaMaxIndex( thetaIndex-1 ) +1 + phiIndex; 00088 } 00089 return index; 00090 }
unsigned int EmcStructure::getNumberOfTheRings | ( | ) |
Definition at line 124 of file EmcStructure.cxx.
References aEmcId, EmcID::getTHETA_BARREL_MAX(), and EmcID::getTHETA_ENDCAP_MAX().
Referenced by EmcSelBhaEvent::initGeom(), and setEmcStruc().
00125 { 00126 unsigned int numberOfTheRings=0; 00127 numberOfTheRings = (aEmcId->getTHETA_BARREL_MAX() + 1) 00128 + (aEmcId->getTHETA_ENDCAP_MAX() + 1 ) * 2; 00129 00130 return numberOfTheRings; 00131 00132 }
unsigned int EmcStructure::getNumberOfXtals | ( | ) |
Definition at line 134 of file EmcStructure.cxx.
References aEmcId, EmcID::getPHI_BARREL_MAX(), EmcID::getPHI_ENDCAP_MAX(), EmcID::getTHETA_BARREL_MAX(), numberOfOneEndcapRings, numberOfThreeEndcapRings, and numberOfTwoEndcapRings.
Referenced by EmcSelBhaEvent::initGeom().
00135 { 00136 unsigned int numberOfXtals=0; 00137 unsigned int numberOfBarrelXtals, numberOfEndcapXtals; 00138 00139 numberOfEndcapXtals = numberOfOneEndcapRings * (aEmcId->getPHI_ENDCAP_MAX(0)+1) 00140 + numberOfTwoEndcapRings * (aEmcId->getPHI_ENDCAP_MAX(2)+1) 00141 + numberOfThreeEndcapRings * (aEmcId->getPHI_ENDCAP_MAX(4)+1); 00142 00143 numberOfBarrelXtals = (aEmcId->getTHETA_BARREL_MAX()+1)*(aEmcId->getPHI_BARREL_MAX()+1); 00144 00145 numberOfXtals = numberOfBarrelXtals + numberOfEndcapXtals * 2; 00146 00147 return numberOfXtals; 00148 }
unsigned int EmcStructure::getPartId | ( | long | Index | ) | const [inline] |
Definition at line 35 of file EmcStructure.h.
References m_partID.
Referenced by EmcSelBhaEvent::expectedEnergy(), EmcCalibConstSvc::getPartID(), and main().
unsigned int EmcStructure::getPhi | ( | long | Index | ) | const [inline] |
Definition at line 37 of file EmcStructure.h.
References m_phiIndex.
Referenced by EmcSelBhaEvent::expectedEnergy(), EmcCalibConstSvc::getPhiIndex(), and main().
00037 {return m_phiIndex[Index];}
unsigned int EmcStructure::getTheta | ( | long | Index | ) | const [inline] |
Definition at line 36 of file EmcStructure.h.
References m_thetaIndex.
Referenced by EmcSelBhaEvent::expectedEnergy(), EmcCalibConstSvc::getThetaIndex(), and main().
00036 {return m_thetaIndex[Index];}
long EmcStructure::getThisThetaMaxIndex | ( | int | Theta | ) | const [inline] |
Definition at line 34 of file EmcStructure.h.
References m_ThetaMaxIndex.
Referenced by getIndex().
00034 {return m_ThetaMaxIndex[Theta];}
bool EmcStructure::isOutofAccep | ( | unsigned int | thetaIndex, | |
unsigned int | phiIndex | |||
) | const |
Definition at line 93 of file EmcStructure.cxx.
Referenced by EmcBhabhaEvent::getDepoMCShowerEnergy(), EmcBhabhaEvent::getDepoMCShowerEnergy_lab(), EmcBhabhaEvent::getErrorDepoMCShowerEnergy(), and getGeomIndex().
00095 { 00096 if ( thetaIndex > 55 ) 00097 { 00098 cout<<"warning " << " theta out of acceptance !" 00099 << endl; 00100 return true; 00101 00102 } 00103 else 00104 { 00105 if ( ((thetaIndex==0 || thetaIndex==1 || thetaIndex==55 || thetaIndex==54) 00106 && (phiIndex > 63)) 00107 || ((thetaIndex==2 || thetaIndex==3 || thetaIndex==53 || thetaIndex==52) 00108 && (phiIndex > 79)) 00109 || ((thetaIndex==4 || thetaIndex==5 || thetaIndex==51 || thetaIndex==50) 00110 && ( phiIndex > 95)) 00111 || ((thetaIndex>=6 && thetaIndex<=49) && ( phiIndex > 119)) ) 00112 { 00113 cout<<"warning "<< " phi out of acceptance !" << endl; 00114 return true; 00115 } 00116 else 00117 { 00118 return false; 00119 } 00120 } 00121 }
void EmcStructure::setEmcStruc | ( | ) |
Definition at line 23 of file EmcStructure.cxx.
References crystalsInRing(), getIndex(), getNumberOfTheRings(), m_partID, m_phiIndex, m_thetaIndex, m_ThetaMaxIndex, and startingTheta().
Referenced by EmcSelBhaEvent::expectedEnergy(), BesEmcParameter::GetLightOutput(), EmcSelBhaEvent::initGeom(), EmcCalibConstSvc::initialize(), and main().
00024 { 00025 int index; 00026 int nrOfTheRings = getNumberOfTheRings(); 00027 for ( int the = startingTheta(); the< nrOfTheRings; the++) { 00028 00029 for ( int phi=0; phi < crystalsInRing((unsigned int) the ); phi++) { 00030 00031 index = getIndex( (unsigned int)the , (unsigned int)phi); 00032 00033 m_phiIndex[index]=phi; 00034 if (the>=0 && the<=5) { 00035 m_partID[index]=0; 00036 m_thetaIndex[index]=the; 00037 } 00038 if (the>=6 && the<=49) { 00039 m_partID[index]=1; 00040 m_thetaIndex[index]=the-6; 00041 } 00042 if (the>=50 && the<=55){ 00043 m_partID[index]=2; 00044 m_thetaIndex[index]=55 - the; 00045 } 00046 00047 } 00048 m_ThetaMaxIndex[the]=index; 00049 } 00050 00051 }
unsigned int EmcStructure::startingTheta | ( | ) | [inline] |
Definition at line 26 of file EmcStructure.h.
Referenced by EmcSelBhaEvent::initGeom(), and setEmcStruc().
EmcID* EmcStructure::aEmcId [private] |
Definition at line 44 of file EmcStructure.h.
Referenced by crystalsInRing(), getNumberOfTheRings(), and getNumberOfXtals().
unsigned int EmcStructure::m_partID[6240] [private] |
unsigned int EmcStructure::m_phiIndex[6240] [private] |
unsigned int EmcStructure::m_thetaIndex[6240] [private] |
long EmcStructure::m_ThetaMaxIndex[56] [private] |
Definition at line 48 of file EmcStructure.h.
Referenced by getThisThetaMaxIndex(), and setEmcStruc().
const unsigned int EmcStructure::numberOfOneEndcapRings = 2 [static, private] |
const unsigned int EmcStructure::numberOfThreeEndcapRings = 2 [static, private] |
const unsigned int EmcStructure::numberOfTwoEndcapRings = 2 [static, private] |