ATLAS Offline Software
Loading...
Searching...
No Matches
xAODSegmentCnvAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4#include "xAODSegmentCnvAlg.h"
5
6using namespace Acts::UnitLiterals;
7
8namespace MuonR4{
9
11 ATH_CHECK(m_geoCtxKey.initialize());
12 ATH_CHECK(m_readKeys.initialize());
13 ATH_CHECK(m_writeKey.initialize());
14 ATH_CHECK(m_prdLinkKey.initialize());
15 ATH_CHECK(m_localSegParKey.initialize());
16 ATH_CHECK(m_localSegCovKey.initialize());
17 ATH_CHECK(m_parentSegKey.initialize());
18 ATH_CHECK(m_combMeasKey.initialize());
19 ATH_CHECK(m_prdStateKey.initialize());
21 ATH_CHECK(m_segmentCnvTool.retrieve());
22 return StatusCode::SUCCESS;
23 }
24 StatusCode xAODSegmentCnvAlg::execute(const EventContext& ctx) const {
25 const ActsTrk::GeometryContext* gctx{nullptr};
26 ATH_CHECK(SG::get(gctx, m_geoCtxKey, ctx));
27
29 ATH_CHECK(ship.segmentContainer.record(m_writeKey, ctx));
34 }
35
39
41 const SegmentContainer* segmentContainer{nullptr};
42 ATH_CHECK(SG::get(segmentContainer, key, ctx));
43
45 unsigned recoSegIdx{0};
46 ship.segmentContainer->reserve(ship.segmentContainer->size() + segmentContainer->size());
47
48 for (const Segment* inSegment : *segmentContainer) {
49 xAOD::MuonSegment* convertedSeg = m_segmentCnvTool->convertSegment(ctx, *inSegment, ship);
50 if (!convertedSeg) {
51 ATH_MSG_ERROR("Failed to convert segment");
52 return StatusCode::FAILURE;
53 }
54
55 dec_parentLink(*convertedSeg) = SegLink_t{segmentContainer, recoSegIdx};
56 ++recoSegIdx;
57 }
58 }
59 return StatusCode::SUCCESS;
60 }
61}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x,...)
size_type size() const noexcept
Returns the number of elements in the collection.
Placeholder for what will later be the muon segment EDM representation.
DecorKey_t m_prdStateKey
Decoration to the PrdLink state (I.e.
DecorKey_t m_localSegParKey
Decoration of the local segment parameters.
DecorKey_t m_localSegCovKey
Decoration of the local fit covariance parameters.
DecorKey_t m_parentSegKey
Decoration of the original segment.
SG::WriteHandleKey< xAOD::MuonSegmentContainer > m_writeKey
Output xAOD::segment container key.
SG::WriteHandleKey< xAOD::CombinedMuonStripContainer > m_combMeasKey
Auxiliary container to model two measurements in the same gas gap as a single track state.
ToolHandle< IxAODSegmentCnvTool > m_segmentCnvTool
Segment converter tool.
DecorKey_t m_prdLinkKey
Decoration to the links to the associated Uncalibrated measurements.
virtual StatusCode execute(const EventContext &ctx) const override final
virtual StatusCode initialize() override final
Gaudi::Property< bool > m_convertBeamSpot
Flag to convert the beamspot constaint as well.
ActsTrk::AuxiliaryMeasurementHandler m_auxMeasProv
Handler to parse the auxiliary beam spot constaint.
SG::ReadHandleKeyArray< SegmentContainer > m_readKeys
Input segment container key.
ActsTrk::GeoContextReadKey_t m_geoCtxKey
Alignment container key.
Property holding a SG store/key/clid from which a ReadHandle is made.
Handle class for adding a decoration to an object.
This header ties the generic definitions in this package.
ElementLink< xAOD::MuonSegmentContainer > SegLink_t
DataVector< Segment > SegmentContainer
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
MuonSegment_v1 MuonSegment
Reference the current persistent version:
Structure to hold the data needed for the conversion and decoration.
StatusCode setupLocalParameters(const DecorKey_t &localParKey, const DecorKey_t &localCovKey, const EventContext &ctx)
Initialize the linking of the local segment parameters and covariance.
StatusCode setupMeasurementLink(const SG::WriteHandleKey< xAOD::CombinedMuonStripContainer > &combinedKey, const DecorKey_t &prdLinkKey, const DecorKey_t &prdStateKey, const EventContext &ctx)
Instantiate the linking of the measurements.
xAOD::FillContainer< xAOD::MuonSegmentContainer, xAOD::MuonSegmentAuxContainer > segmentContainer
Output segment container.
StatusCode setupBeamSpotMeasurement(const ActsTrk::AuxiliaryMeasurementHandler &auxMeasProv, const EventContext &ctx, const ActsTrk::GeometryContext &gctx)
Initialize the creation & linking of the beamspot measurement.