-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remollGenExternal should not wrap around when /run/beamOn request too many events #484
Comments
I'm thinking something like this, but the checks in remollVEvent don't agree. diff --git a/src/remollGenExternal.cc b/src/remollGenExternal.cc
index 206215f5..b34a6469 100644
--- a/src/remollGenExternal.cc
+++ b/src/remollGenExternal.cc
@@ -9,6 +9,7 @@
// Geant4 headers
#include "G4ParticleTable.hh"
#include "G4GenericMessenger.hh"
+#include "G4RunManager.hh"
// ROOT headers
#include "TFile.h"
@@ -108,9 +109,10 @@ void remollGenExternal::SamplePhysics(remollVertex* /* vert */, remollEvent* evt
do {
// Read next event from tree and increment
- //fTree->GetEntry(fEntry++);
- if (fEntry >= fEntries)
- fEntry = 0;
+ if (fEntry >= fEntries) {
+ G4RunManager::GetRunManager()->AbortRun();
+ return;
+ }
fTree->GetEntry(fEntry++);
// Weighting completely handled by event file |
What checks are there in remollEventVGen? This seems like it should be sufficient....... |
remollVEventGen checks that the asymmetry etc is set properly. If it isn't, it exits right away. That prevents the run manager from cleanly ending. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment: (where does this bug occur, have you tried other environments)
Steps to reproduce: (give a step by step account of how to trigger the bug)
macros/tests/unit/test_gen_external.mac
to run twice with 100 events:/run/beamOn 100
build/remoll macros/tests/unit/test_gen_external.mac
Expected Result: (what do you expect when you execute the steps above)
The second run should only pick up about 50 events, and it should end then.
Actual Result: (what do you get when you execute the steps above)
It keeps repeating events, e.g.
root -l remollout.root -e 'T->Draw("part.vx:Entry$")'
The text was updated successfully, but these errors were encountered: