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; |
117 |
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); |
118 |
// |
// |
119 |
UInt_t lowerlimit = llim->GetSec(); |
UInt_t lowerlimit = llim->GetSec(); |
120 |
UInt_t upperlimit = lowerlimit + 86401; |
UInt_t upperlimit = lowerlimit + 86400; |
121 |
// |
// |
122 |
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); |
123 |
// |
// |
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 |
}; |
}; |
286 |
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); |
287 |
// |
// |
288 |
UInt_t lowerlimit = llim->GetSec(); |
UInt_t lowerlimit = llim->GetSec(); |
289 |
UInt_t upperlimit = lowerlimit + 86401; |
UInt_t upperlimit = lowerlimit + 86400; |
290 |
// |
// |
291 |
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); |
292 |
// |
// |
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 |
}; |
}; |
577 |
Target->cd(); |
Target->cd(); |
578 |
// |
// |
579 |
nli->CreateCloneTrees(Target); |
nli->CreateCloneTrees(Target); |
580 |
|
// |
581 |
|
/* nli->GetCloneTree("Tracker")->SetAutoSave(900000000000000LL); |
582 |
|
nli->GetCloneTree("Trigger")->SetAutoSave(900000000000000LL); |
583 |
|
nli->GetCloneTree("Calorimeter")->SetAutoSave(900000000000000LL); |
584 |
|
nli->GetCloneTree("S4")->SetAutoSave(900000000000000LL); |
585 |
|
nli->GetCloneTree("Anticounter")->SetAutoSave(900000000000000LL); |
586 |
|
nli->GetCloneTree("NeutronD")->SetAutoSave(900000000000000LL); |
587 |
|
nli->GetCloneTree("OrbitalInfo")->SetAutoSave(900000000000000LL); |
588 |
|
nli->GetCloneTree("Run")->SetAutoSave(900000000000000LL); |
589 |
|
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); |
593 |
for(ULong64_t iev=0; iev<nevents; iev++){ |
for(ULong64_t iev=0; iev<nevents; iev++){ |
602 |
// Target->Write(); |
// Target->Write(); |
603 |
// TTree *slist = (TTree*)Target->Get("SelectionList"); |
// TTree *slist = (TTree*)Target->Get("SelectionList"); |
604 |
// slist->Delete("all"); |
// slist->Delete("all"); |
605 |
|
if ( !nli->GetCloneTree("ProcessingInfo") ){ |
606 |
|
TChain *P = new TChain("ProcessingInfo"); |
607 |
|
// loop over files and create chains |
608 |
|
TIter next(sourcelist); |
609 |
|
TSystemFile *questo = 0; |
610 |
|
while ((questo = (TSystemFile*) next())) { |
611 |
|
TString name = questo->GetName(); |
612 |
|
P->Add(name); |
613 |
|
} |
614 |
|
if ( P->GetEntries() ){ |
615 |
|
TTree *Pclone = P->CloneTree(); |
616 |
|
// |
617 |
|
ProcInfo *procinfo = new ProcInfo(); |
618 |
|
procinfo->runID = run; |
619 |
|
TTimeStamp *dt = new TTimeStamp(); |
620 |
|
procinfo->date = dt->AsString(); |
621 |
|
delete dt; |
622 |
|
TString isok; |
623 |
|
if ( discarded ){ |
624 |
|
isok = " WARNING, files were discarded while merging! "; |
625 |
|
} else { |
626 |
|
isok = " The level2 merging was OK!"; |
627 |
|
} |
628 |
|
procinfo->commandLine += Form("PadmeAmidala: %s",isok.Data()); |
629 |
|
procinfo->outputFilename = Target->GetName(); |
630 |
|
procinfo->localDir = gSystem->WorkingDirectory(); |
631 |
|
procinfo->uname = gSystem->GetFromPipe("uname -a"); |
632 |
|
procinfo->DB = Form("mysql://%s/%s",dbc->GetHost(),dbc->GetDB()); |
633 |
|
|
634 |
|
Pclone->SetBranchAddress("ProcInfo",&procinfo); |
635 |
|
Pclone->Fill(); |
636 |
|
|
637 |
|
Target->cd(); |
638 |
|
Pclone->Write("ProcessingInfo",TObject::kOverwrite); |
639 |
|
P->Delete(); |
640 |
|
P=0; |
641 |
|
} |
642 |
|
} |
643 |
|
// |
644 |
Target->Close(); |
Target->Close(); |
645 |
|
|
646 |
// // |
// // |