3 #include "CLHEP/Units/GlobalSystemOfUnits.h" 7 LogDebug(
"BHMSim") <<
" Creating BHMNumberingScheme" ;
13 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
14 return (touch) ? ((touch->GetHistoryDepth())+1) : 0;
18 int* copyno, G4String*
name)
const {
22 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
24 int i = level -
ii - 1;
25 name[
ii] = touch->GetVolume(i)->GetName();
26 copyno[
ii] = touch->GetReplicaNumber(i);
36 LogDebug(
"BHMSim") <<
"BHMNumberingScheme number of levels= " <<
level;
38 int* copyno =
new int[
level];
43 int subdet = copyno[0];
44 int zside = copyno[3];
46 intindex =
packIndex (subdet, zside, station);
47 LogDebug(
"BHMSim") <<
"BHMNumberingScheme : subdet " << subdet
48 <<
" zside " << zside <<
" station " <<
station;
53 LogDebug(
"BHMSim") <<
"BHMNumberingScheme : UnitID 0x" << std::hex
62 unsigned int idx = ((6<<28)|(subdet&0x7)<<25);
63 idx |= ((zside&0x3)<<5) | (station&0x1F);
64 LogDebug(
"BHMSim") <<
"BHM packing: subdet " << subdet
65 <<
" zside " << zside <<
" station " << station
66 <<
"-> 0x" << std::hex << idx <<
std::dec;
73 subdet = (idx>>25)>>0x7;
77 <<
" -> subdet " << subdet <<
" zside " << zside
static void unpackIndex(const unsigned int &idx, int &subdet, int &zside, int &station)
static unsigned int packIndex(int subdet, int zside, int station)
unsigned int getUnitID(const G4Step *aStep) const
int detectorLevel(const G4Step *) const