Belle II Software development
HistoManager2.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#pragma once
10
11#include <string>
12#include <map>
13#include "TH1.h"
14
15namespace Belle2 {
22 public:
23 HistoManager2(std::string name);
25
26 // Register histogram
27 bool add(const std::string& subdir, const std::string& name, int pid, TH1* histo);
28 bool update(const std::string& subdir, const std::string& name, int pid, TH1* histo);
29
30 TH1* get(const std::string& subdir, const std::string& name, int pid);
31
32 bool merge(void);
33 void clear(void);
34 void filedump(std::string outfile);
35
36 private:
37 // List to handle histograms sent from different nodes
38 // <subdirname, map<histoname, map<pid, TH1*>>>
39 std::map<std::string, std::map<std::string, std::map<int, TH1*>> > m_subdir;
40
41 // List to handle histograms on TMapFile
42 // <subdirname, map<histoname, TH1*>>
43 std::map<std::string, std::map<std::string, TH1*>> m_mergedir;
44
45 std::string m_name;
46 };
48}
Abstract base class for different kinds of events.