@@ -45,6 +45,7 @@ uint32_t BTLNumberingScheme::getUnitID(const MTDBaseNumber& baseNumber) const {
4545 << bareBaseName (baseNumber.getLevelName (7 )) << " [" << baseNumber.getCopyNumber (7 ) << " ], "
4646 << bareBaseName (baseNumber.getLevelName (8 )) << " [" << baseNumber.getCopyNumber (8 ) << " ]" ;
4747
48+
4849 if (baseNumber.getLevelName (0 ).find (" Timingactive" ) != std::string_view::npos) {
4950 edm::LogError (" MTDGeom" ) << " Geometry v1 of BTL not supported, run on a Geometry configuration D95 or latest " ;
5051 throw cms::Exception (" Configuration" ) << " Invalid BTL Geometry configuration (v1)" ;
@@ -58,7 +59,7 @@ uint32_t BTLNumberingScheme::getUnitID(const MTDBaseNumber& baseNumber) const {
5859
5960 // rod (tray) copy number
6061 rodCopy = baseNumber.getCopyNumber (3 ) - 1 ;
61-
62+
6263 // RU, global module and crystal copy numbers
6364 // (everything start from 0)
6465 // V3: RU number is global RU number
@@ -73,40 +74,39 @@ uint32_t BTLNumberingScheme::getUnitID(const MTDBaseNumber& baseNumber) const {
7374 crystal = int (baseNumber.getCopyNumber (0 )) - 1 ;
7475
7576 // Detector and sensor module numbers from global module number 0-23
76- dmodCopy = int ((modCopy / BTLDetId::kDModulesInRUCol ) / BTLDetId::kSModulesInDM ) +
77- (modCopy % BTLDetId::kDModulesInRUCol ) * BTLDetId::kDModulesInRURow ;
78- smodCopy = int (modCopy / BTLDetId::kDModulesInRUCol ) % BTLDetId::kSModulesInDM ;
77+ dmodCopy = int ((modCopy / BTLDetId::kDModulesInRUCol ) / BTLDetId::kSModulesInDM ) + (modCopy % BTLDetId::kDModulesInRUCol ) * BTLDetId::kDModulesInRURow ;
78+ smodCopy = int ( modCopy / BTLDetId::kDModulesInRUCol ) % BTLDetId::kSModulesInDM ;
7979
8080 // error checking
81- if (0 > int (crystal) || BTLDetId::kCrystalsPerModuleV2 - 1 < crystal) {
81+ if (0 > int (crystal) || BTLDetId::kCrystalsPerModuleV2 - 1 < crystal) {
8282 edm::LogWarning (" MTDGeom" ) << " BTLNumberingScheme::getUnitID(): "
8383 << " ****************** Bad crystal number = " << int (crystal)
8484 << " , Volume Number (counting from 0)= " << baseNumber.getCopyNumber (0 ) - 1 ;
8585 return 0 ;
8686 }
8787
88- if (0 > int (modCopy) || BTLDetId::kModulesPerRUV2 - 1 < modCopy) {
88+ if (0 > int (modCopy) || BTLDetId::kModulesPerRUV2 - 1 < modCopy) {
8989 edm::LogWarning (" MTDGeom" ) << " BTLNumberingScheme::getUnitID(): "
9090 << " ****************** Bad module copy = " << int (modCopy)
9191 << " , Volume Number (counting from 0)= " << baseNumber.getCopyNumber (1 ) - 1 ;
9292 return 0 ;
9393 }
9494
95- if (0 > int (smodCopy) || BTLDetId::kSModulesPerDM - 1 < smodCopy) {
95+ if (0 > int (smodCopy) || BTLDetId::kSModulesPerDM - 1 < smodCopy) {
9696 edm::LogWarning (" MTDGeom" ) << " BTLNumberingScheme::getUnitID(): "
9797 << " ****************** Bad detector module copy = " << int (smodCopy)
9898 << " , Volume Number (counting from 0)= " << baseNumber.getCopyNumber (1 ) - 1 ;
9999 return 0 ;
100100 }
101101
102- if (0 > int (dmodCopy) || BTLDetId::kDModulesPerRU - 1 < dmodCopy) {
102+ if (0 > int (dmodCopy) || BTLDetId::kDModulesPerRU - 1 < dmodCopy) {
103103 edm::LogWarning (" MTDGeom" ) << " BTLNumberingScheme::getUnitID(): "
104104 << " ****************** Bad detector module copy = " << int (dmodCopy)
105105 << " , Volume Number (counting from 0)= " << baseNumber.getCopyNumber (1 ) - 1 ;
106106 return 0 ;
107107 }
108108
109- if (0 > int (runitCopy) || BTLDetId::kRUPerRod - 1 < runitCopy) {
109+ if (0 > int (runitCopy) || BTLDetId::kRUPerRod - 1 < runitCopy) {
110110 edm::LogWarning (" MTDGeom" ) << " BTLNumberingScheme::getUnitID(): "
111111 << " ****************** Bad readout unit copy = " << int (runitCopy)
112112 << " module type = " << int (modtyp)
@@ -115,7 +115,7 @@ uint32_t BTLNumberingScheme::getUnitID(const MTDBaseNumber& baseNumber) const {
115115 return 0 ;
116116 }
117117
118- if (0 > int (rodCopy) || BTLDetId::HALF_ROD - 1 < rodCopy) {
118+ if (0 > int (rodCopy) || BTLDetId::HALF_ROD- 1 < rodCopy) {
119119 edm::LogWarning (" MTDGeom" ) << " BTLNumberingScheme::getUnitID(): "
120120 << " ****************** Bad rod copy = " << int (rodCopy)
121121 << " , Volume Number (counting from 0)= " << baseNumber.getCopyNumber (3 );
@@ -166,41 +166,40 @@ uint32_t BTLNumberingScheme::getUnitID(const MTDBaseNumber& baseNumber) const {
166166 modCopy = baseNumber.getCopyNumber (0 ) - 1 ;
167167
168168 // eval detector and sensor module numbers from global module number 1-24
169- dmodCopy = int ((modCopy / BTLDetId::kDModulesInRUCol ) / BTLDetId::kSModulesInDM ) +
170- (modCopy % BTLDetId::kDModulesInRUCol ) * BTLDetId::kDModulesInRURow ;
171- smodCopy = int (modCopy / BTLDetId::kDModulesInRUCol ) % BTLDetId::kSModulesInDM ;
169+ dmodCopy = int ((modCopy / BTLDetId::kDModulesInRUCol ) / BTLDetId::kSModulesInDM ) + (modCopy % BTLDetId::kDModulesInRUCol ) * BTLDetId::kDModulesInRURow ;
170+ smodCopy = int ( modCopy / BTLDetId::kDModulesInRUCol ) % BTLDetId::kSModulesInDM ;
172171
173172 // error checking
174173
175- if (0 > int (modCopy) || BTLDetId::kModulesPerRUV2 - 1 < modCopy) {
174+ if (0 > int (modCopy) || BTLDetId::kModulesPerRUV2 - 1 < modCopy) {
176175 edm::LogWarning (" MTDGeom" ) << " BTLNumberingScheme::getUnitID(): "
177176 << " ****************** Bad module copy = " << int (modCopy)
178177 << " , Volume Number (counting from 0)= " << baseNumber.getCopyNumber (0 ) - 1 ;
179178 return 0 ;
180179 }
181180
182- if (0 > int (smodCopy) || BTLDetId::kSModulesPerDM - 1 < smodCopy) {
181+ if (0 > int (smodCopy) || BTLDetId::kSModulesPerDM - 1 < smodCopy) {
183182 edm::LogWarning (" MTDGeom" ) << " BTLNumberingScheme::getUnitID(): "
184183 << " ****************** Bad detector module copy = " << int (smodCopy)
185184 << " , Volume Number (counting from 0)= " << baseNumber.getCopyNumber (0 ) - 1 ;
186185 return 0 ;
187186 }
188187
189- if (0 > int (dmodCopy) || BTLDetId::kDModulesPerRU - 1 < dmodCopy) {
188+ if (0 > int (dmodCopy) || BTLDetId::kDModulesPerRU - 1 < dmodCopy) {
190189 edm::LogWarning (" MTDGeom" ) << " BTLNumberingScheme::getUnitID(): "
191190 << " ****************** Bad detector module copy = " << int (dmodCopy)
192191 << " , Volume Number (counting from 0)= " << baseNumber.getCopyNumber (0 ) - 1 ;
193192 return 0 ;
194193 }
195194
196- if (0 > int (runitCopy) || BTLDetId::kRUPerRod - 1 < runitCopy) {
195+ if (0 > int (runitCopy) || BTLDetId::kRUPerRod - 1 < runitCopy) {
197196 edm::LogWarning (" MTDGeom" ) << " BTLNumberingScheme::getUnitID(): "
198197 << " ****************** Bad readout unit copy = " << int (runitCopy)
199198 << " , Volume Number (counting from 0)= " << baseNumber.getCopyNumber (1 ) - 1 ;
200199 return 0 ;
201200 }
202201
203- if (0 > int (rodCopy) || BTLDetId::HALF_ROD - 1 < rodCopy) {
202+ if (0 > int (rodCopy) || BTLDetId::HALF_ROD- 1 < rodCopy) {
204203 edm::LogWarning (" MTDGeom" ) << " BTLNumberingScheme::getUnitID(): "
205204 << " ****************** Bad rod copy = " << int (rodCopy)
206205 << " , Volume Number (counting from 0)= " << baseNumber.getCopyNumber (2 );
@@ -226,9 +225,8 @@ uint32_t BTLNumberingScheme::getUnitID(const MTDBaseNumber& baseNumber) const {
226225 }
227226
228227 LogDebug (" MTDGeom" ) << " BTL Numbering scheme: "
229- << " Raw Id = " << intindex << " zside = " << zside << " rod = " << rodCopy
230- << " runit = " << runitCopy << " dmodule = " << dmodCopy << " smodule = " << smodCopy
231- << " module = " << modCopy + 1 << " crystal = " << crystal << " \n "
228+ << " Raw Id = " << intindex << " zside = " << zside << " rod = " << rodCopy << " runit = " << runitCopy
229+ << " dmodule = " << dmodCopy << " smodule = " << smodCopy << " module = " << modCopy+1 << " crystal = " << crystal << " \n "
232230 << BTLDetId (intindex);
233231
234232 return intindex;
0 commit comments