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)) {
64 std::unordered_set<const xAOD::MuonSimHit*>
getMatchingSimHits(
const std::vector<const SpacePoint*>& spacePoints) {
65 std::unordered_set<const xAOD::MuonSimHit*> hits{};
72 if (secHit && secHit != primHit) {
79 std::unordered_set<const xAOD::MuonSimHit*>
getMatchingSimHits(
const std::vector<const CalibratedSpacePoint*>& measurements) {
80 std::unordered_set<const xAOD::MuonSimHit*> hits{};
89 if (secHit && secHit != primHit) {
96 std::vector<const CalibratedSpacePoint*> calibSps{};
98 std::ranges::transform(segment.
measurements(), std::back_inserter(calibSps), [](
const auto& meas){return meas.get();});
102 std::vector<const SpacePoint*> spacePoints{};
103 spacePoints.reserve(bucket.size());
104 std::ranges::transform(bucket, std::back_inserter(spacePoints), [](
const SpacePointBucket::value_type&
sp){
return sp.get();});
113 if (acc.isAvailable(segment)){
123 if (acc.isAvailable(segment)) {
133 std::vector<const xAOD::MuonSegment*> segments{};
135 if (!acc.isAvailable(truthMuon)) {
138 for (
const SegLink_t& link : acc(truthMuon)) {
139 segments.emplace_back(*link);
ElementLink< xAOD::TruthParticleContainer > TruthLink_t
ElementLink implementation for ROOT usage.
bool isValid() const
Test to see if the link can be dereferenced.
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.
const xAOD::MuonSimHit * getTruthMatchedHit(const xAOD::UncalibratedMeasurement &prdHit)
Returns the MuonSimHit, if there's any, matched to the uncalibrated muon measurement.
std::unordered_set< const xAOD::MuonSimHit * > getMatchingSimHits(const xAOD::MuonSegment &segment)
: Returns all sim hits matched to a xAOD::MuonSegment
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.
MuonSimHit_v1 MuonSimHit
Defined the version of the MuonSimHit.
TruthParticle_v1 TruthParticle
Typedef to implementation.
MuonSegment_v1 MuonSegment
Reference the current persistent version:
UncalibratedMeasurement_v1 UncalibratedMeasurement
Define the version of the uncalibrated measurement class.