Belle II Software  release-05-02-19
ParticleWeightingLookUpTable.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2018 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Ilya Komarov *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 #include <TObject.h>
13 #include <analysis/dbobjects/ParticleWeightingKeyMap.h>
14 #include <map>
15 
16 namespace Belle2 {
23  typedef std::map<std::string, double> WeightInfo;
25  typedef std::map<int, WeightInfo> WeightMap;
26 
30  class ParticleWeightingLookUpTable : public TObject {
35  ParticleWeightingKeyMap m_KeyMap;
38  // We assign unique bin ID for out-of-range bin.
39  const int m_OutOfRangeBinID = -1;
43  public:
48 
54  void addEntry(WeightInfo entryValue, NDBin bin);
55 
62  void addEntry(WeightInfo entryValue, NDBin bin, int key_ID);
63 
68  void defineOutOfRangeWeight(const WeightInfo& entryValue);
69 
74  std::vector<std::string> getAxesNames() const;
75 
81  WeightInfo getInfo(std::map<std::string, double> values) const;
82 
87  };
88 
90 } // Belle2 namespace
91 
92 
Belle2::WeightInfo
std::map< std::string, double > WeightInfo
Weight information: a line from the weight lookup table.
Definition: ParticleWeightingLookUpTable.h:31
Belle2::ParticleWeightingLookUpTable::getAxesNames
std::vector< std::string > getAxesNames() const
Get axes names.
Definition: ParticleWeightingLookUpTable.cc:38
Belle2::ParticleWeightingLookUpTable::addEntry
void addEntry(WeightInfo entryValue, NDBin bin)
Adds entry to the LookUp table and also adds entry to key table if needed.
Definition: ParticleWeightingLookUpTable.cc:18
Belle2::ParticleWeightingLookUpTable
Class for handling LookUp tables.
Definition: ParticleWeightingLookUpTable.h:38
Belle2::ParticleWeightingLookUpTable::m_WeightMap
WeightMap m_WeightMap
Collection of weight infos for global bins.
Definition: ParticleWeightingLookUpTable.h:44
Belle2::ParticleWeightingLookUpTable::defineOutOfRangeWeight
void defineOutOfRangeWeight(const WeightInfo &entryValue)
Define reweight info for particles out of range.
Definition: ParticleWeightingLookUpTable.cc:32
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::WeightMap
std::map< int, WeightInfo > WeightMap
Weight map: the whole lookup table
Definition: ParticleWeightingLookUpTable.h:33
Belle2::ParticleWeightingLookUpTable::ParticleWeightingLookUpTable
ParticleWeightingLookUpTable()
Constructor.
Definition: ParticleWeightingLookUpTable.h:55
Belle2::ParticleWeightingLookUpTable::m_OutOfRangeBinID
const int m_OutOfRangeBinID
out-of-range bin ID
Definition: ParticleWeightingLookUpTable.h:47
Belle2::NDBin
std::map< std::string, ParticleWeightingBinLimits * > NDBin
N-dim bin: pairs of bin limits with name of the axis variable.
Definition: ParticleWeightingKeyMap.h:42
Belle2::ParticleWeightingLookUpTable::printParticleWeightingLookUpTable
void printParticleWeightingLookUpTable() const
Print content of LookUpTable.
Definition: ParticleWeightingLookUpTable.cc:55
Belle2::ParticleWeightingLookUpTable::getInfo
WeightInfo getInfo(std::map< std::string, double > values) const
Get axes names.
Definition: ParticleWeightingLookUpTable.cc:43
Belle2::ParticleWeightingLookUpTable::ClassDef
ClassDef(ParticleWeightingLookUpTable, 1)
ClassDef as this is a TObject.
Belle2::ParticleWeightingLookUpTable::m_KeyMap
ParticleWeightingKeyMap m_KeyMap
LookUp table matches bins of the key map with the LookUp info.
Definition: ParticleWeightingLookUpTable.h:43