eventDispenser
Loading...
Searching...
No Matches
event_dispenser_example.cc
Go to the documentation of this file.
1
45#include "eventDispenser.h"
47#include "goptions.h"
48
49#include <map>
50#include <string>
51
52const std::string plugin_name = "test_gdynamic_plugin";
53
69int main(int argc, char *argv[]) {
70 // Build the option definition set for this module and parse command-line arguments.
71 auto gopts = std::make_shared<GOptions>(argc, argv, eventDispenser::defineOptions());
72
73 // Create the global map of digitization routines.
74 // In a full simulation, this map would contain the digitization plugins needed by the detectors.
75 auto dynamicRoutinesMap = gdynamicdigitization::dynamicRoutinesMap({plugin_name}, gopts);
76
77 // Instantiate the EventDispenser with parsed options and the digitization routine map.
78 EventDispenser eventDisp(gopts, dynamicRoutinesMap);
79
80 // Retrieve the run-to-event allocation computed during construction.
81 // This can be used by applications to report expected run statistics or validate configuration.
82 std::map<int, int> runEvents = eventDisp.getRunEvents();
83 (void)runEvents; // suppress unused-variable warnings in minimal builds
84
85 // Execute the processing loop: per-run initialization + event dispatch.
86 eventDisp.processEvents();
87
88 return EXIT_SUCCESS;
89}
Distributes events among run numbers and coordinates dynamic digitization initialization.
Declares the EventDispenser class.
Public declaration of the Event Dispenser module command-line / configuration options.
const std::string plugin_name
GOptions defineOptions()
Builds and returns the complete set of options supported by the Event Dispenser module.
std::shared_ptr< const dRoutinesMap > dynamicRoutinesMap(const std::vector< std::string > &plugin_names, const std::shared_ptr< GOptions > &gopts)
int main(int argc, char *argv[])