18 : hgcons_(
hgc), mode_(
hgc.geomMode()), det_(det), name_(
name) {
40 << cell <<
" iz " << iz <<
" Position " <<
pos;
43 int cellU(0), cellV(0), waferType(-1),
waferU(0),
waferV(0);
52 hgcons_.
waferFromPosition(
xx,
pos.y(),
layer,
waferU,
waferV, cellU, cellV, waferType, wt,
false,
false);
57 if (
type != waferType) {
62 <<
":" << cell <<
" has a type mismatch " << waferType <<
":" <<
type;
71 << cellU <<
":" << cellV <<
" input " << cell <<
" wt " << wt <<
" Mode " <<
mode_;
82 if (typm.first >= 0) {
89 edm::LogVerbatim(
"HGCSim") <<
"Radius/Phi " <<
id[0] <<
":" <<
id[1] <<
" Type " <<
id[2] <<
":" << typm.first
90 <<
" SiPM " << typm.second <<
":" <<
hgcons_.
tileSiPM(typm.second) <<
" Layer " 91 <<
layer <<
":" << lay <<
" z " << iz <<
" " << detId;
93 edm::LogVerbatim(
"HGCSim") <<
"Radius/Phi " <<
id[0] <<
":" <<
id[1] <<
" Type " <<
id[2] <<
" Layer|iz " <<
layer 94 <<
":" << iz <<
" ERROR";
103 <<
":" << iz <<
":" <<
pos.x() <<
":" <<
pos.y() <<
":" <<
pos.z() <<
" ID " << std::hex
111 std::pair<float, float>
xy;
113 double z1(0), tolR(14.0), tolZ(1.0);
135 double r2 =
pos.perp();
140 bool inok = ((
r2 >= rrange.first) && (
r2 <= rrange.second) && (
z2 >=
zrange.first) && (
z2 <=
zrange.second));
141 bool outok = ((
r1 >= rrange.first) && (
r1 <= rrange.second) && (z1 >=
zrange.first) && (z1 <=
zrange.second));
142 std::string ck = (((
r1 < rrange.first - tolR) || (
r1 > rrange.second + tolR) || (z1 <
zrange.first - tolZ) ||
143 (z1 >
zrange.second + tolZ))
144 ?
"***** ERROR *****" 146 if (matchOnly &&
match)
149 edm::LogVerbatim(
"HGCSim") <<
"HGCalNumberingScheme::Detector " <<
det_ <<
" Layer " << lay <<
" R " <<
r2 <<
":" 150 <<
r1 <<
":" << rrange.first <<
":" << rrange.second <<
" Z " <<
z2 <<
":" << z1 <<
":" 151 <<
zrange.first <<
":" <<
zrange.second <<
" Match " <<
match <<
":" << inok <<
":" 152 << outok <<
" " << ck;
156 double wt = 0,
xx = ((
pos.z() > 0) ?
pos.x() : -
pos.x());
158 hgcons_.
waferFromPosition(
xx,
pos.y(), lay,
waferU,
waferV, cellU, cellV, waferType, wt,
false,
true);
160 double dx = (
xx -
xy.first);
161 double dy = (
pos.y() -
xy.second);
163 ck = (
dR > tolR) ?
" ***** ERROR *****" :
"";
165 <<
":" <<
pos.y() <<
" derived " <<
xy.first <<
":" <<
xy.second <<
" Difference "
double waferZ(int layer, bool reco) const
Log< level::Info, true > LogVerbatim
void waferFromPosition(const double x, const double y, int &wafer, int &icell, int &celltyp) const
HGCalNumberingScheme()=delete
std::pair< double, double > rangeZ(bool reco) const
static int32_t getUnpackedCellU(int id)
static int32_t getUnpackedU(int id)
const HGCalGeometryMode::GeometryMode mode_
int32_t waferU(const int32_t index)
const HGCalDDDConstants & hgcons_
int getLayerOffset() const
static int32_t getUnpackedV(int id)
bool waferHexagon8() const
constexpr std::array< uint8_t, layerIndexSize > layer
std::pair< int, int > tileType(int layer, int ring, int phi) const
int waferType(DetId const &id, bool fromFile=false) const
Abs< T >::type abs(const T &t)
static int32_t getUnpackedType(int id)
int tileSiPM(int sipm) const
bool tileTrapezoid() const
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
std::pair< double, double > rangeR(double z, 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
std::array< int, 3 > assignCellTrap(float x, float y, float z, int lay, bool reco) const
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, bool matchOnly, bool debug) const
static int32_t getUnpackedCellV(int id)
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.
std::pair< float, float > locateCellTrap(int lay, int ieta, int iphi, bool reco) const