15 using SegLink_t = ElementLink<xAOD::MuonSegmentContainer>;
19 using LinkHandle_t = SG::WriteDecorHandle<PrdCont_t, SegLinkVec_t>;
21 using WriteDecorKey_t = SG::WriteDecorHandleKey<xAOD::UncalibratedMeasurementContainer>;
22 using namespace DerivationFramework;
27 ATH_MSG_FATAL(
"Please configure the measurement containers to decorate.");
28 return StatusCode::FAILURE;
39 return StatusCode::SUCCESS;
45 std::unordered_map<const SG::AuxVectorData*, MarkerHandle_t>
markers{};
46 std::unordered_map<Muon::MuonStationIndex::TechnologyIndex, std::vector<const PrdCont_t*>> techConts{};
50 if (measContainer->
empty()) {
54 markers.insert(std::make_pair(measContainer, std::move(decor)));
57 techConts[techIdx].push_back(measContainer);
59 std::unordered_map<const SG::AuxVectorData*, LinkHandle_t> links{};
63 if (measContainer->
empty()) {
67 links.insert(std::make_pair(measContainer, std::move(decor)));
86 SegLink_t segLink{segContainer, segment->index()};
93 links.at(prd->
container())(*prd).push_back(segLink);
96 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
Handle class for reading a decoration on an object.
Handle class for reading from StoreGate.
Handle class for adding a decoration to an object.
const T * at(size_type n) const
Access an element, as an rvalue.
bool empty() const noexcept
Returns true if the collection is empty.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
IdHelperSvc to decode the Identifiers.
Gaudi::Property< std::string > m_segLink
Key to indicate the associated MuonSegment link.
virtual StatusCode execute(const EventContext &ctx) const override final
SG::ReadDecorHandleKeyArray< xAOD::UncalibratedMeasurementContainer > m_prdLinkKeys
Dependency on the sim hit decoration.
SG::ReadHandleKeyArray< xAOD::UncalibratedMeasurementContainer > m_measKeys
Key to the prd containers in the event.
SG::WriteDecorHandleKeyArray< xAOD::UncalibratedMeasurementContainer > m_writeMarkKeys
Key to the marker decoration.
SG::WriteDecorHandleKeyArray< xAOD::UncalibratedMeasurementContainer > m_writeSegLinkKeys
Key to the segment link decoration.
Gaudi::Property< std::string > m_simLink
Decoration key of the prd -> simHit association.
virtual StatusCode initialize() override final
SG::ReadHandleKey< xAOD::MuonSegmentContainer > m_segKey
Key to the primary muon container to select the muon from.
Gaudi::Property< std::string > m_writeMarker
Key that's decorated to mark the uncalibrated measurement.
const SG::AuxVectorData * container() const
Return the container holding this element.
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.
const xAOD::MuonSimHit * getTruthMatchedHit(const xAOD::UncalibratedMeasurement &prdHit)
Returns the MuonSimHit, if there's any, matched to the uncalibrated muon measurement.
SG::WriteDecorHandle< PrdCont_t, bool > MarkerHandle_t
SG::WriteDecorHandle< PrdCont_t, SegLinkVec_t > LinkHandle_t
std::unordered_set< const xAOD::MuonSimHit * > getMatchingSimHits(const xAOD::MuonSegment &segment)
: Returns all sim hits matched to a xAOD::MuonSegment
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
xAOD::UncalibratedMeasurementContainer PrdCont_t
Abrivation to call an uncalibrated measurement container.
TechnologyIndex
enum to classify the different layers in the muon spectrometer
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".
MuonSimHit_v1 MuonSimHit
Defined the version of the MuonSimHit.
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.
UncalibratedMeasurementContainer_v1 UncalibratedMeasurementContainer
Define the version of the uncalibrated measurement container.
MuonSegment_v1 MuonSegment
Reference the current persistent version:
UncalibratedMeasurement_v1 UncalibratedMeasurement
Define the version of the uncalibrated measurement class.