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 ATH_CHECK(m_ctxProvider.initialize());
17
19 return StatusCode::SUCCESS;
20 }
21
22 StatusCode ActsToXAODTrackConverterAlg::execute(const EventContext &ctx) const {
23 ATH_MSG_DEBUG( "Executing " << name() << " ..." );
24 const ActsTrk::TrackContainer* actsTracks{nullptr};
26
27 // Convert to xAOD version
29 // tracksContainer.ensureDynamicColumns(*actsTracks);
30 for ( auto track : *actsTracks ) {
31
32 auto destProxy = tracksContainer.makeTrack();
33 destProxy.copyFrom(track);
34 }
35 ATH_MSG_DEBUG(" \\__ Converted " << tracksContainer.size() << " tracks");
36
37 // Make const
38 auto constTracksContainer = m_tracksBackendHandlesHelper.moveToConst(std::move(tracksContainer),
39 m_ctxProvider.getGeometryContext(ctx),
40 ctx );
41
42 // Store into StoreGate
43 SG::WriteHandle trackContainerHandle{m_outputTrackContainerKey, ctx};
44 ATH_CHECK( trackContainerHandle.record(std::move(constTracksContainer)) );
45 return StatusCode::SUCCESS;
46 }
47
48} // namespace
49
#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.
ContextUtility m_ctxProvider
Auxiliary class to access the magnetic field, geometry and calibration context.
virtual StatusCode execute(const EventContext &ctx) const override
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.