9 #include "CLHEP/Units/GlobalSystemOfUnits.h" 16 std::cout <<
"Creating ZDCNumberingScheme" << std::endl;
21 std::cout <<
" Deleting ZdcNumberingScheme" << std::endl;
31 int* copyno =
new int[
level];
42 for (
int ich = 0; ich <
level; ich++) {
43 if (name[ich] ==
"ZDC") {
48 }
else if (name[ich] ==
"ZDC_EMLayer") {
53 }
else if (name[ich] ==
"ZDC_EMFiber") {
65 }
else if (name[ich] ==
"ZDC_LumLayer") {
69 }
else if (name[ich] ==
"ZDC_HadLayer") {
82 else if (name[ich] ==
"ZDC_LumGas") {
84 }
else if (name[ich] ==
"ZDC_HadFiber") {
91 unsigned intindex = 0;
92 intindex =
packZdcIndex(section, layer, fiber, channel, zside);
95 bool true_for_positive_eta =
true;
97 true_for_positive_eta =
false;
99 HcalZDCDetId zdcId(section, true_for_positive_eta, channel);
100 index = zdcId.
rawId();
107 <<
" getUnitID - # of levels = " << level << std::endl;
108 for (
int ich = 0; ich <
level; ich++)
109 std::cout <<
" " << ich <<
": copyno " << copyno[ich] <<
" name=" << name[ich] <<
" section " << section
110 <<
" zside " << zside <<
" layer " << layer <<
" fiber " << fiber <<
" channel " << channel
111 <<
"packedIndex =" << intindex <<
" detId raw: " << index << std::endl;
123 unsigned int idx = ((z - 1) & 1) << 20;
124 idx += (channel & 7) << 17;
125 idx += (fiber & 255) << 9;
126 idx += (layer & 127) << 2;
127 idx += (section & 3);
130 std::cout <<
"ZDC packing: section " << section <<
" layer " << layer <<
" fiber " << fiber <<
" channel " << channel
131 <<
" zside " << z <<
"idx: " << idx << std::endl;
132 int newsubdet, newlayer, newfiber, newchannel, newz;
133 unpackZdcIndex(idx, newsubdet, newlayer, newfiber, newchannel, newz);
140 const unsigned int&
idx,
int&
section,
int& layer,
int& fiber,
int& channel,
int&
z) {
141 z = 1 + ((idx >> 20) & 1);
142 channel = (idx >> 17) & 7;
143 fiber = (idx >> 9) & 255;
144 layer = (idx >> 2) & 127;
148 std::cout <<
"ZDC unpacking: idx:" << idx <<
" -> section " << section <<
" layer " << layer <<
" fiber " << fiber
149 <<
" channel " << channel <<
" zside " << z << std::endl;
155 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
158 level = ((touch->GetHistoryDepth()) + 1);
165 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
167 int i = level -
ii - 1;
168 name[
ii] = touch->GetVolume(i)->GetName();
169 copyno[
ii] = touch->GetReplicaNumber(i);
static unsigned int packZdcIndex(int subDet, int layer, int fiber, int channel, int z)
virtual unsigned int getUnitID(const G4Step *aStep) const
constexpr uint32_t rawId() const
get the raw id
virtual ~ZdcNumberingScheme()
void setVerbosity(const int)
static void unpackZdcIndex(const unsigned int &idx, int &subDet, int &layer, int &fiber, int &channel, int &z)
int detectorLevel(const G4Step *) const