/[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.26 by mocchiut, Thu Nov 15 15:16:26 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      stringstream myquery;
62      myquery.str("");
63      myquery << "SET time_zone='+0:00'";
64      dbc->Query(myquery.str().c_str());
65    //    //
66    TString processFolder = Form("OrbitalInfoFolder_%u",run);    TString processFolder = Form("OrbitalInfoFolder_%u",run);
67    //    //
# Line 184  int OrbitalInfoCore(UInt_t run, TFile *f Line 193  int OrbitalInfoCore(UInt_t run, TFile *f
193    TTree *tempOrbitalInfo = 0;    TTree *tempOrbitalInfo = 0;
194    stringstream tempname;    stringstream tempname;
195    stringstream OrbitalInfofolder;    stringstream OrbitalInfofolder;
196      Bool_t myfold = false;
197    tempname.str("");    tempname.str("");
198    tempname << outDir;    tempname << outDir;
199    tempname << "/" << processFolder.Data();    tempname << "/" << processFolder.Data();
200    OrbitalInfofolder.str("");    OrbitalInfofolder.str("");
201    OrbitalInfofolder << tempname.str().c_str();    OrbitalInfofolder << tempname.str().c_str();
   gSystem->MakeDirectory(OrbitalInfofolder.str().c_str());  
202    tempname << "/OrbitalInfotree_run";    tempname << "/OrbitalInfotree_run";
203    tempname << run << ".root";      tempname << run << ".root";  
204    //    //
# Line 337  int OrbitalInfoCore(UInt_t run, TFile *f Line 346  int OrbitalInfoCore(UInt_t run, TFile *f
346        //        //
347        // copying old tree to a new file        // copying old tree to a new file
348        //        //
349          gSystem->MakeDirectory(OrbitalInfofolder.str().c_str());
350          myfold = true;
351        tempfile = new TFile(tempname.str().c_str(),"RECREATE");        tempfile = new TFile(tempname.str().c_str(),"RECREATE");
352        tempOrbitalInfo = OrbitalInfotrclone->CloneTree(-1,"fast");        tempOrbitalInfo = OrbitalInfotrclone->CloneTree(-1,"fast");
353        tempOrbitalInfo->SetName("OrbitalInfo-old");        tempOrbitalInfo->SetName("OrbitalInfo-old");
# Line 399  int OrbitalInfoCore(UInt_t run, TFile *f Line 410  int OrbitalInfoCore(UInt_t run, TFile *f
410    //    //
411    // Loop over the run to be processed    // Loop over the run to be processed
412    //    //
     
413    for (UInt_t irun=0; irun < numbofrun; irun++){    for (UInt_t irun=0; irun < numbofrun; irun++){
414      //      //
415      // 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 561  int OrbitalInfoCore(UInt_t run, TFile *f
561      //      //
562      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");
563      //      //
564         //
565      for ( re = runinfo->EV_FROM; re < (runinfo->EV_FROM+runinfo->NEVENTS); re++){      for ( re = runinfo->EV_FROM; re < (runinfo->EV_FROM+runinfo->NEVENTS); re++){
566            
567        //        //
# Line 935  int OrbitalInfoCore(UInt_t run, TFile *f Line 946  int OrbitalInfoCore(UInt_t run, TFile *f
946    //    //
947    if ( l0File ) l0File->Close();    if ( l0File ) l0File->Close();
948    if ( tempfile ) tempfile->Close();                if ( tempfile ) tempfile->Close();            
949    gSystem->Unlink(tempname.str().c_str());    if ( myfold ) gSystem->Unlink(tempname.str().c_str());
950    //    //
951    if ( runinfo ) runinfo->Close();        if ( runinfo ) runinfo->Close();    
952    if ( OrbitalInfotr ) OrbitalInfotr->SetName("OrbitalInfo");        if ( OrbitalInfotr ) OrbitalInfotr->SetName("OrbitalInfo");    
# Line 944  int OrbitalInfoCore(UInt_t run, TFile *f Line 955  int OrbitalInfoCore(UInt_t run, TFile *f
955      file->Write();      file->Write();
956    };    };
957    //    //
958    gSystem->Unlink(OrbitalInfofolder.str().c_str());    if ( myfold ) gSystem->Unlink(OrbitalInfofolder.str().c_str());
959    //    //
960    // the end    // the end
961    //    //
962      if ( dbc ){
963        dbc->Close();
964        delete dbc;
965      };
966    if (verbose) printf("\n Exiting...\n");    if (verbose) printf("\n Exiting...\n");
967    if(OrbitalInfotr)OrbitalInfotr->Delete();    if(OrbitalInfotr)OrbitalInfotr->Delete();
968    //    //

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

  ViewVC Help
Powered by ViewVC 1.1.23