ATLAS Offline Software
EnergyLossRecorderTool.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 
12  const std::string& name,
13  const IInterface* parent)
15  m_pmWriter("")
16  {
17  declareProperty("PositionMomentumWriter", m_pmWriter, "");
18  }
19 
21  {
22  if(!m_pmWriter.empty()) {
23  ATH_CHECK(m_pmWriter.retrieve());
24  // FIXME: thread-unsafe usage of a component in a thread-local action?
25  // See ATLASSIM-3562.
26  m_config.pmWriter = &(*m_pmWriter);
27  }
28  return StatusCode::SUCCESS;
29  }
30 
31  std::unique_ptr<EnergyLossRecorder>
33  {
34  ATH_MSG_DEBUG("Constructing an EnergyLossRecorder action");
35  auto action = std::make_unique<EnergyLossRecorder>(m_config);
36  actionList.runActions.push_back( action.get() );
37  actionList.eventActions.push_back( action.get() );
38  actionList.steppingActions.push_back( action.get() );
39  return action;
40  }
41 
42 } // namespace G4UA
G4UA::G4AtlasUserActions
Struct for passing around user actions.
Definition: IUserActionTool.h:32
G4UA
for nSW
Definition: CalibrationDefaultProcessing.h:19
G4UA::EnergyLossRecorderTool::initialize
virtual StatusCode initialize() override final
Athena initialize method.
Definition: EnergyLossRecorderTool.cxx:20
G4UA::EnergyLossRecorderTool::m_config
EnergyLossRecorder::Config m_config
stores the config obtained from the python side
Definition: EnergyLossRecorderTool.h:44
EnergyLossRecorderTool.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
G4UA::EnergyLossRecorder
Definition: EnergyLossRecorder.h:40
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
G4UA::EnergyLossRecorder::Config::pmWriter
Trk::IPositionMomentumWriter * pmWriter
Definition: EnergyLossRecorder.h:46
G4UA::G4AtlasUserActions::runActions
std::vector< G4UserRunAction * > runActions
Definition: IUserActionTool.h:33
G4UA::UserActionToolBase
abstract template utility base-class for G4 user-action tools.
Definition: UserActionToolBase.h:33
G4UA::EnergyLossRecorderTool::makeAndFillAction
virtual std::unique_ptr< EnergyLossRecorder > makeAndFillAction(G4AtlasUserActions &) override final
creates the instance for this thread
Definition: EnergyLossRecorderTool.cxx:32
IPositionMomentumWriter.h
G4UA::EnergyLossRecorderTool::EnergyLossRecorderTool
EnergyLossRecorderTool(const std::string &type, const std::string &name, const IInterface *parent)
standard tool ctor
Definition: EnergyLossRecorderTool.cxx:11
python.CaloScaleNoiseConfig.action
action
Definition: CaloScaleNoiseConfig.py:77
G4UA::EnergyLossRecorderTool::m_pmWriter
ToolHandle< Trk::IPositionMomentumWriter > m_pmWriter
Definition: EnergyLossRecorderTool.h:45
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
G4UA::G4AtlasUserActions::eventActions
std::vector< G4UserEventAction * > eventActions
Definition: IUserActionTool.h:34
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
G4UA::G4AtlasUserActions::steppingActions
std::vector< G4UserSteppingAction * > steppingActions
Definition: IUserActionTool.h:36