Belle II Software development
ParticleWeightingAxis.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10#include <map>
11#include <string>
12#include <analysis/dbobjects/ParticleWeightingBinLimits.h>
13
14namespace Belle2 {
21 typedef std::map<int, ParticleWeightingBinLimits*> BinMap;
22
27
30 std::string m_axisName;
32 const int m_outOfRangeBinID = -1;
40
41 public:
42
47
51 std::string getName() const { return m_axisName;}
52
57 void setName(const std::string& name) { m_axisName = name;}
58
66
73 int findBin(ParticleWeightingBinLimits* bin) const;
74
80 int findBin(double value) const;
81
85 void printAxis() const;
86 };
87
89} // Belle2 namespace
90
91
Class for handling LookUp tables.
void printAxis() const
Prints axis information to the B2INFO stream.
int findBin(ParticleWeightingBinLimits *bin) const
Returns id of bin with given bin limits Returns out-of-range binID if can't find.
BinMap m_unnamedAxis
Named axis with bins.
const int m_outOfRangeBinID
ID of out-of-range bin.
bool isOverlappingBin(ParticleWeightingBinLimits *bin)
Return TRUE if bin exists or overlaps with existing.
std::string getName() const
Returns name of an axis.
void setName(const std::string &name)
Sets name of an axis.
int addBin(ParticleWeightingBinLimits *bin)
Check if bin exists and creates it if not.
Just pair of numbers - min and max values of bin border.
std::map< int, ParticleWeightingBinLimits * > BinMap
Map of keys with bin limits.
Abstract base class for different kinds of events.