13#include <AthLinks/ElementLink.h>
21 using SimHitLinkVec_t = std::vector<SimHitLink_t>;
29 if (acc.isAvailable(prdHit)){
30 const SimHitLink_t& link{acc(prdHit)};
42 std::unordered_set<const xAOD::MuonSimHit*> hits{};
44 hits.reserve(acc_simLink(segment).
size());
45 for (
const SimHitLink_t& link : acc_simLink(segment)) {
51 for (
const PrdLink_t& link : acc_prdLink(segment)) {
68 std::unordered_set<const xAOD::MuonSimHit*>
getMatchingSimHits(
const std::vector<const SpacePoint*>& spacePoints) {
69 std::unordered_set<const xAOD::MuonSimHit*> hits{};
76 if (secHit && secHit != primHit) {
83 std::unordered_set<const xAOD::MuonSimHit*>
getMatchingSimHits(
const std::vector<const CalibratedSpacePoint*>& measurements) {
84 std::unordered_set<const xAOD::MuonSimHit*> hits{};
93 if (secHit && secHit != primHit) {
100 std::vector<const CalibratedSpacePoint*> calibSps{};
102 std::ranges::transform(segment.
measurements(), std::back_inserter(calibSps), [](
const auto& meas){return meas.get();});
106 std::vector<const SpacePoint*> spacePoints{};
107 spacePoints.reserve(bucket.size());
108 std::ranges::transform(bucket, std::back_inserter(spacePoints), [](
const SpacePointBucket::value_type&
sp){
return sp.get();});
117 if (acc.isAvailable(segment)){
119 if (link.isValid()) {
127 if (acc.isAvailable(segment)) {
138 if (acc.isAvailable(hit)) {
153 std::vector<const xAOD::MuonSegment*> segments{};
155 if (!acc.isAvailable(truthMuon)) {
158 for (
const SegLink_t& link : acc(truthMuon)) {
159 segments.emplace_back(*link);
size_t size() const
Number of registered mappings.
ElementLink< xAOD::TruthParticleContainer > TruthLink_t
ElementLink implementation for ROOT usage.
The calibrated Space point is created during the calibration process.
Representation of a segment seed (a fully processed hough maximum) produced by the hough transform.
Placeholder for what will later be the muon segment EDM representation.
const MeasVec & measurements() const
Returns the associated measurements.
: The muon space point bucket represents a collection of points that will bre processed together in t...
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
Helper class to provide constant type-safe access to aux data.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
This header ties the generic definitions in this package.
std::vector< PrdLink_t > PrdLinkVec_t
Abrivation of a collection of Prd links.
const xAOD::TruthParticle * getTruthMatchedParticle(const xAOD::MuonSegment &segment)
Returns the particle truth-matched to the segment.
std::unordered_set< const xAOD::MuonSimHit * > getMatchingSimHits(const xAOD::MuonSegment &segment)
: Returns all sim hits matched to a xAOD::MuonSegment
const xAOD::MuonSimHit * getTruthMatchedHit(const xAOD::MuonMeasurement &prdHit)
Returns the MuonSimHit, if there's any, matched to the uncalibrated muon measurement.
std::vector< const xAOD::MuonSegment * > getTruthSegments(const xAOD::TruthParticle &truthMuon)
Returns the segments associated to the truth muon.
const xAOD::MuonSegment * getMatchedTruthSegment(const xAOD::MuonSegment &segment)
Returns the truth-matched segment.
ElementLink< MuonR4::SegmentContainer > SegLink_t
Abrivation of the link to the reco segment container.
std::vector< SegLink_t > SegLinkVec_t
ElementLink< PrdCont_t > PrdLink_t
Abrivation to call the link to an element inside an uncalibrated measurement container.
MuonMeasurement_v1 MuonMeasurement
MuonSimHit_v1 MuonSimHit
Defined the version of the MuonSimHit.
TruthParticle_v1 TruthParticle
Typedef to implementation.
MuonSegment_v1 MuonSegment
Reference the current persistent version: