ATLAS Offline Software
TrackContainerReader.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "Acts/Geometry/TrackingGeometry.hpp"
6 
7 #include "TrackContainerReader.h"
8 
9 namespace ActsTrk{
10 TrackContainerReader::TrackContainerReader(const std::string& name, ISvcLocator* pSvcLocator) :
11  AthReentrantAlgorithm(name, pSvcLocator)
12 {
13 }
14 
15 
17 {
20  ATH_CHECK(m_tracksKey.key().find("Tracks") != std::string::npos);
22 
23  return StatusCode::SUCCESS;
24 }
25 
27 {
28  return StatusCode::SUCCESS;
29 }
30 
31 StatusCode TrackContainerReader::execute(const EventContext& context) const
32 {
33  std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry = m_trackingGeometryTool->trackingGeometry();
34  Acts::GeometryContext geoContext = m_trackingGeometryTool->getGeometryContext(context).context();
35 
36  std::unique_ptr<ActsTrk::TrackContainer> trackContainer = m_tracksBackendHandlesHelper.build(trackingGeometry.get(), geoContext, context);
37  ATH_MSG_DEBUG("track container size " << trackContainer->size());
38  auto handle = SG::makeHandle(m_tracksKey, context);
39  ATH_CHECK(handle.record(std::move(trackContainer)));
40  return StatusCode::SUCCESS;
41 }
42 }
ActsTrk::TrackContainerReader::finalize
virtual StatusCode finalize() override
Definition: TrackContainerReader.cxx:26
ActsTrk::TrackContainerReader::execute
virtual StatusCode execute(const EventContext &context) const override final
Definition: TrackContainerReader.cxx:31
ActsTrk::TrackContainerReader::m_tracksBackendHandlesHelper
ActsTrk::ConstTrackContainerHandlesHelper m_tracksBackendHandlesHelper
Definition: TrackContainerReader.h:33
ActsTrk::prefixFromTrackContainerName
std::string prefixFromTrackContainerName(const std::string &tracks)
Parse TrackContainer name to get the prefix for backends The name has to contain XYZTracks,...
Definition: TrackContainerHandlesHelper.cxx:18
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
ActsTrk::ConstTrackContainerHandlesHelper::build
std::unique_ptr< ActsTrk::TrackContainer > build(const Acts::TrackingGeometry *geo, const Acts::GeometryContext &geoContext, const EventContext &context) const
Definition: TrackContainerHandlesHelper.cxx:257
ActsTrk::ConstTrackContainerHandlesHelper::initialize
StatusCode initialize(const std::string &prefix)
Sets up the handles.
Definition: TrackContainerHandlesHelper.cxx:177
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:269
TrackContainerReader.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ActsTrk::TrackContainerReader::m_trackingGeometryTool
ToolHandle< IActsTrackingGeometryTool > m_trackingGeometryTool
Definition: TrackContainerReader.h:32
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ActsTrk::TrackContainerReader::m_tracksKey
SG::WriteHandleKey< ActsTrk::TrackContainer > m_tracksKey
Definition: TrackContainerReader.h:34
ActsTrk::TrackContainerReader::initialize
virtual StatusCode initialize() override final
Definition: TrackContainerReader.cxx:16
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:34
ActsTrk::TrackContainerReader::TrackContainerReader
TrackContainerReader(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TrackContainerReader.cxx:10