ATLAS Offline Software
Loading...
Searching...
No Matches
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
11
12Trk::TrackSlimmer::TrackSlimmer(const std::string& name,
13 ISvcLocator* pSvcLocator)
14 : AthReentrantAlgorithm(name, pSvcLocator) {}
15
17
18StatusCode
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
30StatusCode
32{
33 return StatusCode::SUCCESS;
34}
35
36StatusCode
37Trk::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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
DataVector adapter that acts like it holds const pointers.
An algorithm that can be simultaneously executed in multiple threads.
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
StatusCode execute(const EventContext &ctx) const override
standard Athena-Algorithm method
StatusCode finalize() override
standard Athena-Algorithm method
~TrackSlimmer()
Default Destructor.
StatusCode initialize() override
standard Athena-Algorithm method
ToolHandle< ITrackSlimmingTool > m_slimTool
member variables for algorithm properties:
TrackSlimmer(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.