Belle II Software development
ECLChargedPIDMVAWeights Class Reference

Class to contain payload of everything needed for MVA based charged particle identification. More...

#include <ECLChargedPIDMVAWeights.h>

Inheritance diagram for ECLChargedPIDMVAWeights:

Public Member Functions

 ECLChargedPIDMVAWeights ()
 Default constructor, necessary for ROOT to stream the object.
 
 ~ECLChargedPIDMVAWeights ()
 Destructor.
 
void setWeightCategories (ECLChargedPIDPhasespaceBinning *h)
 Set the N dimensional grid representing the categories for which weightfiles are defined.
 
void storeMVAWeights (std::unordered_map< unsigned int, ECLChargedPIDPhasespaceCategory > &phasespaceCategories)
 Store the ECLChargedPIDPhasespaceCategory objects into the payload.
 
const ECLChargedPIDPhasespaceCategorygetPhasespaceCategory (const unsigned int idx) const
 Returns the ith ECLChargedPIDPhasespaceCategory.
 
const std::unordered_map< unsigned int, ECLChargedPIDPhasespaceCategory > * getPhasespaceCategories () const
 Returns the map of phasespaceCategories.
 
bool isPhasespaceCovered (const int linearBinIndex) const
 Returns bool whether or not the given values are within the phasespace covered by the trainings in the weightfile.
 
unsigned int getLinearisedCategoryIndex (std::vector< float > values) const
 Returns the flattened 1D index of the N dimensional phasespace category grid.
 
std::vector< std::string > getBinningVariables () const
 Returns string definitions of the variables used in defining the phasespace categories.
 
void setBinningVariables (std::vector< std::string > &binningVariables)
 Set string definitions of the variables used in defining the phasespace categories.
 

Private Member Functions

 ClassDef (ECLChargedPIDMVAWeights, 1)
 ClassDef

 

Private Attributes

ECLChargedPIDPhasespaceBinningm_categories = nullptr
 An N Dimensional binning whose bins define the boundaries of the categories for which the training is performed.
 
std::unordered_map< unsigned int, ECLChargedPIDPhasespaceCategorym_phasespaceCategories
 Stores the ECLChargedPIDPhasespaceCategory object for all the N dimensional categories.
 
std::vector< std::string > m_binningVariables
 Stores the list of variables used to define the phasespace binning.
 

Detailed Description

Class to contain payload of everything needed for MVA based charged particle identification.

Definition at line 369 of file ECLChargedPIDMVAWeights.h.

Constructor & Destructor Documentation

◆ ECLChargedPIDMVAWeights()

Default constructor, necessary for ROOT to stream the object.

Definition at line 374 of file ECLChargedPIDMVAWeights.h.

374{};

◆ ~ECLChargedPIDMVAWeights()

Destructor.

Definition at line 379 of file ECLChargedPIDMVAWeights.h.

379{};

Member Function Documentation

◆ getBinningVariables()

std::vector< std::string > getBinningVariables ( ) const
inline

Returns string definitions of the variables used in defining the phasespace categories.

Definition at line 440 of file ECLChargedPIDMVAWeights.h.

440{return m_binningVariables;}
std::vector< std::string > m_binningVariables
Stores the list of variables used to define the phasespace binning.

◆ getLinearisedCategoryIndex()

unsigned int getLinearisedCategoryIndex ( std::vector< float >  values) const
inline

Returns the flattened 1D index of the N dimensional phasespace category grid.

Parameters
valuesN dimensional input vector of floats to be mapped to a globalBinIndex.

Definition at line 429 of file ECLChargedPIDMVAWeights.h.

430 {
431 if (!m_categories) {
432 B2FATAL("No N dimensional grid was found in the ECLChargedPIDMVA DB payload. This should not happen! Abort...");
433 }
434 return m_categories->getLinearisedBinIndex(values);
435 }
ECLChargedPIDPhasespaceBinning * m_categories
An N Dimensional binning whose bins define the boundaries of the categories for which the training is...
int getLinearisedBinIndex(const std::vector< float > values)
Maps the vector of input values to a global bin index.

◆ getPhasespaceCategories()

const std::unordered_map< unsigned int, ECLChargedPIDPhasespaceCategory > * getPhasespaceCategories ( ) const
inline

Returns the map of phasespaceCategories.

Definition at line 409 of file ECLChargedPIDMVAWeights.h.

409{return &m_phasespaceCategories;}
std::unordered_map< unsigned int, ECLChargedPIDPhasespaceCategory > m_phasespaceCategories
Stores the ECLChargedPIDPhasespaceCategory object for all the N dimensional categories.

◆ getPhasespaceCategory()

const ECLChargedPIDPhasespaceCategory * getPhasespaceCategory ( const unsigned int  idx) const
inline

Returns the ith ECLChargedPIDPhasespaceCategory.

Parameters
idxindex of ECLChargedPIDPhasespaceCategory.

Definition at line 404 of file ECLChargedPIDMVAWeights.h.

404{return &m_phasespaceCategories.at(idx);}

◆ isPhasespaceCovered()

bool isPhasespaceCovered ( const int  linearBinIndex) const
inline

Returns bool whether or not the given values are within the phasespace covered by the trainings in the weightfile.

Parameters
linearBinIndexglobal bin index.

Definition at line 415 of file ECLChargedPIDMVAWeights.h.

416 {
417 // if the vector of values passed falls outside the defined phasespace.
418 if (linearBinIndex < 0) return false;
419 // if the vector is within the defined phasespace but we do not provide an ECLChargedPIDPhasespaceCategory object for this bin.
420 if (m_phasespaceCategories.count(linearBinIndex) == 0) return false;
421 return true;
422 }

◆ setBinningVariables()

void setBinningVariables ( std::vector< std::string > &  binningVariables)
inline

Set string definitions of the variables used in defining the phasespace categories.

Parameters
binningVariablesstring definitions of the variables used in defining the phasespace categories.

Definition at line 446 of file ECLChargedPIDMVAWeights.h.

446{m_binningVariables = binningVariables;}

◆ setWeightCategories()

void setWeightCategories ( ECLChargedPIDPhasespaceBinning h)
inline

Set the N dimensional grid representing the categories for which weightfiles are defined.

A multiclass MVA is trained for each phases-space region defined by the bin boundaries.

Parameters
hthe N dimensional ECLChargedPIDPhasespaceBinning object.

Definition at line 387 of file ECLChargedPIDMVAWeights.h.

387{m_categories = h;}

◆ storeMVAWeights()

void storeMVAWeights ( std::unordered_map< unsigned int, ECLChargedPIDPhasespaceCategory > &  phasespaceCategories)
inline

Store the ECLChargedPIDPhasespaceCategory objects into the payload.

Parameters
phasespaceCategoriesa map of ECLChargedPIDPhasespaceCategory objects. Each object contains all the data required to process tracks in that phasespace. The map does not need to cover all phasespace regions.

Definition at line 395 of file ECLChargedPIDMVAWeights.h.

396 {
397 m_phasespaceCategories = phasespaceCategories;
398 }

Member Data Documentation

◆ m_binningVariables

std::vector<std::string> m_binningVariables
private

Stores the list of variables used to define the phasespace binning.

Definition at line 462 of file ECLChargedPIDMVAWeights.h.

◆ m_categories

ECLChargedPIDPhasespaceBinning* m_categories = nullptr
private

An N Dimensional binning whose bins define the boundaries of the categories for which the training is performed.

It is used to lookup the correct file in the payload, given a reconstructed value vector.

Definition at line 452 of file ECLChargedPIDMVAWeights.h.

◆ m_phasespaceCategories

std::unordered_map<unsigned int, ECLChargedPIDPhasespaceCategory> m_phasespaceCategories
private

Stores the ECLChargedPIDPhasespaceCategory object for all the N dimensional categories.

Definition at line 457 of file ECLChargedPIDMVAWeights.h.


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