9#include <analysis/dbobjects/ParticleWeightingLookUpTable.h>
10#include <framework/logging/Logger.h>
19 this->
addEntry(std::move(entryValue), std::move(bin),
id);
25 entryValue.insert(std::make_pair(
"binID",
id));
48 B2FATAL(
"Attempt to access undeclared bin");
56 B2INFO(
"Printing the table");
58 int key_ID = entry.first;
60 std::string bin_info =
"";
61 std::string bin_id =
"";
62 for (
const auto& line : info) {
63 bin_info += line.first +
" " + std::to_string(line.second) +
" ; ";
66 bin_id +=
"Out of range bin " + std::to_string(key_ID) +
" : ";
68 bin_id +=
"Bin " + std::to_string(key_ID) +
" : ";
70 B2INFO(bin_id + bin_info);
double getKey(std::map< std::string, double > values) const
Get global bin ID for given observable values.
void printKeyMap() const
Print content of the key map.
int addKey(NDBin bin, int key_ID)
Adding predefined ID to the table.
std::vector< std::string > getNames() const
Get vector of names ParticleWeightingKeyMap.
WeightInfo getInfo(std::map< std::string, double > values) const
Get axes names.
void addEntry(WeightInfo entryValue, NDBin bin)
Adds entry to the LookUp table and also adds entry to key table if needed.
std::vector< std::string > getAxesNames() const
Get axes names.
WeightMap m_WeightMap
Collection of weight infos for global bins.
void defineOutOfRangeWeight(const WeightInfo &entryValue)
Define reweight info for particles out of range.
ParticleWeightingKeyMap m_KeyMap
LookUp table matches bins of the key map with the LookUp info.
void printParticleWeightingLookUpTable() const
Print content of LookUpTable.
const int m_OutOfRangeBinID
out-of-range bin ID
std::map< std::string, ParticleWeightingBinLimits * > NDBin
N-dim bin: pairs of bin limits with name of the axis variable.
std::map< std::string, double > WeightInfo
Weight information: a line from the weight lookup table.
Abstract base class for different kinds of events.