/[PAMELA software]/DarthVader/ToFLevel2/src/ToFCore.cpp
ViewVC logotype

Diff of /DarthVader/ToFLevel2/src/ToFCore.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.24 by mocchiut, Mon Sep 3 16:08:40 2007 UTC revision 1.25 by mocchiut, Thu Sep 6 12:49:35 2007 UTC
# Line 175  int ToFCore(UInt_t run, TFile *file, TSQ Line 175  int ToFCore(UInt_t run, TFile *file, TSQ
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    //    //
# Line 315  int ToFCore(UInt_t run, TFile *file, TSQ Line 315  int ToFCore(UInt_t run, TFile *file, TSQ
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");
# Line 828  int ToFCore(UInt_t run, TFile *file, TSQ Line 830  int ToFCore(UInt_t run, TFile *file, TSQ
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");
# Line 840  int ToFCore(UInt_t run, TFile *file, TSQ Line 842  int ToFCore(UInt_t run, TFile *file, TSQ
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    //    //

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

  ViewVC Help
Powered by ViewVC 1.1.23