Skip to content

Commit

Permalink
PIDLookup: define momentum cuts to set an explicit boundary between B…
Browse files Browse the repository at this point in the history
…TOF and hpDIRC domains

Currently DIRC is processed after TOF, and will replace previously
looked up TOF values whenever DIRC has a table entry.
  • Loading branch information
veprbl committed Jun 28, 2024
1 parent 87f64cd commit 947b38d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/algorithms/pid_lut/PIDLookup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ void PIDLookup::process(const Input& input, const Output& output) const {

int identified_pdg = 0; // unknown

if ((entry != nullptr) && ((entry->prob_electron != 0.) || (entry->prob_pion != 0.) || (entry->prob_kaon != 0.) || (entry->prob_electron != 0.))) {
bool entry_found = entry != nullptr;
bool entry_valid = (entry->prob_electron != 0.) || (entry->prob_pion != 0.) || (entry->prob_kaon != 0.) || (entry->prob_electron != 0.);
bool momentum_cut_pass = (momentum >= m_cfg.momentum_cut_min) && (momentum < m_cfg.momentum_cut_max);

if (entry_found && entry_valid && momentum_cut_pass) {
double random_unit_interval = m_dist(m_gen);

trace("entry with e:pi:K:P={}:{}:{}:{}", entry->prob_electron, entry->prob_pion, entry->prob_kaon, entry->prob_proton);
Expand Down
3 changes: 3 additions & 0 deletions src/algorithms/pid_lut/PIDLookupConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#pragma once

#include <vector>
#include <limits>

namespace eicrecon {

Expand All @@ -15,6 +16,8 @@ struct PIDLookupConfig {
std::vector<double> momentum_edges;
std::vector<double> polar_edges;
std::vector<double> azimuthal_binning;
double momentum_cut_max = std::numeric_limits<double>::infinity();
double momentum_cut_min = -std::numeric_limits<double>::infinity();
bool azimuthal_bin_centers_in_lut {false};
bool momentum_bin_centers_in_lut {false};
bool polar_bin_centers_in_lut {false};
Expand Down
1 change: 1 addition & 0 deletions src/detectors/BTOF/BTOF.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ void InitPlugin(JApplication *app) {
.azimuthal_binning={0., 360., 360.}, // lower, upper, step
.momentum_bin_centers_in_lut=true,
.polar_bin_centers_in_lut=true,
.momentum_cut_max=2.5*edm4eic::unit::GeV,
},
app
));
Expand Down
1 change: 1 addition & 0 deletions src/detectors/DIRC/DIRC.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ extern "C" {
.momentum_edges={0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.2, 4.4, 4.6, 4.8, 5.0, 5.2, 5.4, 5.6, 5.8, 6.0, 6.2, 6.4, 6.6, 6.8, 7.0, 7.2, 7.4, 7.6, 7.8, 8.0, 8.2, 8.4, 8.6, 8.8, 9.0, 9.2, 9.4, 9.6, 9.8, 10.0, 10.2},
.polar_edges={25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0, 49.0, 50.0, 51.0, 52.0, 53.0, 54.0, 55.0, 56.0, 57.0, 58.0, 59.0, 60.0, 61.0, 62.0, 63.0, 64.0, 65.0, 66.0, 67.0, 68.0, 69.0, 70.0, 71.0, 72.0, 73.0, 74.0, 75.0, 76.0, 77.0, 78.0, 79.0, 80.0, 81.0, 82.0, 83.0, 84.0, 85.0, 86.0, 87.0, 88.0, 89.0, 90.0, 91.0, 92.0, 93.0, 94.0, 95.0, 96.0, 97.0, 98.0, 99.0, 100.0, 101.0, 102.0, 103.0, 104.0, 105.0, 106.0, 107.0, 108.0, 109.0, 110.0, 111.0, 112.0, 113.0, 114.0, 115.0, 116.0, 117.0, 118.0, 119.0, 120.0, 121.0, 122.0, 123.0, 124.0, 125.0, 126.0, 127.0, 128.0, 129.0, 130.0, 131.0, 132.0, 133.0, 134.0, 135.0, 136.0, 137.0, 138.0, 139.0, 140.0, 141.0, 142.0, 143.0, 144.0, 145.0, 146.0, 147.0, 148.0, 149.0, 150.0, 151.0, 152.0, 153.0, 154.0, 155.0, 156.0, 157.0, 158.0, 159.0, 160.0},
.azimuthal_binning={0.0, 30.5, 0.5}, // lower, upper, step
.momentum_cut_min=2.5*edm4eic::unit::GeV,
},
app
));
Expand Down

0 comments on commit 947b38d

Please sign in to comment.