ATLAS Offline Software
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 
8 namespace 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 }
G4UA::G4AtlasUserActions
Struct for passing around user actions.
Definition: IUserActionTool.h:32
G4UA::AthenaStackingAction::Config::photonEnergyCut
double photonEnergyCut
Photon energy cut.
Definition: AthenaStackingAction.h:33
G4UA
for nSW
Definition: CalibrationDefaultProcessing.h:19
AthenaDebugStackingAction.h
G4UA::AthenaStackingAction::Config::russianRouletteNeutronThreshold
double russianRouletteNeutronThreshold
Energy threshold for the Neutron Russian Roulette.
Definition: AthenaStackingAction.h:37
G4UA::AthenaStackingAction::Config::russianRoulettePhotonThreshold
double russianRoulettePhotonThreshold
Energy threshold for the Photon Russian Roulette.
Definition: AthenaStackingAction.h:43
G4UA::AthenaStackingAction::Config::killAllNeutrinos
bool killAllNeutrinos
Flag to toggle killing neutrinos at tracking stage.
Definition: AthenaStackingAction.h:31
G4UA::AthenaStackingAction::Config::russianRoulettePhotonWeight
double russianRoulettePhotonWeight
Weight for the Photon Russian Roulette.
Definition: AthenaStackingAction.h:45
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
G4UA::AthenaStackingActionTool::initialize
virtual StatusCode initialize() override final
Initialize the tool.
Definition: AthenaStackingActionTool.cxx:53
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
G4UA::AthenaStackingAction
Standard ATLAS stacking action functionality. Mostly taken from the old AthenaStackingAction implemen...
Definition: AthenaStackingAction.h:23
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
AthenaStackingActionTool.h
G4UA::UserActionToolBase
abstract template utility base-class for G4 user-action tools.
Definition: UserActionToolBase.h:33
G4UA::G4AtlasUserActions::stackingActions
std::vector< G4UserStackingAction * > stackingActions
Definition: IUserActionTool.h:37
python.CaloScaleNoiseConfig.action
action
Definition: CaloScaleNoiseConfig.py:77
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
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::AthenaStackingAction::Config::russianRouletteNeutronWeight
double russianRouletteNeutronWeight
Weight for the Neutron Russian Roulette.
Definition: AthenaStackingAction.h:39
G4UA::AthenaStackingActionTool::m_config
AthenaStackingAction::Config m_config
Configuration parameters.
Definition: AthenaStackingActionTool.h:48
G4UA::AthenaStackingActionTool::AthenaStackingActionTool
AthenaStackingActionTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Definition: AthenaStackingActionTool.cxx:15
G4UA::AthenaStackingActionTool::m_useDebugAction
bool m_useDebugAction
Use the debug version of the stacking action.
Definition: AthenaStackingActionTool.h:51