ATLAS Offline Software
LArSamplesMon/LArSamplesMon/ClassCounts.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
10 #ifndef LArSamples_ClassCounts_H
11 #define LArSamples_ClassCounts_H
12 
13 #include "TString.h"
14 #include <map>
16 
17 namespace LArSamples {
18 
20 
21  public:
22 
24  ClassCounts(const TString& name);
25 
26  virtual ~ClassCounts();
27 
28  const TString& className() const { return m_className; }
29  static std::map<TString, int>& counts();
30 
33 
34  static void incrementInstanceCount(const TString& name) { counts()[name]++; }
35  static void decrementInstanceCount(const TString& name) { counts()[name]--; }
36 
37  int instanceCount() const { return instanceCount(className()); }
38  static int instanceCount(const TString& name) { return m_counts ? (*m_counts)[name] : 0; }
39 
40  static void printCountsTable();
41 
42  private:
43 
44  TString m_className;
45  static std::map<TString, int>* m_counts;
46  };
47 }
48 #endif
ClassCounts
xx
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
LArSamples::ClassCounts::instanceCount
int instanceCount() const
Definition: LArSamplesMon/LArSamplesMon/ClassCounts.h:37
LArSamples::ClassCounts::ClassCounts
ClassCounts(const TString &name)
Constructor
LArSamples::ClassCounts::className
const TString & className() const
Definition: LArSamplesMon/LArSamplesMon/ClassCounts.h:28
LArSamples
Definition: AbsShape.h:24
LArSamples::ClassCounts::instanceCount
static int instanceCount(const TString &name)
Definition: LArSamplesMon/LArSamplesMon/ClassCounts.h:38
JetTagCalibConfig.className
string className
Definition: JetTagCalibConfig.py:36
LArSamples::ClassCounts::decrementInstanceCount
void decrementInstanceCount() const
Definition: LArSamplesMon/LArSamplesMon/ClassCounts.h:32
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
LArSamples::ClassCounts::decrementInstanceCount
static void decrementInstanceCount(const TString &name)
Definition: LArSamplesMon/LArSamplesMon/ClassCounts.h:35
LArSamples::ClassCounts::incrementInstanceCount
void incrementInstanceCount() const
Definition: LArSamplesMon/LArSamplesMon/ClassCounts.h:31
LArSamples::ClassCounts::~ClassCounts
virtual ~ClassCounts()
checker_macros.h
Define macros for attributes used to control the static checker.
LArSamples::ClassCounts::printCountsTable
static void printCountsTable()
LArSamples::ClassCounts::counts
static std::map< TString, int > & counts()
LArSamples::ClassCounts::incrementInstanceCount
static void incrementInstanceCount(const TString &name)
Definition: LArSamplesMon/LArSamplesMon/ClassCounts.h:34