/[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.16 by mocchiut, Fri Jan 30 16:17:31 2009 UTC revision 1.21 by mocchiut, Fri Oct 17 13:17:05 2014 UTC
# Line 115  TList *RunGlue::GetRunList(){ Line 115  TList *RunGlue::GetRunList(){
115      TTimeStamp *llim = new TTimeStamp(YY,MM,DD,0,0,0,0,true,0);      TTimeStamp *llim = new TTimeStamp(YY,MM,DD,0,0,0,0,true,0);
116      //      //
117      UInt_t lowerlimit = llim->GetSec();      UInt_t lowerlimit = llim->GetSec();
118      UInt_t upperlimit = lowerlimit + 86401;      UInt_t upperlimit = lowerlimit + 86400;
119      //      //
120      if ( DebugMode() ) printf(" YY %u MM %u DD %u ll %u ul %u \n",YY,MM,DD,lowerlimit,upperlimit);      if ( DebugMode() ) printf(" YY %u MM %u DD %u ll %u ul %u \n",YY,MM,DD,lowerlimit,upperlimit);
121      //      //
# Line 282  TList *RunGlue::GetRunList(){ Line 282  TList *RunGlue::GetRunList(){
282      TTimeStamp *llim = new TTimeStamp(YY,MM,DD,0,0,0,0,true,0);      TTimeStamp *llim = new TTimeStamp(YY,MM,DD,0,0,0,0,true,0);
283      //      //
284      UInt_t lowerlimit = llim->GetSec();      UInt_t lowerlimit = llim->GetSec();
285      UInt_t upperlimit = lowerlimit + 86401;      UInt_t upperlimit = lowerlimit + 86400;
286      //      //
287      if ( DebugMode() ) printf(" YY %u MM %u DD %u ll %u ul %u \n",YY,MM,DD,lowerlimit,upperlimit);      if ( DebugMode() ) printf(" YY %u MM %u DD %u ll %u ul %u \n",YY,MM,DD,lowerlimit,upperlimit);
288      //      //
# Line 565  void RunGlue::MergeRootfile(TList *sourc Line 565  void RunGlue::MergeRootfile(TList *sourc
565    //    //
566    merged = true;    merged = true;
567    //    //
568    if ( li ) li->Delete();    //  if ( li ) li->Delete();
569    li = new PamLevel2(wd,sourcelist,fDList);    PamLevel2 *nli = new PamLevel2(wd,sourcelist,fDList);
570    li->SetSELLI(2);    nli->SetSELLI(2);
571    //    //
572    Target->cd();    Target->cd();
573    //    //
574    li->CreateCloneTrees(Target);    nli->CreateCloneTrees(Target);
575    ULong64_t nevents = li->GetEntries();    //
576      /*  nli->GetCloneTree("Tracker")->SetAutoSave(900000000000000LL);
577      nli->GetCloneTree("Trigger")->SetAutoSave(900000000000000LL);
578      nli->GetCloneTree("Calorimeter")->SetAutoSave(900000000000000LL);
579      nli->GetCloneTree("S4")->SetAutoSave(900000000000000LL);
580      nli->GetCloneTree("Anticounter")->SetAutoSave(900000000000000LL);
581      nli->GetCloneTree("NeutronD")->SetAutoSave(900000000000000LL);
582      nli->GetCloneTree("OrbitalInfo")->SetAutoSave(900000000000000LL);
583      nli->GetCloneTree("Run")->SetAutoSave(900000000000000LL);
584      nli->GetCloneTree("ToF")->SetAutoSave(900000000000000LL);*/
585      //
586      ULong64_t nevents = nli->GetEntries();        
587    printf(" NEVENTS %llu \n",nevents);    printf(" NEVENTS %llu \n",nevents);
588    for(ULong64_t iev=0; iev<nevents; iev++){    for(ULong64_t iev=0; iev<nevents; iev++){
589      li->Clear();      nli->Clear();
590      if( li->GetEntry(iev) ){      if( nli->GetEntry(iev) ){
591        li->FillCloneTrees();        nli->FillCloneTrees();
592      };      };
593    };    };
594    Target->cd();    Target->cd();
595    li->WriteCloneTrees();    nli->WriteCloneTrees();
596    printf("Written file %s \n",Target->GetName());    printf("Written file %s \n",Target->GetName());
597    //  Target->Write();    //  Target->Write();
598    //  TTree *slist = (TTree*)Target->Get("SelectionList");    //  TTree *slist = (TTree*)Target->Get("SelectionList");
599    //  slist->Delete("all");    //  slist->Delete("all");
600      if ( !nli->GetCloneTree("ProcessingInfo") ){
601        TChain *P = new TChain("ProcessingInfo");
602        // loop over files and create chains
603        TIter next(sourcelist);
604        TSystemFile *questo = 0;
605        bool found = false;
606        while ((questo = (TSystemFile*) next())) {
607          TString name = questo->GetName();
608          if ( P->Add(name) ) found = true;
609        }
610        if ( found ){
611          TTree *Pclone = P->CloneTree();
612          Target->cd();
613          Pclone->Write("ProcessingInfo",TObject::kOverwrite);
614          P->Delete();
615          P=0;
616        }
617      }
618      //  
619    Target->Close();    Target->Close();
620    
621  //   //  //   //

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.21

  ViewVC Help
Powered by ViewVC 1.1.23