Belle II Software development
dEdxPDFs Class Reference

Base class for holding the dE/dx PDFs. More...

#include <dEdxPDFs.h>

Inheritance diagram for dEdxPDFs:
CDCdEdxPDFs PXDdEdxPDFs SVDdEdxPDFs

Public Member Functions

 dEdxPDFs ()=default
 Default constructor.
 
const TH2F * getPDF (const Const::ChargedStable &chargedStable, bool truncated) const
 Return the dE/dx PDF for the given particle hypothesis.
 
const TH2F * getPDF (const unsigned int hypothesis, const bool truncated) const
 Return the dE/dx PDF for the given particle hypothesis.
 
const std::vector< const TH2F * > & getPDFs (bool truncated) const
 Return all PDF's as a vector of histogram pointers.
 
void setPDF (const TH2F &pdf, const Const::ChargedStable &chargedStable, bool truncated)
 Set the dE/dx PDF for the given particle hypothesis.
 
void setPDF (const TH2F &pdf, const unsigned int hypothesis, const bool truncated)
 Set the dE/dx PDF for the given particle hypothesis.
 
bool checkPDFs (bool truncated) const
 Check PDF histograms if they are defined in the same range and with the same binning.
 

Private Member Functions

 ClassDef (dEdxPDFs, 1)
 do not write out
 

Private Attributes

std::array< TH2F, Const::ChargedStable::c_SetSizem_dEdxPDFs
 Array of dE/dx PDFs for each particle hypothesis.
 
std::array< TH2F, Const::ChargedStable::c_SetSizem_dEdxPDFsTruncated
 Array of truncated dE/dx PDFs for each particle hypothesis.
 
std::vector< const TH2F * > m_cachePDFs
 cache for a vector of pointers to PDFs
 
std::vector< const TH2F * > m_cachePDFsTruncated
 do not write out
 

Detailed Description

Base class for holding the dE/dx PDFs.

Definition at line 32 of file dEdxPDFs.h.

Member Function Documentation

◆ ClassDef()

ClassDef ( dEdxPDFs  ,
 
)
private

do not write out

Class version for the ROOT streamer.

◆ getPDF() [1/2]

const TH2F * getPDF ( const Const::ChargedStable chargedStable,
bool  truncated 
) const
inline

Return the dE/dx PDF for the given particle hypothesis.

Parameters
chargedStableParticle hypothesis
truncatedIf true, return the truncated dE/dx PDF

Definition at line 46 of file dEdxPDFs.h.

47 {
48 return getPDF(chargedStable.getIndex(), truncated);
49 }
const TH2F * getPDF(const Const::ChargedStable &chargedStable, bool truncated) const
Return the dE/dx PDF for the given particle hypothesis.
Definition: dEdxPDFs.h:46

◆ getPDF() [2/2]

const TH2F * getPDF ( const unsigned int  hypothesis,
const bool  truncated 
) const
inline

Return the dE/dx PDF for the given particle hypothesis.

Parameters
hypothesisParticle hypothesis (as in Const::ChargedStable::c_SetSize)
truncatedIf true, return the truncated dE/dx PDF

Definition at line 56 of file dEdxPDFs.h.

57 {
58 return truncated ? &(m_dEdxPDFsTruncated.at(hypothesis)) : &(m_dEdxPDFs.at(hypothesis));
59 }
std::array< TH2F, Const::ChargedStable::c_SetSize > m_dEdxPDFs
Array of dE/dx PDFs for each particle hypothesis.
Definition: dEdxPDFs.h:103
std::array< TH2F, Const::ChargedStable::c_SetSize > m_dEdxPDFsTruncated
Array of truncated dE/dx PDFs for each particle hypothesis.
Definition: dEdxPDFs.h:106

◆ setPDF() [1/2]

void setPDF ( const TH2F &  pdf,
const Const::ChargedStable chargedStable,
bool  truncated 
)
inline

Set the dE/dx PDF for the given particle hypothesis.

Parameters
pdfdE/dx PDF as a 2D histogram (TH2F)
chargedStableParticle hypothesis
truncatedIf true, set the truncated dE/dx PDF

Definition at line 74 of file dEdxPDFs.h.

75 {
76 setPDF(pdf, chargedStable.getIndex(), truncated);
77 }
void setPDF(const TH2F &pdf, const Const::ChargedStable &chargedStable, bool truncated)
Set the dE/dx PDF for the given particle hypothesis.
Definition: dEdxPDFs.h:74

◆ setPDF() [2/2]

void setPDF ( const TH2F &  pdf,
const unsigned int  hypothesis,
const bool  truncated 
)
inline

Set the dE/dx PDF for the given particle hypothesis.

Parameters
pdfdE/dx PDF as a 2D histogram (TH2F)
hypothesisParticle hypothesis (as in Const::ChargedStable::c_SetSize)
truncatedIf true, set the truncated dE/dx PDF

Definition at line 85 of file dEdxPDFs.h.

86 {
87 if (truncated)
88 m_dEdxPDFsTruncated.at(hypothesis) = pdf;
89 else
90 m_dEdxPDFs.at(hypothesis) = pdf;
91 }

Member Data Documentation

◆ m_cachePDFs

std::vector<const TH2F*> m_cachePDFs
mutableprivate

cache for a vector of pointers to PDFs

Definition at line 109 of file dEdxPDFs.h.

◆ m_cachePDFsTruncated

std::vector<const TH2F*> m_cachePDFsTruncated
mutableprivate

do not write out

cache for a vector of pointers to truncated PDFs

Definition at line 112 of file dEdxPDFs.h.

◆ m_dEdxPDFs

std::array<TH2F, Const::ChargedStable::c_SetSize> m_dEdxPDFs
private

Array of dE/dx PDFs for each particle hypothesis.

Definition at line 103 of file dEdxPDFs.h.

◆ m_dEdxPDFsTruncated

std::array<TH2F, Const::ChargedStable::c_SetSize> m_dEdxPDFsTruncated
private

Array of truncated dE/dx PDFs for each particle hypothesis.

Definition at line 106 of file dEdxPDFs.h.


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