/[PAMELA software]/DarthVader/AnticounterLevel2/src/AcCore.cpp
ViewVC logotype

Diff of /DarthVader/AnticounterLevel2/src/AcCore.cpp

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

revision 1.14 by mocchiut, Tue May 22 08:15:04 2007 UTC revision 1.15 by mocchiut, Thu Sep 6 12:49:21 2007 UTC
# Line 152  int AcCore(UInt_t run, TFile *file, TSQL Line 152  int AcCore(UInt_t run, TFile *file, TSQL
152    TTree *tempac = 0;    TTree *tempac = 0;
153    stringstream tempname;    stringstream tempname;
154    stringstream acfolder;    stringstream acfolder;
155      Bool_t myfold = false;
156    tempname.str("");    tempname.str("");
157    tempname << outdir;    tempname << outdir;
158    tempname << "/" << processFolder.Data();    tempname << "/" << processFolder.Data();
159    acfolder.str("");    acfolder.str("");
160    acfolder << tempname.str().c_str();    acfolder << tempname.str().c_str();
   gSystem->MakeDirectory(acfolder.str().c_str());  
161    tempname << "/ac2tree_run";    tempname << "/ac2tree_run";
162    tempname << run << ".root";      tempname << run << ".root";  
163    //    //
# Line 284  int AcCore(UInt_t run, TFile *file, TSQL Line 284  int AcCore(UInt_t run, TFile *file, TSQL
284        //        //
285        // copying old tree to a new file        // copying old tree to a new file
286        //        //
287          gSystem->MakeDirectory(acfolder.str().c_str());
288          myfold = true;
289        tempfile = new TFile(tempname.str().c_str(),"RECREATE");        tempfile = new TFile(tempname.str().c_str(),"RECREATE");
290        tempac = acclone->CloneTree(-1,"fast");        tempac = acclone->CloneTree(-1,"fast");
291        tempac->SetName("Anticounter-old");        tempac->SetName("Anticounter-old");
# Line 641  int AcCore(UInt_t run, TFile *file, TSQL Line 643  int AcCore(UInt_t run, TFile *file, TSQL
643    //    //
644    if ( l0File ) l0File->Close();    if ( l0File ) l0File->Close();
645    if ( tempfile ) tempfile->Close();                if ( tempfile ) tempfile->Close();            
646    gSystem->Unlink(tempname.str().c_str());    if ( myfold ) gSystem->Unlink(tempname.str().c_str());
647    //    //
648    if ( code < 0 && verbose ) printf("\n ANTICOUNTER - ERROR: an error occurred, try to save anyway...\n");    if ( code < 0 && verbose ) printf("\n ANTICOUNTER - ERROR: an error occurred, try to save anyway...\n");
649    if ( verbose ) printf("\n Writing and closing rootple\n");    if ( verbose ) printf("\n Writing and closing rootple\n");
# Line 652  int AcCore(UInt_t run, TFile *file, TSQL Line 654  int AcCore(UInt_t run, TFile *file, TSQL
654      file->Write();      file->Write();
655    };    };
656    //    //
657    gSystem->Unlink(acfolder.str().c_str());    if ( myfold ) gSystem->Unlink(acfolder.str().c_str());
658    //    //
659    // the end    // the end
660    //    //

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.23