/[PAMELA software]/PadmeAmidala/src/RunGlue.cpp
ViewVC logotype

Diff of /PadmeAmidala/src/RunGlue.cpp

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

revision 1.24 by mocchiut, Fri Oct 17 15:10:20 2014 UTC revision 1.25 by mocchiut, Fri Oct 17 15:58:41 2014 UTC
# Line 596  void RunGlue::MergeRootfile(TList *sourc Line 596  void RunGlue::MergeRootfile(TList *sourc
596        nli->FillCloneTrees();        nli->FillCloneTrees();
597      };      };
598    };    };
599      //
600      TTree *P = nli->GetCloneTree("ProcessingInfo");
601      ProcInfo *procinfo = 0;
602      if ( P ){
603        procinfo = nli->GetProcInfo();
604      } else {
605        procinfo = new ProcInfo();    
606      }
607      procinfo->runID = run;
608      TTimeStamp *dt = new TTimeStamp();
609      procinfo->date = dt->AsString();
610      delete dt;
611      TString isok;
612      if ( discarded ){
613        isok = " WARNING, files were discarded while merging! ";
614      } else {
615        isok = " The level2 merging was OK!";
616      }
617      procinfo->commandLine = Form("PadmeAmidala: %s",isok.Data());
618      procinfo->outputFilename = Target->GetName();
619      procinfo->localDir = gSystem->WorkingDirectory();
620      procinfo->uname = gSystem->GetFromPipe("uname -a");
621      procinfo->DB = Form("mysql://%s/%s",dbc->GetHost(),dbc->GetDB());
622      if ( P ) P->Fill();
623      //
624    Target->cd();    Target->cd();
625    nli->WriteCloneTrees();    nli->WriteCloneTrees();
626    printf("Written file %s \n",Target->GetName());    printf("Written file %s \n",Target->GetName());
627    //  Target->Write();    //  Target->Write();
628    //  TTree *slist = (TTree*)Target->Get("SelectionList");    //  TTree *slist = (TTree*)Target->Get("SelectionList");
629    //  slist->Delete("all");    //  slist->Delete("all");
630    if ( !nli->GetCloneTree("ProcessingInfo") ){    if ( !P ){
631      TChain *P = new TChain("ProcessingInfo");      TChain *PC = new TChain("ProcessingInfo");
632      // loop over files and create chains      // loop over files and create chains
633      TIter next(sourcelist);      TIter next(sourcelist);
634      TSystemFile *questo = 0;      TSystemFile *questo = 0;
635      while ((questo = (TSystemFile*) next())) {      while ((questo = (TSystemFile*) next())) {
636        TString name = questo->GetName();        TString name = questo->GetName();
637        P->Add(name);        PC->Add(name);
638      }      }
639      if ( P->GetEntries() ){      if ( P->GetEntries() ){
640        TTree *Pclone = P->CloneTree();        TTree *Pclone = PC->CloneTree();
641        //        //
       ProcInfo *procinfo = new ProcInfo();  
       procinfo->runID = run;  
       TTimeStamp *dt = new TTimeStamp();  
       procinfo->date = dt->AsString();  
       delete dt;  
       TString isok;  
       if ( discarded ){  
         isok = " WARNING, files were discarded while merging! ";  
       } else {  
         isok = " The level2 merging was OK!";  
       }  
       procinfo->commandLine += Form("PadmeAmidala: %s",isok.Data());  
       procinfo->outputFilename = Target->GetName();  
       procinfo->localDir = gSystem->WorkingDirectory();  
       procinfo->uname = gSystem->GetFromPipe("uname -a");  
       procinfo->DB = Form("mysql://%s/%s",dbc->GetHost(),dbc->GetDB());  
642                
643        Pclone->SetBranchAddress("ProcInfo",&procinfo);        Pclone->SetBranchAddress("ProcInfo",&procinfo);
644        Pclone->Fill();        Pclone->Fill();
645          
646        Target->cd();        Target->cd();
647        Pclone->Write("ProcessingInfo",TObject::kOverwrite);        Pclone->Write("ProcessingInfo",TObject::kOverwrite);
648        P->Delete();        PC->Delete();
649        P=0;        PC=0;
650      }      }
651    }    }
652    //      //  

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

  ViewVC Help
Powered by ViewVC 1.1.23