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.zside(), hid.layer(), hid.waferU(), hid.waferV())) ?
"HGCSim" 131 const auto&
info =
hgc.waferInfo(hid.layer(), hid.waferU(), hid.waferV());
133 st1 <<
" Wafer Type:Part:Orient:Cassette " <<
info.type <<
":" <<
info.part <<
":" <<
info.orient <<
":" 151 bool valid1 =
geom->topology().valid(
id);
152 bool valid2 =
hgc.isValidHex8(hid.layer(), hid.waferU(), hid.waferV(), hid.cellU(), hid.cellV(),
false);
153 auto xy =
hgc.locateCell(hid,
false);
154 double xx = (hid.zside() > 0) ?
xy.first : -
xy.first;
156 double dy =
xy.second -
pos.y();
158 if ((
diff > tol) || (!valid1) || (!valid2))
161 <<
" Wafer Type:Part:Orient:Cassette " <<
info.type <<
":" <<
info.part <<
":" 162 <<
info.orient <<
":" <<
info.cassette <<
" at (" <<
pos.x() <<
":" <<
xx <<
":" 163 <<
dx <<
", " <<
pos.y() <<
":" <<
xy.second <<
":" <<
dy <<
", " <<
pos.z()
164 <<
") Valid " << valid1 <<
":" << valid2 <<
" Distance " <<
diff;
172 std::string_view pid =
173 ((
hgc.cassetteShiftScintillator(hid.zside(), hid.layer(), hid.iphi())) ?
"HGCSim" :
"HGCalSim");
175 bool valid1 =
geom->topology().valid(
id);
176 bool valid2 =
hgc.isValidTrap(hid.zside(), hid.layer(), hid.ring(), hid.iphi());
177 if ((!valid1) || (!valid2))
179 int cassette =
hgc.cassetteTile(hid.iphi());
180 edm::LogVerbatim(pid) <<
"Hit[" <<
all <<
":" << allSc <<
"] " << hid <<
" Cassette " << cassette <<
" at (" 181 <<
pos.x() <<
", " <<
pos.y() <<
", " <<
pos.z() <<
") Valid " << valid1 <<
":" 185 st1 << std::hex <<
id.rawId() <<
std::dec;
195 <<
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
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_