Belle II Software  release-06-02-00
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(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 
Abstract base class for different kinds of events.