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
AlignmentIORootBase::closeRoot
int closeRoot(void)
close IO
Definition: AlignmentIORootBase.cc:92
tree
Definition: tree.py:1
AlignmentIORootBase::treename
TString treename
Definition: AlignmentIORootBase.h:39
AlignmentIORootBase::myFile
TFile * myFile
Definition: AlignmentIORootBase.h:47
AlignmentIORootBase::tree
TTree * tree
Definition: AlignmentIORootBase.h:38
AlignmentIORootBase::treetxt
TString treetxt
Definition: AlignmentIORootBase.h:40
AlignmentIORootBase::treeName
TString treeName(int iter, const TString &tname)
compose tree name
Definition: AlignmentIORootBase.cc:129
AlignmentIORootBase::AlignmentIORootBase
AlignmentIORootBase()
constructor
Definition: AlignmentIORootBase.h:14
AlignmentIORootBase::setBranchAddresses
virtual void setBranchAddresses(void)=0
set root branches
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
cond::persistency::GLOBAL_TAG::tname
static constexpr char const * tname
Definition: GTSchema.h:13
AlignmentIORootBase::bWrite
bool bWrite
Definition: AlignmentIORootBase.h:41
AlignmentIORootBase::testFile
int testFile(const char *filename, const TString &tname)
test if file is existing and if so, what the highest iteration is
Definition: AlignmentIORootBase.cc:108
AlignmentIORootBase::createBranches
virtual void createBranches(void)=0
create root branches
AlignmentIORootBase
Base class for ROOT-based I/O of Alignment parameters etc.
Definition: AlignmentIORootBase.h:11
AlignmentIORootBase::openRoot
int openRoot(const char *filename, int iteration, bool writemode)
open IO
Definition: AlignmentIORootBase.cc:16
AlignmentIORootBase::nParMax
const static int nParMax
Definition: AlignmentIORootBase.h:43
AlignmentIORootBase::~AlignmentIORootBase
virtual ~AlignmentIORootBase()
destructor
Definition: AlignmentIORootBase.cc:9
align_cfg.iteration
iteration
Definition: align_cfg.py:5
AlignmentIORootBase::itermax
const static int itermax
Definition: AlignmentIORootBase.h:44