53 : g4Label_(ps.getParameter<
std::
string>(
"moduleLabel")),
54 caloHitSource_(ps.getParameter<
std::
string>(
"caloHitSource")),
55 nameSense_(ps.getParameter<
std::
string>(
"nameSense")),
56 missingFile_(ps.getParameter<
std::
string>(
"missingFile")),
64 std::ifstream fInput(
fileName.c_str());
69 while (fInput.getline(
buffer, 80)) {
71 if (
items.size() > 2) {
76 }
else if (
items.size() == 1) {
77 int dumpdet = std::atoi(
items[0].c_str());
95 descriptions.
add(
"hgcalHitPartialEE",
desc);
102 int firstLayer =
hgc.getLayerOffset();
105 bool getHits = (hitsCalo.
isValid());
106 uint32_t
nhits = (getHits) ? hitsCalo->size() : 0;
107 uint32_t
good(0), allSi(0),
all(0), allSc(0), bad(0);
108 constexpr
double tol = 2.0;
109 edm::LogVerbatim(
"HGCalSim") <<
"HGCalTestPartialWaferHits: Input flags Hits " << getHits <<
" with " <<
nhits 110 <<
" hits: Layer Offset " << firstLayer;
113 std::vector<PCaloHit>
hits;
114 hits.insert(
hits.end(), hitsCalo->begin(), hitsCalo->end());
121 std::ostringstream st1;
128 std::string_view pid =
129 ((
hgc.cassetteShiftSilicon(hid.layer(), hid.waferU(), hid.waferV())) ?
"HGCSim" :
"HGCalSim");
130 const auto&
info =
hgc.waferInfo(hid.layer(), hid.waferU(), hid.waferV());
132 st1 <<
" Wafer Type:Part:Orient:Cassette " <<
info.type <<
":" <<
info.part <<
":" <<
info.orient <<
":" 150 bool valid1 =
geom->topology().valid(
id);
151 bool valid2 =
hgc.isValidHex8(hid.layer(), hid.waferU(), hid.waferV(), hid.cellU(), hid.cellV(),
false);
152 auto xy =
hgc.locateCell(hid,
false);
153 double xx = (hid.zside() > 0) ?
xy.first : -
xy.first;
155 double dy =
xy.second -
pos.y();
157 if ((
diff > tol) || (!valid1) || (!valid2))
160 <<
" Wafer Type:Part:Orient:Cassette " <<
info.type <<
":" <<
info.part <<
":" 161 <<
info.orient <<
":" <<
info.cassette <<
" at (" <<
pos.x() <<
":" <<
xx <<
":" 162 <<
dx <<
", " <<
pos.y() <<
":" <<
xy.second <<
":" <<
dy <<
", " <<
pos.z()
163 <<
") Valid " << valid1 <<
":" << valid2 <<
" Distance " <<
diff;
171 std::string_view pid = ((
hgc.cassetteShiftScintillator(hid.layer(), hid.iphi())) ?
"HGCSim" :
"HGCalSim");
173 bool valid1 =
geom->topology().valid(
id);
174 bool valid2 =
hgc.isValidTrap(hid.zside(), hid.layer(), hid.ring(), hid.iphi());
175 if ((!valid1) || (!valid2))
177 int cassette =
hgc.cassetteTile(hid.iphi());
178 edm::LogVerbatim(pid) <<
"Hit[" <<
all <<
":" << allSc <<
"] " << hid <<
" Cassette " << cassette <<
" at (" 179 <<
pos.x() <<
", " <<
pos.y() <<
", " <<
pos.z() <<
") Valid " << valid1 <<
":" 183 st1 << std::hex <<
id.rawId() <<
std::dec;
193 <<
good <<
" Scintitllator = " << allSc <<
" Invalid = " << bad;
Log< level::Info, true > LogVerbatim
auto const good
min quality of good
std::vector< PCaloHit > PCaloHitContainer
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
std::vector< int > wafers_
int32_t waferU(const int32_t index)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const std::string caloHitSource_
const std::string g4Label_
void analyze(edm::Event const &, edm::EventSetup const &) override
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
static constexpr int32_t WaferFull
std::vector< std::string > splitString(const std::string &)
const std::string missingFile_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
HGCalTestPartialWaferHits(const edm::ParameterSet &ps)
#define DEFINE_FWK_MODULE(type)
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
const std::string nameSense_
const edm::EDGetTokenT< edm::PCaloHitContainer > tok_calo_
~HGCalTestPartialWaferHits() override=default
void add(std::string const &label, ParameterSetDescription const &psetDescription)
int32_t waferV(const int32_t index)
std::vector< int > dumpDets_
const edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > geomToken_