Belle II Software development
PIDCalibrationWeightUtil Class Reference

Class to call calibration weight matrix. More...

#include <PIDCalibrationWeightUtil.h>

Public Member Functions

 PIDCalibrationWeightUtil ()
 Constructor.
 
 PIDCalibrationWeightUtil (std::string matrixName)
 Constructor with the name of the calibration weight matrix.
 
double getWeight (int pdg, Const::EDetector det, double p, double theta) const
 Get the weight for the given combination of the PDG code and the detector in Const::EDetector.
 

Private Attributes

std::string m_matrixName = "PIDCalibrationWeight"
 name of the matrix.
 
std::unique_ptr< DBObjPtr< PIDCalibrationWeight > > m_pidCalibWeightDB
 db object for the calibration weight matrix.
 
std::unique_ptr< DBObjPtr< PIDDetectorWeights > > m_pidDetWeightDB
 db object for the detector weight matrix for momentum and theta dependent matrix.
 

Detailed Description

Class to call calibration weight matrix.

Definition at line 27 of file PIDCalibrationWeightUtil.h.

Constructor & Destructor Documentation

◆ PIDCalibrationWeightUtil() [1/2]

Constructor.

Definition at line 34 of file PIDCalibrationWeightUtil.h.

35 {
36 m_pidCalibWeightDB = std::make_unique<DBObjPtr<PIDCalibrationWeight>>();
37
38 if (!(*m_pidCalibWeightDB))
39 B2FATAL("The dbobject PIDCalibrationWeight could not be found! It is necessary for the weighted PID variables.");
40 };
std::unique_ptr< DBObjPtr< PIDCalibrationWeight > > m_pidCalibWeightDB
db object for the calibration weight matrix.

◆ PIDCalibrationWeightUtil() [2/2]

PIDCalibrationWeightUtil ( std::string  matrixName)
inline

Constructor with the name of the calibration weight matrix.

Definition at line 45 of file PIDCalibrationWeightUtil.h.

46 {
47 m_matrixName = matrixName;
48
49 if (m_matrixName.find("PIDDetectorWeights") != std::string::npos) {
50 m_pidDetWeightDB = std::make_unique<DBObjPtr<PIDDetectorWeights>>(m_matrixName);
51 if (!(*m_pidDetWeightDB))
52 B2FATAL("The dbobject PIDDetectorWeights, " << m_matrixName <<
53 " could not be found! It is necessary for the weighted PID variables.");
54 } else {
55 m_pidCalibWeightDB = std::make_unique<DBObjPtr<PIDCalibrationWeight>>(m_matrixName);
56 if (!(*m_pidCalibWeightDB))
57 B2FATAL("The dbobject PIDCalibrationWeight, " << m_matrixName <<
58 " could not be found! It is necessary for the weighted PID variables.");
59 }
60 };
std::unique_ptr< DBObjPtr< PIDDetectorWeights > > m_pidDetWeightDB
db object for the detector weight matrix for momentum and theta dependent matrix.
std::string m_matrixName
name of the matrix.

Member Function Documentation

◆ getWeight()

double getWeight ( int  pdg,
Const::EDetector  det,
double  p,
double  theta 
) const
inline

Get the weight for the given combination of the PDG code and the detector in Const::EDetector.

Definition at line 65 of file PIDCalibrationWeightUtil.h.

66 {
67 if (m_matrixName.find("PIDDetectorWeights") != std::string::npos) {
68 return (*m_pidDetWeightDB)->getWeight(Const::ParticleType(pdg), det, p, theta);
69 } else {
70 return (*m_pidCalibWeightDB)->getWeight(pdg, det);
71 }
72 }

Member Data Documentation

◆ m_matrixName

std::string m_matrixName = "PIDCalibrationWeight"
private

name of the matrix.

Definition at line 75 of file PIDCalibrationWeightUtil.h.

◆ m_pidCalibWeightDB

std::unique_ptr<DBObjPtr<PIDCalibrationWeight> > m_pidCalibWeightDB
private

db object for the calibration weight matrix.

Definition at line 76 of file PIDCalibrationWeightUtil.h.

◆ m_pidDetWeightDB

std::unique_ptr<DBObjPtr<PIDDetectorWeights> > m_pidDetWeightDB
private

db object for the detector weight matrix for momentum and theta dependent matrix.

Definition at line 78 of file PIDCalibrationWeightUtil.h.


The documentation for this class was generated from the following file: