ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
G4Utilities
G4UserActions
src
AthenaStackingActionTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
AthenaDebugStackingAction.h
"
6
#include "
AthenaStackingActionTool.h
"
7
8
namespace
G4UA
9
{
10
11
//---------------------------------------------------------------------------
12
// Constructor
13
//---------------------------------------------------------------------------
14
AthenaStackingActionTool::
15
AthenaStackingActionTool
(
const
std::string&
type
,
const
std::string& name,
16
const
IInterface* parent)
17
:
UserActionToolBase
<
AthenaStackingAction
>(
type
, name, parent),
18
m_config
{
/*killAllNeutrinos*/
false,
19
/*photonEnergyCut*/
-1.,
20
/*applyNRR*/
false,
21
/*russianRouletteNeutronThreshold*/
-1.,
22
/*russianRouletteNeutronWeight*/
-1.,
23
/*applyPRR*/
false,
24
/*russianRoulettePhotonThreshold*/
-1.,
25
/*russianRoulettePhotonWeight*/
-1.,
26
/*isISFJob*/
false
27
},
28
m_useDebugAction
(false)
29
{
30
declareProperty(
"KillAllNeutrinos"
,
m_config
.killAllNeutrinos,
31
"Toggle killing of all neutrinos"
);
32
declareProperty(
"PhotonEnergyCut"
,
m_config
.photonEnergyCut,
33
"Energy threshold for tracking photons"
);
34
declareProperty(
"ApplyNRR"
,
m_config
.applyNRR,
35
"Apply the Neutron Russian Roulette"
);
36
declareProperty(
"NRRThreshold"
,
m_config
.russianRouletteNeutronThreshold,
37
"Energy threshold for the Neutron Russian Roulette"
);
38
declareProperty(
"NRRWeight"
,
m_config
.russianRouletteNeutronWeight,
39
"Weight for the Neutron Russian Roulette"
);
40
declareProperty(
"ApplyPRR"
,
m_config
.applyPRR,
41
"Apply the Photon Russian Roulette"
);
42
declareProperty(
"PRRThreshold"
,
m_config
.russianRoulettePhotonThreshold,
43
"Energy threshold for the Photon Russian Roulette"
);
44
declareProperty(
"PRRWeight"
,
m_config
.russianRoulettePhotonWeight,
45
"Weight for the Photon Russian Roulette"
);
46
declareProperty(
"IsISFJob"
,
m_config
.isISFJob,
""
);
47
declareProperty(
"UseDebugAction"
,
m_useDebugAction
);
48
}
49
50
//---------------------------------------------------------------------------
51
// Initialize
52
//---------------------------------------------------------------------------
53
StatusCode
AthenaStackingActionTool::initialize
()
54
{
55
ATH_MSG_DEBUG
(
"Initializing "
<< name() );
56
ATH_MSG_DEBUG
(
"KillAllNeutrinos: "
<<
m_config
.killAllNeutrinos );
57
ATH_MSG_DEBUG
(
"PhotonEnergyCut: "
<<
m_config
.photonEnergyCut );
58
ATH_MSG_DEBUG
(
"RussianRouletteNeutronThreshold: "
<<
m_config
.russianRouletteNeutronThreshold );
59
ATH_MSG_DEBUG
(
"RussianRouletteNeutronWeight: "
<<
m_config
.russianRouletteNeutronWeight );
60
ATH_MSG_DEBUG
(
"RussianRoulettePhotonThreshold: "
<<
m_config
.russianRoulettePhotonThreshold );
61
ATH_MSG_DEBUG
(
"RussianRoulettePhotonWeight: "
<<
m_config
.russianRoulettePhotonWeight );
62
return
StatusCode::SUCCESS;
63
}
64
65
//---------------------------------------------------------------------------
66
// Create the action on request
67
//---------------------------------------------------------------------------
68
std::unique_ptr<AthenaStackingAction>
69
AthenaStackingActionTool::makeAndFillAction
(
G4AtlasUserActions
& actionLists)
70
{
71
ATH_MSG_DEBUG
(
"Creating an AthenaStackingAction"
);
72
// Create and configure the action plugin.
73
std::unique_ptr<AthenaStackingAction> action{
nullptr
};
74
if
(
m_useDebugAction
) {
75
action = std::make_unique<AthenaDebugStackingAction>(
m_config
);
76
}
else
{
77
action = std::make_unique<AthenaStackingAction>(
m_config
);
78
}
79
actionLists.
stackingActions
.push_back( action.get() );
80
return
action;
81
}
82
83
}
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
AthenaDebugStackingAction.h
AthenaStackingActionTool.h
G4UA::AthenaStackingActionTool::initialize
virtual StatusCode initialize() override final
Initialize the tool.
Definition
AthenaStackingActionTool.cxx:53
G4UA::AthenaStackingActionTool::m_config
AthenaStackingAction::Config m_config
Configuration parameters.
Definition
AthenaStackingActionTool.h:48
G4UA::AthenaStackingActionTool::m_useDebugAction
bool m_useDebugAction
Use the debug version of the stacking action.
Definition
AthenaStackingActionTool.h:51
G4UA::AthenaStackingActionTool::makeAndFillAction
virtual std::unique_ptr< AthenaStackingAction > makeAndFillAction(G4AtlasUserActions &actionLists) override final
Make the action and push onto the lists.
Definition
AthenaStackingActionTool.cxx:69
G4UA::AthenaStackingActionTool::AthenaStackingActionTool
AthenaStackingActionTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Definition
AthenaStackingActionTool.cxx:15
G4UA::AthenaStackingAction
Standard ATLAS stacking action functionality.
Definition
AthenaStackingAction.h:23
G4UA::UserActionToolBase< AthenaStackingAction >::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::stackingActions
std::vector< G4UserStackingAction * > stackingActions
Definition
IUserActionTool.h:42
type
Generated on
for ATLAS Offline Software by
1.17.0