/[PAMELA software]/DarthVader/OrbitalInfo/src/OrbitalInfoCore.cpp
ViewVC logotype

Diff of /DarthVader/OrbitalInfo/src/OrbitalInfoCore.cpp

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

revision 1.22 by mocchiut, Tue May 22 08:15:07 2007 UTC revision 1.25 by mocchiut, Sun Sep 9 18:57:29 2007 UTC
# Line 50  using namespace std; Line 50  using namespace std;
50  // CORE ROUTINE  // CORE ROUTINE
51  //  //
52  //  //
53  int OrbitalInfoCore(UInt_t run, TFile *file, TSQLServer *dbc, Int_t OrbitalInfoargc, char *OrbitalInfoargv[]){  int OrbitalInfoCore(UInt_t run, TFile *file, GL_TABLES *glt, Int_t OrbitalInfoargc, char *OrbitalInfoargv[]){
54    //    //
55    Int_t i = 0;    Int_t i = 0;
56      TString host = glt->CGetHost();
57      TString user = glt->CGetUser();
58      TString psw = glt->CGetPsw();
59      TSQLServer *dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data());
60    //    //
61    TString processFolder = Form("OrbitalInfoFolder_%u",run);    TString processFolder = Form("OrbitalInfoFolder_%u",run);
62    //    //
# Line 184  int OrbitalInfoCore(UInt_t run, TFile *f Line 188  int OrbitalInfoCore(UInt_t run, TFile *f
188    TTree *tempOrbitalInfo = 0;    TTree *tempOrbitalInfo = 0;
189    stringstream tempname;    stringstream tempname;
190    stringstream OrbitalInfofolder;    stringstream OrbitalInfofolder;
191      Bool_t myfold = false;
192    tempname.str("");    tempname.str("");
193    tempname << outDir;    tempname << outDir;
194    tempname << "/" << processFolder.Data();    tempname << "/" << processFolder.Data();
195    OrbitalInfofolder.str("");    OrbitalInfofolder.str("");
196    OrbitalInfofolder << tempname.str().c_str();    OrbitalInfofolder << tempname.str().c_str();
   gSystem->MakeDirectory(OrbitalInfofolder.str().c_str());  
197    tempname << "/OrbitalInfotree_run";    tempname << "/OrbitalInfotree_run";
198    tempname << run << ".root";      tempname << run << ".root";  
199    //    //
# Line 337  int OrbitalInfoCore(UInt_t run, TFile *f Line 341  int OrbitalInfoCore(UInt_t run, TFile *f
341        //        //
342        // copying old tree to a new file        // copying old tree to a new file
343        //        //
344          gSystem->MakeDirectory(OrbitalInfofolder.str().c_str());
345          myfold = true;
346        tempfile = new TFile(tempname.str().c_str(),"RECREATE");        tempfile = new TFile(tempname.str().c_str(),"RECREATE");
347        tempOrbitalInfo = OrbitalInfotrclone->CloneTree(-1,"fast");        tempOrbitalInfo = OrbitalInfotrclone->CloneTree(-1,"fast");
348        tempOrbitalInfo->SetName("OrbitalInfo-old");        tempOrbitalInfo->SetName("OrbitalInfo-old");
# Line 399  int OrbitalInfoCore(UInt_t run, TFile *f Line 405  int OrbitalInfoCore(UInt_t run, TFile *f
405    //    //
406    // Loop over the run to be processed    // Loop over the run to be processed
407    //    //
     
408    for (UInt_t irun=0; irun < numbofrun; irun++){    for (UInt_t irun=0; irun < numbofrun; irun++){
409      //      //
410      // retrieve the first run ID to be processed using the RunInfo list      // retrieve the first run ID to be processed using the RunInfo list
# Line 551  int OrbitalInfoCore(UInt_t run, TFile *f Line 556  int OrbitalInfoCore(UInt_t run, TFile *f
556      //      //
557      if (verbose) printf("\n Ready to start! \n\n Processed events: \n\n");      if (verbose) printf("\n Ready to start! \n\n Processed events: \n\n");
558      //      //
559         //
560      for ( re = runinfo->EV_FROM; re < (runinfo->EV_FROM+runinfo->NEVENTS); re++){      for ( re = runinfo->EV_FROM; re < (runinfo->EV_FROM+runinfo->NEVENTS); re++){
561            
562        //        //
# Line 935  int OrbitalInfoCore(UInt_t run, TFile *f Line 941  int OrbitalInfoCore(UInt_t run, TFile *f
941    //    //
942    if ( l0File ) l0File->Close();    if ( l0File ) l0File->Close();
943    if ( tempfile ) tempfile->Close();                if ( tempfile ) tempfile->Close();            
944    gSystem->Unlink(tempname.str().c_str());    if ( myfold ) gSystem->Unlink(tempname.str().c_str());
945    //    //
946    if ( runinfo ) runinfo->Close();        if ( runinfo ) runinfo->Close();    
947    if ( OrbitalInfotr ) OrbitalInfotr->SetName("OrbitalInfo");        if ( OrbitalInfotr ) OrbitalInfotr->SetName("OrbitalInfo");    
# Line 944  int OrbitalInfoCore(UInt_t run, TFile *f Line 950  int OrbitalInfoCore(UInt_t run, TFile *f
950      file->Write();      file->Write();
951    };    };
952    //    //
953    gSystem->Unlink(OrbitalInfofolder.str().c_str());    if ( myfold ) gSystem->Unlink(OrbitalInfofolder.str().c_str());
954    //    //
955    // the end    // the end
956    //    //
957      if ( dbc ){
958        dbc->Close();
959        delete dbc;
960      };
961    if (verbose) printf("\n Exiting...\n");    if (verbose) printf("\n Exiting...\n");
962    if(OrbitalInfotr)OrbitalInfotr->Delete();    if(OrbitalInfotr)OrbitalInfotr->Delete();
963    //    //

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

  ViewVC Help
Powered by ViewVC 1.1.23