9 #include "CLHEP/Units/GlobalSystemOfUnits.h"
14 LogDebug(
"BscSim") <<
" Creating BscNumberingScheme" ;
18 LogDebug(
"BscSim") <<
" Deleting BscNumberingScheme" ;
24 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
26 if (touch) level = ((touch->GetHistoryDepth())+1);
31 int* copyno, G4String*
name)
const {
35 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
37 int i = level -
ii - 1;
38 name[
ii] = touch->GetVolume(i)->GetName();
39 copyno[
ii] = touch->GetReplicaNumber(i);
49 LogDebug(
"BscSim") <<
"BscNumberingScheme number of levels= " <<
level;
53 int* copyno =
new int[
level];
60 for (
int ich=0; ich <
level; ich++) {
62 if(name[ich] ==
"BSC1" ||name[ich] ==
"BSC2" ) {
63 zside = copyno[ich]-1;
64 }
else if(name[ich] ==
"BSCTrap") {
66 station = 2*(copyno[ich]-1);
67 }
else if(name[ich] ==
"BSCTubs") {
69 station = copyno[ich]-1;
70 }
else if(name[ich] ==
"BSCTTop") {
72 }
else if(name[ich] ==
"BSC2Pad"){
74 station = copyno[ich]-1;
77 LogDebug(
"BscSim") <<
"BscNumberingScheme " <<
"ich=" << ich <<
"copyno"
78 << copyno[ich] <<
"name=" << name[ich];
82 LogDebug(
"BscSim") <<
"BscNumberingScheme : det " << det <<
" zside "
83 << zside <<
" station " << station
84 <<
" UnitID 0x" << std::hex << intindex << std::dec;
86 for (
int ich = 0; ich <
level; ich++)
87 LogDebug(
"BscSim") <<
" name = " << name[ich] <<
" copy = " << copyno[ich];
88 LogDebug(
"BscSim") <<
" packed index = 0x" << std::hex << intindex
100 unsigned int idx = 6 << 28;
101 idx += (zside<<5)&32;
104 LogDebug(
"BscSim") <<
"Bsc packing: det " << det
105 <<
" zside " << zside <<
" station " << station
106 <<
"-> 0x" << std::hex << idx << std::dec;
117 LogDebug(
"BscSim") <<
" Bsc unpacking: 0x " << std::hex << idx << std::dec
118 <<
" -> det " << det <<
" zside " << zside
virtual ~BscNumberingScheme()
virtual unsigned int getUnitID(const G4Step *aStep) const
static void unpackBscIndex(const unsigned int &idx)
virtual int detectorLevel(const G4Step *) const
static unsigned int packBscIndex(int det, int zside, int station)
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...