ATLAS Offline Software
Loading...
Searching...
No Matches
MuonR4 Namespace Reference

This header ties the generic definitions in this package. More...

Namespaces

namespace  SegmentFit
namespace  FastReco
namespace  HoughHelpers

Classes

class  GlobalPattern
 Data class to represent an eta maximum in hough space. More...
struct  HoughEventData_impl
 Templated event data class for the phase-2 muon hough transform. More...
class  HoughMaximum
 Data class to represent an eta maximum in hough space. More...
class  Segment
 Placeholder for what will later be the muon segment EDM representation. More...
class  SegmentSeed
 Representation of a segment seed (a fully processed hough maximum) produced by the hough transform. More...
class  CalibratedSpacePoint
 The calibrated Space point is created during the calibration process. More...
class  SpacePoint
 The muon space point is the combination of two uncalibrated measurements one of them measures the eta and the other the phi coordinate. More...
class  SpacePointBucket
 : The muon space point bucket represents a collection of points that will bre processed together in the pattern seeding. More...
class  SpacePointPerLayerSorter
 The SpacePointPerLayerSorter sort two given space points by their layer Identifier. More...
class  SpacePointPerLayerSplitter
 The SpacePointPerLayerSplitter takes a set of spacepoints already sorted by layer Identifier (see MuonSpacePoint/SpacePointPerLayerSorter.h) and splits them into two sets of hits, one for MDT hits and the other one for strip detector hits. More...
struct  HitSummary
 Summary struct to hold the hit counts on the track per MS layer. More...
class  MsTrackSeed
class  IdentifierSorter
 Helper struct to establish a sorting of the muon measurements based on their Identifier. More...
class  SpacePointCalibrator
class  BucketDumperAlg
class  CaloCellsDumperAlg
class  MlHitDumperAlg
class  SegmentDumperAlg
class  TruthMuonVertexDumperAlg
class  RpcClusteringAlg
class  SpacePointCsvDumperAlg
class  TruthSegmentCsvDumperAlg
class  PatternCnvAlg
 The MuonPatternCnvAlg converts the SegmentSeeds produced by the R4 pattern recognition chain into the segment seeds that can be consumed by the legacy muon segment maker. More...
class  RpcRdoToRpcPrepDataTool
class  TrkSegmentCnvAlg
 The TrkSegmentCnvAlg converts the SegmentSeeds produced by the R4 pattern recognition chain into the segment seeds that can be consumed by the legacy muon segment maker. More...
class  xAODSegmentCnvAlg
 The xAODSegmentCnvAlg takes MuonR4::Segments and converts them into a xAOD::MuonSegmentContainer. More...
class  TgcDigitToPrepDataCnvTool
 Conversion tool from Tgc digits -> Tgc xAOD uncalibrated measurements. More...
class  xRpcMeasToTrkPrdCnvAlg
 Conversion algorithm to turn xAOD::RpcMeasurements into Trk::RpcPrepData. More...
class  xTgcMeasToTrkPrdCnvAlg
class  MdtMeasViewAlg
class  RpcMeasViewAlg
class  SegmentViewAlg
class  sTgcMeasViewAlg
class  GeomAlignCondAlg
class  RegionSelectorCondAlg
 Conditions algorithm to create the region selector trigger tables from the R4 readout geoemetry. More...
class  MdtDigitizationTool
class  MM_DigitizationTool
class  MmFastDigiTool
class  MuonDigitizationTool
 Barebone implementation of the I/O infrastructure for all MuonDigitizationTools. More...
class  TruthOverlay
class  RpcFastDigiTool
class  sTgcFastDigiTool
class  sTgcDigitizationTool
class  sTgcDigitMaker
class  TgcFastDigiTool
class  FastReconstructionAlg
 Algorithm executing Phase-2 fast reconstruction. More...
class  SPIdDumperAlg
class  EtaHoughTransformAlg
 Algorithm to handle the eta hough transform. More...
class  NswSegmentFinderAlg
class  PhiHoughTransformAlg
 Algorithm to handle the phi hough transform. More...
class  SegmentActsRefitAlg
class  SegmentFittingAlg
 The SegmentFittingAlg fits straight lines to the Mdt/Rpc/Tgc hits associated with the SegmentSeedPatterns. More...
class  SpacePointMakerAlg
 Data preparation algorithm that transforms the uncalibrated measurements into muon space points. More...
class  PrepDataToSimHitAssocAlg
 The PrepDataToSimHitAssocAlg matches the uncalibrated measurements to the MuonSimHits or to the MuonSDO objects. More...
class  RecoSegToTruthAssocAlg
 Algorithm to match the reconstructed muon segment with the truth segment & with the truth particle. More...
class  SimHitToTruthPartAssocAlg
 This algorihm associates the SDO / sim hit Identifiers to the truth particle using the HepMCParticle uniqueID to match both. More...
class  TrackToTruthPartAssocAlg
 The TrackToTruthPartAssocAlg matches the reconstructed tracks to truth muons. More...
class  TruthHitSummaryAlg
class  TruthSegmentMaker
class  TruthSegToTruthPartAssocAlg
 The TruthSegToTruthPartAssocAlg associates the TruthSegments with the primary TruthParticle from the IP. More...
class  ISegmentSelectionTool
class  ISpacePointCalibrator
 Interface class to refine the space point calibration with an external seed. More...
class  ITrackSummaryTool
 Interface tool to calculate the hit summary of tracks & track seeds in the MuonSpectrometer. More...
class  MsTrackFindingAlg
class  MsTrackSeeder
 Helper class to group muon sgements that may belong to a muon trajectory. More...
class  SegmentSelectionTool
class  TrackSummaryTool
class  MeasurementMarkerAlg
 Algorithm that marks the uncalibrated measurements making up a segment, where the segment passes an arbitrary selection requirement. More...
class  SegmentFitParDecorAlg
 Algorithm to decorate the local segment parameters onto the xAOD::MuonSegments produced by the legacy muon reconstruction chain. More...
class  SegmentMarkerAlg
class  TruthMeasMarkerAlg

Typedefs

using GlobalPatternContainer = DataVector<GlobalPattern>
 Abrivation of the GlobalPattern container type.
using HoughEventData = HoughEventData_impl<ActsPeakFinderForMuon, ActsPeakFinderForMuonCfg>
using HoughHitType = const SpacePoint*
using HoughPlane = Acts::HoughTransformUtils::HoughPlane<HoughHitType>
using ActsPeakFinderForMuon = Acts::HoughTransformUtils::PeakFinders::IslandsAroundMax<HoughHitType>
using ActsPeakFinderForMuonCfg = Acts::HoughTransformUtils::PeakFinders::IslandsAroundMaxConfig
using EtaHoughMaxContainer = DataVector<HoughMaximum>
using SegmentSeedContainer = DataVector<SegmentSeed>
using SegmentContainer = DataVector<Segment>
using SpacePointContainer = DataVector<SpacePointBucket>
 Abrivation of the space point container type.
using Cov_t = SpacePoint::Cov_t
using HitVec = SpacePointPerLayerSplitter::HitVec
using MsTrackSeedContainer = std::vector<MsTrackSeed>
using CalibSpacePointVec = ISpacePointCalibrator::CalibSpacePointVec
using CalibSpacePointPtr = ISpacePointCalibrator::CalibSpacePointPtr
using State = CalibratedSpacePoint::State
using SegLink_t = ElementLink<MuonR4::SegmentContainer>
 Abrivation of the link to the reco segment container.
using PrdCont_t = xAOD::UncalibratedMeasurementContainer
 Abrivation to call an uncalibrated measurement container.
using PrdLink_t = ElementLink<PrdCont_t>
 Abrivation to call the link to an element inside an uncalibrated measurement container.
using PrdLinkVec_t = std::vector<PrdLink_t>
 Abrivation of a collection of Prd links.
using SegPars_t = xAOD::MeasVector<Acts::toUnderlying(ParamDefs::nPars)>
 Abrivation of the decorated local segment parameters.
using sTgcDigitVec = sTgcDigitMaker::sTgcDigitVec
using LayerIndex = GlobalPatternFinder::LayerIndex
using PrimitiveVec = MuonValR4::IPatternVisualizationTool::PrimitiveVec
using SearchTree_t = MsTrackSeeder::SearchTree_t
using SectorProjector = MsTrackSeeder::SectorProjector
using Cat_t = HitSummary::HitCategory
using Stat_t = HitSummary::Status
using SegLinkVec_t = std::vector<SegLink_t>
using MarkerHandle_t = SG::WriteDecorHandle<PrdCont_t, bool>
using LinkHandle_t = SG::WriteDecorHandle<PrdCont_t, SegLinkVec_t>
using WriteDecorKey_t = SG::WriteDecorHandleKey<xAOD::UncalibratedMeasurementContainer>
using SegPars = xAOD::MeasVector<Acts::toUnderlying(ParamDefs::nPars)>

Functions

double houghTanBeta (const Amg::Vector3D &v)
 Returns the hough tanBeta [y] / [z].
double houghTanAlpha (const Amg::Vector3D &v)
 : Returns the hough tanAlpha [x] / [z]
bool isPrecisionHit (const SpacePoint &hit)
 Returns whether the uncalibrated spacepoint is a precision hit (Mdt, micromegas, stgc strips).
bool isGoodHit (const CalibratedSpacePoint &hit)
 Returns whether the calibrated spacepoint is valid and therefore suitable to be used in the segment fit.
bool isPrecisionHit (const CalibratedSpacePoint &hit)
 Returns whether the calibrated spacepoint is a precision hit (Mdt, micromegas, stgc strips).
template<Acts::Experimental::CompositeSpacePointContainer cont_t>
std::string print (const cont_t &container)
 Print a space point container to string.
std::ostream & operator<< (std::ostream &ostr, const MuonR4::MsTrackSeed &seed)
const SegmentdetailedSegment (const xAOD::MuonSegment &seg)
 Helper function to navigate from the xAOD::MuonSegment to the MuonR4::Segment.
std::vector< const xAOD::UncalibratedMeasurement * > collectMeasurements (const xAOD::MuonSegment &segment, bool skipOutlier=true)
 Helper function to extract the measurements from the segment.
std::string printID (const xAOD::MuonSegment &seg)
 Print the chamber ID of a segment, e.g.
std::size_t nMeasurements (const xAOD::MuonSegment &segment)
 Returns the number of associated Uncalibrated measurements.
const xAOD::UncalibratedMeasurementgetMeasurement (const xAOD::MuonSegment &segment, const std::size_t n)
 Returns the n-th uncalibrated measurement.
bool isOutlierMeasurement (const xAOD::MuonSegment &segment, const std::size_t n)
 Returns whether the n-the uncalibrated measurement is an outlier.
Acts::GeometryIdentifier volumeId (const Acts::Surface &surface)
 Returns the identifier of the volume in which the surface is embedded.
const xAOD::MuonSimHitgetTruthMatchedHit (const xAOD::MuonMeasurement &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::unordered_set< const xAOD::MuonSimHit * > getMatchingSimHits (const std::vector< const SpacePoint * > &spacePoints)
 Returns all sim hits that are matched to a collection of space points.
std::unordered_set< const xAOD::MuonSimHit * > getMatchingSimHits (const std::vector< const CalibratedSpacePoint * > &measurements)
 Returns all sim hits that are matched to a collection of calibrated space points.
std::unordered_set< const xAOD::MuonSimHit * > getMatchingSimHits (const Segment &seg)
 Returns all sim hits that are matched to the reconstructed segment.
std::unordered_set< const xAOD::MuonSimHit * > getMatchingSimHits (const SegmentSeed &seed)
 Returns all sim hits that are matched to the segmentSeed.
std::unordered_set< const xAOD::MuonSimHit * > getMatchingSimHits (const SpacePointBucket &bucket)
 Returns all sim hits that are matched to the spacePoint bucket.
const xAOD::TruthParticlegetTruthMatchedParticle (const xAOD::MuonSegment &segment)
 Returns the particle truth-matched to the segment.
const xAOD::MuonSegmentgetMatchedTruthSegment (const xAOD::MuonSegment &segment)
 Returns the truth-matched segment.
std::vector< const xAOD::MuonSegment * > getTruthSegments (const xAOD::TruthParticle &truthMuon)
 Returns the segments associated to the truth muon.
const xAOD::MuonSegmentgetMatchedTruthSegment (const xAOD::MuonSimHit &hit)
 Returns the segment matched to the sim hit.
const xAOD::TruthParticlegetTruthMatchedParticle (const xAOD::MuonSimHit &hit)
 Returns the truth particle matched to the sim hit.
bool passesThrough (const SpacePointBucket::chamberLocation &loc, double y0, double tanBeta)
double proximity (const SpacePoint *dc, double y0, double tanBeta)
constexpr double chamberCoverage (const std::array< double, 2 > &seedEdges, const std::array< double, 2 > &chambEdges)
 Calculates how much of the unkknown coordinate along the tube range is covered by the chamber of interest.

Variables

constexpr unsigned minLayers {4}

Detailed Description

This header ties the generic definitions in this package.

The SegmentActsRefitAlg is designed to test the Acts tracking geometry & the global chi2 fitter at chamber level.

Added a flag in MuonConfig to turn off the R4 sTGC Digitization until fully validated.

: The sTgcMeasViewAlg takes all sTgcStrip, sTgcWire & sTgcPad measurements and pushes them into a common sTgcMeasContainer which is a SG::VIEW_ELEMENTS container

: The RpcMeasViewAlg takes the BI & legacy Rpc measurements and pushes them into a common RpcMeasurmentContainer which is a SG::VIEW_ELEMENTS container

: The MdtMeasViewAlg takes the MdtMeasurments && the MdtTwinMeasurements and combined them into a common MdtDriftCircleContainer

The MuonStripCsvDumperAlg reads the RpcStripContainer and dumps information to csv files The files are used for the algorithm development in acts.

Set of helper functions to fetch the links to the xAOD::MuonSimHits from the uncalibrated measurements.

MsTrackSeed represents the collection of segments that may be compatible with a muon track trajectory hypothesis.

Set of helper functions for uncalibrated / calibrated space points meant for local and global pattern recognition.

copyright am arsch

the accumulator, and the peak finder.

To construct a seed, the segments are projected onto a cylinder which is roughly intersecting the middle stations of the spectrometer.

The links are decorated by the PrepDataToSimHitAssocAlg which is residing inside the MuonTruthAlgsR4 package. Before using these functions ensure that the algorithms are ran accordingly

Using FastDigi tool at the moment.

Uncalibrated xAOD measurements are collected from previously fitted segments and then passed through the global chi2 fitter. If the fit succeeded, a new xAOD::MuonSegment is created and the parameters as well as the hit summary are saved.

Typedef Documentation

◆ ActsPeakFinderForMuon

using MuonR4::ActsPeakFinderForMuon = Acts::HoughTransformUtils::PeakFinders::IslandsAroundMax<HoughHitType>

Definition at line 30 of file MuonHoughDefs.h.

◆ ActsPeakFinderForMuonCfg

using MuonR4::ActsPeakFinderForMuonCfg = Acts::HoughTransformUtils::PeakFinders::IslandsAroundMaxConfig

Definition at line 32 of file MuonHoughDefs.h.

◆ CalibSpacePointPtr

◆ CalibSpacePointVec

◆ Cat_t

◆ Cov_t

◆ EtaHoughMaxContainer

◆ GlobalPatternContainer

Abrivation of the GlobalPattern container type.

Definition at line 105 of file GlobalPattern.h.

◆ HitVec

◆ HoughEventData

◆ HoughHitType

Definition at line 24 of file MuonHoughDefs.h.

◆ HoughPlane

using MuonR4::HoughPlane = Acts::HoughTransformUtils::HoughPlane<HoughHitType>

Definition at line 26 of file MuonHoughDefs.h.

◆ LayerIndex

◆ LinkHandle_t

◆ MarkerHandle_t

◆ MsTrackSeedContainer

Definition at line 63 of file MsTrackSeed.h.

◆ PrdCont_t

Abrivation to call an uncalibrated measurement container.

Definition at line 26 of file xAODSegmentCnvAlg.cxx.

◆ PrdLink_t

Abrivation to call the link to an element inside an uncalibrated measurement container.

Definition at line 29 of file xAODSegmentCnvAlg.cxx.

◆ PrdLinkVec_t

typedef std::vector< PrdLink_t > MuonR4::PrdLinkVec_t = std::vector<PrdLink_t>

Abrivation of a collection of Prd links.

Definition at line 31 of file xAODSegmentCnvAlg.cxx.

◆ PrimitiveVec

◆ SearchTree_t

◆ SectorProjector

◆ SegLink_t

Abrivation of the link to the reco segment container.

Definition at line 24 of file xAODSegmentCnvAlg.cxx.

◆ SegLinkVec_t

typedef std::vector< SegLink_t > MuonR4::SegLinkVec_t = std::vector<SegLink_t>

Definition at line 15 of file MeasurementMarkerAlg.cxx.

◆ SegmentContainer

◆ SegmentSeedContainer

◆ SegPars

using MuonR4::SegPars = xAOD::MeasVector<Acts::toUnderlying(ParamDefs::nPars)>

Definition at line 17 of file SegmentFitParDecorAlg.cxx.

◆ SegPars_t

using MuonR4::SegPars_t = xAOD::MeasVector<Acts::toUnderlying(ParamDefs::nPars)>

Abrivation of the decorated local segment parameters.

Definition at line 33 of file xAODSegmentCnvAlg.cxx.

◆ SpacePointContainer

◆ Stat_t

◆ State

◆ sTgcDigitVec

◆ WriteDecorKey_t

Function Documentation

◆ chamberCoverage()

double MuonR4::chamberCoverage ( const std::array< double, 2 > & seedEdges,
const std::array< double, 2 > & chambEdges )
constexpr

Calculates how much of the unkknown coordinate along the tube range is covered by the chamber of interest.

Parameters
seedEdgesArray encoding the minimal [0] and maximal [1] possible position of the muon along the tube /strip
chambEdgesArray encoding the minmal [1] and maximal [1] position along the strip of a chamber

Partial overlap. The lower side of the seed is covered by the chamber.

Reverse case with the upper side of the seed covered

The chamber is fully embedded in the possible seed range

Definition at line 43 of file EtaHoughTransformAlg.cxx.

44 {
45 // The seed is full embedded
46 if (chambEdges[0] <= seedEdges[0] && chambEdges[1] >= seedEdges[1]) {
47 return 1.;
48 }
50 else if (chambEdges[0]<= seedEdges[0]) {
51 return (chambEdges[1] - seedEdges[0]) / (seedEdges[1] - seedEdges[0]);
52 }
54 else if (chambEdges[1] >= seedEdges[1]) {
55 return (seedEdges[1] - chambEdges[0]) / (seedEdges[1] - seedEdges[0]);
56 }
58 else if (seedEdges[0] <= chambEdges[0] && seedEdges[1] >= chambEdges[1]) {
59 return (chambEdges[1] - chambEdges[0]) / (seedEdges[1] - seedEdges[0]);
60 }
61 return 0.;
62 }

◆ collectMeasurements()

std::vector< const xAOD::UncalibratedMeasurement * > MuonR4::collectMeasurements ( const xAOD::MuonSegment & segment,
bool skipOutlier = true )

Helper function to extract the measurements from the segment.

Parameters
segmentReference to the segment of interest
skipOutlierSwitch toggling whether outlier measurements or invalid calib state measurements should be ignored

Definition at line 56 of file TrackingHelpers.cxx.

57 {
58 std::vector<const xAOD::UncalibratedMeasurement*> out{};
59 const PrdLinkVec_t& links{acc_prdLinks(segment)};
60 out.reserve(links.size());
61 for (std::size_t l = 0 ; l < links.size(); ++l) {
62 const PrdLink_t& link{links[l]};
63 if (!skipOutlier || !isOutlierMeasurement(segment, l)) {
64 out.push_back(*link);
65 }
66 }
67 return out;
68 }
std::vector< PrdLink_t > PrdLinkVec_t
Abrivation of a collection of Prd links.
bool isOutlierMeasurement(const xAOD::MuonSegment &segment, const std::size_t n)
Returns whether the n-the uncalibrated measurement is an outlier.
ElementLink< PrdCont_t > PrdLink_t
Abrivation to call the link to an element inside an uncalibrated measurement container.
l
Printing final latex table to .tex output file.
pointer & link(pointer p) const
Return a reference to the link for an element.

◆ detailedSegment()

const Segment * MuonR4::detailedSegment ( const xAOD::MuonSegment & seg)

Helper function to navigate from the xAOD::MuonSegment to the MuonR4::Segment.

The segment should be decorated with 'parentSegment' decoration.

Parameters
segReference to the segment of interest.

Definition at line 24 of file TrackingHelpers.cxx.

24 {
26 static const SG::ConstAccessor<SegLink_t> acc{"parentSegment"};
27 if (acc.isAvailable(seg)){
28 const SegLink_t& link{acc(seg)};
29 if (link.isValid()){
30 return *link;
31 }
32 }
33 return nullptr;
34 }
Helper class to provide constant type-safe access to aux data.
ElementLink< MuonR4::SegmentContainer > SegLink_t
Abrivation of the link to the reco segment container.

◆ getMatchedTruthSegment() [1/2]

const xAOD::MuonSegment * MuonR4::getMatchedTruthSegment ( const xAOD::MuonSegment & segment)

Returns the truth-matched segment.

Definition at line 125 of file MuonSimHitHelpers.cxx.

125 {
126 static const SG::ConstAccessor<SegLink_t> acc{"truthSegmentLink"};
127 if (acc.isAvailable(segment)) {
128 const SegLink_t& link{acc(segment)};
129 if (link.isValid()){
130 return *link;
131 }
132 }
133 return nullptr;
134 }

◆ getMatchedTruthSegment() [2/2]

const xAOD::MuonSegment * MuonR4::getMatchedTruthSegment ( const xAOD::MuonSimHit & hit)

Returns the segment matched to the sim hit.

Definition at line 136 of file MuonSimHitHelpers.cxx.

136 {
137 static const SG::ConstAccessor<SegLink_t> acc{"truthSegmentLink"};
138 if (acc.isAvailable(hit)) {
139 const SegLink_t& link{acc(hit)};
140 if (link.isValid()){
141 return *link;
142 }
143 }
144 return nullptr;
145 }

◆ getMatchingSimHits() [1/6]

std::unordered_set< const xAOD::MuonSimHit * > MuonR4::getMatchingSimHits ( const Segment & seg)

Returns all sim hits that are matched to the reconstructed segment.

Definition at line 99 of file MuonSimHitHelpers.cxx.

99 {
100 std::vector<const CalibratedSpacePoint*> calibSps{};
101 calibSps.reserve(segment.measurements().size());
102 std::ranges::transform(segment.measurements(), std::back_inserter(calibSps), [](const auto& meas){return meas.get();});
103 return getMatchingSimHits(calibSps);
104 }
std::unordered_set< const xAOD::MuonSimHit * > getMatchingSimHits(const xAOD::MuonSegment &segment)
: Returns all sim hits matched to a xAOD::MuonSegment

◆ getMatchingSimHits() [2/6]

std::unordered_set< const xAOD::MuonSimHit * > MuonR4::getMatchingSimHits ( const SegmentSeed & seed)

Returns all sim hits that are matched to the segmentSeed.

Definition at line 111 of file MuonSimHitHelpers.cxx.

111 {
112 return getMatchingSimHits(seed.getHitsInMax());
113 }

◆ getMatchingSimHits() [3/6]

std::unordered_set< const xAOD::MuonSimHit * > MuonR4::getMatchingSimHits ( const SpacePointBucket & bucket)

Returns all sim hits that are matched to the spacePoint bucket.

Definition at line 105 of file MuonSimHitHelpers.cxx.

105 {
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();});
109 return getMatchingSimHits(spacePoints);
110 }
static Double_t sp

◆ getMatchingSimHits() [4/6]

std::unordered_set< const xAOD::MuonSimHit * > MuonR4::getMatchingSimHits ( const std::vector< const CalibratedSpacePoint * > & measurements)

Returns all sim hits that are matched to a collection of calibrated space points.

Definition at line 83 of file MuonSimHitHelpers.cxx.

83 {
84 std::unordered_set<const xAOD::MuonSimHit*> hits{};
85 for (const CalibratedSpacePoint* meas : measurements) {
86 const SpacePoint* sp = meas->spacePoint();
87 if (!sp) continue;
88 const xAOD::MuonSimHit* primHit{getTruthMatchedHit(*sp->primaryMeasurement())};
89 const xAOD::MuonSimHit* secHit{sp->dimension() == 2 ? getTruthMatchedHit(*sp->secondaryMeasurement()) : nullptr};
90 if(primHit){
91 hits.insert(primHit);
92 }
93 if (secHit && secHit != primHit) {
94 hits.insert(secHit);
95 }
96 }
97 return hits;
98 }
const xAOD::MuonSimHit * getTruthMatchedHit(const xAOD::MuonMeasurement &prdHit)
Returns the MuonSimHit, if there's any, matched to the uncalibrated muon measurement.
MuonSimHit_v1 MuonSimHit
Defined the version of the MuonSimHit.
Definition MuonSimHit.h:12

◆ getMatchingSimHits() [5/6]

std::unordered_set< const xAOD::MuonSimHit * > MuonR4::getMatchingSimHits ( const std::vector< const SpacePoint * > & spacePoints)

Returns all sim hits that are matched to a collection of space points.

For each spacepoint, the hit truth matching to the primary and secondary prd are retrieved. The secondary hit is only added if it's different from the primary one.

Definition at line 68 of file MuonSimHitHelpers.cxx.

68 {
69 std::unordered_set<const xAOD::MuonSimHit*> hits{};
70 for (const SpacePoint* sp : spacePoints) {
71 const xAOD::MuonSimHit* primHit{getTruthMatchedHit(*sp->primaryMeasurement())};
72 const xAOD::MuonSimHit* secHit{sp->dimension() == 2 ? getTruthMatchedHit(*sp->secondaryMeasurement()) : nullptr};
73 if(primHit){
74 hits.insert(primHit);
75 }
76 if (secHit && secHit != primHit) {
77 hits.insert(secHit);
78 }
79 }
80 return hits;
81 }

◆ getMatchingSimHits() [6/6]

std::unordered_set< const xAOD::MuonSimHit * > MuonR4::getMatchingSimHits ( const xAOD::MuonSegment & segment)

: Returns all sim hits matched to a xAOD::MuonSegment

Definition at line 38 of file MuonSimHitHelpers.cxx.

38 {
39
40 static const SG::ConstAccessor<SimHitLinkVec_t> acc_simLink{"simHitLinks"};
41 static const SG::ConstAccessor<PrdLinkVec_t> acc_prdLink{"prdLinks"};
42 std::unordered_set<const xAOD::MuonSimHit*> hits{};
43 if (acc_simLink.isAvailable(segment)){
44 hits.reserve(acc_simLink(segment).size());
45 for (const SimHitLink_t& link : acc_simLink(segment)) {
46 if (link.isValid()) {
47 hits.insert(*link);
48 }
49 }
50 } else if (acc_prdLink.isAvailable(segment)){
51 for (const PrdLink_t& link : acc_prdLink(segment)) {
52 if(!link.isValid()){
53 continue;
54 }
55 const auto* prdHit = dynamic_cast<const xAOD::MuonMeasurement*>(*link);
56 if (!prdHit) {
57 continue;
58 }
59 const xAOD::MuonSimHit* hit = getTruthMatchedHit(*prdHit);
60 if (hit){
61 hits.insert(hit);
62 }
63 }
64 }
65 return hits;
66 }
size_t size() const
Number of registered mappings.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
MuonMeasurement_v1 MuonMeasurement

◆ getMeasurement()

const xAOD::UncalibratedMeasurement * MuonR4::getMeasurement ( const xAOD::MuonSegment & segment,
const std::size_t n )

Returns the n-th uncalibrated measurement.

Parameters
segmentReference to the segment of interest
nIndex of the measurement to retrieve

Definition at line 39 of file TrackingHelpers.cxx.

40 {
41 if (!acc_prdLinks.isAvailable(segment)) {
42 return nullptr;
43 }
44 assert(n < nMeasurements(segment));
45 const PrdLink_t& link{acc_prdLinks(segment)[n]};
46 return link.isValid() ? *link : nullptr;
47 }
std::size_t nMeasurements(const xAOD::MuonSegment &segment)
Returns the number of associated Uncalibrated measurements.

◆ getTruthMatchedHit()

const xAOD::MuonSimHit * MuonR4::getTruthMatchedHit ( const xAOD::MuonMeasurement & prdHit)

Returns the MuonSimHit, if there's any, matched to the uncalibrated muon measurement.

Definition at line 27 of file MuonSimHitHelpers.cxx.

27 {
28 static const SG::ConstAccessor<SimHitLink_t> acc("simHitLink");
29 if (acc.isAvailable(prdHit)){
30 const SimHitLink_t& link{acc(prdHit)};
31 if (link.isValid()) {
32 return (*link);
33 }
34 }
35 return nullptr;
36 }

◆ getTruthMatchedParticle() [1/2]

const xAOD::TruthParticle * MuonR4::getTruthMatchedParticle ( const xAOD::MuonSegment & segment)

Returns the particle truth-matched to the segment.

Definition at line 114 of file MuonSimHitHelpers.cxx.

114 {
116 static const SG::ConstAccessor<TruthLink_t> acc{"truthParticleLink"};
117 if (acc.isAvailable(segment)){
118 const TruthLink_t& link {acc(segment)};
119 if (link.isValid()) {
120 return *link;
121 }
122 }
123 return nullptr;
124 }
ElementLink< xAOD::TruthParticleContainer > TruthLink_t

◆ getTruthMatchedParticle() [2/2]

const xAOD::TruthParticle * MuonR4::getTruthMatchedParticle ( const xAOD::MuonSimHit & hit)

Returns the truth particle matched to the sim hit.

Definition at line 146 of file MuonSimHitHelpers.cxx.

146 {
147 const xAOD::MuonSegment* truthSeg = getMatchedTruthSegment(hit);
148 return truthSeg ? getTruthMatchedParticle(*truthSeg) : nullptr;
149 }
const xAOD::TruthParticle * getTruthMatchedParticle(const xAOD::MuonSegment &segment)
Returns the particle truth-matched to the segment.
const xAOD::MuonSegment * getMatchedTruthSegment(const xAOD::MuonSegment &segment)
Returns the truth-matched segment.
MuonSegment_v1 MuonSegment
Reference the current persistent version:

◆ getTruthSegments()

std::vector< const xAOD::MuonSegment * > MuonR4::getTruthSegments ( const xAOD::TruthParticle & truthMuon)

Returns the segments associated to the truth muon.

Definition at line 151 of file MuonSimHitHelpers.cxx.

151 {
152 static const SG::ConstAccessor<SegLinkVec_t> acc{"truthSegmentLinks"};
153 std::vector<const xAOD::MuonSegment*> segments{};
154
155 if (!acc.isAvailable(truthMuon)) {
156 return segments;
157 }
158 for (const SegLink_t& link : acc(truthMuon)) {
159 segments.emplace_back(*link);
160 }
161 return segments;
162 }

◆ houghTanAlpha()

double MuonR4::houghTanAlpha ( const Amg::Vector3D & v)

: Returns the hough tanAlpha [x] / [z]

Parameters
vArbitrary direction vector

Definition at line 30 of file SegmentFitterEventData.cxx.

30 {
31 constexpr double eps = std::numeric_limits<float>::epsilon();
32 return v.x() / ( std::abs(v.z()) > eps ? v.z() : eps);
33 }

◆ houghTanBeta()

double MuonR4::houghTanBeta ( const Amg::Vector3D & v)

Returns the hough tanBeta [y] / [z].

Parameters
vArbitrary direction vector

Definition at line 26 of file SegmentFitterEventData.cxx.

26 {
27 constexpr double eps = std::numeric_limits<float>::epsilon();
28 return v.y() / ( std::abs(v.z()) > eps ? v.z() : eps);
29 }

◆ isGoodHit()

bool MuonR4::isGoodHit ( const CalibratedSpacePoint & hit)

Returns whether the calibrated spacepoint is valid and therefore suitable to be used in the segment fit.

Parameters
hitReference to the calibrated space point of interest

Definition at line 16 of file SpacePointHelpers.cxx.

16 {
18 return hit.fitState() == Valid;
19}
State
State flag to distinguish different space point states.
State fitState() const
Returns the state of the calibrated space point.

◆ isOutlierMeasurement()

bool MuonR4::isOutlierMeasurement ( const xAOD::MuonSegment & segment,
const std::size_t n )

Returns whether the n-the uncalibrated measurement is an outlier.

Parameters
segmentReference to the segment of interest
nIndex of the measurement to retrieve

Definition at line 48 of file TrackingHelpers.cxx.

49 {
50 if(!acc_prdState.isAvailable(segment)) {
51 return false;
52 }
53 assert (n < acc_prdState(segment).size());
54 return acc_prdState(segment)[n] != Acts::toUnderlying(CalibratedSpacePoint::State::Valid);
55 }

◆ isPrecisionHit() [1/2]

bool MuonR4::isPrecisionHit ( const CalibratedSpacePoint & hit)

Returns whether the calibrated spacepoint is a precision hit (Mdt, micromegas, stgc strips).

Parameters
hitReference to the calibrated space point of interest

Definition at line 20 of file SpacePointHelpers.cxx.

20 {
21 using enum xAOD::UncalibMeasType;
23 return false;
24 }
25 return isGoodHit(hit) && isPrecisionHit(*hit.spacePoint());
26}
const SpacePoint * spacePoint() const
The pointer to the space point out of which this space point has been built.
xAOD::UncalibMeasType type() const
Returns the space point type.
bool isPrecisionHit(const SpacePoint &hit)
Returns whether the uncalibrated spacepoint is a precision hit (Mdt, micromegas, stgc strips).
bool isGoodHit(const CalibratedSpacePoint &hit)
Returns whether the calibrated spacepoint is valid and therefore suitable to be used in the segment f...
UncalibMeasType
Define the type of the uncalibrated measurement.

◆ isPrecisionHit() [2/2]

bool MuonR4::isPrecisionHit ( const SpacePoint & hit)

Returns whether the uncalibrated spacepoint is a precision hit (Mdt, micromegas, stgc strips).

Parameters
hitReference to the uncalibrated space point

Definition at line 9 of file SpacePointHelpers.cxx.

9 {
10 using enum xAOD::UncalibMeasType;
11 return hit.type() == MdtDriftCircleType || hit.type() == MMClusterType ||
12 (hit.type() == sTgcStripType &&
13 static_cast<const xAOD::sTgcMeasurement*>(hit.primaryMeasurement())->channelType() ==
15}
sTgcMeasurement_v1 sTgcMeasurement

◆ nMeasurements()

std::size_t MuonR4::nMeasurements ( const xAOD::MuonSegment & segment)

Returns the number of associated Uncalibrated measurements.

Parameters
segmentReference to the segment of interest

Definition at line 36 of file TrackingHelpers.cxx.

36 {
37 return acc_prdLinks.isAvailable(segment) ? acc_prdLinks(segment).size() : 0;
38 }

◆ operator<<()

std::ostream & MuonR4::operator<< ( std::ostream & ostr,
const MuonR4::MsTrackSeed & seed )

Definition at line 16 of file MsTrackSeed.cxx.

16 {
17 ostr<<"MS Track seed @"<<Amg::toString(seed.position())<<", sector: "<<seed.sector() << ", location: "<< Acts::toUnderlying(seed.location())<< std::endl;
18 using namespace Muon::MuonStationIndex;
19 for (const xAOD::MuonSegment* seg : seed.segments()) {
20 ostr<<" **** "<< printID(*seg)
21 <<", theta: "<<(seg->direction().theta() /Gaudi::Units::degree)
22 <<", phi: "<<(seg->direction().phi() /Gaudi::Units::degree)
23 <<", R: "<<Acts::fastHypot(seg->x(), seg->y())
24 <<", Z: "<<seg->z()<<" "<<(seg->position().theta() / Gaudi::Units::degree)
25 // <<", "<<SegmentFit::toString(SegmentFit::localSegmentPars(*seg))
26 <<", chi2: "<<(seg->chiSquared() / std::max(seg->numberDoF(), 1.f))
27 <<", nPrec: "<<seg->nPrecisionHits()
28 <<", nPhi: "<<seg->nPhiLayers()
29 <<", nTrigEta: "<<seg->nTrigEtaLayers()<<std::endl;
30 }
31 return ostr;
32 }
Scalar phi() const
phi method
Scalar theta() const
theta method
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
std::string printID(const xAOD::MuonSegment &seg)
Print the chamber ID of a segment, e.g.

◆ passesThrough()

bool MuonR4::passesThrough ( const SpacePointBucket::chamberLocation & loc,
double y0,
double tanBeta )
inline

Definition at line 25 of file EtaHoughTransformAlg.cxx.

25 {
26 double yCross = (y0 + loc.location().z() * tanBeta);
27 return (loc.minY() < yCross && yCross < loc. maxY());
28 }
#define z
double minY() const
Returns the minimum y covered by the chamber location.
const Amg::Vector3D & location() const
Returns the location.

◆ print()

template<Acts::Experimental::CompositeSpacePointContainer cont_t>
std::string MuonR4::print ( const cont_t & container)

Print a space point container to string.

Parameters
containerReference to the space point container to print

◆ printID()

std::string MuonR4::printID ( const xAOD::MuonSegment & seg)

Print the chamber ID of a segment, e.g.

BMS1A12, meaning that the segment is in the first BMS eta station on the A-side in sector 12

Parameters
segReference to the segment from which the id should be printed

Definition at line 17 of file TrackingHelpers.cxx.

17 {
18 using namespace Muon::MuonStationIndex;
19 return std::format("{:}{:}{:}{:}", chName(seg.chamberIndex()),
20 std::abs(seg.etaIndex()),
21 seg.etaIndex() > 0 ? 'A' : 'C',
22 seg.sector());
23 }
::Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index.
int etaIndex() const
Returns the eta index, which corresponds to stationEta in the offline identifiers (and the ).
const std::string & chName(ChIndex index)
convert ChIndex into a string

◆ proximity()

double MuonR4::proximity ( const SpacePoint * dc,
double y0,
double tanBeta )
inline

Definition at line 30 of file EtaHoughTransformAlg.cxx.

30 {
32 return std::min(std::abs(HoughHelpers::Eta::houghParamMdtLeft(tanBeta, dc) - y0),
33 std::abs(HoughHelpers::Eta::houghParamMdtRight(tanBeta, dc) - y0));
34 }
35 return std::abs(HoughHelpers::Eta::houghParamStrip(tanBeta, dc) - y0);
36 }
double houghParamMdtRight(double tanBeta, const MuonR4::HoughHitType &dc)
right-side straight line parametrisation for drift circles
double houghParamStrip(double tanBeta, const MuonR4::HoughHitType &strip)
straight line parametrisation for strip detector measurements
double houghParamMdtLeft(double tanBeta, const MuonR4::HoughHitType &dc)
left-side straight line parametrisation for drift circles

◆ volumeId()

Acts::GeometryIdentifier MuonR4::volumeId ( const Acts::Surface & surface)

Returns the identifier of the volume in which the surface is embedded.

Parameters
surfaceReference to the surface of interest

Definition at line 69 of file TrackingHelpers.cxx.

69 {
70 return surface.geometryId().withSensitive(0).withBoundary(0);
71 }

Variable Documentation

◆ minLayers

unsigned MuonR4::minLayers {4}
constexpr

Definition at line 79 of file NswSegmentFinderAlg.cxx.

79{4};