175 |
TTree *temptof = 0; |
TTree *temptof = 0; |
176 |
stringstream tempname; |
stringstream tempname; |
177 |
stringstream toffolder; |
stringstream toffolder; |
178 |
|
Bool_t myfold = false; |
179 |
tempname.str(""); |
tempname.str(""); |
180 |
tempname << outdir; |
tempname << outdir; |
181 |
tempname << "/" << processFolder.Data(); |
tempname << "/" << processFolder.Data(); |
182 |
toffolder.str(""); |
toffolder.str(""); |
183 |
toffolder << tempname.str().c_str(); |
toffolder << tempname.str().c_str(); |
|
gSystem->MakeDirectory(toffolder.str().c_str()); |
|
184 |
tempname << "/toftree_run"; |
tempname << "/toftree_run"; |
185 |
tempname << run << ".root"; |
tempname << run << ".root"; |
186 |
// |
// |
315 |
// |
// |
316 |
// copying old tree to a new file |
// copying old tree to a new file |
317 |
// |
// |
318 |
|
gSystem->MakeDirectory(toffolder.str().c_str()); |
319 |
|
myfold = true; |
320 |
tempfile = new TFile(tempname.str().c_str(),"RECREATE"); |
tempfile = new TFile(tempname.str().c_str(),"RECREATE"); |
321 |
temptof = toftclone->CloneTree(-1,"fast"); |
temptof = toftclone->CloneTree(-1,"fast"); |
322 |
temptof->SetName("ToF-old"); |
temptof->SetName("ToF-old"); |
830 |
// |
// |
831 |
if ( l0File ) l0File->Close(); |
if ( l0File ) l0File->Close(); |
832 |
if ( tempfile ) tempfile->Close(); |
if ( tempfile ) tempfile->Close(); |
833 |
gSystem->Unlink(tempname.str().c_str()); |
if ( myfold ) gSystem->Unlink(tempname.str().c_str()); |
834 |
if ( tracker ) tracker->Delete(); // delete tracker tree from memory only to avoid writing a copy to file! |
if ( tracker ) tracker->Delete(); // delete tracker tree from memory only to avoid writing a copy to file! |
835 |
// |
// |
836 |
if ( code < 0 && verbose ) printf("\n TOF - ERROR: an error occurred, try to save anyway...\n"); |
if ( code < 0 && verbose ) printf("\n TOF - ERROR: an error occurred, try to save anyway...\n"); |
842 |
file->Write("ToF"); |
file->Write("ToF"); |
843 |
}; |
}; |
844 |
// |
// |
845 |
gSystem->Unlink(toffolder.str().c_str()); |
if ( myfold ) gSystem->Unlink(toffolder.str().c_str()); |
846 |
// |
// |
847 |
// the end |
// the end |
848 |
// |
// |