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 protected:
14  AlignmentIORootBase() : tree(nullptr), myFile(nullptr) {}
16  virtual ~AlignmentIORootBase();
17 
19  int openRoot(const char* filename, int iteration, bool writemode);
20 
22  int closeRoot(void);
23 
25  virtual void createBranches(void) = 0;
26 
28  virtual void setBranchAddresses(void) = 0;
29 
31  int testFile(const char* filename, const TString& tname);
32 
34  TString treeName(int iter, const TString& tname);
35 
36  // data members
37 
38  TTree* tree; // root tree
39  TString treename; // tree identifier name
40  TString treetxt; // tree text
41  bool bWrite; // if true we are writing, else reading
42 
43  const static int nParMax = 20; // maximal number of Parameters
44  const static int itermax = 1000; // max iteration to test for
45 
46 private:
47  TFile* myFile; // root file
48 };
49 
50 #endif
TString treeName(int iter, const TString &tname)
compose tree name
static const int nParMax
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
std::string tname(const std::string &tableName, const std::string &schemaVersion)
Definition: tree.py:1
AlignmentIORootBase()
constructor