31 B2FATAL(
"You are trying create bin with ID identical to out-of-range Bin : " <<
m_outOfRangeBin);
36 for (
const auto& i_1dbin : bin) {
41 if (bin.size() !=
m_axes.size()) {
42 B2FATAL(
"Inconsistent dimensionality of added bin");
46 std::vector<int> bin_id_collection;
47 for (
auto i_axis :
m_axes) {
48 auto it = bin.find(i_axis.first);
49 if (it != bin.end()) {
50 bin_id_collection.push_back(i_axis.second->addBin(it->second));
52 B2FATAL(
"Names of bin and existing axes don't match");
57 for (
auto i_bin :
m_bins) {
58 if (std::equal(i_bin.first.begin(), i_bin.first.end(), bin_id_collection.begin())) {
59 B2FATAL(
"You tried to overwrite existing bin " + std::to_string(i_bin.second) +
" with new ID " + std::to_string(key_ID));
64 m_bins.emplace_back(bin_id_collection, key_ID);
77 if (values.size() !=
m_axes.size()) {
78 B2FATAL(
"Inconsistent dimensionality of requested value map");
81 std::vector<int> bin_id_collection;
82 for (
auto i_axis :
m_axes) {
83 auto it = values.find(i_axis.first);
84 if (it != values.end()) {
85 bin_id_collection.push_back(i_axis.second->findBin(it->second));
87 B2FATAL(
"Names of bin and existing axes don't match");
91 for (
auto i_bin :
m_bins) {
92 if (std::equal(i_bin.first.begin(), i_bin.first.end(), bin_id_collection.begin())) {
Class for handling LookUp tables.
std::map< std::string, ParticleWeightingAxis * > m_axes
Axes mapped with their names.
const int m_outOfRangeBin
We assign unique bin ID for out-of-range bin.
double getKey(std::map< std::string, double > values) const
Get global bin ID for given observable values.
std::vector< MultiDimBin > m_bins
Vector of keys.
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.
void addAxis(const std::string &name)
Add axis.