24 : hgcons_(
hgc), mode_(
hgc.geomMode()), det_(det), name_(
name) {
37 std::ifstream fInput(filetmp2.c_str());
42 while (fInput.getline(
buffer, 80)) {
44 if (
items.size() > 2) {
56 }
else if (
items.size() == 1) {
57 int dumpdet = std::atoi(
items[0].c_str());
63 <<
" component information from " << filetmp2 <<
" Layer Offset " <<
firstLayer_;
82 << cell <<
" iz " << iz <<
" Position " <<
pos;
85 int cellU(0), cellV(0), waferType(-1),
waferU(0),
waferV(0);
107 hgcons_.
waferFromPosition(
xx,
pos.y(),
layer,
waferU,
waferV, cellU, cellV, waferType, wt,
false,
debug);
109 if (waferType >= 0) {
112 if (
type != waferType) {
117 <<
":" << cell <<
" has a type mismatch " << waferType <<
":" <<
type;
126 << cellU <<
":" << cellV <<
" input " << cell <<
" wt " << wt <<
" Mode " <<
mode_;
140 if (typm.first >= 0) {
152 edm::LogVerbatim(
"HGCSim") <<
"Radius/Phi " <<
ring <<
"(" <<
id[0] <<
"):" <<
id[1] <<
" Type " <<
id[2] <<
":" 153 << typm.first <<
" SiPM " << typm.second <<
":" <<
hgcons_.
tileSiPM(typm.second)
154 <<
" Layer " <<
layer <<
" z " << iz <<
" " << detId <<
" wt " << wt <<
" position " 155 <<
pos <<
" R " <<
pos.perp();
158 edm::LogVerbatim(
"HGCSim") <<
"Radius/Phi " <<
id[0] <<
":" <<
id[1] <<
" Type " <<
id[2] <<
" Layer|iz " <<
layer 159 <<
":" << iz <<
" ERROR";
168 <<
":" << iz <<
":" <<
pos.x() <<
":" <<
pos.y() <<
":" <<
pos.z() <<
" ID " << std::hex
176 std::pair<float, float>
xy;
178 double z1(0), tolR(14.0), tolZ(1.0);
200 double r2 =
pos.perp();
205 bool inok = ((
r2 >= rrange.first) && (
r2 <= rrange.second) && (
z2 >=
zrange.first) && (
z2 <=
zrange.second));
206 bool outok = ((
r1 >= rrange.first) && (
r1 <= rrange.second) && (z1 >=
zrange.first) && (z1 <=
zrange.second));
207 std::string ck = (((
r1 < rrange.first - tolR) || (
r1 > rrange.second + tolR) || (z1 <
zrange.first - tolZ) ||
208 (z1 >
zrange.second + tolZ))
209 ?
"***** ERROR *****" 211 if (matchOnly &&
match)
214 edm::LogVerbatim(
"HGCSim") <<
"HGCalNumberingScheme::Detector " <<
det_ <<
" Layer " << lay <<
" R " <<
r2 <<
":" 215 <<
r1 <<
":" << rrange.first <<
":" << rrange.second <<
" Z " <<
z2 <<
":" << z1 <<
":" 216 <<
zrange.first <<
":" <<
zrange.second <<
" Match " <<
match <<
":" << inok <<
":" 217 << outok <<
" " << ck;
221 double wt = 0,
xx = ((
pos.z() > 0) ?
pos.x() : -
pos.x());
223 hgcons_.
waferFromPosition(
xx,
pos.y(), lay,
waferU,
waferV, cellU, cellV, waferType, wt,
false,
false);
225 double dx = (
xx -
xy.first);
226 double dy = (
pos.y() -
xy.second);
228 ck = (
dR > tolR) ?
" ***** ERROR *****" :
"";
230 <<
":" <<
pos.y() <<
" derived " <<
xy.first <<
":" <<
xy.second <<
" Difference "
std::pair< float, float > locateCellTrap(int lay, int ieta, int iphi, bool reco, bool debug=false) const
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
const DetId::Detector det_
std::pair< int, int > tileRings(int layer) 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 > layer
U second(std::pair< T, U > const &p)
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 &)
int waferType(DetId const &id, bool fromFile=false) const
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
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
bool tileExist(int zside, int layer, int ring, int phi) const
constexpr uint32_t rawId() const
get the raw id
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)
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.