11#include <framework/gearbox/Const.h>
12#include <framework/logging/Logger.h>
14#include <boost/algorithm/string.hpp>
18#include <ROOT/RDataFrame.hxx>
19#include <ROOT/RCsvDS.hxx>
Provides a type-safe way to pass members of the chargedStableSet set.
EDetector
Enum for identifying the detector components (detector and subdetector).
static std::string parseDetectors(EDetector det)
Converts Const::EDetector object to string.
Nested class acting as a container the per-detector weights.
int m_nPBins
Number of p bins.
int m_nThetaBins
Number of theta bins.
std::unordered_map< double, unsigned int > m_linBinIdxsToRowIdxs
Map the linearised index of the (p, theta) bin indexes to the row index in the (filtered) table.
std::map< std::string, std::vector< double > > m_weightsPerDet
Map each detector to its vector of weights.
bool m_isEmpty
Default constructor.
ClassDef(WeightsTable, 1)
Needed for sub-class schema evolution.
std::set< double > m_pBinEdges
Set of p bins edges.
std::set< double > m_thetaBinEdges
Set of theta bins edges.
Class for handling the PID weights per detector, used to calculate the track helix isolation score pe...
std::map< std::string, std::string > m_weightNames
The names of the per-detector weight columns in the RDataFrame.
PIDDetectorWeights()
Default constructor, necessary for ROOT to stream the object.
PIDDetectorWeights(const std::string &weightsCSVFileName)
Constructor from CSV file of weights.
ClassDef(PIDDetectorWeights, 4)
ClassDef as this is a TObject.
void fillWeightsTablePerHypoFromRDF()
Fill the internal weights container class per particle hypo, based on the content of the RDataFrame.
ROOT::RDataFrame m_weightsRDataFrame
The RDataFrame containing the detector weights per particle hypo, per phase space bin.
PIDDetectorWeights(const std::string &treeName, const std::string &weightsROOTFileName)
Constructor from ROOT file w/ TTree of weights.
ROOT::RDataFrame getWeightsRDF() const
Get the RDataFrame of detector weights.
~PIDDetectorWeights()
Destructor.
double getWeight(Const::ChargedStable hypo, Const::EDetector det, double p, double theta) const
Lookup the weight from the internal map structures.
std::map< int, WeightsTable > m_weightsTablePerHypo
Map containing a WeightsTable object per particle hypo.
Abstract base class for different kinds of events.