27 edm::LogInfo(
"AlignmentIORootBase") <<
"Write to new file; first iteration: " << iter;
28 myFile = TFile::Open(filename,
"recreate");
30 if (iteration == -1) {
32 edm::LogInfo(
"AlignmentIORootBase") <<
"Write to existing file; highest iteration: " << iter;
34 if (iteration <= iterfile) {
36 <<
"Iteration " << iteration <<
" invalid or already exists for tree " <<
treename;
40 edm::LogInfo(
"AlignmentIORootBase") <<
"Write to new iteration: " << iter;
42 myFile = TFile::Open(filename,
"update");
55 edm::LogError(
"AlignmentIORootBase") <<
"File does not exist!";
57 }
else if (iterfile == -2) {
61 if (iteration == -1) {
63 edm::LogInfo(
"AlignmentIORootBase") <<
"Read from highest iteration: " << iter;
65 if (iteration > iterfile) {
66 edm::LogError(
"AlignmentIORootBase") <<
"Iteration " << iteration <<
" does not exist for tree " <<
treename;
70 edm::LogInfo(
"AlignmentIORootBase") <<
"Read from specified iteration: " << iter;
72 myFile = TFile::Open(filename,
"read");
79 if (
tree ==
nullptr) {
80 edm::LogError(
"AlignmentIORootBase") <<
"Tree does not exist in file!";
110 testFILE = fopen(filename,
"r");
111 if (testFILE ==
nullptr) {
116 TFile* aFile = TFile::Open(filename,
"read");
117 for (
int iter = 0; iter <
itermax; iter++) {
118 if ((
nullptr != (TTree*)aFile->Get(
treeName(iter, tname))) && (iter > ihighest))
TString treeName(int iter, const TString &tname)
compose tree name
static char const * tname
int testFile(const char *filename, const TString &tname)
test if file is existing and if so, what the highest iteration is
virtual ~AlignmentIORootBase()
destructor
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