ATLAS Offline Software
Loading...
Searching...
No Matches
ActsToXAODTrackConverterAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7namespace ActsTrk {
8
9
11 {
12 ATH_MSG_DEBUG( "Initializing " << name() << " ..." );
13
14 ATH_CHECK( m_inputTrackContainerKey.initialize() );
16
19
20 return StatusCode::SUCCESS;
21 }
22
23 StatusCode ActsToXAODTrackConverterAlg::execute(const EventContext &ctx) const {
24 ATH_MSG_DEBUG( "Executing " << name() << " ..." );
25 const ActsTrk::TrackContainer* actsTracks{nullptr};
27
28 // Convert to xAOD version
30 // tracksContainer.ensureDynamicColumns(*actsTracks);
31 for ( auto track : *actsTracks ) {
32
33 auto destProxy = tracksContainer.makeTrack();
34 destProxy.copyFrom(track);
35 }
36 ATH_MSG_DEBUG(" \\__ Converted " << tracksContainer.size() << " tracks");
37
38 // Make const
39 auto constTracksContainer = m_tracksBackendHandlesHelper.moveToConst(std::move(tracksContainer),
40 m_trackingGeometryTool->getGeometryContext(ctx).context(),
41 ctx );
42
43 // Store into StoreGate
44 SG::WriteHandle trackContainerHandle{m_outputTrackContainerKey, ctx};
45 ATH_CHECK( trackContainerHandle.record(std::move(constTracksContainer)) );
46 return StatusCode::SUCCESS;
47 }
48
49} // namespace
50
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
SG::WriteHandleKey< ActsTrk::PersistentTrackContainer > m_outputTrackContainerKey
Key under which the xAOD type track container will be written to storegate.
virtual StatusCode execute(const EventContext &ctx) const override
PublicToolHandle< ActsTrk::ITrackingGeometryTool > m_trackingGeometryTool
Tracking geometry tool handling the alignment constants.
ActsTrk::MutableTrackContainerHandlesHelper m_tracksBackendHandlesHelper
Auxiliary class taking over the conversion of the Acts -> xAOD conversion.
SG::ReadHandleKey< ActsTrk::TrackContainer > m_inputTrackContainerKey
Key to access the track container considered for persitification.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
std::string prefixFromTrackContainerName(const std::string &tracks)
Parse TrackContainer name to get the prefix for backends The name has to contain XYZTracks,...
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.