14 using SegLink_t = ElementLink<xAOD::MuonSegmentContainer>;
32 ATH_MSG_FATAL(
"Please configure the measurement containers to decorate.");
33 return StatusCode::FAILURE;
44 return StatusCode::SUCCESS;
53 std::unordered_map<const SG::AuxVectorData*, MarkerHandle_t> writeDecorMap{};
54 std::unordered_map<const SG::AuxVectorData*, LinkHandle_t> linkDecorMap{};
58 writeDecorMap.emplace(std::make_pair(measCont,
makeHandle(ctx, decorKey,
false)));
68 if (!readDecor(*seg)){
71 SegLink_t segLink{segments, seg->index()};
72 for (
const PrdLink_t& link : prdLinks(*seg)) {
73 const auto* prd = (*link);
74 writeDecorMap.at(prd->container())(*prd) = readDecor(*seg);
78 linkDecorMap.at(prd->container())(*prd).push_back(segLink);
81 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Handle class for reading a decoration on an object.
Handle class for reading from StoreGate.
Handle class for adding a decoration to an object.
ElementLink implementation for ROOT usage.
SG::ReadHandleKeyArray< xAOD::UncalibratedMeasurementContainer > m_measKeys
Key to the segment container to fetch the marked segments.
SG::WriteDecorHandleKeyArray< xAOD::UncalibratedMeasurementContainer > m_writeMarkKeys
Key to the decoration.
Gaudi::Property< std::string > m_segLink
virtual StatusCode execute(const EventContext &ctx) const override final
virtual StatusCode initialize() override final
SG::WriteDecorHandleKeyArray< xAOD::UncalibratedMeasurementContainer > m_writeSegLinkKeys
Key to the decoration.
SG::ReadDecorHandleKey< xAOD::MuonSegmentContainer > m_readMarkKey
Key to the decoration to fetch the marked muons.
SG::ReadHandleKey< xAOD::MuonSegmentContainer > m_segKey
Key to the primary muon container to select the muon from.
SG::ReadDecorHandleKey< xAOD::MuonSegmentContainer > m_prdLinkKey
Key to the prd association decoration.
Handle class for reading a decoration on an object.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Handle class for adding a decoration to an object.
SG::WriteDecorHandle< ContType, dType > makeHandle(const EventContext &ctx, const SG::WriteDecorHandleKey< ContType > &key, const dType &defValue=dType{})
This header ties the generic definitions in this package.
std::vector< PrdLink_t > PrdLinkVec_t
Abrivation of a collection of Prd links.
SG::WriteDecorHandle< PrdCont_t, bool > MarkerHandle_t
SG::WriteDecorHandle< PrdCont_t, SegLinkVec_t > LinkHandle_t
ElementLink< MuonR4::SegmentContainer > SegLink_t
Abrivation of the link to the reco segment container.
SG::WriteDecorHandleKey< xAOD::UncalibratedMeasurementContainer > WriteDecorKey_t
std::vector< SegLink_t > SegLinkVec_t
ElementLink< PrdCont_t > PrdLink_t
Abrivation to call the link to an element inside an uncalibrated measurement container.
xAOD::UncalibratedMeasurementContainer PrdCont_t
Abrivation to call an uncalibrated measurement container.
std::string decorKeyFromKey(const std::string &key, const std::string &deflt)
Extract the decoration part of key.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
MuonSegmentContainer_v1 MuonSegmentContainer
Definition of the current "MuonSegment container version".
UncalibratedMeasurementContainer_v1 UncalibratedMeasurementContainer
Define the version of the uncalibrated measurement container.
MuonSegment_v1 MuonSegment
Reference the current persistent version: