25 : hgcons_(
hgc), mode_(
hgc.geomMode()), det_(det), name_(
name) {
38 std::ifstream fInput(filetmp2.c_str());
43 while (fInput.getline(
buffer, 80)) {
45 if (
items.size() == 3) {
57 }
else if (
items.size() == 1) {
58 int dumpdet = std::atoi(
items[0].c_str());
60 }
else if (
items.size() == 4) {
61 int idet = std::atoi(
items[0].c_str());
64 int cassette = std::atoi(
items[3].c_str());
70 <<
dumpCassette_.size() <<
" component information from " << filetmp2
90 << cell <<
" iz " << iz <<
" Position " <<
pos;
93 int cellU(0), cellV(0), waferType(-1),
waferU(0),
waferV(0);
127 hgcons_.
waferFromPosition(
xx,
pos.y(),
zside,
layer,
waferU,
waferV, cellU, cellV, waferType, wt,
false,
debug);
129 if (waferType >= 0) {
132 if (
type != waferType) {
137 <<
":" << cell <<
" has a type mismatch " << waferType <<
":" <<
type;
148 <<
":" <<
module <<
":" << cell <<
" WaferType " << waferType <<
" Wafer " <<
waferU 149 <<
":" <<
waferV <<
" Cell " << cellU <<
":" << cellV <<
" wt " << wt <<
" Mode " 163 if (typm.first >= 0) {
164 detId.setType(typm.first);
165 detId.setSiPM(typm.second);
175 edm::LogVerbatim(
"HGCSim") <<
"Radius/Phi " <<
id[0] <<
":" <<
id[1] <<
" Type " <<
id[2] <<
":" << typm.first
176 <<
" SiPM " << typm.second <<
":" <<
hgcons_.
tileSiPM(typm.second) <<
" Layer " 177 <<
layer <<
" z " << iz <<
" " <<
detId <<
" wt " << wt <<
" position " <<
pos 178 <<
" R " <<
pos.perp();
181 edm::LogVerbatim(
"HGCSim") <<
"Radius/Phi " <<
id[0] <<
":" <<
id[1] <<
" Type " <<
id[2] <<
" Layer|iz " <<
layer 182 <<
":" << iz <<
" for i/p Layer " <<
layer <<
" module " <<
module <<
" cell " << cell
183 <<
" iz " << iz <<
" pos " <<
pos <<
" wt " << wt <<
" ERROR";
192 <<
":" << iz <<
":" <<
pos.x() <<
":" <<
pos.y() <<
":" <<
pos.z() <<
" ID " << std::hex
195 if (matchOnly && (!
ok))
197 <<
":" << iz <<
":" <<
pos.x() <<
":" <<
pos.y() <<
":" <<
pos.z() <<
" ID " << std::hex
204 std::pair<float, float>
xy;
205 bool ok(
false), iok(
true);
206 double z1(0), tolR(14.0), tolZ(1.0);
213 id.
zside(), lay,
id.
waferU(),
id.
waferV(),
id.cellU(),
id.cellV(),
false,
true,
false,
false,
false);
229 double r2 =
pos.perp();
234 bool inok = ((
r2 >= rrange.first) && (
r2 <= rrange.second) && (
z2 >=
zrange.first) && (
z2 <=
zrange.second));
235 bool outok = ((
r1 >= rrange.first) && (
r1 <= rrange.second) && (z1 >=
zrange.first) && (z1 <=
zrange.second));
236 std::string ck = (((
r1 < rrange.first - tolR) || (
r1 > rrange.second + tolR) || (z1 <
zrange.first - tolZ) ||
237 (z1 >
zrange.second + tolZ))
238 ?
"***** ERROR *****" 240 if (matchOnly &&
match)
245 edm::LogVerbatim(
"HGCSim") <<
"HGCalNumberingScheme::Detector " <<
det_ <<
" Layer " << lay <<
" R " <<
r2 <<
":" 246 <<
r1 <<
":" << rrange.first <<
":" << rrange.second <<
" Z " <<
z2 <<
":" << z1 <<
":" 247 <<
zrange.first <<
":" <<
zrange.second <<
" Match " <<
match <<
":" << inok <<
":" 248 << outok <<
" " << ck;
255 hgcons_.
waferFromPosition(
xx,
pos.y(),
zside, lay,
waferU,
waferV, cellU, cellV, waferType, wt,
false,
true);
256 xy =
hgcons_.
locateCell(
zside, lay,
waferU,
waferV, cellU, cellV,
false,
true,
false,
false,
true);
257 double dx = (
xx -
xy.first);
258 double dy = (
pos.y() -
xy.second);
261 ck =
" ***** ERROR *****";
267 <<
":" <<
pos.y() <<
" derived " <<
xy.first <<
":" <<
xy.second <<
" Difference "
double waferZ(int layer, bool reco) const
Log< level::Info, true > LogVerbatim
static int cassetteIndex(int det, int layer, int zside, int cassette)
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
const DetId::Detector det_
const HGCalParameters * getParameter() const
static int32_t getUnpackedCellU(int id)
std::string fullPath() const
static int32_t getUnpackedU(int id)
const HGCalGeometryMode::GeometryMode mode_
int32_t waferU(const int32_t index)
HGCalParameters::waferInfo waferInfo(int lay, int waferU, int waferV) const
const HGCalDDDConstants & hgcons_
int getLayerOffset() const
static int32_t getUnpackedV(int id)
bool waferHexagon8() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< int > indices_
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ietaAbs(uint32_t id)
int32_t tileIndex(int32_t layer, int32_t ring, int32_t phi)
static constexpr int32_t WaferFull
std::vector< std::string > splitString(const std::string &)
Abs< T >::type abs(const T &t)
std::vector< int > dumpDets_
static int32_t getUnpackedType(int id)
int tileSiPM(int sipm) const
bool tileTrapezoid() const
std::pair< int, int > tileType(int layer, int ring, int phi) const
std::pair< float, float > locateCellTrap(int zside, int lay, int ieta, int iphi, bool reco, bool debug) const
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
bool waferHexagon8Module() const
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
int waferType(DetId const &id, bool fromFile) const
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
bool waferHexagon8File() const
static int32_t getUnpackedCellV(int id)
std::vector< int > dumpCassette_
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.
bool checkPosition(uint32_t index, const G4ThreeVector &pos, bool matchOnly, bool debug) const
waferInfo_map waferInfoMap_