Belle II Software  release-05-01-25
ParticleWeightingAxis.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 <map>
13 #include <string>
14 #include <analysis/dbobjects/ParticleWeightingBinLimits.h>
15 
16 namespace Belle2 {
23  typedef std::map<int, ParticleWeightingBinLimits*> BinMap;
24 
28  class ParticleWeightingAxis {
29 
32  std::string m_axisName;
34  const int m_outOfRangeBinID = -1;
41  bool isOverlappingBin(ParticleWeightingBinLimits* bin);
42 
43  public:
44 
49 
53  std::string getName() { return m_axisName;}
54 
59  void setName(const std::string& name) { m_axisName = name;}
60 
68 
76 
82  int findBin(double value);
83 
87  void printAxis();
88  };
89 
91 } // Belle2 namespace
92 
93 
Belle2::ParticleWeightingAxis::getName
std::string getName()
Returns name of an axis.
Definition: ParticleWeightingAxis.h:61
Belle2::ParticleWeightingBinLimits
Just pair of numbers - min and max values of bin border.
Definition: ParticleWeightingBinLimits.h:31
Belle2::ParticleWeightingAxis::addBin
int addBin(ParticleWeightingBinLimits *bin)
Check if bin exists and creates it if not.
Definition: ParticleWeightingAxis.cc:48
Belle2::ParticleWeightingAxis::setName
void setName(const std::string &name)
Sets name of an axis.
Definition: ParticleWeightingAxis.h:67
Belle2::ParticleWeightingAxis::isOverlappingBin
bool isOverlappingBin(ParticleWeightingBinLimits *bin)
Return TRUE if bin exisits or overlaps with existing.
Definition: ParticleWeightingAxis.cc:16
Belle2::ParticleWeightingAxis::m_axisName
std::string m_axisName
Axis name.
Definition: ParticleWeightingAxis.h:40
Belle2::ParticleWeightingAxis::m_unnamedAxis
BinMap m_unnamedAxis
Named axis with bins.
Definition: ParticleWeightingAxis.h:38
Belle2::BinMap
std::map< int, ParticleWeightingBinLimits * > BinMap
Map of keys with bin limits.
Definition: ParticleWeightingAxis.h:31
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ParticleWeightingAxis::m_outOfRangeBinID
const int m_outOfRangeBinID
ID of out-of-range bin.
Definition: ParticleWeightingAxis.h:42
Belle2::ParticleWeightingAxis::ParticleWeightingAxis
ParticleWeightingAxis()
Constructor.
Definition: ParticleWeightingAxis.h:56
Belle2::ParticleWeightingAxis::findBin
int findBin(ParticleWeightingBinLimits *bin)
Returns id of bin with given bin limits Returns out-of-range binID if can't find.
Definition: ParticleWeightingAxis.cc:64
Belle2::ParticleWeightingAxis::printAxis
void printAxis()
Prints axis information to the B2INFO stream.
Definition: ParticleWeightingAxis.cc:85