CMS 3D CMS Logo

Functions
BscNumberingScheme Namespace Reference

Functions

unsigned int getUnitID (const G4Step *aStep)
 
unsigned int packBscIndex (int det, int zside, int station)
 
void unpackBscIndex (const unsigned int &idx)
 

Function Documentation

◆ getUnitID()

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

Definition at line 37 of file BscNumberingScheme.cc.

References TauDecayModes::dec, personalPlayback::level, LogDebug, Skims_PA_cff::name, packBscIndex(), relativeConstraints::station, and ecaldqm::zside().

Referenced by BscSD::setDetUnitId().

37  {
38  unsigned int intindex = 0;
39  int level = detectorLevel(aStep);
40 
41  LogDebug("BscSim") << "BscNumberingScheme number of levels= " << level;
42 
43  if (level > 0) {
44  std::vector<int> copyno;
45  std::vector<G4String> name;
46  detectorLevel(aStep, level, copyno, name);
47 
48  int det = 0;
49  int zside = 0;
50  int station = 0;
51  for (int ich = 0; ich < level; ich++) {
52  // new and old set up configurations are possible:
53  if (name[ich] == "BSC1" || name[ich] == "BSC2") {
54  zside = copyno[ich] - 1;
55  } else if (name[ich] == "BSCTrap") {
56  det = 0;
57  station = 2 * (copyno[ich] - 1);
58  } else if (name[ich] == "BSCTubs") {
59  det = 1;
60  station = copyno[ich] - 1;
61  } else if (name[ich] == "BSCTTop") {
62  ++station;
63  } else if (name[ich] == "BSC2Pad") {
64  det = 2;
65  station = copyno[ich] - 1;
66  }
67 
68  LogDebug("BscSim") << "BscNumberingScheme "
69  << "ich=" << ich << "copyno" << copyno[ich] << "name=" << name[ich];
70  }
71  intindex = packBscIndex(zside, det, station);
72  LogDebug("BscSim") << "BscNumberingScheme : det " << det << " zside " << zside << " station " << station
73  << " UnitID 0x" << std::hex << intindex << std::dec;
74 
75  for (int ich = 0; ich < level; ich++)
76  LogDebug("BscSim") << " name = " << name[ich] << " copy = " << copyno[ich];
77 
78  LogDebug("BscSim") << " packed index = 0x" << std::hex << intindex << std::dec;
79  }
80 
81  return intindex;
82  }
int zside(DetId const &)
unsigned int packBscIndex(int det, int zside, int station)
#define LogDebug(id)

◆ packBscIndex()

unsigned int BscNumberingScheme::packBscIndex ( int  det,
int  zside,
int  station 
)

Definition at line 84 of file BscNumberingScheme.cc.

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

Referenced by getUnitID().

84  {
85  unsigned int idx = 6 << 28; // autre numero que les detecteurs existants
86  idx += (zside << 5) & 32; // vaut 0 ou 1 bit 5
87  idx += (det << 3) & 24; //bit 3-4 det:0-1-2 2 bits:0-1
88  idx += (station & 7); //bits 0-2 station:0-7=8-->2**3 =8 3 bits:0-2
89  LogDebug("BscSim") << "Bsc packing: det " << det << " zside " << zside << " station " << station << "-> 0x"
90  << std::hex << idx << std::dec;
91 
92  // unpackBscIndex(idx);
93  return idx;
94  }
int zside(DetId const &)
#define LogDebug(id)

◆ unpackBscIndex()

void BscNumberingScheme::unpackBscIndex ( const unsigned int &  idx)

Definition at line 96 of file BscNumberingScheme.cc.

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

Referenced by BscTest::update().

96  {
97  int zside, det, station;
98  zside = (idx & 32) >> 5;
99  det = (idx & 24) >> 3;
100  station = idx & 7;
101  LogDebug("BscSim") << " Bsc unpacking: 0x " << std::hex << idx << std::dec << " -> det " << det << " zside "
102  << zside << " station " << station;
103  }
int zside(DetId const &)
#define LogDebug(id)