ATLAS Offline Software
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 
13  ISvcLocator* pSvcLocator)
14  : AthReentrantAlgorithm(name, pSvcLocator) {}
15 
17 
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 
32 {
33  return StatusCode::SUCCESS;
34 }
35 
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 }
Trk::TrackSlimmer::TrackSlimmer
TrackSlimmer(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.
Definition: TrackSlimmer.cxx:12
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
ConstDataVector.h
DataVector adapter that acts like it holds const pointers.
Trk::TrackSlimmer::execute
StatusCode execute(const EventContext &ctx) const override
standard Athena-Algorithm method
Definition: TrackSlimmer.cxx:37
skel.it
it
Definition: skel.GENtoEVGEN.py:396
Trk::TrackSlimmer::~TrackSlimmer
~TrackSlimmer()
Default Destructor.
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
Trk::TrackSlimmer::initialize
StatusCode initialize() override
standard Athena-Algorithm method
Definition: TrackSlimmer.cxx:19
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Trk::TrackSlimmer::finalize
StatusCode finalize() override
standard Athena-Algorithm method
Definition: TrackSlimmer.cxx:31
TrackSlimmer.h