ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkAlgorithms
TrkTrackSlimmer
src
TrackSlimmer.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// TrackSlimmer.cxx, (c) ATLAS Detector software
8
9
#include "
TrkTrackSlimmer/TrackSlimmer.h
"
10
#include "
AthContainers/ConstDataVector.h
"
11
12
Trk::TrackSlimmer::TrackSlimmer
(
const
std::string& name,
13
ISvcLocator* pSvcLocator)
14
:
AthReentrantAlgorithm
(name, pSvcLocator) {}
15
16
Trk::TrackSlimmer::~TrackSlimmer
() =
default
;
17
18
StatusCode
19
Trk::TrackSlimmer::initialize
()
20
{
21
if
(
m_slimTool
.retrieve().isFailure()) {
22
ATH_MSG_ERROR
(
"Failed to retrieve TrkTrackSlimmingTool tool "
23
<<
m_slimTool
);
24
return
StatusCode::FAILURE;
25
}
26
ATH_CHECK
(
m_trackLocation
.initialize());
27
return
StatusCode::SUCCESS;
28
}
29
30
StatusCode
31
Trk::TrackSlimmer::finalize
()
32
{
33
return
StatusCode::SUCCESS;
34
}
35
36
StatusCode
37
Trk::TrackSlimmer::execute
(
const
EventContext& ctx)
const
38
{
39
auto
InputHandles =
m_trackLocation
.makeHandles(ctx);
40
auto
InputIt = InputHandles.begin();
41
auto
InputE = InputHandles.end();
42
for
(; InputIt != InputE; ++InputIt) {
43
auto
& trackLocation = *InputIt;
44
if
(trackLocation.isValid()) {
45
// loop through tracks, slimming them as you go.
46
TrackCollection::const_iterator
it = trackLocation->begin();
47
TrackCollection::const_iterator
itEnd = trackLocation->end();
48
for
(; it != itEnd; ++it) {
49
m_slimTool
->slimConstTrack(**it);
50
}
// Loop over Trk::Track
51
}
// is valid
52
}
// loop over input collections
53
54
return
StatusCode::SUCCESS;
55
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ConstDataVector.h
DataVector adapter that acts like it holds const pointers.
TrackSlimmer.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
DataVector< Trk::Track >::const_iterator
DataModel_detail::const_iterator< DataVector > const_iterator
Definition
DataVector.h:838
Trk::TrackSlimmer::~TrackSlimmer
~TrackSlimmer()
Default Destructor.
Trk::TrackSlimmer::m_trackLocation
SG::ReadHandleKeyArray< TrackCollection > m_trackLocation
Definition
TrackSlimmer.h:53
Trk::TrackSlimmer::finalize
StatusCode finalize() override
standard Athena-Algorithm method
Definition
TrackSlimmer.cxx:31
Trk::TrackSlimmer::m_slimTool
ToolHandle< ITrackSlimmingTool > m_slimTool
member variables for algorithm properties:
Definition
TrackSlimmer.h:50
Trk::TrackSlimmer::initialize
StatusCode initialize() override
standard Athena-Algorithm method
Definition
TrackSlimmer.cxx:19
Trk::TrackSlimmer::execute
StatusCode execute(const EventContext &ctx) const override
standard Athena-Algorithm method
Definition
TrackSlimmer.cxx:37
Trk::TrackSlimmer::TrackSlimmer
TrackSlimmer(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.
Definition
TrackSlimmer.cxx:12
Generated on
for ATLAS Offline Software by
1.17.0