Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:57:36

0001 #ifndef CL_TEcnaRootFile
0002 #define CL_TEcnaRootFile
0003 
0004 #include "TObject.h"
0005 #include "TString.h"
0006 #include "TFile.h"
0007 #include "TTree.h"
0008 
0009 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaObject.h"
0010 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaResultType.h"
0011 
0012 ///-----------------------------------------------------------
0013 ///   TEcnaRootFile.h
0014 ///   Update: 05/10/2012
0015 ///   Authors:   FX Gentit, B.Fabbro (bernard.fabbro@cea.fr)
0016 ///              DSM/IRFU/SPP CEA-Saclay
0017 ///   Copyright: Those valid for CEA sofware
0018 ///
0019 ///   ECNA web page:
0020 ///     http://cms-fabbro.web.cern.ch/cms-fabbro/
0021 ///     cna_new/Correlated_Noise_Analysis/ECNA_main_page.htm
0022 ///-----------------------------------------------------------
0023 ///
0024 
0025 class TEcnaRootFile : public TObject {
0026 protected:
0027   void Init();
0028 
0029 public:
0030   TString fRootFileName;    // Treename of fRootFile
0031   TString fRootFileStatus;  // Status of fRootFile
0032 
0033   TFile *fRootFile;  // Root file for ECNA
0034 
0035   Int_t fCounterBytesCnaResults;  // Counter of bytes in fCnaResultsTree
0036   Int_t fNbEntries;               // Nb of entries in fCnaResultsTree
0037   TTree *fCnaResultsTree;         // Tree containing the individual results
0038                                   // individual result = equivalent
0039                                   // of one ASCII file
0040 
0041   TBranch *fCnaResultsBranch;        // Branch of the individual results
0042   TEcnaResultType *fCnaIndivResult;  // One of the individual results
0043                                      // in the branch fCnaResultsBranch
0044 
0045   TEcnaRootFile();
0046   TEcnaRootFile(TEcnaObject *, const Text_t *, const TString &);
0047   TEcnaRootFile(TEcnaObject *, const Text_t *);
0048 
0049   TEcnaRootFile(const Text_t *);
0050   TEcnaRootFile(const Text_t *, const TString &);
0051 
0052   ~TEcnaRootFile() override;
0053 
0054   void ReStart(const Text_t *);
0055   void ReStart(const Text_t *, const TString &);
0056   void CloseFile();
0057   Bool_t OpenR(const Text_t * = "");
0058   Bool_t OpenW(const Text_t * = "");
0059   Bool_t ReadElement(Int_t);
0060   Bool_t ReadElement(CnaResultTyp, Int_t);
0061   Int_t ReadElementNextEntryNumber(CnaResultTyp, Int_t);
0062   ClassDefOverride(TEcnaRootFile, 1)  //Root file of CNA
0063 };
0064 
0065 R__EXTERN TEcnaRootFile *gCnaRootFile;
0066 
0067 #endif