00001 #ifndef CL_TCnaRootFile 00002 #define CL_TCnaRootFile 00003 00004 #include "TObject.h" 00005 #include "TString.h" 00006 #include "TFile.h" 00007 #include "TTree.h" 00008 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TCnaResultType.h" 00009 00010 class TCnaRootFile : public TObject { 00011 00012 protected: 00013 00014 void Init(); 00015 00016 public: 00017 00018 TString fRootFileName; // Treename of fRootFile 00019 TString fRootFileStatus; // Status of fRootFile 00020 TFile *fRootFile; // Root file for CNA 00021 Int_t fCounterBytesCnaResults; // Counter of bytes in fCnaResultsTree 00022 Int_t fNbEntries; // Nb of entries in fCnaResultsTree 00023 TTree *fCnaResultsTree; // Tree containing the individual results 00024 // individual result = equivalent 00025 // of one ASCII file 00026 00027 TBranch *fCnaResultsBranch; // Branch of the individual results 00028 TCnaResultType *fCnaIndivResult; // One of the individual results 00029 // in the branch fCnaResultsBranch 00030 00031 TCnaRootFile() { Init(); } 00032 TCnaRootFile(const Text_t*); 00033 TCnaRootFile(const Text_t*, TString); 00034 ~TCnaRootFile(); 00035 void CloseFile(); 00036 Bool_t OpenR(Text_t* = ""); 00037 Bool_t OpenW(Text_t* = ""); 00038 Bool_t ReadElement(Int_t); 00039 Bool_t ReadElement(CnaResultTyp,Int_t); 00040 ClassDef(TCnaRootFile,1) //Root file of CNA 00041 }; 00042 00043 R__EXTERN TCnaRootFile *gCnaRootFile; 00044 00045 #endif