ATLAS Offline Software
LArCafJobs/LArCafJobs/ClassCounts.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 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>
15 
17 
18 namespace LArSamples {
19 
21 
22  public:
23 
25  ClassCounts(const TString& name);
26 
27  virtual ~ClassCounts();
28 
29  const TString& className() const { return m_className; }
30  static std::map<TString, int>& counts();
31 
34 
35  static void incrementInstanceCount(const TString& name) { counts()[name]++; }
36  static void decrementInstanceCount(const TString& name) { counts()[name]--; }
37 
38  int instanceCount() const { return instanceCount(className()); }
39  static int instanceCount(const TString& name) { return m_counts ? (*m_counts)[name] : 0; }
40 
41  static void printCountsTable();
42 
43  private:
44 
45  TString m_className;
46  static std::map<TString, int>* m_counts;
47  };
48 }
49 #endif
LArSamples::ClassCounts::m_className
TString m_className
Definition: LArCafJobs/LArCafJobs/ClassCounts.h:45
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::m_counts
static std::map< TString, int > * m_counts
Definition: LArCafJobs/LArCafJobs/ClassCounts.h:46
LArSamples::ClassCounts::instanceCount
int instanceCount() const
Definition: LArCafJobs/LArCafJobs/ClassCounts.h:38
LArSamples::ClassCounts::className
const TString & className() const
Definition: LArCafJobs/LArCafJobs/ClassCounts.h:29
LArSamples
Definition: AbsShape.h:24
LArSamples::ClassCounts::instanceCount
static int instanceCount(const TString &name)
Definition: LArCafJobs/LArCafJobs/ClassCounts.h:39
JetTagCalibConfig.className
string className
Definition: JetTagCalibConfig.py:36
LArSamples::ClassCounts::decrementInstanceCount
void decrementInstanceCount() const
Definition: LArCafJobs/LArCafJobs/ClassCounts.h:33
LArSamples::ClassCounts
Definition: LArCafJobs/LArCafJobs/ClassCounts.h:20
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
LArSamples::ClassCounts::decrementInstanceCount
static void decrementInstanceCount(const TString &name)
Definition: LArCafJobs/LArCafJobs/ClassCounts.h:36
LArSamples::ClassCounts::incrementInstanceCount
void incrementInstanceCount() const
Definition: LArCafJobs/LArCafJobs/ClassCounts.h:32
checker_macros.h
Define macros for attributes used to control the static checker.
LArSamples::ClassCounts::incrementInstanceCount
static void incrementInstanceCount(const TString &name)
Definition: LArCafJobs/LArCafJobs/ClassCounts.h:35