3#include <gemc/gbase/gbase.h>
4#include <gemc/gdynamicDigitization/gdynamicdigitization.h>
51 const std::shared_ptr<const gdynamicdigitization::dRoutinesMap>& gdynamicDigitizationMap);
66 bool offscreen_screenshots =
false;
69 int currentRunno = -1;
79 std::map<int, double> runWeights;
82 std::map<int, int> runEvents;
85 std::vector<int> listOfRuns;
88 int currentRunIndex{};
91 std::optional<std::chrono::steady_clock::time_point> beamOnTime;
109 void distributeEvents(
int nevents_to_process);
117 void setNextRun() { currentRunIndex++; }
128 std::shared_ptr<const gdynamicdigitization::dRoutinesMap> gDigitizationMap;
154 [[nodiscard]]
int getCurrentRun()
const {
return listOfRuns[currentRunIndex]; }
187 [[nodiscard]]
bool beamOnIssued()
const {
return beamOnTime.has_value(); }
196 [[nodiscard]] std::chrono::steady_clock::time_point
beamOnStartTime()
const {
return beamOnTime.value(); }
Distributes events among run numbers and coordinates dynamic digitization initialization.
void resetRunContext()
Force per-run digitization setup to run again on the next event batch.
bool beamOnIssued() const
Returns whether at least one /run/beamOn has been issued.
int processEvents()
Processes all runs by initializing digitization routines and dispatching events.
std::chrono::steady_clock::time_point beamOnStartTime() const
Returns the wall-clock time of the first /run/beamOn.
EventDispenser(const std::shared_ptr< GOptions > &gopt, const std::shared_ptr< const gdynamicdigitization::dRoutinesMap > &gdynamicDigitizationMap)
Constructs an EventDispenser and prepares the run event distribution.
int getCurrentRun() const
Returns the current run number from the internally stored run list.
void setNumberOfEvents(int nevts)
Sets the total number of events to process in single-run mode.
int getTotalNumberOfEvents() const
Computes the total number of events across all runs.
std::map< int, int > getRunEvents()
Returns the computed run-to-event allocation.