actions
Loading...
Searching...
No Matches
gEventAction.h
Go to the documentation of this file.
1#pragma once
2
3// geant4
4#include "G4UserEventAction.hh"
5
6// gemc
7#include "gbase.h"
8#include "../run/gRunAction.h"
9
17constexpr const char* EVENTACTION_LOGGER = "geventaction";
18
24namespace geventaction {
31} // namespace geventaction
32
33
54class GEventAction : public GBase<GEventAction>, public G4UserEventAction {
55public:
63 GEventAction(const std::shared_ptr<GOptions>& gopt, GRunAction* run_a);
64
72 void BeginOfEventAction(const G4Event* event) override;
73
84 void EndOfEventAction(const G4Event* event) override;
85
86private:
90 std::shared_ptr<GOptions> goptions;
91
99 GRunAction* run_action;
100};
101
102
103// looping over output factories
104// for (auto [factoryName, streamerFactory] : *gstreamerFactoryMap) {
105// if (streamerFactory->getStreamType() == "event") {
106// logSummary("Writing event data using streamer factory >" + factoryName + "<");
107// map<string, bool> streamReport = streamerFactory->publishEventRunData(goptions, theRun->getRunData());
108//
109// for (auto [reportName, result] : streamReport) {
110// string resultString = result ? " success" : " failure";
111// logSummary("Factory <" + factoryName + "> " + reportName + resultString);
112// }
113// }
114// }
Handles event begin/end callbacks and triggers digitization + streaming.
void EndOfEventAction(const G4Event *event) override
Called by Geant4 at the end of an event.
void BeginOfEventAction(const G4Event *event) override
Called by Geant4 at the beginning of an event.
GEventAction(const std::shared_ptr< GOptions > &gopt, GRunAction *run_a)
Constructs the event action.
Handles run begin/end callbacks and creates the per-thread run object.
Definition gRunAction.h:54
constexpr const char * EVENTACTION_LOGGER
Declares GRunAction, responsible for run lifecycle hooks and run object creation.
Namespace collecting helpers for the event action.
GOptions defineOptions()
Returns the options associated with the event action.