Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:32:13

0001 #ifndef TestHistoMgr_h
0002 #define TestHistoMgr_h 1
0003 
0004 #include "TH1F.h"
0005 #include "TH2F.h"
0006 #include "TProfile.h"
0007 #include "TProfile2D.h"
0008 #include "TFile.h"
0009 
0010 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0011 
0012 #include <map>
0013 #include <string>
0014 #include <memory>
0015 
0016 typedef std::map<int, TH1F*> mih1;
0017 typedef std::map<int, TH2F*> mih2;
0018 typedef std::map<int, TProfile*> mihp1;
0019 typedef std::map<int, TProfile2D*> mihp2;
0020 
0021 class TestHistoMgr {
0022 public:
0023   TestHistoMgr();
0024   ~TestHistoMgr();
0025   void save(const std::string& name);
0026   void openSecondFile(const std::string& name);
0027 
0028   void printComparisonResult(int ih);
0029 
0030   bool addHisto1(TH1F* ih);
0031   bool addHisto2(TH2F* ih);
0032   bool addHistoProf1(TProfile* ih);
0033   bool addHistoProf2(TProfile2D* ih);
0034 
0035   TH1F* getHisto1(int ih);
0036   TH2F* getHisto2(int ih);
0037   TProfile* getHistoProf1(int ih);
0038   TProfile2D* getHistoProf2(int ih);
0039 
0040   TH1F* getHisto1FromSecondFile(const char* hnam);
0041 
0042 private:
0043   mih1 theHistos1;
0044   mih2 theHistos2;
0045   mihp1 theHistoProfs1;
0046   mihp2 theHistoProfs2;
0047 
0048   std::unique_ptr<TFile> theFileRef;
0049 };
0050 
0051 #endif