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

A database class to hold the prior probability for the particle identification. More...

#include <PIDPriors.h>

Inheritance diagram for PIDPriors:
Collaboration diagram for PIDPriors:

Public Member Functions

 PIDPriors ()
 Default constructor.
 
void setPriors (const Const::ChargedStable &particle, const PIDPriorsTable &table)
 Sets the prior table for a particle species from a PIDPriorsTable object. More...
 
void setPriors (const Const::ChargedStable &particle, std::vector< float > xAxisEdges, std::vector< float > yAxisEdges, std::vector< float > priorsTable, std::vector< float > errorsTable)
 Sets the prior table for a particle species from the std::vectors of the bin edges and the probability values. More...
 
void setPriors (const Const::ChargedStable &particle, TH2F *priorHistogram)
 Sets the prior table for a particle species from a TH2F. More...
 
void setPriors (const Const::ChargedStable &particle, TH2F *counts, TH2F *normalization)
 Sets the prior table for a particle species starting from a TH2F of the counts and a TH2F of the normalization. More...
 
void setPriorsAxes (const Const::ChargedStable &particle, std::vector< float > xAxisEdges, std::vector< float > yAxisEdges)
 Sets the axes for the priors table of the selected species. More...
 
void setPriorsTable (const Const::ChargedStable &particle, std::vector< float > priorsTable)
 Sets the probability table for the priors of the selected particle species. More...
 
void setErrorsTable (const Const::ChargedStable &particle, std::vector< float > errorsTable)
 Sets the probability error table for the priors of the selected particle species. More...
 
void setAxisLabels (const Const::ChargedStable &particle, std::string xAxisLabel, std::string yAxisLabel)
 Sets the axis labels for the priors of the selected particle species. More...
 
PIDPriorsTable getPriorsTable (const Const::ChargedStable &particle) const
 Returns the priors table of the selected particle species. More...
 
float getPriorValue (const Const::ChargedStable &particle, float x, float y) const
 Returns the prior probability associated to a particle with defined species and parameters. More...
 
float getPriorError (const Const::ChargedStable &particle, float x, float y) const
 Returns the error on the prior probability associated to a particle with defined species and parameters. More...
 
std::string getXAxisLabel (const Const::ChargedStable &particle) const
 Returns the X axis label of the prior. More...
 
std::string getYAxisLabel (const Const::ChargedStable &particle) const
 Returns the Y axis label of the prior. More...
 

Private Member Functions

 ClassDef (PIDPriors, 1)
 Class revision number.
 

Private Attributes

PIDPriorsTable m_priors [Const::ChargedStable::c_SetSize]
 The array of PIDPiorsTable, one per particle species.
 

Detailed Description

A database class to hold the prior probability for the particle identification.

This prior probability for each particle species is stored as PIDPriorsTable object, that allows to bin it in 2 dimensions defined by two kinematic variables. This class provides a container for 6 PIDPriorsTable objects, some wrappers around the most used getters and setters, and some setters that allow the user to load the priors starting from a TH2 object.

Definition at line 31 of file PIDPriors.h.

Member Function Documentation

◆ getPriorError()

float getPriorError ( const Const::ChargedStable particle,
float  x,
float  y 
) const
inline

Returns the error on the prior probability associated to a particle with defined species and parameters.

Parameters
particlethe charged stable type of the prior's species
xthe value of the x-axis coordinate
ythe value of the y-axis coordinate
Returns
the prior probability error

Definition at line 191 of file PIDPriors.h.

192  {
193  auto index = particle.getIndex();
194  return m_priors[index].getErrorValue(x, y);
195  }
float getErrorValue(float x, float y) const
Returns the error on the prior probability for a given value of (x,y).
PIDPriorsTable m_priors[Const::ChargedStable::c_SetSize]
The array of PIDPiorsTable, one per particle species.
Definition: PIDPriors.h:222

◆ getPriorsTable()

PIDPriorsTable getPriorsTable ( const Const::ChargedStable particle) const
inline

Returns the priors table of the selected particle species.

Parameters
particlethe charged stable type of the prior's species
Returns
the priors table

Definition at line 163 of file PIDPriors.h.

◆ getPriorValue()

float getPriorValue ( const Const::ChargedStable particle,
float  x,
float  y 
) const
inline

Returns the prior probability associated to a particle with defined species and parameters.

Parameters
particlethe charged stable type of the prior's species
xthe value of the x-axis coordinate
ythe value of the y-axis coordinate
Returns
the prior probability value

Definition at line 177 of file PIDPriors.h.

◆ getXAxisLabel()

std::string getXAxisLabel ( const Const::ChargedStable particle) const
inline

Returns the X axis label of the prior.

Parameters
particlethe charged stable type of the prior's species
Returns
the X axis label for the prior table of the selected particle species

Definition at line 203 of file PIDPriors.h.

◆ getYAxisLabel()

std::string getYAxisLabel ( const Const::ChargedStable particle) const
inline

Returns the Y axis label of the prior.

Parameters
particlethe charged stable type of the prior's species
Returns
the Y axis label for the prior table of the selected particle species

Definition at line 215 of file PIDPriors.h.

◆ setAxisLabels()

void setAxisLabels ( const Const::ChargedStable particle,
std::string  xAxisLabel,
std::string  yAxisLabel 
)
inline

Sets the axis labels for the priors of the selected particle species.

Parameters
particlethe charged stable type of the prior's species
xAxisLabelthe label of the X axis
yAxisLabelthe label of the Y axis

Definition at line 150 of file PIDPriors.h.

◆ setErrorsTable()

void setErrorsTable ( const Const::ChargedStable particle,
std::vector< float >  errorsTable 
)
inline

Sets the probability error table for the priors of the selected particle species.

Effectively this is just a wrapper around PIDPriorsTable::setErrorssTable()

Parameters
particlethe charged stable type of the prior's species
errorsTablea 2D vector containing the prior probabilities

Definition at line 136 of file PIDPriors.h.

◆ setPriors() [1/4]

void setPriors ( const Const::ChargedStable particle,
const PIDPriorsTable table 
)
inline

Sets the prior table for a particle species from a PIDPriorsTable object.

Parameters
particlethe charged stable type of the particle
tablethe priors table

Definition at line 52 of file PIDPriors.h.

◆ setPriors() [2/4]

void setPriors ( const Const::ChargedStable particle,
std::vector< float >  xAxisEdges,
std::vector< float >  yAxisEdges,
std::vector< float >  priorsTable,
std::vector< float >  errorsTable 
)
inline

Sets the prior table for a particle species from the std::vectors of the bin edges and the probability values.

Parameters
particlethe charged stable type of the particle
xAxisEdgesthe std::vector<float> containing the bin edges of the X axis
yAxisEdgesthe std::vector<float> containing the bin edges of the Y axis
priorsTablethe 2D std::vector<float> containing the prior probabilities
errorsTablethe 2D std::vector<float> containing the errors on prior probabilities

Definition at line 68 of file PIDPriors.h.

◆ setPriors() [3/4]

void setPriors ( const Const::ChargedStable particle,
TH2F *  counts,
TH2F *  normalization 
)

Sets the prior table for a particle species starting from a TH2F of the counts and a TH2F of the normalization.

The counts histogram is divided by the normalization one to get the probabilities and the errors The bin edges are taken form the TH2 axes, the prior probability from the bins content and the errors from the bins error

Parameters
particlethe charged stable type of the particle
countshistogram of counts
normalizationhistogram used for normalization

Definition at line 57 of file PIDPriors.cc.

58 {
59  TH2F* priorHistogram = static_cast<TH2F*>(counts->Clone());
60 
61  priorHistogram->Sumw2();
62  priorHistogram->Divide(normalization);
63 
64  setPriors(particle, priorHistogram);
65 };
void setPriors(const Const::ChargedStable &particle, const PIDPriorsTable &table)
Sets the prior table for a particle species from a PIDPriorsTable object.
Definition: PIDPriors.h:52

◆ setPriors() [4/4]

void setPriors ( const Const::ChargedStable particle,
TH2F *  priorHistogram 
)

Sets the prior table for a particle species from a TH2F.

The bin edges are taken form the TH2 axes, the prior probability from the bins content and the errors from the bins error

Parameters
particlethe charged stable type of the particle
priorHistogramthe prior for the particle specie

Definition at line 18 of file PIDPriors.cc.

◆ setPriorsAxes()

void setPriorsAxes ( const Const::ChargedStable particle,
std::vector< float >  xAxisEdges,
std::vector< float >  yAxisEdges 
)
inline

Sets the axes for the priors table of the selected species.

Effectively this is just a wrapper around PIDPriorsTable::setBinEdges()

Parameters
particlethe charged stable type of the prior's species
xAxisEdgesthe vector of edges of the X axis
yAxisEdgesthe vector of edges of the Y axis

Definition at line 107 of file PIDPriors.h.

◆ setPriorsTable()

void setPriorsTable ( const Const::ChargedStable particle,
std::vector< float >  priorsTable 
)
inline

Sets the probability table for the priors of the selected particle species.

Effectively this is just a wrapper around PIDPriorsTable::setPriorsTable()

Parameters
particlethe charged stable type of the prior's species
priorsTablea 2D vector containing the prior probabilities

Definition at line 122 of file PIDPriors.h.


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