actions
Loading...
Searching...
No Matches
gaction.h
Go to the documentation of this file.
1#pragma once
2
3// geant4
4#include "G4VUserActionInitialization.hh"
5
6// gemc
7#include <gemc/gbase/gbase.h>
8#include <gemc/gdynamicDigitization/gdynamicdigitization.h>
9#include <gemc/gstreamer/gstreamer.h>
10
11// the other actions, so we can define the options all at once
12#include "event/gEventAction.h"
13#include "run/gRunAction.h"
14#include "run/gRun.h"
16
29constexpr const char* GACTION_LOGGER = "gaction";
30
63
64
94class GAction : public GBase<GAction>, public G4VUserActionInitialization {
95public:
102 explicit GAction(std::shared_ptr<GOptions> gopts,
103 std::shared_ptr<gdynamicdigitization::dRoutinesMap> digi_map);
104
105 ~GAction() override = default;
106
107 GAction(const GAction&) = delete;
108 GAction& operator=(const GAction&) = delete;
109 GAction(GAction&&) = delete;
111
128 void Build() const override;
129
137 void BuildForMaster() const override;
138
139private:
147 std::shared_ptr<GOptions> goptions;
148
155 std::shared_ptr<gdynamicdigitization::dRoutinesMap> digitization_routines_map;
156
164 std::shared_ptr<std::vector<GparticlePtr>> sharedParticles_;
165
166public:
168 std::shared_ptr<std::vector<GparticlePtr>> getSharedParticles() const { return sharedParticles_; }
169};
Registers GEMC user actions for worker threads, sequential execution, and the master thread.
Definition gaction.h:94
GAction(std::shared_ptr< GOptions > gopts, std::shared_ptr< gdynamicdigitization::dRoutinesMap > digi_map)
Constructs the action initializer used by the Geant4 run manager.
Definition gaction.cc:12
GAction(const GAction &)=delete
std::shared_ptr< std::vector< GparticlePtr > > getSharedParticles() const
Returns the shared particle list so the pmaker GUI can wire its tabs to the same objects.
Definition gaction.h:168
~GAction() override=default
GAction(GAction &&)=delete
void Build() const override
Registers the user actions required by worker threads and sequential execution.
Definition gaction.cc:37
void BuildForMaster() const override
Registers the user actions required by the master thread.
Definition gaction.cc:28
GAction & operator=(const GAction &)=delete
GAction & operator=(GAction &&)=delete
Declares GEventAction, the per-event processing action for the GEMC actions module.
Declares GPrimaryGeneratorAction, the primary-particle generation action for the GEMC actions module.
Declares GRunAction, the run-lifecycle action for the GEMC actions module.
Declares GRun, the thread-local run container used by the GEMC actions module.
constexpr const char * GACTION_LOGGER
Definition gaction.h:29
Namespace containing helpers related to action-subsystem configuration.
Definition gaction.h:39
GOptions defineOptions()
Builds the aggregate option set required by the actions subsystem.
Definition gaction.h:53
GOptions defineOptions()
Returns the options associated with the event-action logger scope.
GOptions defineOptions()
Returns the options associated with the primary-generator action scope.
GOptions defineOptions()
Returns the options associated with the run-container logger scope.
Definition gRun.h:32
GOptions defineOptions()
Returns the options associated with the run-action logger scope.
Definition gRunAction.h:38