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

Class for handling KeyMap. More...

#include <ParticleWeightingKeyMap.h>

Collaboration diagram for ParticleWeightingKeyMap:

Public Member Functions

 ParticleWeightingKeyMap ()
 Constructor.
 
void addAxis (const std::string &name)
 Add axis.
 
int addKey (NDBin bin, int key_ID)
 Adding predefined ID to the table. More...
 
double addKey (NDBin bin)
 Adding predefined ID to the table. More...
 
double getKey (std::map< std::string, double > values) const
 Get global bin ID for given observable values. More...
 
std::vector< std::string > getNames () const
 Get vector of names ParticleWeightingKeyMap. More...
 
void printKeyMap () const
 Print content of the key map.
 

Private Attributes

std::map< std::string, ParticleWeightingAxis * > m_axes
 Axes mapped with their names.
 
std::vector< MultiDimBinm_bins
 Vector of keys.
 
const int m_outOfRangeBin = -1
 We assign unique bin ID for out-of-range bin.
 

Detailed Description

Class for handling KeyMap.

Definition at line 37 of file ParticleWeightingKeyMap.h.

Member Function Documentation

◆ addKey() [1/2]

double addKey ( NDBin  bin)

Adding predefined ID to the table.

Parameters
bincontains bin ranges and names of the variables
Returns
added key ID

Definition at line 67 of file ParticleWeightingKeyMap.cc.

68 {
69  return this->addKey(std::move(bin), m_bins.size());
70 }
std::vector< MultiDimBin > m_bins
Vector of keys.
int addKey(NDBin bin, int key_ID)
Adding predefined ID to the table.

◆ addKey() [2/2]

int addKey ( NDBin  bin,
int  key_ID 
)

Adding predefined ID to the table.

Parameters
bincontains bin ranges and names of the variables
key_IDpredefined bin ID
Returns
added key ID

Definition at line 25 of file ParticleWeightingKeyMap.cc.

◆ getKey()

double getKey ( std::map< std::string, double >  values) const

Get global bin ID for given observable values.

Parameters
valuesmap of axis names and corresponding values
Returns
global ID

Definition at line 73 of file ParticleWeightingKeyMap.cc.

◆ getNames()

std::vector< std::string > getNames ( ) const

Get vector of names ParticleWeightingKeyMap.

Returns
vector of axes names

Definition at line 98 of file ParticleWeightingKeyMap.cc.


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