7 #ifndef FP420NumberingScheme_h
8 #define FP420NumberingScheme_h
10 #include <boost/cstdint.hpp>
22 virtual unsigned int getUnitID(
const G4Step* aStep)
const;
26 virtual void detectorLevel(
const G4Step*,
int&,
int*, G4String*)
const;
32 static void unpackFP420Index(
const unsigned int&
idx,
int& det,
int& zside,
int& station,
int& superplane);
41 int det,
int zside,
int sector,
int zmodule) {
43 int sScale = zScale*(pn0-1);
44 int dScale = sScale*(sn0-1);
46 unsigned int intindex = dScale*(det - 1)+sScale*(sector - 1)+zScale*(zmodule - 1)+zside;
52 int rn0,
int pn0,
int sn0,
53 int& det,
int& zside,
int& sector,
int& zmodule) {
54 int zScale=(rn0-1), sScale = (rn0-1)*(pn0-1), dScale = (rn0-1)*(pn0-1)*(sn0-1);
56 det = (idx-1)/dScale + 1;
57 sector = (idx-1- dScale*(det - 1))/sScale + 1;
58 zmodule = (idx-1- dScale*(det - 1)- sScale*(sector - 1) )/ zScale + 1;
59 zside = idx - dScale*(det - 1) - sScale*(sector - 1) - zScale*(zmodule - 1);
64 int layerIndex = 1,
b;
65 float a = (zside+1)/2.;
67 if(a-
b != 0.) layerIndex = 2;
69 if(zside>(rn0-1) || zside<1) layerIndex = 0;
76 if(zside>(rn0-1) || zside<1) {
79 int layerIndex = 1,
b;
80 float a = (zside+1)/2.;
82 if(a-
b != 0.) layerIndex = 2;
83 if(layerIndex==2) copyIndex = zside/2;
84 if(layerIndex==1) copyIndex = (zside+1)/2;
93 if(zside>(rn0-1) || zside<1) Orientation = 0;
94 if(zside==1 || zside==2) Orientation = 1;
106 if(zsideinorder<0) {zside = 0;}
107 else if(zsideinorder<4) {zside = 2*zsideinorder-1;}
108 else if(zsideinorder<7) {zside = 2*zsideinorder-6;}
114 if(zside>2) zsidereal=0;
119 if(zside==4 || zside==5) zsidereal=0;
static int unpackCopyIndex(int rn0, int zside)
virtual int detectorLevel(const G4Step *) const
static int realzside(int rn0, int zsideinorder)
static void unpackFP420Index(const unsigned int &idx, int &det, int &zside, int &station, int &superplane)
virtual ~FP420NumberingScheme()
static int unpackLayerIndex(int rn0, int zside)
static void unpackMYIndex(const int &idx, int rn0, int pn0, int sn0, int &det, int &zside, int §or, int &zmodule)
static unsigned packMYIndex(int rn0, int pn0, int sn0, int det, int zside, int sector, int zmodule)
virtual unsigned int getUnitID(const G4Step *aStep) const
static unsigned int packFP420Index(int det, int zside, int station, int superplane)
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
static int unpackOrientation(int rn0, int zside)