CMS 3D CMS Logo

TestHistoMgr.h
Go to the documentation of this file.
1 #ifndef TestHistoMgr_h
2 #define TestHistoMgr_h 1
3 
4 #include "TH1F.h"
5 #include "TH2F.h"
6 #include "TProfile.h"
7 #include "TProfile2D.h"
8 #include "TFile.h"
9 
11 
12 #include <map>
13 #include <string>
14 #include <memory>
15 
16 typedef std::map<int, TH1F*> mih1;
17 typedef std::map<int, TH2F*> mih2;
18 typedef std::map<int, TProfile*> mihp1;
19 typedef std::map<int, TProfile2D*> mihp2;
20 
21 class TestHistoMgr {
22 public:
23  TestHistoMgr();
24  ~TestHistoMgr();
25  void save(const std::string& name);
26  void openSecondFile(const std::string& name);
27 
28  void printComparisonResult(int ih);
29 
30  bool addHisto1(TH1F* ih);
31  bool addHisto2(TH2F* ih);
32  bool addHistoProf1(TProfile* ih);
33  bool addHistoProf2(TProfile2D* ih);
34 
35  TH1F* getHisto1(int ih);
36  TH2F* getHisto2(int ih);
37  TProfile* getHistoProf1(int ih);
38  TProfile2D* getHistoProf2(int ih);
39 
40  TH1F* getHisto1FromSecondFile(const char* hnam);
41 
42 private:
47 
48  std::unique_ptr<TFile> theFileRef;
49 };
50 
51 #endif
TProfile2D * getHistoProf2(int ih)
std::map< int, TH1F * > mih1
Definition: TestHistoMgr.h:16
bool addHistoProf2(TProfile2D *ih)
bool addHisto1(TH1F *ih)
void openSecondFile(const std::string &name)
Definition: TestHistoMgr.cc:64
std::map< int, TH2F * > mih2
Definition: TestHistoMgr.h:17
TProfile * getHistoProf1(int ih)
std::map< int, TProfile * > mihp1
Definition: TestHistoMgr.h:18
TH2F * getHisto2(int ih)
void save(const std::string &name)
Definition: TestHistoMgr.cc:39
mihp2 theHistoProfs2
Definition: TestHistoMgr.h:46
std::unique_ptr< TFile > theFileRef
Definition: TestHistoMgr.h:48
TH1F * getHisto1FromSecondFile(const char *hnam)
void printComparisonResult(int ih)
Definition: TestHistoMgr.cc:66
bool addHistoProf1(TProfile *ih)
TH1F * getHisto1(int ih)
mihp1 theHistoProfs1
Definition: TestHistoMgr.h:45
bool addHisto2(TH2F *ih)
std::map< int, TProfile2D * > mihp2
Definition: TestHistoMgr.h:19