BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
EmcStructure Class Reference

#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
 

Detailed Description

Definition at line 5 of file EmcStructure.h.

Constructor & Destructor Documentation

◆ EmcStructure()

EmcStructure::EmcStructure ( )

Definition at line 11 of file EmcStructure.cxx.

12{
13
14}

◆ ~EmcStructure()

EmcStructure::~EmcStructure ( )

Definition at line 19 of file EmcStructure.cxx.

20{
21}

Member Function Documentation

◆ crystalsInRing()

unsigned int EmcStructure::crystalsInRing ( unsigned int  theta) const

Definition at line 151 of file EmcStructure.cxx.

152{
153 //The theta index is defined by Endcap_east(0-5),Barrel(6-49),Endcap_west(50-55)
154 //in Emc Bhabha Calibration
155 unsigned int theXtalInRing;
156
157 if (theta==0 || theta==1 || theta==55 || theta==54)
158 {
159 theXtalInRing= aEmcId->getPHI_ENDCAP_MAX(0)+1;
160 }
161
162 if (theta==2 || theta==3 || theta==53 || theta==52)
163 {
164 theXtalInRing=aEmcId->getPHI_ENDCAP_MAX(2)+1;
165 }
166
167 if (theta==4 || theta==5 || theta==51 || theta==50)
168 {
169 theXtalInRing=aEmcId->getPHI_ENDCAP_MAX(4)+1;
170 }
171
172 if (theta>=6 && theta<=49)
173 {
174 theXtalInRing=aEmcId->getPHI_BARREL_MAX()+1;
175 }
176
177 // if (theta<0 || theta>55) theXtalInRing= 0;
178 if (theta>55)
179 {
180 theXtalInRing= 0;
181 }
182
183 return theXtalInRing;
184}
static unsigned int getPHI_BARREL_MAX()
Definition: EmcID.cxx:107
static unsigned int getPHI_ENDCAP_MAX(const unsigned int theta)
Definition: EmcID.cxx:115

Referenced by EmcSelBhaEvent::initGeom(), and setEmcStruc().

◆ getGeomIndex()

int EmcStructure::getGeomIndex ( unsigned int  PartId,
unsigned int  ThetaIndex,
unsigned int  PhiIndex 
) const

Definition at line 53 of file EmcStructure.cxx.

56{
57 if (PartId>2){
58 cout<<"PartId is out of EMC"<<endl;
59 return -1;
60 } else {
61 unsigned int newThetaIndex;
62 //The newThetaIndex is defined by Endcap_east(0-5),Barrel(6-49),Endcap_west(50-55)
63 if (PartId==0) newThetaIndex = ThetaIndex;
64 if (PartId==1) newThetaIndex = ThetaIndex + 6;
65 if (PartId==2) newThetaIndex = 55 - ThetaIndex;
66
67 if ( isOutofAccep(newThetaIndex, PhiIndex) )
68 {
69 return -1;
70 } else {
71
72 int index;
73 index = getIndex(newThetaIndex,PhiIndex);
74
75 return index;
76 }
77 }
78}
long getIndex(unsigned int thetaIndex, unsigned int phiIndex) const
bool isOutofAccep(unsigned int thetaIndex, unsigned int phiIndex) const

Referenced by EmcCalibConstSvc::getIndex(), and BesEmcParameter::GetLightOutput().

◆ getIndex()

long EmcStructure::getIndex ( unsigned int  thetaIndex,
unsigned int  phiIndex 
) const

Definition at line 81 of file EmcStructure.cxx.

82{
83 long index = -1;
84 if(thetaIndex==0){
85 index=phiIndex;
86 } else {
87 index = getThisThetaMaxIndex( thetaIndex-1 ) +1 + phiIndex;
88 }
89 return index;
90}
long getThisThetaMaxIndex(int Theta) const
Definition: EmcStructure.h:34

Referenced by getGeomIndex(), EmcSelBhaEvent::initGeom(), and setEmcStruc().

◆ getNumberOfTheRings()

unsigned int EmcStructure::getNumberOfTheRings ( )

Definition at line 124 of file EmcStructure.cxx.

125{
126 unsigned int numberOfTheRings=0;
127 numberOfTheRings = (aEmcId->getTHETA_BARREL_MAX() + 1)
128 + (aEmcId->getTHETA_ENDCAP_MAX() + 1 ) * 2;
129
130 return numberOfTheRings;
131
132}
static unsigned int getTHETA_ENDCAP_MAX()
Definition: EmcID.cxx:99
static unsigned int getTHETA_BARREL_MAX()
Definition: EmcID.cxx:91

Referenced by EmcSelBhaEvent::initGeom(), and setEmcStruc().

◆ getNumberOfXtals()

unsigned int EmcStructure::getNumberOfXtals ( )

Definition at line 134 of file EmcStructure.cxx.

135{
136 unsigned int numberOfXtals=0;
137 unsigned int numberOfBarrelXtals, numberOfEndcapXtals;
138
139 numberOfEndcapXtals = numberOfOneEndcapRings * (aEmcId->getPHI_ENDCAP_MAX(0)+1)
140 + numberOfTwoEndcapRings * (aEmcId->getPHI_ENDCAP_MAX(2)+1)
141 + numberOfThreeEndcapRings * (aEmcId->getPHI_ENDCAP_MAX(4)+1);
142
143 numberOfBarrelXtals = (aEmcId->getTHETA_BARREL_MAX()+1)*(aEmcId->getPHI_BARREL_MAX()+1);
144
145 numberOfXtals = numberOfBarrelXtals + numberOfEndcapXtals * 2;
146
147 return numberOfXtals;
148}

Referenced by EmcSelBhaEvent::initGeom().

◆ getPartId()

unsigned int EmcStructure::getPartId ( long  Index) const
inline

Definition at line 35 of file EmcStructure.h.

35{return m_partID[Index];}

Referenced by EmcCalibConstSvc::getPartID(), and main().

◆ getPhi()

unsigned int EmcStructure::getPhi ( long  Index) const
inline

Definition at line 37 of file EmcStructure.h.

37{return m_phiIndex[Index];}

Referenced by EmcCalibConstSvc::getPhiIndex(), and main().

◆ getTheta()

unsigned int EmcStructure::getTheta ( long  Index) const
inline

Definition at line 36 of file EmcStructure.h.

36{return m_thetaIndex[Index];}

Referenced by EmcCalibConstSvc::getThetaIndex(), and main().

◆ getThisThetaMaxIndex()

long EmcStructure::getThisThetaMaxIndex ( int  Theta) const
inline

Definition at line 34 of file EmcStructure.h.

34{return m_ThetaMaxIndex[Theta];}

Referenced by getIndex().

◆ isOutofAccep()

bool EmcStructure::isOutofAccep ( unsigned int  thetaIndex,
unsigned int  phiIndex 
) const

Definition at line 93 of file EmcStructure.cxx.

95{
96 if ( thetaIndex > 55 )
97 {
98 cout<<"warning " << " theta out of acceptance !"
99 << endl;
100 return true;
101
102 }
103 else
104 {
105 if ( ((thetaIndex==0 || thetaIndex==1 || thetaIndex==55 || thetaIndex==54)
106 && (phiIndex > 63))
107 || ((thetaIndex==2 || thetaIndex==3 || thetaIndex==53 || thetaIndex==52)
108 && (phiIndex > 79))
109 || ((thetaIndex==4 || thetaIndex==5 || thetaIndex==51 || thetaIndex==50)
110 && ( phiIndex > 95))
111 || ((thetaIndex>=6 && thetaIndex<=49) && ( phiIndex > 119)) )
112 {
113 cout<<"warning "<< " phi out of acceptance !" << endl;
114 return true;
115 }
116 else
117 {
118 return false;
119 }
120 }
121}

Referenced by EmcBhabhaEvent::getDepoMCShowerEnergy(), EmcBhabhaEvent::getDepoMCShowerEnergy_lab(), EmcBhabhaEvent::getErrorDepoMCShowerEnergy(), and getGeomIndex().

◆ setEmcStruc()

void EmcStructure::setEmcStruc ( )

Definition at line 23 of file EmcStructure.cxx.

24{
25 int index;
26 int nrOfTheRings = getNumberOfTheRings();
27 for ( int the = startingTheta(); the< nrOfTheRings; the++) {
28
29 for ( int phi=0; phi < crystalsInRing((unsigned int) the ); phi++) {
30
31 index = getIndex( (unsigned int)the , (unsigned int)phi);
32
33 m_phiIndex[index]=phi;
34 if (the>=0 && the<=5) {
35 m_partID[index]=0;
36 m_thetaIndex[index]=the;
37 }
38 if (the>=6 && the<=49) {
39 m_partID[index]=1;
40 m_thetaIndex[index]=the-6;
41 }
42 if (the>=50 && the<=55){
43 m_partID[index]=2;
44 m_thetaIndex[index]=55 - the;
45 }
46
47 }
48 m_ThetaMaxIndex[the]=index;
49 }
50
51}
unsigned int getNumberOfTheRings()
unsigned int startingTheta()
Definition: EmcStructure.h:26
unsigned int crystalsInRing(unsigned int theta) const

Referenced by BesEmcParameter::GetLightOutput(), EmcSelBhaEvent::initGeom(), EmcCalibConstSvc::initialize(), and main().

◆ startingTheta()

unsigned int EmcStructure::startingTheta ( )
inline

Definition at line 26 of file EmcStructure.h.

26{return 0;}

Referenced by EmcSelBhaEvent::initGeom(), and setEmcStruc().


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