ATLAS Offline Software
LWBinLabels.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
7 // //
8 // Header file for class LWBinLabels //
9 // //
10 // Description: A mem-efficient, LWPools using, analogy of //
11 // std::map<unsigned,std::string>, needed for //
12 // SetBinLabel/GetBinLabel functionality. //
13 // //
14 // Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
15 // Initial version: May 2009 //
16 // //
18 
19 #ifndef LWBINLABELS_H
20 #define LWBINLABELS_H
21 
22 #include <utility>
23 
24 class TAxis;
25 class LWBinLabels {
26 public:
27 
28  LWBinLabels();
29  ~LWBinLabels();
30 
31  const char * getBinLabel(unsigned bin) const;//0 if not set
32  void setBinLabel(unsigned bin, const char* label);
33 
34  void apply(TAxis*) const;
35  unsigned size() const { return m_size; }
36 
37 private:
40 
41  unsigned m_size;
42  unsigned m_allocated;
43  typedef std::pair<unsigned,char*> Entry;
45  void grow();
46  static bool cmp(const Entry& e1, const Entry& e2) { return e1.first<e2.first; }
47 
48 };
49 
50 #endif
egammaEnergyPositionAllSamples::e1
double e1(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 1st sampling
LWBinLabels::setBinLabel
void setBinLabel(unsigned bin, const char *label)
Definition: LWBinLabels.cxx:58
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
LWBinLabels
Definition: LWBinLabels.h:25
bin
Definition: BinsDiffFromStripMedian.h:43
LWBinLabels::m_list
Entry * m_list
Definition: LWBinLabels.h:44
LWBinLabels::m_size
unsigned m_size
Definition: LWBinLabels.h:41
LWBinLabels::Entry
std::pair< unsigned, char * > Entry
Definition: LWBinLabels.h:43
LWBinLabels::LWBinLabels
LWBinLabels(const LWBinLabels &)
LWBinLabels::~LWBinLabels
~LWBinLabels()
Definition: LWBinLabels.cxx:30
egammaEnergyPositionAllSamples::e2
double e2(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 2nd sampling
LWBinLabels::getBinLabel
const char * getBinLabel(unsigned bin) const
Definition: LWBinLabels.cxx:47
LWBinLabels::grow
void grow()
Definition: LWBinLabels.cxx:99
LWBinLabels::cmp
static bool cmp(const Entry &e1, const Entry &e2)
Definition: LWBinLabels.h:46
LWBinLabels::size
unsigned size() const
Definition: LWBinLabels.h:35
LWBinLabels::m_allocated
unsigned m_allocated
Definition: LWBinLabels.h:42
LWBinLabels::apply
void apply(TAxis *) const
Definition: LWBinLabels.cxx:38
LWBinLabels::operator=
LWBinLabels & operator=(const LWBinLabels &)
LWBinLabels::LWBinLabels
LWBinLabels()
Definition: LWBinLabels.cxx:22