HistogramManager.h
Go to the documentation of this file.
1 // HistogramManager.h
2 //
3 // David Adams
4 // August 2017
5 //
6 // Interface for a tool that manages histograms.
7 //
8 // Ih histogram has an associated directory, then the tool
9 // should unset that association and take mangement, i.e. ensure
10 // the histogram is deleted at the appropriate time.
11 
12 #ifndef HistogramManager_H
13 #define HistogramManager_H
14 
15 #include <string>
16 #include <vector>
17 
18 class TH1;
19 
21 
22 public:
23 
24  using Name = std::string;
25  using NameVector = std::vector<Name>;
26 
27  virtual ~HistogramManager() =default;
28 
29  // Take management of a histogram.
30  virtual int manage(TH1* ph) =0;
31 
32  // Return the names of histograms managed here.
33  virtual NameVector names() const =0;
34 
35  // Return a histogram.
36  virtual TH1* get(Name hname) const =0;
37 
38  // Return the last histogram managed here.
39  virtual TH1* last() const =0;
40 
41  // Delete the named histogram.
42  // Defult argument "* releases all histograms.
43  virtual int release(Name hname ="*") =0;
44 
45 };
46 
47 #endif
std::string string
Definition: nybbler.cc:12
virtual ~HistogramManager()=default
virtual int release(Name hname="*")=0
virtual NameVector names() const =0
virtual int manage(TH1 *ph)=0
virtual TH1 * last() const =0
std::vector< Name > NameVector