18 int layer,
int module,
int cell,
int iz,
const G4ThreeVector&
pos,
double& wt) {
22 int cellU(0), cellV(0), waferType(-1), waferU(0), waferV(0);
24 waferType = module / 1000000;
25 waferU = module % 100;
26 if ((module / 10000) % 10 > 0)
28 waferV = (module / 100) % 100;
29 if ((module / 100000) % 10 > 0)
32 cellV = (cell / 100) % 100;
34 double xx = (pos.z() > 0) ? pos.x() : -pos.x();
38 index =
HFNoseDetId(iz, waferType, layer, waferU, waferV, cellU, cellV).
rawId();
40 edm::LogVerbatim(
"HFNSim") <<
"OK WaferType " << waferType <<
" Wafer " << waferU <<
":" << waferV <<
" Cell " 41 << cellU <<
":" << cellV;
47 edm::LogVerbatim(
"HFNSim") <<
"HFNoseNumberingScheme::i/p " << layer <<
":" << module <<
":" << cell <<
":" << iz
48 <<
":" << pos.x() <<
":" << pos.y() <<
":" << pos.z() <<
" ID " << std::hex << index
56 std::pair<float, float>
xy;
58 double z1(0), tolR(10.0), tolZ(1.0);
64 xy =
hgcons_.
locateCell(lay,
id.waferU(),
id.waferV(),
id.cellU(),
id.cellV(),
false,
true);
69 double r1 =
std::sqrt(xy.first * xy.first + xy.second * xy.second);
70 double r2 = pos.perp();
75 bool inok = ((r2 >= rrange.first) && (r2 <= rrange.second) && (z2 >= zrange.first) && (z2 <= zrange.second));
76 bool outok = ((r1 >= rrange.first) && (r1 <= rrange.second) && (z1 >= zrange.first) && (z1 <= zrange.second));
77 std::string ck = (((r1 < rrange.first - tolR) || (r1 > rrange.second + tolR) || (z1 < zrange.first - tolZ) ||
78 (z1 > zrange.second + tolZ))
81 if (!(match && inok && outok)) {
83 <<
" R " << r2 <<
":" << r1 <<
":" << rrange.first <<
":" << rrange.second <<
" Z " 84 << z2 <<
":" << z1 <<
":" << zrange.first <<
":" << zrange.second <<
" Match " << match
85 <<
":" << inok <<
":" << outok <<
" " << ck;
86 edm::LogVerbatim(
"HGCSim") <<
"Original " << pos.x() <<
":" << pos.y() <<
" return " << xy.first <<
":" 89 double wt = 0,
xx = ((pos.z() > 0) ? pos.x() : -pos.x());
90 int waferU, waferV, cellU, cellV, waferType;
void waferFromPosition(const double x, const double y, int &wafer, int &icell, int &celltyp) const
uint32_t getUnitID(int layer, int module, int cell, int iz, const G4ThreeVector &pos, double &wt)
assigns the det id to a hit
constexpr uint32_t rawId() const
get the raw id
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
void checkPosition(uint32_t index, const G4ThreeVector &pos) const
std::pair< double, double > rangeR(double z, bool reco) const
std::pair< double, double > rangeZ(bool reco) const
Abs< T >::type abs(const T &t)
HFNoseNumberingScheme()=delete
double waferZ(int layer, bool reco) const
const HGCalGeometryMode::GeometryMode mode_
const HGCalDDDConstants & hgcons_
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
constexpr Detector det() const
get the detector field from this detid