Belle II Software  release-08-01-10
ECLChargedPidPDFs Class Reference

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>

Inheritance diagram for ECLChargedPidPDFs:
Collaboration diagram for ECLChargedPidPDFs:

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, PdfsByVariablePdfsMapByCategory
 Typedef.
 
typedef std::unordered_map< int, PdfsMapByCategoryPdfsMapByParticle
 Typedef.
 
typedef std::unordered_map< int, std::vector< InputVar > > VariablesMapByCategory
 Typedef.
 
typedef std::unordered_map< int, VariablesMapByCategoryVariablesMapByParticle
 Typedef.
 
typedef std::unordered_map< int, VarTransfoSettingsVTSMapByCategory
 Typedef.
 
typedef std::unordered_map< int, VTSMapByCategoryVTSMapByParticle
 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). More...
 
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). More...
 
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. More...
 
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. More...
 
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). More...
 
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. More...
 
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. More...
 
const VarTransfoSettingsgetVTS (const unsigned int pdg, const int charge, const double &p, const double &theta) const
 Getter for variable transformation settings. More...
 

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. More...
 
 ClassDef (ECLChargedPidPDFs, 2)
 ClassDef. More...
 

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. More...
 
VariablesMapByParticle m_variablesmap
 Internal map. More...
 
VariablesMapByCategory m_variablesmap_bycategory
 Internal map. More...
 
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. More...
 
PdfsMapByCategory m_pdfsmap_bycategory
 Internal map. More...
 
PdfsByVariable m_pdfs_byvariable
 Internal map. More...
 
VTSMapByParticle m_vtsmap
 Internal map. More...
 
VTSMapByCategory m_vtsmap_bycategory
 Internal map. More...
 

Detailed Description

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.

Member Enumeration Documentation

◆ InputVar

enum InputVar : unsigned int
strong

Enum type for observables for which PDFs are stored.

Enumerator
c_NONE 

Null var.

c_E1E9 

E1/E9.

c_E9E21 

E9/E21.

c_S2 

Second moment.

c_E 

Energy of maxE shower.

c_EoP 

E/p.

c_Z40 

Zernike moment 40.

c_Z51 

Zernike moment 51.

c_ZMVA 

Zernike MVA.

c_PSDMVA 

PSD MVA.

c_DeltaL 

DeltaL (track depth)

c_LAT 

Lateral shower shape.

Definition at line 49 of file ECLChargedPidPDFs.h.

49  : unsigned int {
51  c_NONE = 0,
53  c_E1E9 = 1,
55  c_E9E21 = 2,
57  c_S2 = 3,
59  c_E = 4,
61  c_EoP = 5,
63  c_Z40 = 6,
65  c_Z51 = 7,
67  c_ZMVA = 8,
69  c_PSDMVA = 9,
71  c_DeltaL = 10,
73  c_LAT = 11
74  };

Member Function Documentation

◆ add()

void add ( const unsigned int  pdg,
const int  true_charge,
const unsigned int  i,
const unsigned int  j,
const InputVar  varid,
TF1 *  pdf 
)
inline

Fills the internal maps for a given hypothesis and category (clusterTheta, p).

Parameters
pdgthe particle hypothesis' abs(pdgId).
true_chargethe particle's true charge sign (+1 or -1).
ithe index along the 2D grid Y axis (rows) --> p.
jthe index along the 2D grid X axis (cols) --> clusterTheta.
varidthe observable's enum identifier.
pdfthe pdf object.

Definition at line 226 of file ECLChargedPidPDFs.h.

◆ ClassDef()

ClassDef ( ECLChargedPidPDFs  ,
 
)
private

ClassDef.

2: removed dependency on pdgId of category histograms added enum InputVar added m_variablesmap_bycategory added m_do_varstransform added m_variables

◆ findBin()

int findBin ( const TH2F *  h,
const double &  x,
const double &  y 
) const
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() :(

Parameters
h2D histogram
xvalue along the x axis.
yvalue along the y axis.
Returns
the global linearised bin index.

Definition at line 349 of file ECLChargedPidPDFs.h.

◆ getPdf()

const TF1* getPdf ( const unsigned int  pdg,
const int  charge,
const double &  p,
const double &  theta,
const InputVar  varid 
) const
inline

Return the PDF of this observable for this candidate's reconstructed (p, clusterTheta), under the given particle hypothesis.

Parameters
pdgthe particle hypothesis' abs(pdgId).
chargethe particle's reconstructed charge sign (+1 or -1).
pthe reconstructed momentum of the candidate's track.
thetathe reconstructed polar angle of the candidate's cluster.
varidthe observable's enum identifier.

Definition at line 245 of file ECLChargedPidPDFs.h.

◆ getVars()

const std::vector<InputVar>* getVars ( const unsigned int  pdg,
const int  charge,
const double &  p,
const double &  theta 
) const
inline

Getter for list of input variables (enums) for which PDFs are stored for a given hypothesis and category (p, clusterTheta).

Parameters
pdgthe particle hypothesis' abs(pdgId).
chargethe particle's reconstructed charge sign (+1 or -1).
pthe reconstructed momentum of the particle's track.
thetathe reconstructed polar angle of the particle's cluster.

Definition at line 139 of file ECLChargedPidPDFs.h.

◆ getVTS()

const VarTransfoSettings* getVTS ( const unsigned int  pdg,
const int  charge,
const double &  p,
const double &  theta 
) const
inline

Getter for variable transformation settings.

Parameters
pdgthe particle hypothesis' abs(pdgId).
chargethe particle's reconstructed charge sign (+1 or -1).
pthe reconstructed momentum of the candidate's track.
thetathe reconstructed polar angle of the candidate's cluster.

Definition at line 328 of file ECLChargedPidPDFs.h.

◆ printPdfMap()

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
inline

Print out the content of the internal 'matrioska' maps.

Useful for debugging.

Definition at line 153 of file ECLChargedPidPDFs.h.

◆ setPdfCategories()

void setPdfCategories ( TH2F *  h)
inline

Set the 2D (clusterTheta, p) grid representing the categories for which PDFs are defined.

Parameters
hthe 2D histogram.

Definition at line 204 of file ECLChargedPidPDFs.h.

◆ setVars()

void setVars ( const unsigned int  pdg,
const int  true_charge,
const unsigned int  i,
const unsigned int  j,
const std::vector< InputVar > &  vars 
)
inline

Set the names of the input variables for which PDFs are stored for a given hypothesis and category (p, clusterTheta).

Parameters
pdgthe particle hypothesis' abs(pdgId).
true_chargethe particle's true charge sign (+1 or -1).
ithe index along the 2D grid Y axis (rows) --> p.
jthe index along the 2D grid X axis (cols) --> clusterTheta.
varsthe 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.

◆ storeVarsTransfoSettings()

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>() 
)
inline

Setup the variable transformations for a given hypothesis in a category (p, clusterTheta), needed to build a multi-dimensional likelihood.

Parameters
pdgthe particle hypothesis' abs(pdgId).
true_chargethe particle's true charge sign (+1 or -1).
ithe index along the 2D grid Y axis (rows) --> p.
jthe index along the 2D grid X axis (cols) --> clusterTheta.
nVarsthe 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.
nDivisionsthe number of divisions (steps) of the variable's range.
cumulDistthe value of the variable's cumulative density function at each step.
xthe value of the variable at each step.
covMatrixthe variables' inverse square-root covariance matrix.

Definition at line 285 of file ECLChargedPidPDFs.h.

Member Data Documentation

◆ m_categories

TH2F* m_categories = nullptr
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.

◆ m_pdfs_byvariable

PdfsByVariable m_pdfs_byvariable
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.

◆ m_pdfsmap

PdfsMapByParticle m_pdfsmap
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.

◆ m_pdfsmap_bycategory

PdfsMapByCategory m_pdfsmap_bycategory
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.

◆ m_variablesmap

VariablesMapByParticle m_variablesmap
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.

◆ m_variablesmap_bycategory

VariablesMapByCategory m_variablesmap_bycategory
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.

◆ m_vtsmap

VTSMapByParticle m_vtsmap
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.

◆ m_vtsmap_bycategory

VTSMapByCategory m_vtsmap_bycategory
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.


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