EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
PIDLookupTable.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// Copyright (C) 2024, Nathan Brei, Dmitry Kalinkin
3
4#pragma once
5
6#include <algorithms/logger.h>
7#include <boost/histogram.hpp>
8#include <string>
9#include <tuple>
10#include <variant>
11#include <vector>
12// IWYU pragma: no_include <boost/mp11/detail/mp_defer.hpp>
13
14namespace eicrecon {
15
16class PIDLookupTable : public algorithms::LoggerMixin {
17
18public:
20 struct Entry : public boost::histogram::accumulators::count<unsigned char, false> {
22 };
23
24 struct Binning {
25 std::vector<int> pdg_values;
26 std::vector<int> charge_values;
27 std::vector<double> momentum_edges;
28 std::vector<double> polar_edges;
29 std::vector<double> azimuthal_binning;
35 };
36
37private:
38 boost::histogram::histogram<
39 std::tuple<boost::histogram::axis::category<int>, boost::histogram::axis::category<int>,
40 boost::histogram::axis::variable<>, boost::histogram::axis::variable<>,
41 boost::histogram::axis::circular<>>,
42 boost::histogram::dense_storage<Entry>>
43 m_hist;
44 bool m_symmetrizing_charges;
45
46public:
47 PIDLookupTable() : algorithms::LoggerMixin("PIDLookupTable") {};
48
49 const Entry* Lookup(int pdg, int charge, double momentum, double theta_deg, double phi_deg) const;
50
51 void load_file(const std::string& filename, const Binning& binning);
52};
53
54} // namespace eicrecon
Definition PIDLookupTable.h:16
void load_file(const std::string &filename, const Binning &binning)
Definition PIDLookupTable.cc:38
PIDLookupTable()
Definition PIDLookupTable.h:47
const Entry * Lookup(int pdg, int charge, double momentum, double theta_deg, double phi_deg) const
Definition PIDLookupTable.cc:24
Definition ActsSvc.h:11
-client
Definition CalorimeterClusterRecoCoG.cc:37
Definition PIDLookupTable.h:24
bool polar_bin_centers_in_lut
Definition PIDLookupTable.h:32
bool use_radians
Definition PIDLookupTable.h:33
std::vector< int > charge_values
Definition PIDLookupTable.h:26
bool momentum_bin_centers_in_lut
Definition PIDLookupTable.h:31
std::vector< int > pdg_values
Definition PIDLookupTable.h:25
std::vector< double > azimuthal_binning
Definition PIDLookupTable.h:29
bool azimuthal_bin_centers_in_lut
Definition PIDLookupTable.h:30
std::vector< double > momentum_edges
Definition PIDLookupTable.h:27
bool missing_electron_prob
Definition PIDLookupTable.h:34
std::vector< double > polar_edges
Definition PIDLookupTable.h:28
The histogram entry with access counter, where the probabilities are stored in metadata.
Definition PIDLookupTable.h:20
float prob_proton
Definition PIDLookupTable.h:21
float prob_pion
Definition PIDLookupTable.h:21
float prob_electron
Definition PIDLookupTable.h:21
float prob_kaon
Definition PIDLookupTable.h:21