Belle II Software development
|
Class representing the DB payload w/ information about ECL PDF parameters for a set of particle hypotheses 'signed pdgId' values, i.e. More...
#include <ECLChargedPidPDFs.h>
Classes | |
class | VarTransfoSettings |
Class to hold parameters needed to perform pre-processing of input variables (e.g., gaussianisation, decorrelation) to build a multi-dimensional likelihood model. More... | |
Public Types | |
enum class | InputVar : unsigned int { c_NONE = 0 , c_E1E9 = 1 , c_E9E21 = 2 , c_S2 = 3 , c_E = 4 , c_EoP = 5 , c_Z40 = 6 , c_Z51 = 7 , c_ZMVA = 8 , c_PSDMVA = 9 , c_DeltaL = 10 , c_LAT = 11 } |
Enum type for observables for which PDFs are stored. More... | |
typedef std::unordered_map< InputVar, TF1 * > | PdfsByVariable |
Typedef. | |
typedef std::unordered_map< int, PdfsByVariable > | PdfsMapByCategory |
Typedef. | |
typedef std::unordered_map< int, PdfsMapByCategory > | PdfsMapByParticle |
Typedef. | |
typedef std::unordered_map< int, std::vector< InputVar > > | VariablesMapByCategory |
Typedef. | |
typedef std::unordered_map< int, VariablesMapByCategory > | VariablesMapByParticle |
Typedef. | |
typedef std::unordered_map< int, VarTransfoSettings > | VTSMapByCategory |
Typedef. | |
typedef std::unordered_map< int, VTSMapByCategory > | VTSMapByParticle |
Typedef. | |
Public Member Functions | |
ECLChargedPidPDFs () | |
Default constructor. | |
~ECLChargedPidPDFs () | |
Destructor. | |
void | setVars (const unsigned int pdg, const int true_charge, const unsigned int i, const unsigned int j, const std::vector< InputVar > &vars) |
Set the names of the input variables for which PDFs are stored for a given hypothesis and category (p, clusterTheta). | |
const std::vector< InputVar > * | getVars (const unsigned int pdg, const int charge, const double &p, const double &theta) const |
Getter for list of input variables (enums) for which PDFs are stored for a given hypothesis and category (p, clusterTheta). | |
void | printPdfMap (const unsigned int pdg=0, const double &p=-1.0, const double &theta=-999.0, const int true_charge=1, const InputVar varid=InputVar::c_NONE) const |
Print out the content of the internal 'matrioska' maps. | |
void | setEnergyUnit (const double &unit) |
Set the energy unit to be consistent w/ the one used in the fit. | |
void | setAngularUnit (const double &unit) |
Set the angular unit to be consistent w/ the one used in the fit. | |
void | setPdfCategories (TH2F *h) |
Set the 2D (clusterTheta, p) grid representing the categories for which PDFs are defined. | |
const TH2F * | getPdfCategories () const |
Get the 2D (clusterTheta, p) grid representing the categories for which PDFs are defined. | |
void | add (const unsigned int pdg, const int true_charge, const unsigned int i, const unsigned int j, const InputVar varid, TF1 *pdf) |
Fills the internal maps for a given hypothesis and category (clusterTheta, p). | |
const TF1 * | getPdf (const unsigned int pdg, const int charge, const double &p, const double &theta, const InputVar varid) const |
Return the PDF of this observable for this candidate's reconstructed (p, clusterTheta), under the given particle hypothesis. | |
bool | doVarsTransfo () const |
Check whether variables transformation is applied. | |
void | storeVarsTransfoSettings (const unsigned int pdg, const int true_charge, const unsigned int i, const unsigned int j, const int nVars, const std::string &classPath="", const std::vector< int > &nDivisions=std::vector< int >(), const std::vector< double > &cumulDist=std::vector< double >(), const std::vector< double > &x=std::vector< double >(), const std::vector< double > &covMatrix=std::vector< double >()) |
Setup the variable transformations for a given hypothesis in a category (p, clusterTheta), needed to build a multi-dimensional likelihood. | |
const VarTransfoSettings * | getVTS (const unsigned int pdg, const int charge, const double &p, const double &theta) const |
Getter for variable transformation settings. | |
Private Member Functions | |
int | findBin (const TH2F *h, const double &x, const double &y) const |
Find global bin index of a 2D histogram for the given (x, y) values. | |
ClassDef (ECLChargedPidPDFs, 2) | |
ClassDef. | |
Private Attributes | |
TParameter< double > | m_energy_unit |
The energy unit used for the binning. | |
TParameter< double > | m_ang_unit |
The angular unit used for the binning. | |
TH2F * | m_categories = nullptr |
A 2D (x, y) = (clusterTheta, p) histogram whose bins represent the categories for which PDFs are defined. | |
VariablesMapByParticle | m_variablesmap |
Internal map. | |
VariablesMapByCategory | m_variablesmap_bycategory |
Internal map. | |
bool | m_do_varstransform = false |
To be toggled on if input variables have been transformed (i.e., if storeVarsTransfoSettings() was called when creating the payload). | |
PdfsMapByParticle | m_pdfsmap |
Internal map. | |
PdfsMapByCategory | m_pdfsmap_bycategory |
Internal map. | |
PdfsByVariable | m_pdfs_byvariable |
Internal map. | |
VTSMapByParticle | m_vtsmap |
Internal map. | |
VTSMapByCategory | m_vtsmap_bycategory |
Internal map. | |
Class representing the DB payload w/ information about ECL PDF parameters for a set of particle hypotheses 'signed pdgId' values, i.e.
abs(pdgId) x true_charge.
Definition at line 30 of file ECLChargedPidPDFs.h.
typedef std::unordered_map<InputVar, TF1*> PdfsByVariable |
Typedef.
Definition at line 102 of file ECLChargedPidPDFs.h.
typedef std::unordered_map<int, PdfsByVariable > PdfsMapByCategory |
Typedef.
Definition at line 103 of file ECLChargedPidPDFs.h.
typedef std::unordered_map<int, PdfsMapByCategory > PdfsMapByParticle |
Typedef.
Definition at line 104 of file ECLChargedPidPDFs.h.
typedef std::unordered_map<int, std::vector<InputVar> > VariablesMapByCategory |
Typedef.
Definition at line 105 of file ECLChargedPidPDFs.h.
typedef std::unordered_map<int, VariablesMapByCategory > VariablesMapByParticle |
Typedef.
Definition at line 106 of file ECLChargedPidPDFs.h.
typedef std::unordered_map<int, VarTransfoSettings> VTSMapByCategory |
Typedef.
Definition at line 108 of file ECLChargedPidPDFs.h.
typedef std::unordered_map<int, VTSMapByCategory > VTSMapByParticle |
Typedef.
Definition at line 109 of file ECLChargedPidPDFs.h.
|
strong |
Enum type for observables for which PDFs are stored.
Definition at line 49 of file ECLChargedPidPDFs.h.
|
inline |
Default constructor.
Definition at line 35 of file ECLChargedPidPDFs.h.
|
inline |
|
inline |
Fills the internal maps for a given hypothesis and category (clusterTheta, p).
pdg | the particle hypothesis' abs(pdgId). |
true_charge | the particle's true charge sign (+1 or -1). |
i | the index along the 2D grid Y axis (rows) --> p. |
j | the index along the 2D grid X axis (cols) --> clusterTheta. |
varid | the observable's enum identifier. |
the pdf object. |
Definition at line 226 of file ECLChargedPidPDFs.h.
|
private |
ClassDef.
2: removed dependency on pdgId of category histograms added enum InputVar added m_variablesmap_bycategory added m_do_varstransform added m_variables
|
inline |
Check whether variables transformation is applied.
Definition at line 270 of file ECLChargedPidPDFs.h.
|
inlineprivate |
Find global bin index of a 2D histogram for the given (x, y) values.
This method had to be re-implemented b/c ROOT has no const version of TH1::FindBin() :(
h | 2D histogram |
x | value along the x axis. |
y | value along the y axis. |
Definition at line 349 of file ECLChargedPidPDFs.h.
|
inline |
Return the PDF of this observable for this candidate's reconstructed (p, clusterTheta), under the given particle hypothesis.
pdg | the particle hypothesis' abs(pdgId). |
charge | the particle's reconstructed charge sign (+1 or -1). |
p | the reconstructed momentum of the candidate's track. |
theta | the reconstructed polar angle of the candidate's cluster. |
varid | the observable's enum identifier. |
Definition at line 245 of file ECLChargedPidPDFs.h.
|
inline |
Get the 2D (clusterTheta, p) grid representing the categories for which PDFs are defined.
Definition at line 212 of file ECLChargedPidPDFs.h.
|
inline |
Getter for list of input variables (enums) for which PDFs are stored for a given hypothesis and category (p, clusterTheta).
pdg | the particle hypothesis' abs(pdgId). |
charge | the particle's reconstructed charge sign (+1 or -1). |
p | the reconstructed momentum of the particle's track. |
theta | the reconstructed polar angle of the particle's cluster. |
Definition at line 139 of file ECLChargedPidPDFs.h.
|
inline |
Getter for variable transformation settings.
pdg | the particle hypothesis' abs(pdgId). |
charge | the particle's reconstructed charge sign (+1 or -1). |
p | the reconstructed momentum of the candidate's track. |
theta | the reconstructed polar angle of the candidate's cluster. |
Definition at line 328 of file ECLChargedPidPDFs.h.
|
inline |
Print out the content of the internal 'matrioska' maps.
Useful for debugging.
Definition at line 153 of file ECLChargedPidPDFs.h.
|
inline |
Set the angular unit to be consistent w/ the one used in the fit.
Definition at line 198 of file ECLChargedPidPDFs.h.
|
inline |
Set the energy unit to be consistent w/ the one used in the fit.
Definition at line 194 of file ECLChargedPidPDFs.h.
|
inline |
Set the 2D (clusterTheta, p) grid representing the categories for which PDFs are defined.
h | the 2D histogram. |
Definition at line 204 of file ECLChargedPidPDFs.h.
|
inline |
Set the names of the input variables for which PDFs are stored for a given hypothesis and category (p, clusterTheta).
pdg | the particle hypothesis' abs(pdgId). |
true_charge | the particle's true charge sign (+1 or -1). |
i | the index along the 2D grid Y axis (rows) --> p. |
j | the index along the 2D grid X axis (cols) --> clusterTheta. |
vars | the list of variables. The variable ID is not a string, but an enum code integer as defined in InputVar. |
Definition at line 119 of file ECLChargedPidPDFs.h.
|
inline |
Setup the variable transformations for a given hypothesis in a category (p, clusterTheta), needed to build a multi-dimensional likelihood.
pdg | the particle hypothesis' abs(pdgId). |
true_charge | the particle's true charge sign (+1 or -1). |
i | the index along the 2D grid Y axis (rows) --> p. |
j | the index along the 2D grid X axis (cols) --> clusterTheta. |
nVars | the number of input variables used to build the model. |
classPath | (for debugging) full path to the file containing the TMVA standalone class used to get the variables transformation parameters. |
nDivisions | the number of divisions (steps) of the variable's range. |
cumulDist | the value of the variable's cumulative density function at each step. |
x | the value of the variable at each step. |
covMatrix | the variables' inverse square-root covariance matrix. |
Definition at line 285 of file ECLChargedPidPDFs.h.
|
private |
The angular unit used for the binning.
Definition at line 375 of file ECLChargedPidPDFs.h.
|
private |
A 2D (x, y) = (clusterTheta, p) histogram whose bins represent the categories for which PDFs are defined.
It is used to lookup the correct PDF in the payload, given a reconstructed pair (clusterTheta, p).
Definition at line 381 of file ECLChargedPidPDFs.h.
|
private |
To be toggled on if input variables have been transformed (i.e., if storeVarsTransfoSettings()
was called when creating the payload).
Definition at line 403 of file ECLChargedPidPDFs.h.
|
private |
The energy unit used for the binning.
Definition at line 374 of file ECLChargedPidPDFs.h.
|
private |
Internal map.
The key corresponds to an observable of interest (E/p, E, shower shape...). The mapped value is a TF1 representing the normalised PDF for that variable, for a given particle in a given category (clusterTheta, p).
Definition at line 424 of file ECLChargedPidPDFs.h.
|
private |
Internal map.
The key corresponds to the particle hypothesis' signed pdgId. The mapped value is a PdfsMapByCategory map, described below.
Definition at line 410 of file ECLChargedPidPDFs.h.
|
private |
Internal map.
The key corresponds to the global bin index in the 2D (clusterTheta, p) category grid. The mapped value is a PdfsByVariable map, described below.
Definition at line 417 of file ECLChargedPidPDFs.h.
|
private |
Internal map.
The key corresponds to the particle hypothesis' signed pdgId. The mapped value is a VariablesMapByCategory map, described below.
Definition at line 388 of file ECLChargedPidPDFs.h.
|
private |
Internal map.
The key corresponds to the global bin index in the 2D (clusterTheta, p) grid. The mapped value is a list of variables used for the MVA training for a given particle in a given 2D bin. NB: the order of the variables in the mapped vector matches the one used in the training by construction!
Definition at line 397 of file ECLChargedPidPDFs.h.
|
private |
Internal map.
The key corresponds to the particle hypothesis' signed pdgId. The mapped value is a VTSMapByCategory map, described below.
Definition at line 431 of file ECLChargedPidPDFs.h.
|
private |
Internal map.
The key corresponds to the global bin index in the 2D (clusterTheta, p) category grid. The mapped value is a VarTransfoSettings struct, containing the info for transforming input variables for a given particle in a given category.
Definition at line 439 of file ECLChargedPidPDFs.h.