Skip to content

Commit

Permalink
Revert "Merge pull request #393 from rest-for-physics/nkx111-single-e…
Browse files Browse the repository at this point in the history
…vent-file"

This reverts commit 324cf3d, reversing
changes made to babeff3.
  • Loading branch information
jgalan committed May 3, 2023
1 parent 46eb352 commit 4ca4959
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 40 deletions.
10 changes: 0 additions & 10 deletions pipeline/ValidateTrees.C
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,6 @@ Int_t ValidateTrees(const char* validationFilename, const char* inputFilename =
printf(" value: %.15f, should be: %.15f\n", (*inputObservableVector)[m],
(*validationObservableVector)[m]);

cout << "Validation vector contents: " << endl;
for (int m = 0; m < (*validationObservableVector).size(); m++)
cout << (*validationObservableVector)[m] << "\t";
cout << endl;

cout << "Results vector contents: " << endl;
for (int m = 0; m < (*inputObservableVector).size(); m++)
cout << (*inputObservableVector)[m] << "\t";
cout << endl;

if (!TMath::IsNaN((*inputObservableVector)[m] - (*validationObservableVector)[m]) &&
abs(((*inputObservableVector)[m] - (*validationObservableVector)[m]) /
(*inputObservableVector)[m]) < 1e-15) {
Expand Down
Binary file modified pipeline/trex/validation.root
Binary file not shown.
54 changes: 25 additions & 29 deletions source/framework/core/src/TRestRun.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -828,40 +828,36 @@ Int_t TRestRun::GetNextEvent(TRestEvent* targetevt, TRestAnalysisTree* targettre
//}
fCurrentEvent++;
} else {
if (eve == nullptr) {
RESTDebug << "TRestRun::GetNextEvent(): input event has not been initialized!" << RESTendl;
RESTDebug << "TRestRun: getting next event from root file" << RESTendl;
if (fAnalysisTree == nullptr) {
RESTWarning << "error to get event from input file, missing analysis tree from input file"
<< RESTendl;
eve = nullptr;
} else {
RESTDebug << "TRestRun: getting next event from root file" << RESTendl;
if (fAnalysisTree == nullptr) {
RESTWarning << "error to get event from input file, missing analysis tree from input file"
<< RESTendl;
if (fCurrentEvent >= fAnalysisTree->GetTree()->GetEntriesFast()) {
eve = nullptr;
} else {
if (fCurrentEvent >= fAnalysisTree->GetTree()->GetEntriesFast()) {
eve = nullptr;
} else {
if (targettree != nullptr) {
// normal reading procedure
eve->Initialize();
fBytesRead += fAnalysisTree->GetEntry(fCurrentEvent);
targettree->SetEventInfo(fAnalysisTree);
for (int n = 0; n < fAnalysisTree->GetNumberOfObservables(); n++)
targettree->SetObservable(n, fAnalysisTree->GetObservable(n));
}
if (fEventTree != nullptr) {
if (fEventTree->IsA() == TChain::Class()) {
Long64_t entry = fEventTree->LoadTree(fCurrentEvent);
fBytesRead += ((TBranch*)fEventTree->GetTree()->GetListOfBranches()->UncheckedAt(
fEventBranchLoc))
->GetEntry(entry);
} else {
fBytesRead +=
((TBranch*)fEventTree->GetListOfBranches()->UncheckedAt(fEventBranchLoc))
->GetEntry(fCurrentEvent);
}
if (targettree != nullptr) {
// normal reading procedure
eve->Initialize();
fBytesRead += fAnalysisTree->GetEntry(fCurrentEvent);
targettree->SetEventInfo(fAnalysisTree);
for (int n = 0; n < fAnalysisTree->GetNumberOfObservables(); n++)
targettree->SetObservable(n, fAnalysisTree->GetObservable(n));
}
if (fEventTree != nullptr) {
if (fEventTree->IsA() == TChain::Class()) {
Long64_t entry = fEventTree->LoadTree(fCurrentEvent);
fBytesRead += ((TBranch*)fEventTree->GetTree()->GetListOfBranches()->UncheckedAt(
fEventBranchLoc))
->GetEntry(entry);
} else {
fBytesRead +=
((TBranch*)fEventTree->GetListOfBranches()->UncheckedAt(fEventBranchLoc))
->GetEntry(fCurrentEvent);
}
fCurrentEvent++;
}
fCurrentEvent++;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/framework/core/src/TRestThread.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ bool TRestThread::TestRun() {
}

fOutputEvent = ProcessedEvent;
fHostRunner->GetNextevtFunc(fInputEvent, fAnalysisTree);
if (fOutputEvent != nullptr) {
RESTDebug << "Output Event ---- " << fOutputEvent->ClassName() << "(" << fOutputEvent << ")"
<< RESTendl;
break;
} else {
RESTDebug << "Null output, trying again" << RESTendl;
}
fHostRunner->GetNextevtFunc(fInputEvent, fAnalysisTree);
}
if (fOutputEvent == nullptr) {
// fOutputEvent = fProcessChain[fProcessChain.size() - 1]->GetOutputEvent();
Expand Down

0 comments on commit 4ca4959

Please sign in to comment.