CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/Alignment/CommonAlignmentAlgorithm/interface/AlignmentIORootBase.h

Go to the documentation of this file.
00001 #ifndef Alignment_CommonAlignmentAlgorithm_AlignmentIORootBase_h
00002 #define Alignment_CommonAlignmentAlgorithm_AlignmentIORootBase_h
00003 
00004 #include "TString.h"
00005 
00006 class TFile;
00007 class TTree;
00008 
00010 
00011 class AlignmentIORootBase 
00012 {
00013 
00014   protected:
00016   AlignmentIORootBase() : tree(0), myFile(0) {}
00018   virtual ~AlignmentIORootBase();
00019 
00021   int openRoot(const char* filename, int iteration, bool writemode);
00022 
00024   int closeRoot(void);
00025 
00027   virtual void createBranches(void) = 0;
00028 
00030   virtual void setBranchAddresses(void) = 0;
00031 
00033   int testFile(const char* filename, const TString &tname);
00034 
00036   TString treeName(int iter, const TString &tname);
00037 
00038   // data members
00039 
00040   TTree* tree; // root tree
00041   TString treename; // tree identifier name
00042   TString treetxt;  // tree text
00043   bool bWrite; // if true we are writing, else reading
00044 
00045   const static int nParMax = 20;   // maximal number of Parameters
00046   const static int itermax = 1000; // max iteration to test for
00047 
00048  private:
00049   TFile* myFile; // root file
00050 };
00051 
00052 #endif