Skip to content

Commit e7242c1

Browse files
committed
Revert "code formatting"
This reverts commit 2413b69.
1 parent d968191 commit e7242c1

File tree

6 files changed

+52
-59
lines changed

6 files changed

+52
-59
lines changed

DataFormats/ForwardDetId/interface/BTLDetId.h

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class BTLDetId : public MTDDetId {
6767
static constexpr uint32_t kBTLoldFieldMask = 0x3FFFFF;
6868
static constexpr uint32_t kBTLNewFormat = 1 << 15;
6969

70-
//
70+
//
7171

7272
// Number of crystals in BTL according to TDR design, valid also for barphiflat scenario:
7373
// 16 crystals x 24 modules x 2 readout units/type x 3 types x 36 rods/side x 2 sides
@@ -111,23 +111,21 @@ class BTLDetId : public MTDDetId {
111111
id_ |= (MTDType::BTL & kMTDsubdMask) << kMTDsubdOffset | (zside & kZsideMask) << kZsideOffset |
112112
(rod & kRodRingMask) << kRodRingOffset | (runit & kBTLRUMask) << kBTLRUOffset |
113113
(dmodule & kBTLdetectorModMask) << kBTLdetectorModOffset |
114-
(smodule & kBTLsensorModMask) << kBTLsensorModOffset | (crystal & kBTLCrystalMask) << kBTLCrystalOffset;
114+
(smodule & kBTLsensorModMask) << kBTLsensorModOffset |
115+
(crystal & kBTLCrystalMask) << kBTLCrystalOffset;
115116
id_ |= kBTLNewFormat;
116117
}
117118

118119
// ---------- Common methods ----------
119120

120121
/** Returns BTL crystal number. */
121-
inline int crystal() const { return ((id_ >> kBTLCrystalOffset) & kBTLCrystalMask); }
122+
inline int crystal() const { return ((id_ >> kBTLCrystalOffset) & kBTLCrystalMask);}
122123

123124
/** Returns BTL crystal number in construction database. */
124-
inline int crystalConsDB() const {
125-
if (crystal() == kCrystalsPerModuleV2)
126-
return -1;
127-
if (smodule() == 0)
128-
return kCrystalsPerModuleV2 - 1 - crystal();
129-
else
130-
return crystal();
125+
inline int crystalConsDB() const {
126+
if (crystal() == kCrystalsPerModuleV2) return -1;
127+
if (smodule() == 0) return kCrystalsPerModuleV2-1 - crystal() ;
128+
else return crystal();
131129
}
132130

133131
/** Returns BTL detector module number. */
@@ -138,9 +136,7 @@ class BTLDetId : public MTDDetId {
138136

139137
/** Returns BTL module number [1-24] (OLD BTL NUMBERING). */
140138
inline int module() const {
141-
int mod = ((dmodule() % kDModulesInRURow) * (kSModulesInDM * kDModulesInRUCol) + int(dmodule() / kDModulesInRURow) +
142-
kDModulesInRUCol * smodule()) +
143-
1;
139+
int mod = ((dmodule() % kDModulesInRURow) * (kSModulesInDM * kDModulesInRUCol) + int(dmodule() / kDModulesInRURow) + kDModulesInRUCol * smodule()) + 1;
144140
return mod;
145141
}
146142

@@ -177,29 +173,28 @@ class BTLDetId : public MTDDetId {
177173

178174
// convert old module number into detector module + sensor module numbers
179175
uint32_t oldModule = (rawid >> kBTLoldModuleOffset) & kBTLoldModuleMask;
180-
uint32_t detModule = int((oldModule - 1) % (kDModulesInRUCol)) * kDModulesInRURow +
176+
uint32_t detModule = int((oldModule - 1) % (kDModulesInRUCol)) * kDModulesInRURow +
181177
int((oldModule - 1) / (kDModulesInRUCol * kSModulesInDM));
182-
uint32_t senModule = int((oldModule - 1) / kDModulesInRUCol) % kSModulesInDM;
178+
uint32_t senModule = int((oldModule - 1) / kDModulesInRUCol) % kSModulesInDM;
183179

184180
// change detector module number if on the negative side
185181
int zside = int(mtdSide());
186-
if (zside < 1)
187-
detModule = detModule - 2 * kDModulesInRURow * (int(detModule / kDModulesInRURow) - 1);
182+
if (zside < 1) detModule = detModule - 2 * kDModulesInRURow * (int(detModule/kDModulesInRURow) - 1);
188183

189184
// convert old RU and type number into new RU number
190185
uint32_t oldRU = (rawid >> kBTLoldRUOffset) & kBTLoldRUMask;
191186
uint32_t oldType = (rawid >> kBTLoldModTypeOffset) & kBTLoldModTypeMask;
192-
uint32_t newRU = ((oldType - 1) * kRUPerTypeV2) + (oldRU - 1);
187+
uint32_t newRU = ((oldType - 1) * kRUPerTypeV2) + (oldRU-1);
193188

194189
// get crystal number
195190
uint32_t crystal = (rawid & kBTLCrystalMask) >> kBTLCrystalOffset;
196191

197192
// return new BTLDetID for v3 geom
198-
return (fixedP | (newTray & kBTLRodMask) << kBTLRodOffset | (newRU & kBTLRUMask) << kBTLRUOffset |
193+
return (fixedP | (newTray & kBTLRodMask) << kBTLRodOffset | (newRU & kBTLRUMask) << kBTLRUOffset |
199194
(detModule & kBTLdetectorModMask) << kBTLdetectorModOffset |
200195
(senModule & kBTLsensorModMask) << kBTLsensorModOffset |
201196
((crystal & kBTLCrystalMask) << kBTLCrystalOffset)) |
202-
kBTLNewFormat;
197+
kBTLNewFormat;
203198
}
204199
};
205200

DataFormats/ForwardDetId/src/BTLDetId.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
#include "FWCore/MessageLogger/interface/MessageLogger.h"
33

44
BTLDetId BTLDetId::geographicalId(CrysLayout lay) const {
5+
56
// For tracking geometry navigation
67
// v2,v3: set number of crystals to 17 to distinguish from crystal BTLDetId
78
// v1: obsolete and not supported
8-
9+
910
if (lay == CrysLayout::v2 || lay == CrysLayout::v3) {
1011
return BTLDetId(mtdSide(), mtdRR(), runit(), dmodule(), smodule(), kCrystalsPerModuleV2);
1112
} else {
@@ -22,7 +23,7 @@ std::ostream& operator<<(std::ostream& os, const BTLDetId& id) {
2223
os << " BTL " << std::endl
2324
<< " Side : " << id.mtdSide() << std::endl
2425
<< " Rod : " << id.mtdRR() << std::endl
25-
<< " Crystal type : " << id.modType() << std::endl // crystal type in v1 geometry scheme
26+
<< " Crystal type : " << id.modType() << std::endl // crystal type in v1 geometry scheme
2627
<< " Runit by Type : " << id.runitByType() << std::endl
2728
<< " Readout unit : " << id.runit() << std::endl
2829
<< " Detector module: " << id.dmodule() << std::endl

Geometry/MTDCommonData/interface/BTLElectronicsMapping.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class BTLElectronicsMapping {
3131
// Map SiPM Channel to crystal bars for Backward module orientation
3232
static constexpr std::array<uint32_t, BTLDetId::kCrystalsPerModuleV2 * 2> SiPMChannelMapBW{
3333
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
34-
31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16}};
34+
31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16}};
3535

3636
// Map TOFHIR Channel to SiPM Channel
3737
static constexpr std::array<uint32_t, BTLDetId::kCrystalsPerModuleV2 * 2> THChannelMap{
@@ -61,8 +61,7 @@ class BTLElectronicsMapping {
6161

6262
// Get xtal from TOFHIR Channel number
6363
int THChToXtal(uint32_t smodCopy, uint32_t THCh);
64-
BTLDetId THChToBTLDetId(
65-
uint32_t zside, uint32_t rod, uint32_t runit, uint32_t dmodule, uint32_t smodCopy, uint32_t THCh);
64+
BTLDetId THChToBTLDetId(uint32_t zside, uint32_t rod, uint32_t runit, uint32_t dmodule, uint32_t smodCopy, uint32_t THCh);
6665

6766
/** Returns TOFHIR ASIC number in construction database. */
6867
int TOFHIRASIC(uint32_t dmodule, uint32_t smodCopy);

Geometry/MTDCommonData/src/BTLElectronicsMapping.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,18 +160,16 @@ BTLDetId BTLElectronicsMapping::THChToBTLDetId(
160160
}
161161

162162
// Get TOFHIR asic number
163-
// if dmodule is odd number (DM range [1-12])
163+
// if dmodule is odd number (DM range [1-12])
164164
// SM1 --> TOFHIR A0 (simply 0)
165165
// SM2 --> TOFHIR A1 (simply 1)
166166
// else if dmodule is even number the order is inverted
167167
// SM1 --> TOFHIR A1 (simply 1)
168168
// SM2 --> TOFHIR A0 (simply 0)
169-
int BTLElectronicsMapping::TOFHIRASIC(uint32_t dmodule, uint32_t smodCopy) {
170-
if (dmodule % BTLDetId::kSModulesInDM == 0)
171-
return smodCopy;
172-
else
173-
return BTLDetId::kSModulesInDM - smodCopy - 1;
174-
}
169+
int BTLElectronicsMapping::TOFHIRASIC(uint32_t dmodule, uint32_t smodCopy) {
170+
if (dmodule % BTLDetId::kSModulesInDM == 0) return smodCopy;
171+
else return BTLDetId::kSModulesInDM - smodCopy - 1;
172+
}
175173

176174
int BTLElectronicsMapping::TOFHIRASIC(BTLDetId det) {
177175
uint32_t dmodule = det.dmodule();
@@ -184,6 +182,7 @@ int BTLElectronicsMapping::TOFHIRASIC(uint32_t rawID) {
184182
return BTLElectronicsMapping::TOFHIRASIC(theId);
185183
}
186184

185+
187186
/** Returns FE board number */
188187
int BTLElectronicsMapping::FEBoardFromDM(uint32_t dmodule) { return dmodule; }
189188

@@ -196,3 +195,4 @@ int BTLElectronicsMapping::FEBoard(uint32_t rawID) {
196195
BTLDetId theId(rawID);
197196
return BTLElectronicsMapping::FEBoard(theId);
198197
}
198+

Geometry/MTDCommonData/src/BTLNumberingScheme.cc

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -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;

Geometry/MTDGeometryBuilder/test/DD4hep_TestPixelTopology.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ void DD4hep_TestPixelTopology::analyze(const edm::Event& iEvent, const edm::Even
293293

294294
if (isBarrel) {
295295
edm::LogVerbatim("DD4hep_TestPixelTopology")
296-
<< "geoId= " << modIdBTL.rawId() << " side= " << modIdBTL.mtdSide() << " RU/mod= " << modIdBTL.runit()
297-
<< " / " << modIdBTL.module();
296+
<< "geoId= " << modIdBTL.rawId() << " side= " << modIdBTL.mtdSide()
297+
<< " RU/mod= " << modIdBTL.runit() << " / " << modIdBTL.module();
298298
sunitt_ << "geoId= " << modIdBTL.rawId() << " side= " << modIdBTL.mtdSide()
299299
<< " RU/mod= " << modIdBTL.runit() << " / " << modIdBTL.module();
300300
} else {
@@ -416,10 +416,10 @@ void DD4hep_TestPixelTopology::analyze(const edm::Event& iEvent, const edm::Even
416416
<< " module/geomodule= " << theIdBTL.module() << " / " << static_cast<BTLDetId>(geoId).module()
417417
<< " crys= " << theIdBTL.crystal() << " BTLDetId row/col= " << origRow << " / " << origCol << "\n";
418418
sunitt_ << "rawId= " << theIdBTL.rawId() << " geoId= " << geoId.rawId()
419-
<< " side/rod= " << theIdBTL.mtdSide() << " / " << theIdBTL.mtdRR() << " RU= " << theIdBTL.runit()
420-
<< " module/geomodule= " << theIdBTL.module() << " / " << static_cast<BTLDetId>(geoId).module()
421-
<< " crys= " << theIdBTL.crystal() << " BTLDetId row/col= " << origRow << " / " << origCol
422-
<< "\n";
419+
<< " side/rod= " << theIdBTL.mtdSide() << " / " << theIdBTL.mtdRR()
420+
<< " RU= " << theIdBTL.runit() << " module/geomodule= " << theIdBTL.module() << " / "
421+
<< static_cast<BTLDetId>(geoId).module() << " crys= " << theIdBTL.crystal()
422+
<< " BTLDetId row/col= " << origRow << " / " << origCol << "\n";
423423
} else {
424424
edm::LogVerbatim("DD4hep_TestPixelTopology")
425425
<< "geoId= " << modIdETL.rawId() << " side= " << modIdETL.mtdSide()

0 commit comments

Comments
 (0)