Belle II Software  release-06-01-15
DQMHistAnalysis.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 // File : DQMHistAnalysis.h
10 // Description : Baseclass for histogram analysis module for DQM
11 //-
12 
13 #pragma once
14 
15 #include <framework/core/Module.h>
16 #include <dqm/dataobjects/MonitoringObject.h>
17 #include <TH1.h>
18 
19 #include <string>
20 #include <map>
21 
22 namespace Belle2 {
31  class DQMHistAnalysisModule : public Module {
32 
33  public:
37  typedef std::map<std::string, TH1*> HistList;
41  typedef std::map<std::string, MonitoringObject*> MonObjList;
42 
43 
44 
45  private:
49  static HistList g_hist;
54 
55 
56  public:
61  static const HistList& getHistList() { return g_hist;};
62 
67  static const MonObjList& getMonObjList() { return g_monObj;};
68 
74  TCanvas* findCanvas(TString cname);
75 
81  static TH1* findHist(const std::string& histname);
88  static TH1* findHist(const std::string& dirname,
89  const std::string& histname);
96  static TH1* findHist(const TDirectory* histdir, const TString& histname);
102  static MonitoringObject* findMonitoringObject(const std::string& objName);
103 
104  public:
111  static void addHist(const std::string& dirname,
112  const std::string& histname, TH1* h);
113 
118  static MonitoringObject* getMonitoringObject(const std::string& histname);
119 
123  static void resetHist() { g_hist = std::map<std::string, TH1*>(); }
124 
125  // Public functions
126  public:
127 
130  virtual ~DQMHistAnalysisModule();
131 
132  // Data members
133  private:
134 
135  };
137 } // end namespace Belle2
138 
The base class for the histogram analysis module.
TCanvas * findCanvas(TString cname)
Find canvas by name.
static MonitoringObject * findMonitoringObject(const std::string &objName)
Find MonitoringObject.
static void addHist(const std::string &dirname, const std::string &histname, TH1 *h)
Add histogram.
static const HistList & getHistList()
Get the list of the histograms.
static void resetHist()
Clear and reset the list of histograms.
static HistList g_hist
The list of Histograms.
static TH1 * findHist(const std::string &histname)
Find histogram.
std::map< std::string, MonitoringObject * > MonObjList
The type of list of MonitoringObjects.
DQMHistAnalysisModule()
Constructor / Destructor.
static const MonObjList & getMonObjList()
Get the list of MonitoringObjects.
static MonObjList g_monObj
The list of MonitoringObjects.
static MonitoringObject * getMonitoringObject(const std::string &histname)
Get MonitoringObject with given name (new object is created if non-existing)
std::map< std::string, TH1 * > HistList
The type of list of histograms.
Base class for Modules.
Definition: Module.h:72
MonitoringObject is a basic object to hold data for the run-dependency monitoring Run summary TCanvas...
Abstract base class for different kinds of events.