Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIDLookup: define momentum cuts to set an explicit boundary between TOF and hpDIRC domains #1518

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 2 additions & 0 deletions src/detectors/BTOF/BTOF.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Copyright (C) 2024, Dmitry Kalinkin

#include <DD4hep/Detector.h>
#include <edm4eic/unit_system.h>
#include <Evaluator/DD4hepUnits.h>
#include <JANA/JApplication.h>
#include <algorithm>
Expand Down Expand Up @@ -70,6 +71,7 @@ void InitPlugin(JApplication *app) {
.momentum_edges={0.0, 0.3, 0.6, 0.9, 1.2, 1.5, 1.8, 2.1, 2.4, 2.7, 3.0, 3.3, 3.6, 3.9, 4.2, 4.5, 4.8, 5.1, 5.4, 5.7, 6.0},
.polar_edges={2.50, 10.95, 19.40, 27.85, 36.30, 44.75, 53.20, 61.65, 70.10, 78.55, 87.00, 95.45, 103.90, 112.35, 120.80, 129.25, 137.70, 146.15, 154.60},
.azimuthal_binning={0., 360., 360.}, // lower, upper, step
.momentum_cut_max=2.5*edm4eic::unit::GeV,
.momentum_bin_centers_in_lut=true,
.polar_bin_centers_in_lut=true,
};
Expand Down
2 changes: 2 additions & 0 deletions src/detectors/DIRC/DIRC.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// Copyright (C) 2024, Dmitry Kalinkin

#include <DD4hep/Detector.h>
#include <edm4eic/unit_system.h>
#include <JANA/JApplication.h>
#include <stddef.h>
#include <algorithm>
Expand Down Expand Up @@ -98,6 +99,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->Add(new JOmniFactoryGeneratorT<PIDLookup_factory>(
Expand Down
Loading