CMS 3D CMS Logo

Functions
BHMNumberingScheme Namespace Reference

Functions

unsigned int getUnitID (const G4Step *aStep)
 
unsigned int packIndex (int subdet, int zside, int station)
 
void unpackIndex (const unsigned int &idx, int &subdet, int &zside, int &station)
 

Function Documentation

◆ getUnitID()

unsigned int BHMNumberingScheme::getUnitID ( const G4Step *  aStep)

Definition at line 30 of file BHMNumberingScheme.cc.

References TauDecayModes::dec, gammaJetAnalysis_CHSJECs_cff::level, LogDebug, packIndex(), relativeConstraints::station, and ecaldqm::zside().

Referenced by BHMSD::setDetUnitId().

30  {
31  unsigned intindex = 0;
32  int level = detectorLevel(aStep);
33 
34  LogDebug("BHMSim") << "BHMNumberingScheme number of levels= " << level;
35  if (level > 0) {
36  auto copyno = detectorLevelCopyNo(aStep, level);
37 
38  if (level > 3) {
39  int subdet = copyno[0];
40  int zside = copyno[3];
41  int station = copyno[1];
42  intindex = packIndex(subdet, zside, station);
43  LogDebug("BHMSim") << "BHMNumberingScheme : subdet " << subdet << " zside " << zside << " station " << station;
44  }
45  }
46  LogDebug("BHMSim") << "BHMNumberingScheme : UnitID 0x" << std::hex << intindex << std::dec;
47 
48  return intindex;
49  }
int zside(DetId const &)
unsigned int packIndex(int subdet, int zside, int station)
#define LogDebug(id)

◆ packIndex()

unsigned int BHMNumberingScheme::packIndex ( int  subdet,
int  zside,
int  station 
)

Definition at line 51 of file BHMNumberingScheme.cc.

References TauDecayModes::dec, heavyIonCSV_trainingSettings::idx, LogDebug, relativeConstraints::station, and ecaldqm::zside().

Referenced by getUnitID().

51  {
52  unsigned int idx = ((6 << 28) | (subdet & 0x7) << 25); // Use 6 as the detector name
53  idx |= ((zside & 0x3) << 5) | (station & 0x1F); // bits 0-4:station 5-6:side
54  LogDebug("BHMSim") << "BHM packing: subdet " << subdet << " zside " << zside << " station " << station << "-> 0x"
55  << std::hex << idx << std::dec;
56  return idx;
57  }
int zside(DetId const &)
#define LogDebug(id)

◆ unpackIndex()

void BHMNumberingScheme::unpackIndex ( const unsigned int &  idx,
int &  subdet,
int &  zside,
int &  station 
)

Definition at line 59 of file BHMNumberingScheme.cc.

References TauDecayModes::dec, heavyIonCSV_trainingSettings::idx, LogDebug, relativeConstraints::station, and ecaldqm::zside().

59  {
60  subdet = (idx >> 25) >> 0x7;
61  zside = (idx >> 5) & 0x3;
62  station = idx & 0x1F;
63  LogDebug("BHMSim") << " Bsc unpacking: 0x " << std::hex << idx << std::dec << " -> subdet " << subdet << " zside "
64  << zside << " station " << station;
65  }
int zside(DetId const &)
#define LogDebug(id)