Belle II Software  release-05-01-25
HistoManager.h
1 #ifndef HISTOMANAGER_H
2 #define HISTOMANAGER_H
3 //+
4 // File : HistoManager.h
5 // Description : Manage histograms in hserver
6 //
7 // Author : Ryosuke Itoh, IPNS, KEK
8 // Date : 13 - May - 2013
9 //-
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(std::string& subdir, std::string& name, int pid, TH1* histo);
31  bool update(std::string& subdir, std::string& name, int pid, TH1* histo);
32 
33  TH1* get(std::string& subdir, std::string& name, int pid);
34 
35  // int remove ( std::string& name );
36 
37 
38 
39  bool merge();
40  void clear();
41 
42  private:
43  // List to handle histograms sent from different nodes
44  // <subdirname, map<histoname, map<pid, TH1*>>>
45  std::map<std::string, std::map<std::string, std::map<int, TH1*>> > m_subdir;
46  //OBSOLETE std::map<std::string, std::map<int, TH1*> > m_list;
47 
48  // List to handle histograms on TMapFile
49  // <subdirname, map<histoname, TH1*>>
50  std::map<std::string, std::map<std::string, TH1*>> m_mergedir;
51  //OBSOLETE std::map<std::string, TH1*> m_merge;
52 
53  // TMapFile
54  DqmMemFile* m_memfile;
55  };
57 }
58 
59 #endif
60 
Belle2::HistoManager
Definition: HistoManager.h:24
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::DqmMemFile
Definition: DqmMemFile.h:28