ATLAS Offline Software
Loading...
Searching...
No Matches
IxAODSegmentCnvTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef MUONRECTOOLINTERFACESR4_IXAODSEGMENTCNVTOOL_H
5#define MUONRECTOOLINTERFACESR4_IXAODSEGMENTCNVTOOL_H
6
7#include <GaudiKernel/IAlgTool.h>
9
12
19
22
23namespace MuonR4{
37
38 class IxAODSegmentCnvTool : virtual public IAlgTool {
39 public:
40 virtual ~IxAODSegmentCnvTool() = default;
41
43
45 struct DataShip {
52 StatusCode setupLocalParameters(const DecorKey_t& localParKey,
53 const DecorKey_t& localCovKey,
54 const EventContext& ctx) {
55 if (localParKey.empty() || localCovKey.empty()) {
56 return StatusCode::FAILURE;
57 }
58 dec_localSegPars.initialize(localParKey, ctx);
59 dec_localSegCov.initialize(localCovKey, ctx);
60 return StatusCode::SUCCESS;
61 }
62
70 const DecorKey_t& prdLinkKey,
71 const DecorKey_t& prdStateKey,
72 const EventContext& ctx) {
73 if (combinedKey.empty() || prdLinkKey.empty() || prdStateKey.empty()) {
74 return StatusCode::FAILURE;
75 }
76 dec_prdLinks.initialize(prdLinkKey, ctx);
77 dec_prdStates.initialize(prdStateKey, ctx);
78 return prdCombContainer.record(combinedKey, ctx);
79 }
80
87 const EventContext& ctx,
88 const ActsTrk::GeometryContext& gctx) {
89 beamSpotMeasCreator = auxMeasProv.makeHandle(ctx, gctx.context());
90 if (!beamSpotMeasCreator.ok()) {
91 return StatusCode::FAILURE;
92 }
93 return StatusCode::SUCCESS;
94 }
95
99
101 using SegPars_t = xAOD::PosAccessor<Acts::toUnderlying(SegmentFit::ParamDefs::nPars)>::element_type;
103 using SegCov_t = xAOD::PosAccessor<Acts::sumUpToN(Acts::toUnderlying(SegmentFit::ParamDefs::nPars))>::element_type;
104
109
118
122 std::vector<PrdLink_t>> dec_prdLinks{};
126 std::vector<char>> dec_prdStates{};
127 };
128
134 virtual xAOD::MuonSegment* convertSegment(const EventContext& ctx,
135 const MuonR4::Segment& inSegment,
136 DataShip& ship) const = 0;
137 };
138}
139
140#endif
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Helper struct to create a new pseudo measurement.
Utility class to handle the creation of the Auxiliary measurement used in an Acts track fit This clas...
HandleReturn_t makeHandle(const EventContext &ctx, const Acts::GeometryContext &gctx) const
Creates a new MeasurementProvider and triggers the write of the container backend to StoreGate.
Acts::GeometryContext context() const
The xAODSegmentCnvTool takes a MuonR4::Segment and converts it into a xAOD::MuonSegment.
DeclareInterfaceID(IxAODSegmentCnvTool, 1, 0)
virtual xAOD::MuonSegment * convertSegment(const EventContext &ctx, const MuonR4::Segment &inSegment, DataShip &ship) const =0
Convert a MuonR4::Segment to an xAOD::MuonSegment and decorate it with the necessary information.
virtual ~IxAODSegmentCnvTool()=default
Placeholder for what will later be the muon segment EDM representation.
bool empty() const
Test if the key is blank.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
Auxiliary class to instantiate WriteDecorHandles.The handles can be created in an empty state.
This header ties the generic definitions in this package.
SG::AuxElement::Accessor< std::array< float, N > > PosAccessor
xAOD Accessor to the position
CombinedMuonStripAuxContainer_v1 CombinedMuonStripAuxContainer
UncalibratedMeasurement_v1 UncalibratedMeasurement
Define the version of the uncalibrated measurement class.
MuonSegmentContainer_v1 MuonSegmentContainer
Definition of the current "MuonSegment container version".
MuonSegmentAuxContainer_v1 MuonSegmentAuxContainer
Definition of the current Muon auxiliary container.
MuonSegment_v1 MuonSegment
Reference the current persistent version:
CombinedMuonStripContainer_v1 CombinedMuonStripContainer
Structure to hold the data needed for the conversion and decoration.
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > DecorKey_t
StatusCode setupLocalParameters(const DecorKey_t &localParKey, const DecorKey_t &localCovKey, const EventContext &ctx)
Initialize the linking of the local segment parameters and covariance.
xAOD::ContainerDecorator< xAOD::MuonSegmentContainer, SegPars_t > dec_localSegPars
Decoration of the 5 local segment parameters (not persitifiable).
xAOD::FillContainer< xAOD::CombinedMuonStripContainer, xAOD::CombinedMuonStripAuxContainer > prdCombContainer
Container handle to create the combined measurements of Rpc/Tgc/sTgc.
Acts::Result< ActsTrk::AuxiliaryMeasurementHandler::MeasurementProvider, ActsTrk::AuxiliaryMeasurementHandler::HandleStatus > beamSpotMeasCreator
Container handle to create the beamspot measurement, if needed.
xAOD::PosAccessor< Acts::sumUpToN(Acts::toUnderlying(SegmentFit::ParamDefs::nPars))>::element_type SegCov_t
Abrivation of the decorated local segment 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.
const xAOD::UncalibratedMeasurement * beamSpot
Pointer to the commonly shared beamspot measurement.
xAOD::ContainerDecorator< xAOD::MuonSegmentContainer, std::vector< char > > dec_prdStates
Extra column containing the fitState of each measurement (Valid, Outlier, wrongly calibrated).
xAOD::ContainerDecorator< xAOD::MuonSegmentContainer, SegCov_t > dec_localSegCov
Decoration of the local segment fit covariance (not persitifiable).
xAOD::PosAccessor< Acts::toUnderlying(SegmentFit::ParamDefs::nPars)>::element_type SegPars_t
Abrivation of the decorated local segment parameters.
ElementLink< xAOD::UncalibratedMeasurementContainer > PrdLink_t
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.
xAOD::ContainerDecorator< xAOD::MuonSegmentContainer, std::vector< PrdLink_t > > dec_prdLinks
Decoration of the list of measurements used to construct the segment.