9 #include "CLHEP/Units/GlobalSystemOfUnits.h"
17 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
18 return (touch) ? ((touch->GetHistoryDepth()) + 1) : 0;
24 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
26 int i = level -
ii - 1;
27 name[
ii] = touch->GetVolume(i)->GetName();
28 copyno[
ii] = touch->GetReplicaNumber(i);
34 unsigned int intindex = 0;
37 LogDebug(
"BscSim") <<
"BscNumberingScheme number of levels= " <<
level;
40 int* copyno =
new int[
level];
47 for (
int ich = 0; ich <
level; ich++) {
49 if (name[ich] ==
"BSC1" || name[ich] ==
"BSC2") {
50 zside = copyno[ich] - 1;
51 }
else if (name[ich] ==
"BSCTrap") {
53 station = 2 * (copyno[ich] - 1);
54 }
else if (name[ich] ==
"BSCTubs") {
56 station = copyno[ich] - 1;
57 }
else if (name[ich] ==
"BSCTTop") {
59 }
else if (name[ich] ==
"BSC2Pad") {
61 station = copyno[ich] - 1;
64 LogDebug(
"BscSim") <<
"BscNumberingScheme "
65 <<
"ich=" << ich <<
"copyno" << copyno[ich] <<
"name=" << name[ich];
68 LogDebug(
"BscSim") <<
"BscNumberingScheme : det " << det <<
" zside " << zside <<
" station " << station
69 <<
" UnitID 0x" << std::hex << intindex <<
std::dec;
71 for (
int ich = 0; ich <
level; ich++)
72 LogDebug(
"BscSim") <<
" name = " << name[ich] <<
" copy = " << copyno[ich];
74 LogDebug(
"BscSim") <<
" packed index = 0x" << std::hex << intindex <<
std::dec;
84 unsigned int idx = 6 << 28;
85 idx += (zside << 5) & 32;
86 idx += (det << 3) & 24;
88 LogDebug(
"BscSim") <<
"Bsc packing: det " << det <<
" zside " << zside <<
" station " << station <<
"-> 0x"
97 zside = (idx & 32) >> 5;
98 det = (idx & 24) >> 3;
100 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