467 |
runfirstentry = 0LL; |
runfirstentry = 0LL; |
468 |
runlastentry = 0LL; |
runlastentry = 0LL; |
469 |
gltsync = 0; // Emiliano |
gltsync = 0; // Emiliano |
470 |
|
fUpdateRunInfo = true; // Emiliano |
471 |
|
|
472 |
l0_file = NULL; |
l0_file = NULL; |
473 |
l0_tree = NULL; |
l0_tree = NULL; |
647 |
run_tree->Delete();; |
run_tree->Delete();; |
648 |
if (sel_tree) |
if (sel_tree) |
649 |
sel_tree->Delete();; |
sel_tree->Delete();; |
650 |
for (Int_t i = 0; i < NCLONES; i++) |
|
651 |
|
// The following lines are commented out since they may generate a double delete error |
652 |
|
// if the file containing the clone trees is closed. This is because the file owns the |
653 |
|
// clone trees which are written into it, so it will delete them when it is closed; if |
654 |
|
// also PamLevel2 will try to delete these trees, a double delete error will be generated |
655 |
|
// when exiting from analysis program. (Nicola 28/11/2011) |
656 |
|
|
657 |
|
/*for (Int_t i = 0; i < NCLONES; i++) |
658 |
if (pam_tree_clone[i]) |
if (pam_tree_clone[i]) |
659 |
pam_tree_clone[i]->Delete();; |
pam_tree_clone[i]->Delete();; |
660 |
if (run_tree_clone) |
if (run_tree_clone) |
661 |
run_tree_clone->Delete();; |
run_tree_clone->Delete();; |
662 |
if (sel_tree_clone) |
if (sel_tree_clone) |
663 |
sel_tree_clone->Delete();; |
sel_tree_clone->Delete();;*/ |
664 |
|
|
665 |
if (irunoffset) |
if (irunoffset) |
666 |
delete[] irunoffset; |
delete[] irunoffset; |
841 |
} |
} |
842 |
; |
; |
843 |
|
|
844 |
|
void PamLevel2::SkipRunInfoUpdate(){ |
845 |
|
printf("\n\n ******** WARNING ******** \n Skip DB connections, DO NOT USE PamLevel2::GetRunInfo() method! \n\n"); |
846 |
|
fUpdateRunInfo = false; |
847 |
|
this->SetSELLI(2); |
848 |
|
printf(" ===============> W A R N I N G <================ \n"); |
849 |
|
printf(" in case PamLevel2::CreateCloneTrees() will be called \n"); |
850 |
|
printf(" it will be reverted to PadmeAmidala level2 structure , i.e. NO SELECTIONLIST WILL BE CREATED IN THE NEW LEVEL2 FILE! \n\n"); |
851 |
|
if ( run_tree_clone ){ |
852 |
|
printf(" ===============> W A R N I N G <================ \n"); |
853 |
|
printf(" PamLevel2::SkipRunIndoUpdate or PamLevel2::NoDBconnections() has been called together with PamLevel2::CreateCloneTrees() \n"); |
854 |
|
printf(" TO AVOID CRASHES call PamLevel2::CreateCloneTrees() after PamLevel2::SkipRunIndoUpdate or PamLevel2::NoDBconnections() \n"); |
855 |
|
}; |
856 |
|
} |
857 |
|
|
858 |
//-------------------------------------- |
//-------------------------------------- |
859 |
// |
// |
860 |
// |
// |
2135 |
if (file.EndsWith(".root")) { |
if (file.EndsWith(".root")) { |
2136 |
TString filedir; |
TString filedir; |
2137 |
cout << ddir << endl; |
cout << ddir << endl; |
2138 |
if (ddir != "") { |
if ( ddir != "" ) { |
2139 |
filedir = ddir; // take the input dir |
filedir = ddir; // take the input dir |
2140 |
} |
} |
2141 |
else { |
else { |
2143 |
filedir = gSystem->DirName(file); // this will take the path if exist in the list otherwise it will return automatically the working dir |
filedir = gSystem->DirName(file); // this will take the path if exist in the list otherwise it will return automatically the working dir |
2144 |
}; |
}; |
2145 |
filedir.Append("/"); |
filedir.Append("/"); |
2146 |
char *fullpath = gSystem->ConcatFileName(gSystem->DirName(filedir), gSystem->BaseName(file)); |
// char *fullpath = gSystem->ConcatFileName(gSystem->DirName(filedir), gSystem->BaseName(file)); |
2147 |
|
char *fullpath = gSystem->ConcatFileName(filedir.Data(), gSystem->BaseName(file)); |
2148 |
contents->Add(new TSystemFile(fullpath, gSystem->DirName(fullpath)));// add file to the list |
contents->Add(new TSystemFile(fullpath, gSystem->DirName(fullpath)));// add file to the list |
2149 |
cout << fullpath << endl; |
cout << fullpath << endl; |
2150 |
delete fullpath; |
delete fullpath; |
2909 |
gltsync = new GL_TIMESYNC(GetRunInfo()->ID_ROOT_L0, "ID", dbc, false); //Emiliano // the "false" means not to use level0 file (not necessary here) |
gltsync = new GL_TIMESYNC(GetRunInfo()->ID_ROOT_L0, "ID", dbc, false); //Emiliano // the "false" means not to use level0 file (not necessary here) |
2910 |
if (dbc){ |
if (dbc){ |
2911 |
dbc->Close();// Emiliano |
dbc->Close();// Emiliano |
2912 |
|
delete dbc; |
2913 |
dbc=0; |
dbc=0; |
2914 |
}; |
}; |
2915 |
}; |
}; |
3058 |
gltsync = new GL_TIMESYNC(GetRunInfo()->ID_ROOT_L0, "ID", dbc, false); // Emiliano |
gltsync = new GL_TIMESYNC(GetRunInfo()->ID_ROOT_L0, "ID", dbc, false); // Emiliano |
3059 |
if (dbc){ |
if (dbc){ |
3060 |
dbc->Close(); // Emiliano |
dbc->Close(); // Emiliano |
3061 |
|
delete dbc; |
3062 |
dbc=0; |
dbc=0; |
3063 |
}; |
}; |
3064 |
if (gltsync->DBobt(GetRunInfo()->RUNHEADER_OBT) > gltsync->DBobt(GetRunInfo()->RUNTRAILER_OBT)) { // Emiliano |
if (gltsync->DBobt(GetRunInfo()->RUNHEADER_OBT) > gltsync->DBobt(GetRunInfo()->RUNTRAILER_OBT)) { // Emiliano |
3100 |
TrkParams::Set(GetRunInfo(), dbc); |
TrkParams::Set(GetRunInfo(), dbc); |
3101 |
if (dbc){ |
if (dbc){ |
3102 |
dbc->Close(); |
dbc->Close(); |
3103 |
|
delete dbc; |
3104 |
dbc=0; |
dbc=0; |
3105 |
}; |
}; |
3106 |
|
|
3196 |
TrkParams::Set(GetRunInfo(), dbc); |
TrkParams::Set(GetRunInfo(), dbc); |
3197 |
if (dbc){ |
if (dbc){ |
3198 |
dbc->Close(); |
dbc->Close(); |
3199 |
|
delete dbc; |
3200 |
dbc=0; |
dbc=0; |
3201 |
}; |
}; |
3202 |
// cout << endl; |
// cout << endl; |
4131 |
if (GP) { |
if (GP) { |
4132 |
pam_tree_clone[i] = new TTree("h20", "GPAMELA info "); |
pam_tree_clone[i] = new TTree("h20", "GPAMELA info "); |
4133 |
pam_tree_clone[i]->Branch("GPamela", "GPamela", GetPointerTo("GPamela"), 32000, 1);//split |
pam_tree_clone[i]->Branch("GPamela", "GPamela", GetPointerTo("GPamela"), 32000, 1);//split |
4134 |
cout << "OrbitalInfo : branch OrbitalInfo" << endl; |
cout << "GPamela : branch GPamela" << endl; |
4135 |
i++; |
i++; |
4136 |
}; |
}; |
4137 |
cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" << endl; |
cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" << endl; |
4249 |
ii = iee; |
ii = iee; |
4250 |
// Bool_t UPDATED = UpdateRunInfo(run_tree,ii); |
// Bool_t UPDATED = UpdateRunInfo(run_tree,ii); |
4251 |
// Bool_t UPDATED = UpdateRunInfo(ii); |
// Bool_t UPDATED = UpdateRunInfo(ii); |
4252 |
UpdateRunInfo(ii); |
if ( fUpdateRunInfo ) UpdateRunInfo(ii); // Emiliano |
4253 |
if (SELLI == 0 || SELLI == 2) |
if (SELLI == 0 || SELLI == 2) |
4254 |
irunentry = iee - runfirstentry; |
irunentry = iee - runfirstentry; |
4255 |
// if(UPDATED && run_tree_clone)run_tree_clone->Fill(); |
// if(UPDATED && run_tree_clone)run_tree_clone->Fill(); |
4377 |
} |
} |
4378 |
|
|
4379 |
dbc->Close(); // EMILIANO, do not leave open connections, open only when needed |
dbc->Close(); // EMILIANO, do not leave open connections, open only when needed |
4380 |
|
delete dbc; |
4381 |
dbc=0; |
dbc=0; |
4382 |
|
|
4383 |
}; |
}; |
4399 |
}; |
}; |
4400 |
if(dbc){ |
if(dbc){ |
4401 |
dbc->Close(); // EMILIANO, do not leave open connections, open only when needed |
dbc->Close(); // EMILIANO, do not leave open connections, open only when needed |
4402 |
|
delete dbc; |
4403 |
dbc=0; |
dbc=0; |
4404 |
}; |
}; |
4405 |
} |
} |