ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
G4Utilities
G4UserActions
src
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
5
#include "
LengthIntegratorTool.h
"
6
7
namespace
G4UA
8
{
9
10
//---------------------------------------------------------------------------
11
// Constructor
12
//---------------------------------------------------------------------------
13
LengthIntegratorTool::LengthIntegratorTool
(
const
std::string&
type
,
14
const
std::string& name,
15
const
IInterface* parent)
16
:
UserActionToolBase
<
LengthIntegrator
>(
type
, name, 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
//---------------------------------------------------------------------------
27
StatusCode
LengthIntegratorTool::initialize
()
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>
40
LengthIntegratorTool::makeAndFillAction
(
G4AtlasUserActions
& actionList)
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
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
LengthIntegratorTool.h
G4UA::LengthIntegratorTool::LengthIntegratorTool
LengthIntegratorTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Definition
LengthIntegratorTool.cxx:13
G4UA::LengthIntegratorTool::initialize
virtual StatusCode initialize() override
Initialize the tool.
Definition
LengthIntegratorTool.cxx:27
G4UA::LengthIntegratorTool::makeAndFillAction
virtual std::unique_ptr< LengthIntegrator > makeAndFillAction(G4AtlasUserActions &) override final
Create aciton for this thread.
Definition
LengthIntegratorTool.cxx:40
G4UA::LengthIntegratorTool::m_doHistos
bool m_doHistos
Definition
LengthIntegratorTool.h:51
G4UA::LengthIntegratorTool::m_hSvc
ServiceHandle< ITHistSvc > m_hSvc
Handle to the histogram service.
Definition
LengthIntegratorTool.h:47
G4UA::LengthIntegrator
A user action used to evaluate thickness of all detectors traversed by outgoing particles.
Definition
LengthIntegrator.h:41
G4UA::UserActionToolBase< LengthIntegrator >::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::steppingActions
std::vector< G4UserSteppingAction * > steppingActions
Definition
IUserActionTool.h:41
G4UA::G4AtlasUserActions::eventActions
std::vector< G4UserEventAction * > eventActions
Definition
IUserActionTool.h:39
type
Generated on
for ATLAS Offline Software by
1.17.0