/[PAMELA software]/PamelaLevel2/src/PamLevel2.cpp
ViewVC logotype

Diff of /PamelaLevel2/src/PamLevel2.cpp

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

revision 1.100 by mocchiut, Fri Oct 17 15:58:09 2014 UTC revision 1.109 by mocchiut, Tue Oct 21 10:08:36 2014 UTC
# Line 628  void PamLevel2::Initialize() { Line 628  void PamLevel2::Initialize() {
628    if (strcmp(pamdbpsw, ""))    if (strcmp(pamdbpsw, ""))
629      psw = pamdbpsw;      psw = pamdbpsw;
630    
631      customString = "";
632    
633    //    sorted_tracks = 0;//new TRefArray();    //    sorted_tracks = 0;//new TRefArray();
634    
635    CAL0 = false;    CAL0 = false;
# Line 971  void PamLevel2::Reset() { Line 973  void PamLevel2::Reset() {
973    if (sel_tree)    if (sel_tree)
974      sel_tree->Delete();;      sel_tree->Delete();;
975    sel_tree = NULL;    sel_tree = NULL;
976    
977      if (proc_tree)
978        proc_tree->Delete();
979      proc_tree = NULL;
980    //    //
981    // Close file    // Close file
982    //    //
# Line 1201  void *PamLevel2::GetPointerTo(const char Line 1207  void *PamLevel2::GetPointerTo(const char
1207    if (!objname.CompareTo("SoftInfo"))    if (!objname.CompareTo("SoftInfo"))
1208      return &soft_obj; // Emiliano      return &soft_obj; // Emiliano
1209    
1210    if (!objname.CompareTo("ProcessingInfo")){    if (!objname.CompareTo("ProcInfo")){
1211      if (!proc_obj)      if (!proc_obj)
1212        proc_obj = new ProcInfo();            proc_obj = new ProcInfo();    
1213      return &proc_obj; // Emiliano      return &proc_obj; // Emiliano
# Line 3504  TChain *PamLevel2::GetPamTree(TList *fl, Line 3510  TChain *PamLevel2::GetPamTree(TList *fl,
3510      cout << ">>> Found ProcessingInfo <<<" << endl;      cout << ">>> Found ProcessingInfo <<<" << endl;
3511      //  L->SetBranchAddress("RunEntry",&irun);      //  L->SetBranchAddress("RunEntry",&irun);
3512      P->SetBranchAddress("ProcInfo", &proc_obj);//NEWNEW      P->SetBranchAddress("ProcInfo", &proc_obj);//NEWNEW
3513        proc_tree = P;
3514      } else {
3515        //    proc_tree = new TChain("ProcessingInfo","Log of data processing");
3516        //    proc_tree->Branch("ProcInfo", "ProcInfo", &proc_obj);
3517        cout << "----------------------------------------------------" << endl;
3518        cout << ">>> ProcessingInfo not found, PROC set to false and continue (not 10RED files?)<<<" << endl;
3519        PROC = false;
3520    }    }
3521    //  --------------------------------------------    //  --------------------------------------------
3522    //  return the pamela chain with all the friends    //  return the pamela chain with all the friends
3523    //  --------------------------------------------    //  --------------------------------------------
3524    
3525    pam_tree = Trout;    pam_tree = Trout;
   
3526    return Trout;    return Trout;
3527  }  }
3528    
# Line 5208  void PamLevel2::CreateCloneTrees(TFile * Line 5220  void PamLevel2::CreateCloneTrees(TFile *
5220      //  cout << i<< "\t | "<<GetRunInfo()->ID<<"\t "<<GetRunInfo()->NEVENTS<< "\t "<<GetRunInfo()->RUNHEADER_TIME<<" <---> "<<GetRunInfo()->RUNTRAILER_TIME<<endl;      //  cout << i<< "\t | "<<GetRunInfo()->ID<<"\t "<<GetRunInfo()->NEVENTS<< "\t "<<GetRunInfo()->RUNHEADER_TIME<<" <---> "<<GetRunInfo()->RUNTRAILER_TIME<<endl;
5221      run_tree_clone->Fill();      run_tree_clone->Fill();
5222    }    }
5223    if ( PROC ){    //
5224      proc_tree_clone->Branch("ProcessingInfo", "ProcInfo", GetPointerTo("ProcessingInfo"));    // replicate processinginfo tree
5225      //
5226      if ( PROC ){ // EMEMEM
5227        proc_tree_clone = new TTree("ProcessingInfo","Log of data processing");
5228        proc_tree_clone->Branch("ProcInfo", "ProcInfo", GetPointerTo("ProcInfo"));
5229      cout << "ProcessingInfo: branch ProcessingInfo" << endl;        cout << "ProcessingInfo: branch ProcessingInfo" << endl;  
5230      // ------------------      // ------------------
5231      // replicate processinginfo tree      // replicate processinginfo tree
# Line 5218  void PamLevel2::CreateCloneTrees(TFile * Line 5234  void PamLevel2::CreateCloneTrees(TFile *
5234      //    cout << "irun\t | RUN\t NEVENTS\t absolute time"<<endl;      //    cout << "irun\t | RUN\t NEVENTS\t absolute time"<<endl;
5235      for (Int_t i = 0; i < proc_tree->GetEntries(); i++) {      for (Int_t i = 0; i < proc_tree->GetEntries(); i++) {
5236        proc_tree->GetEntry(i);        proc_tree->GetEntry(i);
5237        //        cout << i<< "\t | "<<GetRunInfo()->ID<<"\t "<<GetRunInfo()->NEVENTS<< "\t "<<GetRunInfo()->RUNHEADER_TIME<<" <---> "<<GetRunInfo()->RUNTRAILER_TIME<<endl;        //      cout << i<< "\t | "<<endl;
5238        proc_tree_clone->Fill();        proc_tree_clone->Fill();
5239      }      }
5240      if ( SELLI != 2 || true ){            if ( SELLI != 2 ){      
5241        proc_obj->runID = 0;        proc_obj->runID = 0;
5242        TTimeStamp *dt = new TTimeStamp();        TTimeStamp *dt = new TTimeStamp();
5243        proc_obj->date = dt->AsString();        proc_obj->date = dt->AsString();
5244        delete dt;        delete dt;
5245        proc_obj->commandLine = Form("PamelaLevel2 was called");        proc_obj->commandLine = Form("PamelaLevel2 was called: CAL2 %i CAL1 %i CAL0 %i TRK2 %i TRK1 %i TRKh %i TRK0 %i TOF %i TOF0 %i TRG %i \n                                            S4 %i ND %i AC %i ORB %i GP %i EXT %i NUC %i RUN %i ISGP %i SELLI %i \n Custom string   = %s",CAL2,CAL1,CAL0,TRK2,TRK1,TRKh,TRK0,TOF,TOF0,TRG,S4,ND,AC,ORB,GP,EXT,NUC,RUN,ISGP,SELLI,customString.Data());
5246        proc_obj->outputFilename = "";        proc_obj->outputFilename = ofile->GetName();
5247        proc_obj->localDir = gSystem->WorkingDirectory();        proc_obj->localDir = gSystem->WorkingDirectory();
5248        proc_obj->uname = gSystem->GetFromPipe("uname -a");        proc_obj->uname = gSystem->GetFromPipe("uname -a");
5249          if (!dbc || (dbc && !dbc->IsConnected())) SetDBConnection();
5250        proc_obj->DB = Form("mysql://%s/%s",dbc->GetHost(),dbc->GetDB());        proc_obj->DB = Form("mysql://%s/%s",dbc->GetHost(),dbc->GetDB());
5251          dbc->Close();
5252        proc_tree_clone->Fill();        proc_tree_clone->Fill();
5253      }      }
5254      cout << "----------------------------------------------------" << endl;      cout << "----------------------------------------------------" << endl;
# Line 5453  void PamLevel2::WriteCloneTrees() { Line 5471  void PamLevel2::WriteCloneTrees() {
5471      };      };
5472    }    }
5473        
5474    if ( PROC ){    if ( PROC ){//EMEMEMEM
5475      proc_tree_clone->Write("ProcessingInfo",TObject::kOverwrite);      proc_tree_clone->Write("ProcessingInfo",TObject::kOverwrite);
5476    }    }
5477    cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" << endl;    cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" << endl;

Legend:
Removed from v.1.100  
changed lines
  Added in v.1.109

  ViewVC Help
Powered by ViewVC 1.1.23