Belle II Software development
|
Stores all required information for the ECLChargedPIDMVA for a phasespace category. More...
#include <ECLChargedPIDMVAWeights.h>
Public Types | |
enum class | MVAResponseTransformMode : unsigned int { c_LogTransform = 0 , c_LogTransformSingle = 1 , c_GaussianTransform = 2 , c_DecorrelationTransform = 3 , c_DirectMVAResponse = 4 , c_LogMVAResponse = 5 } |
Enum of implemented transformations which can be applied to the MVA response. More... | |
Public Member Functions | |
ECLChargedPIDPhasespaceCategory () | |
Default constructor, necessary for ROOT to stream the object. | |
ECLChargedPIDPhasespaceCategory (const std::string weightfilePath, const MVAResponseTransformMode &mvaResponeTransformMode, const std::unordered_map< unsigned int, unsigned int > &mvaIndexForHypothesis) | |
Useful constructor. | |
~ECLChargedPIDPhasespaceCategory () | |
Destructor. | |
const std::string | getSerialisedWeight () const |
Getter for serialised weightfile. | |
MVAResponseTransformMode | getTransformMode () const |
Getter for the MVA transform mode. | |
const TF1 * | getPDF (const unsigned int iMVAResponse, const unsigned int hypoPDG) const |
Getter for pdfs. | |
const TH1F * | getCDF (const unsigned int iMVAResponse, const int hypoPDG) const |
Gets the cdf for the hypothesis pdg for a given response value. | |
const std::vector< float > * | getDecorrelationMatrix (const int hypoPDG) const |
Gets the decorrelation matrix for a given particle hypothesis. | |
void | setCDFs (std::vector< std::unordered_map< unsigned int, TH1F > > cdfs) |
Set the cdfs. | |
void | setPDFs (std::vector< std::unordered_map< unsigned int, TF1 > > &pdfs) |
Set the pdfs. | |
void | setDecorrelationMatrixMap (std::unordered_map< unsigned int, std::vector< float > > decorrelationMatrices) |
Set the decorrelation matrices. | |
void | setlogTransformOffset (const float &offset) |
Set the offset used in the log transformation to be consistent with the offset used when generating the p.d.f.s. | |
float | getLogTransformOffset () const |
Getter for the log transform offset. | |
void | setTemperature (const float &temperature) |
Set the temperature parameter used to calibrate the MVA. | |
float | getTemperature () const |
Getter for the temperature. | |
void | setMaxPossibleResponseValue (const float &offset) |
Set the max possible response value, used in log transformation of the responses. | |
float | getMaxPossibleResponseValue () const |
Get the max possible response value, used in log transformation of the responses. | |
unsigned int | getMVAIndexForHypothesis (const unsigned int hypoPDG) const |
Maps a charged stable pdg code to an index of the MVA response. | |
Private Member Functions | |
ClassDef (ECLChargedPIDPhasespaceCategory, 1) | |
ClassDef. | |
Private Attributes | |
TParameter< float > | m_log_transform_offset |
Small offset to avoid mva response values of 1.0 being log transformed to NaN. | |
TParameter< float > | m_max_possible_response_value |
Max possible value of the mva response. | |
TParameter< float > | m_temperature |
calibration factor for MVA responses. | |
std::string | m_weight |
Serialsed MVA weightfile. | |
MVAResponseTransformMode | m_mvaResponseTransformMode |
Stores which transformation mode to apply to the mva responses. | |
std::vector< std::unordered_map< unsigned int, TF1 > > | m_pdfs |
A vector of unodered maps. | |
std::unordered_map< unsigned int, unsigned int > | m_mvaIndexForHypothesis |
Unordered map of abs(pdg_code) for the 6 charged stable hypotheses to index of the MVA response vector. | |
std::vector< std::unordered_map< unsigned int, TH1F > > | m_cdfs |
CDFs for each mva return value for each hypothesis. | |
std::unordered_map< unsigned int, std::vector< float > > | m_decorrelationMatrices |
Decorrelation matrices. | |
Stores all required information for the ECLChargedPIDMVA for a phasespace category.
This includes:
Definition at line 132 of file ECLChargedPIDMVAWeights.h.
|
strong |
Enum of implemented transformations which can be applied to the MVA response.
Definition at line 136 of file ECLChargedPIDMVAWeights.h.
|
inline |
Default constructor, necessary for ROOT to stream the object.
Definition at line 154 of file ECLChargedPIDMVAWeights.h.
|
inline |
Useful constructor.
weightfilePath | path to the MVA weightfile for this phasespace category. |
mvaResponeTransformMode | mva response transform mode booked for this phasespace. |
mvaIndexForHypothesis | unordered_map mapping hypothesis to index of mva response. Useful if we exclude a class from the MVA training but want to use the likelihood of a different particle. For example using the proton pdf for a deuteron. |
Definition at line 167 of file ECLChargedPIDMVAWeights.h.
|
inline |
|
inline |
Gets the cdf for the hypothesis pdg for a given response value.
iMVAResponse | index of MVA response. |
hypoPDG | hypothesis pdg. |
Definition at line 224 of file ECLChargedPIDMVAWeights.h.
|
inline |
Gets the decorrelation matrix for a given particle hypothesis.
hypoPDG | hypothesis pdg. |
Definition at line 233 of file ECLChargedPIDMVAWeights.h.
|
inline |
Getter for the log transform offset.
Definition at line 272 of file ECLChargedPIDMVAWeights.h.
|
inline |
Get the max possible response value, used in log transformation of the responses.
Definition at line 304 of file ECLChargedPIDMVAWeights.h.
|
inline |
Maps a charged stable pdg code to an index of the MVA response.
In general this is a one-to-one mapping however in cases where we do not include all six stable charged particles in the MVA training we may have a many-to-one mapping. For example if we take the proton response value also for deuterons.
Definition at line 315 of file ECLChargedPIDMVAWeights.h.
|
inline |
Getter for pdfs.
iMVAResponse | index of MVA response. |
hypoPDG | hypothesis pdg. |
Definition at line 214 of file ECLChargedPIDMVAWeights.h.
|
inline |
|
inline |
Getter for the temperature.
Definition at line 288 of file ECLChargedPIDMVAWeights.h.
|
inline |
|
inline |
Set the cdfs.
cdfs | vector of map of cdfs to be stored in the payload. |
Definition at line 242 of file ECLChargedPIDMVAWeights.h.
|
inline |
Set the decorrelation matrices.
decorrelationMatrices | map of decorrelation matrices to be stored in the payload. |
Definition at line 256 of file ECLChargedPIDMVAWeights.h.
|
inline |
Set the offset used in the log transformation to be consistent with the offset used when generating the p.d.f.s.
Definition at line 264 of file ECLChargedPIDMVAWeights.h.
|
inline |
Set the max possible response value, used in log transformation of the responses.
Definition at line 296 of file ECLChargedPIDMVAWeights.h.
|
inline |
Set the pdfs.
pdfs | vector of map of pdfs to be stored in the payload. |
Definition at line 249 of file ECLChargedPIDMVAWeights.h.
|
inline |
Set the temperature parameter used to calibrate the MVA.
Definition at line 280 of file ECLChargedPIDMVAWeights.h.
|
private |
CDFs for each mva return value for each hypothesis.
The N vector elements correspond to the N MVA return values. The unordered map maps the hypothesis pdg values to their matching TH1F cdfs which can be used for a gaussianisation.
Definition at line 353 of file ECLChargedPIDMVAWeights.h.
|
private |
Decorrelation matrices.
To be used (optionally) after gaussianisation. The unordered map maps the hypothesis pdg values to their matching linearised decorrelation matrix.
Definition at line 359 of file ECLChargedPIDMVAWeights.h.
|
private |
Small offset to avoid mva response values of 1.0 being log transformed to NaN.
Definition at line 322 of file ECLChargedPIDMVAWeights.h.
|
private |
Max possible value of the mva response.
Used in the log transformation.
Definition at line 323 of file ECLChargedPIDMVAWeights.h.
|
private |
Unordered map of abs(pdg_code) for the 6 charged stable hypotheses to index of the MVA response vector.
Needed if we do not train with all 6 species to map several to the same MVA response value.
Definition at line 346 of file ECLChargedPIDMVAWeights.h.
|
private |
Stores which transformation mode to apply to the mva responses.
Definition at line 334 of file ECLChargedPIDMVAWeights.h.
|
private |
A vector of unodered maps.
The vector corresponds to the return values of the MVA, one for each class correspondonding to charged stable particles considered by the MVA. In general this is the full six charged stable particles {e, mu, pi, K, p, d}. The unordered map maps the hypothesis pdg values to their matching TF1 pdfs from which the likelihood will be taken.
Definition at line 340 of file ECLChargedPIDMVAWeights.h.
|
private |
calibration factor for MVA responses.
Follows arXiv:1706.04599
Definition at line 324 of file ECLChargedPIDMVAWeights.h.
|
private |
Serialsed MVA weightfile.
Definition at line 329 of file ECLChargedPIDMVAWeights.h.