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;
146 << cellU <<
":" << cellV <<
" input " << cell <<
" wt " << wt <<
" Mode " <<
mode_;
157 if (typm.first >= 0) {
169 edm::LogVerbatim(
"HGCSim") <<
"Radius/Phi " <<
id[0] <<
":" <<
id[1] <<
" Type " <<
id[2] <<
":" << typm.first
170 <<
" SiPM " << typm.second <<
":" <<
hgcons_.
tileSiPM(typm.second) <<
" Layer " 171 <<
layer <<
" z " << iz <<
" " << detId <<
" wt " << wt <<
" position " <<
pos 172 <<
" R " <<
pos.perp();
175 edm::LogVerbatim(
"HGCSim") <<
"Radius/Phi " <<
id[0] <<
":" <<
id[1] <<
" Type " <<
id[2] <<
" Layer|iz " <<
layer 176 <<
":" << iz <<
" ERROR";
185 <<
":" << iz <<
":" <<
pos.x() <<
":" <<
pos.y() <<
":" <<
pos.z() <<
" ID " << std::hex
193 std::pair<float, float>
xy;
195 double z1(0), tolR(14.0), tolZ(1.0);
202 id.
zside(), lay,
id.
waferU(),
id.
waferV(),
id.cellU(),
id.cellV(),
false,
true,
false,
false);
218 double r2 =
pos.perp();
223 bool inok = ((
r2 >= rrange.first) && (
r2 <= rrange.second) && (
z2 >=
zrange.first) && (
z2 <=
zrange.second));
224 bool outok = ((
r1 >= rrange.first) && (
r1 <= rrange.second) && (z1 >=
zrange.first) && (z1 <=
zrange.second));
225 std::string ck = (((
r1 < rrange.first - tolR) || (
r1 > rrange.second + tolR) || (z1 <
zrange.first - tolZ) ||
226 (z1 >
zrange.second + tolZ))
227 ?
"***** ERROR *****" 229 if (matchOnly &&
match)
232 edm::LogVerbatim(
"HGCSim") <<
"HGCalNumberingScheme::Detector " <<
det_ <<
" Layer " << lay <<
" R " <<
r2 <<
":" 233 <<
r1 <<
":" << rrange.first <<
":" << rrange.second <<
" Z " <<
z2 <<
":" << z1 <<
":" 234 <<
zrange.first <<
":" <<
zrange.second <<
" Match " <<
match <<
":" << inok <<
":" 235 << outok <<
" " << ck;
242 hgcons_.
waferFromPosition(
xx,
pos.y(),
zside, lay,
waferU,
waferV, cellU, cellV, waferType, wt,
false,
true);
244 double dx = (
xx -
xy.first);
245 double dy = (
pos.y() -
xy.second);
247 ck = (
dR > tolR) ?
" ***** ERROR *****" :
"";
249 <<
":" <<
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_
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
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)
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
void checkPosition(uint32_t index, const G4ThreeVector &pos, bool matchOnly, bool debug) 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.
waferInfo_map waferInfoMap_