11#include <framework/gearbox/Const.h>
12#include <framework/logging/Logger.h>
14#include <boost/algorithm/string.hpp>
70 double getWeight(
int pdg, std::string detector)
const
72 std::vector<double> weightVector =
getWeights(pdg);
75 boost::to_lower(detector);
76 if (detector ==
"svd") det = Const::SVD;
77 else if (detector ==
"cdc") det = Const::CDC;
78 else if (detector ==
"top") det = Const::TOP;
79 else if (detector ==
"arich") det = Const::ARICH;
80 else if (detector ==
"ecl") det = Const::ECL;
81 else if (detector ==
"klm") det = Const::KLM;
82 else B2FATAL(
"Unknown detector component: " << detector);
85 return weightVector[det_index];
96 std::vector<double> weightVector =
getWeights(pdg);
99 return weightVector[det_index];
111 if (pdgIter.getPDGCode() == pdg) {
112 p_index = pdgIter.getIndex();
117 B2FATAL(
"Invalid particle: " << pdg);
int getIndex(EDetector det) const
Getter for the index of a given detector in this set.
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).
Class for handling the PID calibration weight matrix.
PIDCalibrationWeight(WeightMatrix weightMatrix)
Constructor with the initial WeightMatrix.
std::vector< double > getWeights(int pdg) const
Get the weights for the given PDG code.
void setWeightMatrix(WeightMatrix weightMatrix)
Set the WeightMatrix.
WeightMatrix m_weightMatrix
PID calibration weight matrix.
PIDCalibrationWeight()
Constructor.
WeightMatrix getWeightMatrix() const
Get the WeightMatrix.
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.
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.