11#include <framework/gearbox/Const.h>
12#include <framework/logging/Logger.h>
14#include <boost/algorithm/string.hpp>
69 double getWeight(
int pdg, std::string detector)
const
71 std::vector<double> weightVector =
getWeights(pdg);
74 boost::to_lower(detector);
75 if (detector ==
"svd") det = Const::SVD;
76 else if (detector ==
"cdc") det = Const::CDC;
77 else if (detector ==
"top") det = Const::TOP;
78 else if (detector ==
"arich") det = Const::ARICH;
79 else if (detector ==
"ecl") det = Const::ECL;
80 else if (detector ==
"klm") det = Const::KLM;
81 else B2FATAL(
"Unknown detector component: " << detector);
84 return weightVector[det_index];
95 std::vector<double> weightVector =
getWeights(pdg);
98 return weightVector[det_index];
110 if (pdgIter.getPDGCode() == pdg) {
111 p_index = pdgIter.getIndex();
116 B2FATAL(
"Invalid particle: " << pdg);
static const DetectorSet c_set
The set of valid PID detectors.
static const ParticleSet chargedStableSet
set of charged stable particles
EDetector
Enum for identifying the detector components (detector and subdetector).
std::vector< double > getWeights(int pdg) const
Get the weights for the given PDG code.
const WeightMatrix & getWeightMatrix() const
Get the WeightMatrix.
PIDCalibrationWeight(const WeightMatrix &weightMatrix)
Constructor with the initial WeightMatrix.
WeightMatrix m_weightMatrix
PID calibration weight matrix.
PIDCalibrationWeight()
Constructor.
double getWeight(int pdg, Const::EDetector det) const
Get the weight for the given combination of the PDG code and the detector in Const::EDetector.
void setWeightMatrix(const WeightMatrix &weightMatrix)
Set the WeightMatrix.
double getWeight(int pdg, std::string detector) const
Get the weight for the given combination of the PDG code and the detector name.
ClassDef(PIDCalibrationWeight, 1)
ClassDef as this is a TObject.
std::vector< std::vector< double > > WeightMatrix
PID calibration weight matrix, 6 (particle type) x 6 (detectors).
Abstract base class for different kinds of events.