7 #ifndef FP420NumberingScheme_h 8 #define FP420NumberingScheme_h 10 #include <boost/cstdint.hpp> 21 virtual unsigned int getUnitID(
const G4Step* aStep)
const;
25 virtual void detectorLevel(
const G4Step*,
int&,
int*, G4String*)
const;
31 static void unpackFP420Index(
const unsigned int&
idx,
int& det,
int& zside,
int& station,
int& superplane);
38 static unsigned packMYIndex(
int rn0,
int pn0,
int sn0,
int det,
int zside,
int sector,
int zmodule) {
39 int zScale = (rn0 - 1);
40 int sScale = zScale * (pn0 - 1);
41 int dScale = sScale * (sn0 - 1);
43 unsigned int intindex = dScale * (det - 1) + sScale * (sector - 1) + zScale * (zmodule - 1) + zside;
48 static void unpackMYIndex(
const int& idx,
int rn0,
int pn0,
int sn0,
int& det,
int& zside,
int& sector,
int& zmodule) {
49 int zScale = (rn0 - 1), sScale = (rn0 - 1) * (pn0 - 1), dScale = (rn0 - 1) * (pn0 - 1) * (sn0 - 1);
51 det = (idx - 1) / dScale + 1;
52 sector = (idx - 1 - dScale * (det - 1)) / sScale + 1;
53 zmodule = (idx - 1 - dScale * (det - 1) - sScale * (sector - 1)) / zScale + 1;
54 zside = idx - dScale * (det - 1) - sScale * (sector - 1) - zScale * (zmodule - 1);
59 int layerIndex = 1,
b;
60 float a = (zside + 1) / 2.;
65 if (zside > (rn0 - 1) || zside < 1)
73 if (zside > (rn0 - 1) || zside < 1) {
75 int layerIndex = 1,
b;
76 float a = (zside + 1) / 2.;
81 copyIndex = zside / 2;
83 copyIndex = (zside + 1) / 2;
92 if (zside > (rn0 - 1) || zside < 1)
94 if (zside == 1 || zside == 2)
106 int zside, zsidereal;
107 if (zsideinorder < 0) {
109 }
else if (zsideinorder < 4) {
110 zside = 2 * zsideinorder - 1;
111 }
else if (zsideinorder < 7) {
112 zside = 2 * zsideinorder - 6;
126 if (zside == 4 || zside == 5)
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)
static int unpackOrientation(int rn0, int zside)