9 hcal_sim_hits_collection_ = parameters.
get<std::string>(
"sim_coll_name");
10 hcal_rec_hits_collection_ = parameters.
get<std::string>(
"rec_coll_name");
11 hcal_sim_hits_pass_name_ = parameters.
get<std::string>(
"sim_pass_name");
12 hcal_rec_hits_pass_name_ = parameters.
get<std::string>(
"rec_pass_name");
13 pe_veto_threshold_ = parameters.
get<
double>(
"pe_veto_threshold");
14 max_hit_time_ = parameters.
get<
double>(
"max_hit_time");
19 hcal_sim_hits_collection_, hcal_sim_hits_pass_name_);
20 const auto hcal_rec_hits =
event.getCollection<
ldmx::HcalHit>(
21 hcal_rec_hits_collection_, hcal_rec_hits_pass_name_);
23 const int failed_veto{999};
25 std::vector<int> first_layers_hit{failed_veto, failed_veto, failed_veto,
26 failed_veto, failed_veto};
28 const std::vector<std::string> section_names{
"back",
"top",
"bottom",
"right",
30 for (
const auto &hit : hcal_rec_hits) {
31 const ldmx::HcalID id{
static_cast<ldmx::DetectorID::RawValue
>(hit.getID())};
32 const auto section{
id.section()};
33 const auto layer{
id.layer()};
34 if (hitPassesVeto(hit, section)) {
35 if (layer < first_layers_hit[section]) {
36 first_layers_hit[section] = layer;
41 bool vetoed_by_back{first_layers_hit[ldmx::HcalID::HcalSection::BACK] !=
43 bool vetoed_by_top{first_layers_hit[ldmx::HcalID::HcalSection::TOP] !=
45 bool vetoed_by_bottom{first_layers_hit[ldmx::HcalID::HcalSection::BOTTOM] !=
47 bool vetoed_by_right{first_layers_hit[ldmx::HcalID::HcalSection::RIGHT] !=
49 bool vetoed_by_left{first_layers_hit[ldmx::HcalID::HcalSection::LEFT] !=
51 bool vetoed_by_side{vetoed_by_top || vetoed_by_bottom || vetoed_by_right ||
54 for (
int section{0}; section < first_layers_hit.size(); ++section) {
55 const auto layer{first_layers_hit[section]};
56 const auto section_name{section_names[section]};
57 if (layer != failed_veto) {
62 if (vetoed_by_back || vetoed_by_side) {
64 if (vetoed_by_back && vetoed_by_side) {
66 }
else if (vetoed_by_back && !vetoed_by_side) {
68 }
else if (vetoed_by_side && !vetoed_by_back) {