ATLAS Offline Software
Loading...
Searching...
No Matches
LengthIntegratorTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7namespace G4UA
8{
9
10 //---------------------------------------------------------------------------
11 // Constructor
12 //---------------------------------------------------------------------------
14 const std::string& name,
15 const IInterface* parent)
17 m_hSvc("THistSvc", name)
18 {
19 declareProperty("HistoSvc", m_hSvc);
20 declareProperty("CreateHistograms", m_doHistos=true);
21
22 }
23
24 //---------------------------------------------------------------------------
25 // Initialize - temporarily here for debugging
26 //---------------------------------------------------------------------------
28 {
29 ATH_MSG_DEBUG("initialize");
30
31 ATH_CHECK( m_hSvc.retrieve() );
32
33 return StatusCode::SUCCESS;
34 }
35
36 //---------------------------------------------------------------------------
37 // Create the action on request
38 //---------------------------------------------------------------------------
39 std::unique_ptr<LengthIntegrator>
41 {
42 ATH_MSG_DEBUG("Making a LengthIntegrator action");
43 auto action = std::make_unique<LengthIntegrator>( m_hSvc.name(), m_doHistos );
44 actionList.eventActions.push_back( action.get() );
45 actionList.steppingActions.push_back( action.get() );
46 return action;
47 }
48
49}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
LengthIntegratorTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
virtual StatusCode initialize() override
Initialize the tool.
virtual std::unique_ptr< LengthIntegrator > makeAndFillAction(G4AtlasUserActions &) override final
Create aciton for this thread.
ServiceHandle< ITHistSvc > m_hSvc
Handle to the histogram service.
A user action used to evaluate thickness of all detectors traversed by outgoing particles.
UserActionToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Struct for passing around user actions.
std::vector< G4UserSteppingAction * > steppingActions
std::vector< G4UserEventAction * > eventActions