|
eventDispenser
|
Distributes events among run numbers and coordinates dynamic digitization initialization. More...
#include <eventDispenser.h>
Public Member Functions | |
| EventDispenser (const std::shared_ptr< GOptions > &gopt, const std::shared_ptr< const gdynamicdigitization::dRoutinesMap > &gdynamicDigitizationMap, std::shared_ptr< GAnalysisAccumulator > analysisAccumulator=nullptr) | |
| Constructs an EventDispenser and prepares the run event distribution. | |
| std::map< int, int > | getRunEvents () |
| Returns the computed run-to-event allocation. | |
| int | getCurrentRun () const |
| Returns the current run number from the internally stored run list. | |
| int | getTotalNumberOfEvents () const |
| Computes the total number of events across all runs. | |
| int | processEvents () |
| Processes all runs by initializing digitization routines and dispatching events. | |
| bool | beamOnIssued () const |
Returns whether at least one /run/beamOn has been issued. | |
| std::chrono::steady_clock::time_point | beamOnStartTime () const |
Returns the wall-clock time of the first /run/beamOn. | |
| void | setNumberOfEvents (int nevts) |
| Sets the total number of events to process in single-run mode. | |
| void | resetRunContext () |
| Force per-run digitization setup to run again on the next event batch. | |
| Public Member Functions inherited from GBase< EventDispenser > | |
| GBase (const std::shared_ptr< GOptions > &gopt, std::string logger_name="") | |
| virtual | ~GBase () |
| GBase & | operator= (const GBase &)=default |
Additional Inherited Members | |
| Protected Attributes inherited from GBase< EventDispenser > | |
| std::shared_ptr< GLogger > | log |
EventDispenser provides a small orchestration layer that:
Definition at line 35 of file eventDispenser.h.
| EventDispenser::EventDispenser | ( | const std::shared_ptr< GOptions > & | gopt, |
| const std::shared_ptr< const gdynamicdigitization::dRoutinesMap > & | gdynamicDigitizationMap, | ||
| std::shared_ptr< GAnalysisAccumulator > | analysisAccumulator = nullptr ) |
During construction, the object reads configuration from gopt and initializes its internal maps and lists. Depending on the configuration, it will either:
| gopt | Parsed module configuration (e.g. run number, number of events, optional weight file). |
| gdynamicDigitizationMap | Map of dynamic digitization routines used to load run-dependent constants and translation tables. |
| analysisAccumulator | GUI-only Analyzer service; null in batch mode. |
Definition at line 37 of file eventDispenser.cc.
|
inlinenodiscard |
Definition at line 193 of file eventDispenser.h.
|
inlinenodiscard |
Definition at line 202 of file eventDispenser.h.
|
inlinenodiscard |
This accessor is meaningful when a run-weight file was used and listOfRuns contains the run sequence. The index is currentRunIndex.
Definition at line 160 of file eventDispenser.h.
|
inline |
The allocation is prepared during construction (or after setNumberOfEvents() is called). Keys are run numbers and values are the number of events assigned to that run.
Definition at line 146 of file eventDispenser.h.
|
nodiscard |
This is the sum of all values in runEvents. In a correctly initialized object, it should match the user-requested event count (option -n), except for edge cases where the distribution inputs are inconsistent.
Definition at line 150 of file eventDispenser.cc.
| int EventDispenser::processEvents | ( | ) |
For each (runNumber, nevents) pair in runEvents, this method:
nevents events for that run (currently a single /run/beamOn call per run allocation entry).Definition at line 161 of file eventDispenser.cc.
| void EventDispenser::resetRunContext | ( | ) |
GUI geometry reloads can replace digitization routines without changing the run number. Resetting the cached run keeps processEvents() from skipping constants/TT setup after a geometry variation change.
Definition at line 109 of file eventDispenser.cc.
| void EventDispenser::setNumberOfEvents | ( | int | nevts | ) |
This method exists primarily for GUI-driven workflows, where the user may adjust the event count interactively. The method clears any existing distribution and assigns all events to userRunno.
| nevts | Total number of events to assign to userRunno. |
Definition at line 104 of file eventDispenser.cc.