ATLAS Offline Software
Loading...
Searching...
No Matches
G4UA::G4AtlasEventAction Class Reference

ATLAS subclass of the G4 event action. More...

#include <G4AtlasEventAction.h>

Inheritance diagram for G4UA::G4AtlasEventAction:
Collaboration diagram for G4UA::G4AtlasEventAction:

Public Member Functions

 G4AtlasEventAction ()
 Constructor.
void BeginOfEventAction (const G4Event *event) override final
 Geant4 method for pre-event action.
void EndOfEventAction (const G4Event *event) override final
 Geant4 method for post-event action.
void addEventAction (G4UserEventAction *action)
 Add one action to the list.

Private Attributes

std::vector< G4UserEventAction * > m_eventActions
 List of ATLAS event actions.

Detailed Description

ATLAS subclass of the G4 event action.

Maintains a list of custom actions for the beginning and end of an event and when invoked by Geant4 will forward the call to each of them in turn.

Todo
TODO lifetime management of wrapper actions.
Author
Steve Farrell Steve.nosp@m.n.Fa.nosp@m.rrell.nosp@m.@cer.nosp@m.n.ch

Definition at line 28 of file G4AtlasEventAction.h.

Constructor & Destructor Documentation

◆ G4AtlasEventAction()

G4UA::G4AtlasEventAction::G4AtlasEventAction ( )

Constructor.

Definition at line 16 of file G4AtlasEventAction.cxx.

17 {
18 }

Member Function Documentation

◆ addEventAction()

void G4UA::G4AtlasEventAction::addEventAction ( G4UserEventAction * action)

Add one action to the list.

Definition at line 59 of file G4AtlasEventAction.cxx.

60 {
61 m_eventActions.push_back(action);
62 }
std::vector< G4UserEventAction * > m_eventActions
List of ATLAS event actions.

◆ BeginOfEventAction()

void G4UA::G4AtlasEventAction::BeginOfEventAction ( const G4Event * event)
finaloverride

Geant4 method for pre-event action.

This method forwards the G4 call onto each of its pre-event ATLAS actions.

Definition at line 23 of file G4AtlasEventAction.cxx.

24 {
25 // Loop over my pre-actions and apply each one in turn
26 for(auto action : m_eventActions){
27 action->BeginOfEventAction(event);
28 if(event->IsAborted()) {
29 if(event->GetUserInformation()) {
30 // no user information means an empty event, skip message
31 G4cout << "G4AtlasEventAction: Event was aborted in BeginOfEventAction, skipping further actions" << G4endl;
32 }
33 break;
34 }
35 }
36 }

◆ EndOfEventAction()

void G4UA::G4AtlasEventAction::EndOfEventAction ( const G4Event * event)
finaloverride

Geant4 method for post-event action.

This method forwards the G4 call onto each of its post-event ATLAS actions.

Definition at line 41 of file G4AtlasEventAction.cxx.

42 {
43 // Loop over my post-actions and apply each one in turn
44 for(auto action : m_eventActions){
45 action->EndOfEventAction(event);
46 if(event->IsAborted()) {
47 if(event->GetUserInformation()) {
48 // no user information means an empty event, skip message
49 G4cout << "G4AtlasEventAction: Event was aborted in EndOfEventAction, skipping further actions" << G4endl;
50 }
51 break;
52 }
53 }
54 }

Member Data Documentation

◆ m_eventActions

std::vector<G4UserEventAction*> G4UA::G4AtlasEventAction::m_eventActions
private

List of ATLAS event actions.

Definition at line 52 of file G4AtlasEventAction.h.


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