13#include <AthLinks/ElementLink.h>
23 using SimHitLinkVec_t = std::vector<SimHitLink_t>;
31 if (acc.isAvailable(prdHit)){
32 const SimHitLink_t& link{acc(prdHit)};
44 std::unordered_set<const xAOD::MuonSimHit*> hits{};
46 hits.reserve(acc_simLink(segment).
size());
47 for (
const SimHitLink_t& link : acc_simLink(segment)) {
53 for (
const PrdLink_t& link : acc_prdLink(segment)) {
62 std::vector<const xAOD::MuonMeasurement*> prds{prdHit};
67 prds = {cmb->primaryStrip(), cmb->secondaryStrip()};
81 std::unordered_set<const xAOD::MuonSimHit*>
getMatchingSimHits(
const std::vector<const SpacePoint*>& spacePoints) {
82 std::unordered_set<const xAOD::MuonSimHit*> hits{};
89 if (secHit && secHit != primHit) {
96 std::unordered_set<const xAOD::MuonSimHit*>
getMatchingSimHits(
const std::vector<const CalibratedSpacePoint*>& measurements) {
97 std::unordered_set<const xAOD::MuonSimHit*> hits{};
104 hits.insert(primHit);
106 if (secHit && secHit != primHit) {
113 std::vector<const CalibratedSpacePoint*> calibSps{};
115 std::ranges::transform(segment.
measurements(), std::back_inserter(calibSps), [](
const auto& meas){return meas.get();});
119 std::vector<const SpacePoint*> spacePoints{};
120 spacePoints.reserve(bucket.size());
121 std::ranges::transform(bucket, std::back_inserter(spacePoints), [](
const SpacePointBucket::value_type&
sp){
return sp.get();});
130 if (acc.isAvailable(segment)){
132 if (link.isValid()) {
140 if (acc.isAvailable(segment)) {
151 if (acc.isAvailable(
hit)) {
166 std::vector<const xAOD::MuonSegment*> segments{};
168 if (!acc.isAvailable(truthMuon)) {
171 for (
const SegLink_t& link : acc(truthMuon)) {
172 segments.emplace_back(*link);
size_t size() const
Number of registered mappings.
ElementLink< xAOD::TruthParticleContainer > TruthLink_t
ElementLink< xAOD::MuonSegmentContainer > SegLink_t
std::vector< SegLink_t > SegLinkVec_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.
const xAOD::TruthParticle * getTruthMatchedParticle(const xAOD::MuonSegment &segment)
Returns the particle truth-matched to the segment.
ElementLink< PrdCont_t > PrdLink_t
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.
std::vector< PrdLink_t > PrdLinkVec_t
ElementLink< xAOD::MuonSegmentContainer > SegLink_t
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:
CombinedMuonStrip_v1 CombinedMuonStrip