11 #include "CLHEP/Units/GlobalSystemOfUnits.h"
18 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
19 return (touch) ? ((touch->GetHistoryDepth()) + 1) : 0;
25 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
27 int i = level -
ii - 1;
29 copyno[
ii] = touch->GetReplicaNumber(i);
35 unsigned int intindex = 0;
38 LogDebug(
"BscSim") <<
"BscNumberingScheme number of levels= " <<
level;
41 int* copyno =
new int[
level];
48 for (
int ich = 0; ich <
level; ich++) {
50 if (name[ich] ==
"BSC1" || name[ich] ==
"BSC2") {
51 zside = copyno[ich] - 1;
52 }
else if (name[ich] ==
"BSCTrap") {
54 station = 2 * (copyno[ich] - 1);
55 }
else if (name[ich] ==
"BSCTubs") {
57 station = copyno[ich] - 1;
58 }
else if (name[ich] ==
"BSCTTop") {
60 }
else if (name[ich] ==
"BSC2Pad") {
62 station = copyno[ich] - 1;
65 LogDebug(
"BscSim") <<
"BscNumberingScheme "
66 <<
"ich=" << ich <<
"copyno" << copyno[ich] <<
"name=" << name[ich];
69 LogDebug(
"BscSim") <<
"BscNumberingScheme : det " << det <<
" zside " << zside <<
" station " << station
70 <<
" UnitID 0x" << std::hex << intindex <<
std::dec;
72 for (
int ich = 0; ich <
level; ich++)
73 LogDebug(
"BscSim") <<
" name = " << name[ich] <<
" copy = " << copyno[ich];
75 LogDebug(
"BscSim") <<
" packed index = 0x" << std::hex << intindex <<
std::dec;
85 unsigned int idx = 6 << 28;
86 idx += (zside << 5) & 32;
87 idx += (det << 3) & 24;
89 LogDebug(
"BscSim") <<
"Bsc packing: det " << det <<
" zside " << zside <<
" station " << station <<
"-> 0x"
98 zside = (idx & 32) >> 5;
99 det = (idx & 24) >> 3;
101 LogDebug(
"BscSim") <<
" Bsc unpacking: 0x " << std::hex << idx <<
std::dec <<
" -> det " << det <<
" zside " << zside
unsigned int getUnitID(const G4Step *aStep) const
static unsigned int packBscIndex(int det, int zside, int station)
static void unpackBscIndex(const unsigned int &idx)
int detectorLevel(const G4Step *) const
std::string getName(const G4String &)