CMS 3D CMS Logo

AlignmentIORootBase.h
Go to the documentation of this file.
1 #ifndef Alignment_CommonAlignmentAlgorithm_AlignmentIORootBase_h
2 #define Alignment_CommonAlignmentAlgorithm_AlignmentIORootBase_h
3 
4 #include "TString.h"
5 
6 class TFile;
7 class TTree;
8 
10 
12 {
13 
14  protected:
18  virtual ~AlignmentIORootBase();
19 
21  int openRoot(const char* filename, int iteration, bool writemode);
22 
24  int closeRoot(void);
25 
27  virtual void createBranches(void) = 0;
28 
30  virtual void setBranchAddresses(void) = 0;
31 
33  int testFile(const char* filename, const TString &tname);
34 
36  TString treeName(int iter, const TString &tname);
37 
38  // data members
39 
40  TTree* tree; // root tree
41  TString treename; // tree identifier name
42  TString treetxt; // tree text
43  bool bWrite; // if true we are writing, else reading
44 
45  const static int nParMax = 20; // maximal number of Parameters
46  const static int itermax = 1000; // max iteration to test for
47 
48  private:
49  TFile* myFile; // root file
50 };
51 
52 #endif
TString treeName(int iter, const TString &tname)
compose tree name
static const int nParMax
static char const * tname
Definition: GTSchema.h:13
int testFile(const char *filename, const TString &tname)
test if file is existing and if so, what the highest iteration is
static const int itermax
virtual ~AlignmentIORootBase()
destructor
Base class for ROOT-based I/O of Alignment parameters etc.
virtual void setBranchAddresses(void)=0
set root branches
int closeRoot(void)
close IO
int openRoot(const char *filename, int iteration, bool writemode)
open IO
virtual void createBranches(void)=0
create root branches
Definition: tree.py:1
AlignmentIORootBase()
constructor