ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
G4Atlas
G4AtlasServices
src
G4AtlasRunAction.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// Local includes
6
#include "
G4AtlasRunAction.h
"
7
8
namespace
G4UA
9
{
10
11
//---------------------------------------------------------------------------
12
// Constructor
13
//---------------------------------------------------------------------------
14
G4AtlasRunAction::G4AtlasRunAction
():
fTimer
(
std
::make_unique<G4Timer>())
15
{
16
}
17
18
//---------------------------------------------------------------------------
19
// Begin-run action
20
//---------------------------------------------------------------------------
21
void
G4AtlasRunAction::BeginOfRunAction
(
const
G4Run*
run
)
22
{
23
// Loop over my pre-actions and apply each one in turn
24
for
(
auto
action :
m_runActions
){
25
action->BeginOfRunAction(
run
);
26
}
27
fTimer
->Start();
28
29
}
30
31
//---------------------------------------------------------------------------
32
// End-run action
33
//---------------------------------------------------------------------------
34
void
G4AtlasRunAction::EndOfRunAction
(
const
G4Run*
run
)
35
{
36
fTimer
->Stop();
37
G4cout <<
" ======================================================"
<< G4endl;
38
G4cout <<
" Time: "
<< *
fTimer
<< G4endl;
39
G4cout <<
" ======================================================"
<< G4endl;
40
// Loop over my post-actions and apply each one in turn
41
for
(
auto
action :
m_runActions
){
42
action->EndOfRunAction(
run
);
43
}
44
}
45
46
//---------------------------------------------------------------------------
47
// Add one action to the list
48
//---------------------------------------------------------------------------
49
void
G4AtlasRunAction::addRunAction
(G4UserRunAction* action)
50
{
51
m_runActions
.push_back(action);
52
}
53
54
}
// namespace G4UA
G4AtlasRunAction.h
G4UA::G4AtlasRunAction::m_runActions
std::vector< G4UserRunAction * > m_runActions
List of ATLAS run actions.
Definition
G4AtlasRunAction.h:52
G4UA::G4AtlasRunAction::G4AtlasRunAction
G4AtlasRunAction()
Constructor.
Definition
G4AtlasRunAction.cxx:14
G4UA::G4AtlasRunAction::addRunAction
void addRunAction(G4UserRunAction *action)
Add one action to the list.
Definition
G4AtlasRunAction.cxx:49
G4UA::G4AtlasRunAction::BeginOfRunAction
void BeginOfRunAction(const G4Run *run) override final
Geant4 method for pre-run action.
Definition
G4AtlasRunAction.cxx:21
G4UA::G4AtlasRunAction::fTimer
std::unique_ptr< G4Timer > fTimer
Definition
G4AtlasRunAction.h:53
G4UA::G4AtlasRunAction::EndOfRunAction
void EndOfRunAction(const G4Run *run) override final
Geant4 method for post-run action.
Definition
G4AtlasRunAction.cxx:34
G4UA
for nSW
Definition
CalibrationDefaultProcessing.h:19
std
STL namespace.
run
int run(int argc, char *argv[])
Definition
ttree2hdf5.cxx:28
Generated on
for ATLAS Offline Software by
1.17.0