ATLAS Offline Software
Loading...
Searching...
No Matches
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
7
8namespace G4UA
9{
10
11 //---------------------------------------------------------------------------
12 // Constructor
13 //---------------------------------------------------------------------------
15 AthenaStackingActionTool(const std::string& type, const std::string& name,
16 const IInterface* 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 //---------------------------------------------------------------------------
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>
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}
#define ATH_MSG_DEBUG(x)
virtual StatusCode initialize() override final
Initialize the tool.
AthenaStackingAction::Config m_config
Configuration parameters.
bool m_useDebugAction
Use the debug version of the stacking action.
virtual std::unique_ptr< AthenaStackingAction > makeAndFillAction(G4AtlasUserActions &actionLists) override final
Make the action and push onto the lists.
AthenaStackingActionTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Standard ATLAS stacking action functionality.
UserActionToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Struct for passing around user actions.
std::vector< G4UserStackingAction * > stackingActions