14 hgcons_(hgc), mode_(hgc.geomMode()), det_(det), name_(name) {
28 int iz,
const G4ThreeVector &
pos,
35 int cellU(0), cellV(0), waferType(-1), waferU(0), waferV(0);
37 waferType = module/1000000;
39 if ((module/10000)%10 > 0) waferU = -waferU;
40 waferV = (module/100)%100;
41 if ((module/100000)%10 > 0) waferV = -waferV;
43 cellV = (cell/100)%100;
45 double xx = (pos.z() > 0) ? pos.x() : -pos.x();
54 << waferU <<
":" << waferV <<
" Cell " 55 << cellU <<
":" << cellV;
67 <<
" Type " <<
id[2] <<
" Layer|iz " 68 << layer <<
":" << iz <<
" " 72 <<
" Type " <<
id[2] <<
" Layer|iz " << layer
80 << layer <<
":" << module <<
":" << cell <<
":" 81 << iz <<
":" << pos.x() <<
":" << pos.y() <<
":" 82 << pos.z() <<
" ID " << std::hex << index
90 const G4ThreeVector &
pos)
const {
92 std::pair<float,float>
xy;
101 id.cellV(),
false,
true);
104 drMax = 10.0; dzMax = 1.0;
111 drMax = 50.0; dzMax = 5.0;
114 double r1 =
std::sqrt(xy.first*xy.first+xy.second*xy.second);
115 double r2 = pos.perp();
120 bool inok = ((r2 >= rrange.first) && (r2 <= rrange.second) &&
121 (z2 >= zrange.first) && (z2 <= zrange.second));
122 bool outok= ((r1 >= rrange.first) && (r1 <= rrange.second) &&
123 (z1 >= zrange.first) && (z1 <= zrange.second));
124 std::string ck = (((r1 < rrange.first-10.0) || (r1 > rrange.second+10.0) ||
125 (z1 < zrange.first-5.0) || (z1 > zrange.second+5.0)) ?
126 "***** ERROR *****" :
"");
127 if (!(match && inok && outok)) {
129 <<
" Layer " << lay <<
" R " << r2 <<
":" 130 << r1 <<
":" << rrange.first <<
":" 131 << rrange.second <<
" Z " << z2 <<
":" << z1
132 <<
":" << zrange.first <<
":" << zrange.second
133 <<
" Match " << match <<
":" << inok <<
":" 134 << outok <<
" " << ck;
136 <<
" return " << xy.first <<
":" << xy.second;
138 double wt=0,
xx = ((pos.z() > 0) ? pos.x() : -pos.x());
139 int waferU,waferV,cellU,cellV,waferType;
141 cellV,waferType,wt,
true);
145 << xy.first <<
":" << xy.second;
HGCalNumberingScheme()=delete
void waferFromPosition(const double x, const double y, int &wafer, int &icell, int &celltyp) const
const HGCalGeometryMode::GeometryMode mode_
const HGCalDDDConstants & hgcons_
constexpr uint32_t rawId() const
get the raw id
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
std::pair< double, double > rangeR(double z, bool reco) const
std::pair< double, double > rangeZ(bool reco) const
std::pair< float, float > locateCellTrap(int lay, int ieta, int iphi, bool reco) const
Abs< T >::type abs(const T &t)
double waferZ(int layer, bool reco) const
uint32_t getUnitID(int layer, int module, int cell, int iz, const G4ThreeVector &pos, double &wt)
assigns the det id to a hit
void checkPosition(uint32_t index, const G4ThreeVector &pos) const
std::array< int, 3 > assignCellTrap(float x, float y, float z, int lay, bool reco) const
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.