ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
G4Utilities
G4UserActions
src
LooperKillerTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LooperKillerTool.h
"
6
7
namespace
G4UA
8
{
9
10
//---------------------------------------------------------------------------
11
// Constructor
12
//---------------------------------------------------------------------------
13
LooperKillerTool::LooperKillerTool
(
const
std::string&
type
,
const
std::string& name,
14
const
IInterface* parent)
15
:
UserActionToolBase
<
LooperKiller
>(
type
, name, parent)
16
{
17
declareProperty(
"MaxSteps"
,
m_config
.MaxSteps);
18
declareProperty(
"PrintSteps"
,
m_config
.PrintSteps);
19
declareProperty(
"VerboseLevel"
,
m_config
.VerboseLevel);
20
declareProperty(
"AbortEvent"
,
m_config
.AbortEvent);
21
declareProperty(
"SetError"
,
m_config
.SetError);
22
declareProperty(
"BSM_Only"
,
m_config
.BSM_Only);
23
}
24
25
//---------------------------------------------------------------------------
26
// Initialize - temporarily here for debugging
27
//---------------------------------------------------------------------------
28
StatusCode
LooperKillerTool::initialize
()
29
{
30
ATH_MSG_DEBUG
(
"initialize"
);
31
return
StatusCode::SUCCESS;
32
}
33
34
StatusCode
LooperKillerTool::finalize
()
35
{
36
ATH_MSG_DEBUG
(
"finalize"
);
37
38
// Accumulate the results across threads
39
LooperKiller::Report
report;
40
m_actions
.accumulate(report, &
LooperKiller::getReport
,
41
&
LooperKiller::Report::merge
);
42
43
ATH_MSG_INFO
(
"******* Report from "
<< name()<<
" *******"
);
44
ATH_MSG_INFO
(
" Set to kill tracks over "
<<
m_config
.MaxSteps <<
" steps"
);
45
ATH_MSG_INFO
(
" and give "
<<
m_config
.PrintSteps <<
" steps of verbose output"
);
46
ATH_MSG_INFO
(
" We killed "
<< report.killed_tracks <<
" tracks this run."
);
47
ATH_MSG_INFO
(
" Was set to "
<< (
m_config
.AbortEvent?
""
:
"not "
) <<
"abort events and "
);
48
ATH_MSG_INFO
( (
m_config
.SetError?
""
:
"not "
) <<
"set an error state."
);
49
50
return
StatusCode::SUCCESS;
51
}
52
53
54
//---------------------------------------------------------------------------
55
// Create the action on request
56
//---------------------------------------------------------------------------
57
std::unique_ptr<LooperKiller>
58
LooperKillerTool::makeAndFillAction
(
G4AtlasUserActions
& actionList)
59
{
60
ATH_MSG_DEBUG
(
"Making a LooperKiller action"
);
61
auto
action = std::make_unique<LooperKiller>(
m_config
);
62
actionList.
steppingActions
.push_back( action.get() );
63
return
action;
64
}
65
66
}
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
ATH_MSG_INFO
#define ATH_MSG_INFO(x,...)
Definition
AthMsgStreamMacros.h:45
LooperKillerTool.h
G4UA::LooperKillerTool::m_config
G4UA::LooperKiller::Config m_config
Configuration parameters.
Definition
LooperKillerTool.h:48
G4UA::LooperKillerTool::initialize
virtual StatusCode initialize() override
Definition
LooperKillerTool.cxx:28
G4UA::LooperKillerTool::LooperKillerTool
LooperKillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Definition
LooperKillerTool.cxx:13
G4UA::LooperKillerTool::finalize
virtual StatusCode finalize() override
Definition
LooperKillerTool.cxx:34
G4UA::LooperKillerTool::makeAndFillAction
virtual std::unique_ptr< LooperKiller > makeAndFillAction(G4AtlasUserActions &) override final
Create action for this thread.
Definition
LooperKillerTool.cxx:58
G4UA::LooperKiller
A user action to kill looping tracks.
Definition
LooperKiller.h:23
G4UA::LooperKiller::getReport
const Report & getReport() const
Retrieve results.
Definition
LooperKiller.h:49
G4UA::UserActionToolBase< LooperKiller >::m_actions
ThreadSpecificUserAction< LooperKiller > m_actions
Definition
UserActionToolBase.h:70
G4UA::UserActionToolBase< LooperKiller >::UserActionToolBase
UserActionToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Definition
UserActionToolBase.h:40
G4UA
for nSW
Definition
CalibrationDefaultProcessing.h:19
G4UA::G4AtlasUserActions
Struct for passing around user actions.
Definition
IUserActionTool.h:35
G4UA::G4AtlasUserActions::steppingActions
std::vector< G4UserSteppingAction * > steppingActions
Definition
IUserActionTool.h:41
G4UA::LooperKiller::Report
Definition
LooperKiller.h:38
G4UA::LooperKiller::Report::merge
void merge(const Report &rep)
Definition
LooperKiller.h:40
type
Generated on
for ATLAS Offline Software by
1.17.0