19 int layer,
int module,
int cell,
int iz,
const G4ThreeVector& pos,
double& wt) {
23 int cellU(0), cellV(0), waferType(-1),
waferU(0),
waferV(0);
31 double xx = (pos.z() > 0) ? pos.x() : -pos.x();
37 edm::LogVerbatim(
"HFNSim") <<
"OK WaferType " << waferType <<
" Wafer " <<
waferU <<
":" << waferV <<
" Cell "
38 << cellU <<
":" << cellV;
44 edm::LogVerbatim(
"HFNSim") <<
"HFNoseNumberingScheme::i/p " << layer <<
":" << module <<
":" << cell <<
":" << iz
45 <<
":" << pos.x() <<
":" << pos.y() <<
":" << pos.z() <<
" ID " << std::hex << index
53 std::pair<float, float>
xy;
55 double z1(0), tolR(10.0), tolZ(1.0);
66 double r1 =
std::sqrt(xy.first * xy.first + xy.second * xy.second);
67 double r2 = pos.perp();
72 bool inok = ((r2 >= rrange.first) && (r2 <= rrange.second) && (z2 >= zrange.first) && (z2 <= zrange.second));
73 bool outok = ((r1 >= rrange.first) && (r1 <= rrange.second) && (z1 >= zrange.first) && (z1 <= zrange.second));
74 std::string ck = (((r1 < rrange.first - tolR) || (r1 > rrange.second + tolR) || (z1 < zrange.first - tolZ) ||
75 (z1 > zrange.second + tolZ))
78 if (!(match && inok && outok)) {
80 <<
" R " << r2 <<
":" << r1 <<
":" << rrange.first <<
":" << rrange.second <<
" Z "
81 << z2 <<
":" << z1 <<
":" << zrange.first <<
":" << zrange.second <<
" Match " << match
82 <<
":" << inok <<
":" << outok <<
" " << ck;
83 edm::LogVerbatim(
"HGCSim") <<
"Original " << pos.x() <<
":" << pos.y() <<
" return " << xy.first <<
":"
86 double wt = 0, xx = ((pos.z() > 0) ? pos.x() : -pos.x());
Log< level::Info, true > LogVerbatim
static int32_t getUnpackedCellU(int id)
void waferFromPosition(const double x, const double y, int &wafer, int &icell, int &celltyp) const
static int32_t getUnpackedU(int id)
uint32_t getUnitID(int layer, int module, int cell, int iz, const G4ThreeVector &pos, double &wt)
assigns the det id to a hit
int32_t waferU(const int32_t index)
constexpr uint32_t rawId() const
get the raw id
static int32_t getUnpackedV(int id)
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
void checkPosition(uint32_t index, const G4ThreeVector &pos) const
constexpr std::array< uint8_t, layerIndexSize > layer
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)
static int32_t getUnpackedType(int id)
HFNoseNumberingScheme()=delete
double waferZ(int layer, bool reco) const
Basic2DVector< T > xy() const
const HGCalGeometryMode::GeometryMode mode_
static int32_t getUnpackedCellV(int id)
const HGCalDDDConstants & hgcons_
int32_t waferV(const int32_t index)
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