31 |
run = ru; |
run = ru; |
32 |
dir = di; |
dir = di; |
33 |
// |
// |
34 |
|
discarded = false; |
35 |
|
// |
36 |
wd = gSystem->WorkingDirectory(); |
wd = gSystem->WorkingDirectory(); |
37 |
// |
// |
38 |
outdir = wrkdi; |
outdir = wrkdi; |
176 |
if ( li->CheckLevel2File(thisrun) ){ |
if ( li->CheckLevel2File(thisrun) ){ |
177 |
lList->Add(su); |
lList->Add(su); |
178 |
} else { |
} else { |
179 |
if ( DebugMode() ) printf(" RUN %s DISCARDED \n",Row->GetField(0)); |
if ( DebugMode() ) printf(" RUN %s DISCARDED \n",Row->GetField(0)); |
180 |
|
discarded = true; |
181 |
}; |
}; |
182 |
// |
// |
183 |
}; |
}; |
222 |
fNlist++; |
fNlist++; |
223 |
} else { |
} else { |
224 |
if ( DebugMode() ) printf(" RUN %s DISCARDED \n",fullpath.Data()); |
if ( DebugMode() ) printf(" RUN %s DISCARDED \n",fullpath.Data()); |
225 |
|
discarded = true; |
226 |
}; |
}; |
227 |
// |
// |
228 |
}; |
}; |
349 |
if ( DebugMode() ) printf(" RUN %s ADDED \n",Row->GetField(0)); |
if ( DebugMode() ) printf(" RUN %s ADDED \n",Row->GetField(0)); |
350 |
} else { |
} else { |
351 |
if ( DebugMode() ) printf(" RUN %s DISCARDED \n",Row->GetField(0)); |
if ( DebugMode() ) printf(" RUN %s DISCARDED \n",Row->GetField(0)); |
352 |
|
discarded = true; |
353 |
}; |
}; |
354 |
// |
// |
355 |
}; |
}; |
578 |
// |
// |
579 |
nli->CreateCloneTrees(Target); |
nli->CreateCloneTrees(Target); |
580 |
// |
// |
581 |
nli->GetCloneTree("Tracker")->SetAutoSave(900000000000000LL); |
/* nli->GetCloneTree("Tracker")->SetAutoSave(900000000000000LL); |
582 |
nli->GetCloneTree("Trigger")->SetAutoSave(900000000000000LL); |
nli->GetCloneTree("Trigger")->SetAutoSave(900000000000000LL); |
583 |
nli->GetCloneTree("Calorimeter")->SetAutoSave(900000000000000LL); |
nli->GetCloneTree("Calorimeter")->SetAutoSave(900000000000000LL); |
584 |
nli->GetCloneTree("S4")->SetAutoSave(900000000000000LL); |
nli->GetCloneTree("S4")->SetAutoSave(900000000000000LL); |
586 |
nli->GetCloneTree("NeutronD")->SetAutoSave(900000000000000LL); |
nli->GetCloneTree("NeutronD")->SetAutoSave(900000000000000LL); |
587 |
nli->GetCloneTree("OrbitalInfo")->SetAutoSave(900000000000000LL); |
nli->GetCloneTree("OrbitalInfo")->SetAutoSave(900000000000000LL); |
588 |
nli->GetCloneTree("Run")->SetAutoSave(900000000000000LL); |
nli->GetCloneTree("Run")->SetAutoSave(900000000000000LL); |
589 |
nli->GetCloneTree("ToF")->SetAutoSave(900000000000000LL); |
nli->GetCloneTree("ToF")->SetAutoSave(900000000000000LL);*/ |
590 |
// |
// |
591 |
ULong64_t nevents = nli->GetEntries(); |
ULong64_t nevents = nli->GetEntries(); |
592 |
printf(" NEVENTS %llu \n",nevents); |
printf(" NEVENTS %llu \n",nevents); |
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 ( !P ){ |
631 |
|
TChain *PC = new TChain("ProcessingInfo"); |
632 |
|
// loop over files and create chains |
633 |
|
TIter next(sourcelist); |
634 |
|
TSystemFile *questo = 0; |
635 |
|
while ((questo = (TSystemFile*) next())) { |
636 |
|
TString name = questo->GetName(); |
637 |
|
PC->Add(name); |
638 |
|
} |
639 |
|
if ( P->GetEntries() ){ |
640 |
|
TTree *Pclone = PC->CloneTree(); |
641 |
|
// |
642 |
|
|
643 |
|
Pclone->SetBranchAddress("ProcInfo",&procinfo); |
644 |
|
Pclone->Fill(); |
645 |
|
|
646 |
|
Target->cd(); |
647 |
|
Pclone->Write("ProcessingInfo",TObject::kOverwrite); |
648 |
|
PC->Delete(); |
649 |
|
PC=0; |
650 |
|
} |
651 |
|
} |
652 |
|
// |
653 |
Target->Close(); |
Target->Close(); |
654 |
|
|
655 |
// // |
// // |