actions
Loading...
Searching...
No Matches
GRunAction Class Reference

Handles run begin/end callbacks and creates the per-thread run object. More...

#include <gRunAction.h>

Public Member Functions

 GRunAction (std::shared_ptr< GOptions > gopts, std::shared_ptr< gdynamicdigitization::dRoutinesMap > digi_map)
 Constructs the run action.
 
auto get_digitization_routines_map () const -> std::shared_ptr< gdynamicdigitization::dRoutinesMap >
 Returns the shared digitization routines map.
 
auto get_streamer_map () const -> std::shared_ptr< const gstreamer::gstreamersMap >
 Returns the per-thread streamer map, if it has been created.
 
- Public Member Functions inherited from GBase< GRunAction >
 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 ()
 
GBaseoperator= (const GBase &)=default
 
GBaseoperator= (GBase &&) noexcept=default
 

Additional Inherited Members

- Protected Attributes inherited from GBase< GRunAction >
std::shared_ptr< GLoggerlog
 

Detailed Description

Responsibilities:

  • Create the per-thread run object (GRun) via GenerateRun().
  • At the start of each run on worker threads, create the per-thread streamer map (once) and open streamer connections for the run.
  • At the end of each run on worker threads, close streamer connections.

Threading:

  • Worker threads own their local streamer map instance.
  • The master thread typically does not create streamers and primarily exists to coordinate the run lifecycle.

Definition at line 54 of file gRunAction.h.

Constructor & Destructor Documentation

◆ GRunAction()

GRunAction::GRunAction ( std::shared_ptr< GOptions > gopts,
std::shared_ptr< gdynamicdigitization::dRoutinesMap > digi_map )
Parameters
goptsShared configuration used by the run action and by the created run object.
digi_mapShared digitization routines map to be passed into the created run object.

Definition at line 12 of file gRunAction.cc.

Member Function Documentation

◆ get_digitization_routines_map()

auto GRunAction::get_digitization_routines_map ( ) const -> std::shared_ptr<gdynamicdigitization::dRoutinesMap>
inline

This map is used by event-level logic to select the correct digitization routine for each hit collection.

Returns
Shared pointer to the digitization routines map.

Definition at line 72 of file gRunAction.h.

◆ get_streamer_map()

auto GRunAction::get_streamer_map ( ) const -> std::shared_ptr<const gstreamer::gstreamersMap>
inline

The map is instantiated lazily for worker threads at the beginning of a run.

Returns
Shared pointer to the streamer map (may be nullptr if not yet created or on master).

Definition at line 83 of file gRunAction.h.


The documentation for this class was generated from the following files: