11 #include "CLHEP/Units/GlobalSystemOfUnits.h"
34 int* copyno =
new int[
level];
45 for (
int ich = 0; ich <
level; ich++) {
46 if (name[ich] ==
"ZDC") {
51 }
else if (name[ich] ==
"ZDC_EMLayer") {
56 }
else if (name[ich] ==
"ZDC_EMFiber") {
68 }
else if (name[ich] ==
"ZDC_LumLayer") {
72 }
else if (name[ich] ==
"ZDC_HadLayer") {
85 else if (name[ich] ==
"ZDC_LumGas") {
87 }
else if (name[ich] ==
"ZDC_HadFiber") {
94 unsigned intindex = 0;
95 intindex =
packZdcIndex(section, layer, fiber, channel, zside);
98 bool true_for_positive_eta =
true;
100 true_for_positive_eta =
false;
102 HcalZDCDetId zdcId(section, true_for_positive_eta, channel);
103 index = zdcId.
rawId();
109 <<
" getUnitID - # of levels = " <<
level;
110 for (
int ich = 0; ich <
level; ich++)
111 edm::LogVerbatim(
"ForwardSim") <<
" " << ich <<
": copyno " << copyno[ich] <<
" name=" << name[ich]
112 <<
" section " << section <<
" zside " << zside <<
" layer " << layer <<
" fiber "
113 << fiber <<
" channel " << channel <<
"packedIndex =" << intindex
114 <<
" detId raw: " << std::hex << index <<
std::dec;
126 unsigned int idx = ((z - 1) & 1) << 20;
127 idx += (channel & 7) << 17;
128 idx += (fiber & 255) << 9;
129 idx += (layer & 127) << 2;
130 idx += (section & 3);
133 edm::LogVerbatim(
"ForwardSim") <<
"ZDC packing: section " << section <<
" layer " << layer <<
" fiber " << fiber
134 <<
" channel " << channel <<
" zside " << z <<
"idx: " << std::hex << idx <<
std::dec;
135 int newsubdet, newlayer, newfiber, newchannel, newz;
136 unpackZdcIndex(idx, newsubdet, newlayer, newfiber, newchannel, newz);
143 const unsigned int& idx,
int&
section,
int&
layer,
int& fiber,
int& channel,
int&
z) {
144 z = 1 + ((idx >> 20) & 1);
145 channel = (idx >> 17) & 7;
146 fiber = (idx >> 9) & 255;
147 layer = (idx >> 2) & 127;
151 edm::LogVerbatim(
"ForwardSim") <<
"ZDC unpacking: idx:" << idx <<
" -> section " << section <<
" layer " << layer
152 <<
" fiber " << fiber <<
" channel " << channel <<
" zside " <<
z;
158 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
161 level = ((touch->GetHistoryDepth()) + 1);
168 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
170 int i = level -
ii - 1;
172 copyno[
ii] = touch->GetReplicaNumber(i);
static unsigned int packZdcIndex(int subDet, int layer, int fiber, int channel, int z)
Log< level::Info, true > LogVerbatim
virtual unsigned int getUnitID(const G4Step *aStep) const
constexpr uint32_t rawId() const
get the raw id
constexpr std::array< uint8_t, layerIndexSize > layer
virtual ~ZdcNumberingScheme()
void setVerbosity(const int)
static void unpackZdcIndex(const unsigned int &idx, int &subDet, int &layer, int &fiber, int &channel, int &z)
std::string getName(const G4String &)
int detectorLevel(const G4Step *) const