13 hcal_sim_hits_collection_ = parameters.
get<std::string>(
"sim_coll_name");
14 hcal_rec_hits_collection_ = parameters.
get<std::string>(
"rec_coll_name");
15 hcal_sim_hits_pass_name_ = parameters.
get<std::string>(
"sim_pass_name");
16 hcal_rec_hits_pass_name_ = parameters.
get<std::string>(
"rec_pass_name");
17 pe_veto_threshold_ = parameters.
get<
double>(
"pe_veto_threshold");
18 max_hit_time_ = parameters.
get<
double>(
"max_hit_time");
23 hcal_sim_hits_collection_, hcal_sim_hits_pass_name_);
24 const auto hcal_rec_hits =
event.getCollection<
ldmx::HcalHit>(
25 hcal_rec_hits_collection_, hcal_rec_hits_pass_name_);
27 const int failed_veto{999};
29 std::vector<int> first_layers_hit{failed_veto, failed_veto, failed_veto,
30 failed_veto, failed_veto};
32 const std::vector<std::string> section_names{
"back",
"top",
"bottom",
"right",
34 for (
const auto& hit : hcal_rec_hits) {
35 const ldmx::HcalID id{
static_cast<ldmx::DetectorID::RawValue
>(hit.getID())};
36 const auto section{
id.section()};
37 const auto layer{
id.layer()};
38 if (hitPassesVeto(hit, section)) {
39 if (layer < first_layers_hit[section]) {
40 first_layers_hit[section] = layer;
45 bool vetoed_by_back{first_layers_hit[ldmx::HcalID::HcalSection::BACK] !=
47 bool vetoed_by_top{first_layers_hit[ldmx::HcalID::HcalSection::TOP] !=
49 bool vetoed_by_bottom{first_layers_hit[ldmx::HcalID::HcalSection::BOTTOM] !=
51 bool vetoed_by_right{first_layers_hit[ldmx::HcalID::HcalSection::RIGHT] !=
53 bool vetoed_by_left{first_layers_hit[ldmx::HcalID::HcalSection::LEFT] !=
55 bool vetoed_by_side{vetoed_by_top || vetoed_by_bottom || vetoed_by_right ||
58 for (
int section{0}; section < first_layers_hit.size(); ++section) {
59 const auto layer{first_layers_hit[section]};
60 const auto section_name{section_names[section]};
61 if (layer != failed_veto) {
66 if (vetoed_by_back || vetoed_by_side) {
68 if (vetoed_by_back && vetoed_by_side) {
70 }
else if (vetoed_by_back && !vetoed_by_side) {
72 }
else if (vetoed_by_side && !vetoed_by_back) {