Belle II Software  release-08-01-10
HistoManager.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 #ifndef HISTOMANAGER_H
9 #define HISTOMANAGER_H
10 
11 #include <string>
12 #include <map>
13 
14 #include <daq/dqm/DqmMemFile.h>
15 
16 #include "TH1.h"
17 
18 namespace Belle2 {
24  class HistoManager {
25  public:
26  HistoManager(DqmMemFile* mapfile);
27  ~HistoManager();
28 
29  // Register histogram
30  bool add(const std::string& subdir, const std::string& name, int pid, TH1* histo);
31  bool update(const std::string& subdir, const std::string& name, int pid, TH1* histo);
32 
33  TH1* get(const std::string& subdir, const std::string& name, int pid);
34 
35  bool merge(void);
36  void clear(void);
37  void filedump(std::string outfile);
38 
39  private:
40  // List to handle histograms sent from different nodes
41  // <subdirname, map<histoname, map<pid, TH1*>>>
42  std::map<std::string, std::map<std::string, std::map<int, TH1*>> > m_subdir;
43 
44  // List to handle histograms on TMapFile
45  // <subdirname, map<histoname, TH1*>>
46  std::map<std::string, std::map<std::string, TH1*>> m_mergedir;
47 
48  // TMapFile
49  DqmMemFile* m_memfile;
50  };
52 }
53 
54 #endif
55 
Abstract base class for different kinds of events.