7 hcalSimHitsCollection_, hcalSimHitsPassName_);
9 hcalRecHitsCollection_, hcalRecHitsPassName_);
11 const int failedVeto{999};
13 std::vector<int> firstLayersHit{failedVeto, failedVeto, failedVeto,
14 failedVeto, failedVeto};
16 const std::vector<std::string> sectionNames{
"back",
"top",
"bottom",
"right",
18 for (
const auto &hit : hcalRecHits) {
19 const ldmx::HcalID id{
static_cast<ldmx::DetectorID::RawValue
>(hit.getID())};
20 const auto section{
id.section()};
21 const auto layer{
id.layer()};
22 if (hitPassesVeto(hit, section)) {
23 if (layer < firstLayersHit[section]) {
24 firstLayersHit[section] = layer;
29 bool vetoedByBack{firstLayersHit[ldmx::HcalID::HcalSection::BACK] !=
31 bool vetoedByTop{firstLayersHit[ldmx::HcalID::HcalSection::TOP] !=
33 bool vetoedByBottom{firstLayersHit[ldmx::HcalID::HcalSection::BOTTOM] !=
35 bool vetoedByRight{firstLayersHit[ldmx::HcalID::HcalSection::RIGHT] !=
37 bool vetoedByLeft{firstLayersHit[ldmx::HcalID::HcalSection::LEFT] !=
39 bool vetoedBySide{vetoedByTop || vetoedByBottom || vetoedByRight ||
42 for (
int section{0}; section < firstLayersHit.size(); ++section) {
43 const auto layer{firstLayersHit[section]};
44 const auto sectionName{sectionNames[section]};
45 if (layer != failedVeto) {
50 if (vetoedByBack || vetoedBySide) {
52 if (vetoedByBack && vetoedBySide) {
54 }
else if (vetoedByBack && !vetoedBySide) {
56 }
else if (vetoedBySide && !vetoedByBack) {