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 
23 {
24 public:
25 
26  TestHistoMgr();
27  ~TestHistoMgr();
28  void save( const std::string& name );
29  void openSecondFile( const std::string& name );
30 
31  void printComparisonResult( int ih );
32 
33  bool addHisto1( TH1F* ih );
34  bool addHisto2( TH2F* ih );
35  bool addHistoProf1( TProfile* ih );
36  bool addHistoProf2( TProfile2D* ih );
37 
38  TH1F* getHisto1( int ih );
39  TH2F* getHisto2( int ih );
40  TProfile* getHistoProf1( int ih );
41  TProfile2D* getHistoProf2( int ih );
42 
43  TH1F* getHisto1FromSecondFile( const char* hnam );
44 
45  private:
50 
51  std::unique_ptr<TFile> theFileRef;
52 
53 };
54 
55 
56 #endif
TProfile2D * getHistoProf2(int ih)
bool addHistoProf2(TProfile2D *ih)
bool addHisto1(TH1F *ih)
std::map< int, TProfile * > mihp1
Definition: TestHistoMgr.h:18
void openSecondFile(const std::string &name)
Definition: TestHistoMgr.cc:69
TProfile * getHistoProf1(int ih)
std::map< int, TH2F * > mih2
Definition: TestHistoMgr.h:17
TH2F * getHisto2(int ih)
void save(const std::string &name)
Definition: TestHistoMgr.cc:41
mihp2 theHistoProfs2
Definition: TestHistoMgr.h:49
std::unique_ptr< TFile > theFileRef
Definition: TestHistoMgr.h:51
TH1F * getHisto1FromSecondFile(const char *hnam)
void printComparisonResult(int ih)
Definition: TestHistoMgr.cc:77
std::map< int, TH1F * > mih1
Definition: TestHistoMgr.h:16
bool addHistoProf1(TProfile *ih)
TH1F * getHisto1(int ih)
mihp1 theHistoProfs1
Definition: TestHistoMgr.h:48
bool addHisto2(TH2F *ih)
std::map< int, TProfile2D * > mihp2
Definition: TestHistoMgr.h:19