ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
G4Atlas
G4AtlasServices
src
G4AtlasEventAction.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include <G4Event.hh>
6
7
// Local includes
8
#include "
G4AtlasEventAction.h
"
9
10
namespace
G4UA
11
{
12
13
//---------------------------------------------------------------------------
14
// Constructor
15
//---------------------------------------------------------------------------
16
G4AtlasEventAction::G4AtlasEventAction
()
17
{
18
}
19
20
//---------------------------------------------------------------------------
21
// Begin-event action
22
//---------------------------------------------------------------------------
23
void
G4AtlasEventAction::BeginOfEventAction
(
const
G4Event* event)
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
}
37
38
//---------------------------------------------------------------------------
39
// End-event action
40
//---------------------------------------------------------------------------
41
void
G4AtlasEventAction::EndOfEventAction
(
const
G4Event* event)
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
}
55
56
//---------------------------------------------------------------------------
57
// Add one action to the list
58
//---------------------------------------------------------------------------
59
void
G4AtlasEventAction::addEventAction
(G4UserEventAction* action)
60
{
61
m_eventActions
.push_back(action);
62
}
63
64
}
// namespace G4UA
G4AtlasEventAction.h
G4UA::G4AtlasEventAction::BeginOfEventAction
void BeginOfEventAction(const G4Event *event) override final
Geant4 method for pre-event action.
Definition
G4AtlasEventAction.cxx:23
G4UA::G4AtlasEventAction::m_eventActions
std::vector< G4UserEventAction * > m_eventActions
List of ATLAS event actions.
Definition
G4AtlasEventAction.h:52
G4UA::G4AtlasEventAction::addEventAction
void addEventAction(G4UserEventAction *action)
Add one action to the list.
Definition
G4AtlasEventAction.cxx:59
G4UA::G4AtlasEventAction::EndOfEventAction
void EndOfEventAction(const G4Event *event) override final
Geant4 method for post-event action.
Definition
G4AtlasEventAction.cxx:41
G4UA::G4AtlasEventAction::G4AtlasEventAction
G4AtlasEventAction()
Constructor.
Definition
G4AtlasEventAction.cxx:16
G4UA
for nSW
Definition
CalibrationDefaultProcessing.h:19
Generated on
for ATLAS Offline Software by
1.17.0