|
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) | |
| 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. | |
| void | setNumberOfEvents (int nevts) |
| Sets the total number of events to process in single-run mode. | |
Public Member Functions inherited from GBase< EventDispenser > | |
| GBase (const std::shared_ptr< GOptions > &gopt, std::string logger_name="") | |
| GBase (const std::shared_ptr< GLogger > &logger) | |
| GBase (const GBase &)=default | |
| GBase (GBase &&) noexcept=default | |
| virtual | ~GBase () |
| GBase & | operator= (const GBase &)=default |
| GBase & | operator= (GBase &&) noexcept=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 32 of file eventDispenser.h.
| EventDispenser::EventDispenser | ( | const std::shared_ptr< GOptions > & | gopt, |
| const std::shared_ptr< const gdynamicdigitization::dRoutinesMap > & | gdynamicDigitizationMap ) |
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. |
Definition at line 25 of file eventDispenser.cc.
|
inline |
This accessor is meaningful when a run-weight file was used and listOfRuns contains the run sequence. The index is currentRunIndex.
Definition at line 149 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 135 of file eventDispenser.h.
| int EventDispenser::getTotalNumberOfEvents | ( | ) | const |
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 113 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 124 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 80 of file eventDispenser.cc.