24 for (
int phi = 0; phi <
crystalsInRing( (
unsigned int)the ); phi++ )
27 index =
getIndex( (
unsigned int)the, (
unsigned int)phi );
29 m_phiIndex[index] = phi;
30 if ( the >= 0 && the <= 5 )
33 m_thetaIndex[index] = the;
35 if ( the >= 6 && the <= 49 )
38 m_thetaIndex[index] = the - 6;
40 if ( the >= 50 && the <= 55 )
43 m_thetaIndex[index] = 55 - the;
46 m_ThetaMaxIndex[the] = index;
50 unsigned int PhiIndex )
const {
53 cout <<
"PartId is out of EMC" << endl;
58 unsigned int newThetaIndex;
60 if ( PartId == 0 ) newThetaIndex = ThetaIndex;
61 if ( PartId == 1 ) newThetaIndex = ThetaIndex + 6;
62 if ( PartId == 2 ) newThetaIndex = 55 - ThetaIndex;
64 if (
isOutofAccep( newThetaIndex, PhiIndex ) ) {
return -1; }
69 index =
getIndex( newThetaIndex, PhiIndex );
84 if ( thetaIndex > 55 )
87 <<
" theta out of acceptance !" << endl;
92 if ( ( ( thetaIndex == 0 || thetaIndex == 1 || thetaIndex == 55 || thetaIndex == 54 ) &&
93 ( phiIndex > 63 ) ) ||
94 ( ( thetaIndex == 2 || thetaIndex == 3 || thetaIndex == 53 || thetaIndex == 52 ) &&
95 ( phiIndex > 79 ) ) ||
96 ( ( thetaIndex == 4 || thetaIndex == 5 || thetaIndex == 51 || thetaIndex == 50 ) &&
97 ( phiIndex > 95 ) ) ||
98 ( ( thetaIndex >= 6 && thetaIndex <= 49 ) && ( phiIndex > 119 ) ) )
101 <<
" phi out of acceptance !" << endl;
104 else {
return false; }
116 unsigned int numberOfXtals = 0;
117 unsigned int numberOfBarrelXtals, numberOfEndcapXtals;
119 numberOfEndcapXtals = numberOfOneEndcapRings * ( aEmcId->getPHI_ENDCAP_MAX( 0 ) + 1 ) +
120 numberOfTwoEndcapRings * ( aEmcId->getPHI_ENDCAP_MAX( 2 ) + 1 ) +
121 numberOfThreeEndcapRings * ( aEmcId->getPHI_ENDCAP_MAX( 4 ) + 1 );
123 numberOfBarrelXtals =
124 ( aEmcId->getTHETA_BARREL_MAX() + 1 ) * ( aEmcId->getPHI_BARREL_MAX() + 1 );
126 numberOfXtals = numberOfBarrelXtals + numberOfEndcapXtals * 2;
128 return numberOfXtals;
134 unsigned int theXtalInRing;
136 if ( theta == 0 || theta == 1 || theta == 55 || theta == 54 )
137 { theXtalInRing = aEmcId->getPHI_ENDCAP_MAX( 0 ) + 1; }
139 if ( theta == 2 || theta == 3 || theta == 53 || theta == 52 )
140 { theXtalInRing = aEmcId->getPHI_ENDCAP_MAX( 2 ) + 1; }
142 if ( theta == 4 || theta == 5 || theta == 51 || theta == 50 )
143 { theXtalInRing = aEmcId->getPHI_ENDCAP_MAX( 4 ) + 1; }
145 if ( theta >= 6 && theta <= 49 ) { theXtalInRing = aEmcId->getPHI_BARREL_MAX() + 1; }
148 if ( theta > 55 ) { theXtalInRing = 0; }
150 return theXtalInRing;