Add a max_events setting. (#2945)

Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
Patrick Shriwise 2024-04-11 12:09:23 -05:00 committed by GitHub
parent cfebe16127
commit 9fd096b843
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 59 additions and 16 deletions

View file

@ -96,6 +96,7 @@ int32_t gen_per_batch {1};
int64_t n_particles {-1};
int64_t max_particles_in_flight {100000};
int max_particle_events {1000000};
ElectronTreatment electron_treatment {ElectronTreatment::TTB};
array<double, 4> energy_cutoff {0.0, 1000.0, 0.0, 0.0};
@ -156,6 +157,12 @@ void get_run_parameters(pugi::xml_node node_base)
std::stoll(get_node_value(node_base, "max_particles_in_flight"));
}
// Get maximum number of events allowed per particle
if (check_for_node(node_base, "max_particle_events")) {
max_particle_events =
std::stoll(get_node_value(node_base, "max_particle_events"));
}
// Get number of basic batches
if (check_for_node(node_base, "batches")) {
n_batches = std::stoi(get_node_value(node_base, "batches"));