Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
MuonR4 Namespace Reference

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

Namespaces

 CombinatorialSeedSolver
 
 HoughHelpers
 
 SegmentFit
 
 SegmentFitHelpers
 

Classes

class  BucketDumperAlg
 
class  CalibratedSpacePoint
 The calibrated Space point is created during the calibration process. More...
 
class  CombinatorialNSWSeedFinderAlg
 
class  EtaHoughTransformAlg
 Algorithm to handle the eta hough transform. 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  ISegmentSelectionTool
 
class  ISpacePointCalibrator
 Interface class to refine the space point calibration with an external seed. More...
 
class  MdtDigitizationTool
 
class  MdtMeasViewAlg
 
class  MdtSegmentFitter
 
class  MdtSegmentSeedGenerator
 Helper class to generate valid seeds for the segment fit. More...
 
class  MeasurementMarkerAlg
 Algorithm that marks the uncalibrated measurements making up a segment, where the segment passes an arbitrary selection requirement. More...
 
class  MM_DigitizationTool
 
class  MmFastDigiTool
 
class  MSTrackFindingAlg
 
class  MsTrackSeed
 
class  MuonDigitizationTool
 Barebone implementation of the I/O infrastructure for all MuonDigitizationTools. More...
 
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  PhiHoughTransformAlg
 Algorithm to handle the phi hough transform. More...
 
class  PrdMultiTruthMaker
 The PrdMultiTruthMaker translates the UncalibratedMeasurementContainers of a given MS technology to PRD_MultiTruthCollections, which are later needed for a TruthParticle <-> SDO matching. 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  RpcClusteringAlg
 
class  RpcFastDigiTool
 
class  RpcMeasViewAlg
 
class  RpcRdoToRpcPrepDataTool
 
class  SdoMultiTruthMaker
 The SdoMuliTruthMaker translates the HepMCParticle links associated with the SDO into a PRD_MultiTruthCollection. More...
 
class  Segment
 Placeholder for what will later be the muon segment EDM representation. More...
 
class  SegmentAmbiSolver
 
class  SegmentFitParDecorAlg
 Algorithm to decorate the segment fit parameters in the chamber's frame onto the xAOD::MuonSegment Additionally, the ElementLinks to the associated measurements are decorated. More...
 
struct  SegmentFitResult
 
class  SegmentFittingAlg
 Algorithm to handle segment fits
More...
 
class  SegmentMarkerAlg
 
class  SegmentSeed
 Representation of a segment seed (a fully processed hough maximum) produced by the hough transform. More...
 
class  SegmentSelectionTool
 
class  SegmentViewAlg
 
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  SpacePointCalibrator
 
class  SpacePointCsvDumperAlg
 
class  SpacePointMakerAlg
 
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...
 
class  SPIdDumperAlg
 
class  sTgcFastDigiTool
 
class  sTgcMeasViewAlg
 
class  TgcFastDigiTool
 
class  TrackToTruthPartAssocAlg
 The TrackToTruthPartAssocAlg matches the reconstructed tracks to truth muons. More...
 
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  TruthMeasMarkerAlg
 
class  TruthOverlay
 
class  TruthSegmentCsvDumperAlg
 
class  TruthSegmentMaker
 
class  TruthSegToTruthPartAssocAlg
 The TruthSegToTruthPartAssocAlg associates the TruthSegments with the primary TruthParticle from the IP. More...
 
class  xAODSegmentCnvAlg
 The xAODSegmentCnvAlg takes MuonR4::Segments and converts them into an xAOD::MuonSegmentContainer. More...
 
class  xRpcMeasToRpcTrkPrdCnvAlg
 Conversion algorithm to turn xAOD::RpcMeasurements into Trk::RpcPrepData. More...
 

Typedefs

using HoughEventData = HoughEventData_impl< ActsPeakFinderForMuon, ActsPeakFinderForMuonCfg >
 
using HoughHitType = HoughMaximum::HitType
 
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 >
 
using Covariance_t = CalibratedSpacePoint::Covariance_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 >
 
using PrdCont_t = xAOD::UncalibratedMeasurementContainer
 
using PrdLink_t = ElementLink< PrdCont_t >
 
using PrdLinkVec_t = std::vector< PrdLink_t >
 
using SegPars_t = xAOD::MeasVector< toInt(ParamDefs::nPars)>
 
using TechIdx_t = Muon::MuonStationIndex::TechnologyIndex
 
using HitType = SegmentFitResult::HitType
 
using SegmentVec = SegmentAmbiSolver::SegmentVec
 
using HitLayVec = SpacePointPerLayerSplitter::HitLayVec
 
using HitLaySpan = std::span< const HitVec, std::dynamic_extent >
 
using PrimitiveVec = MuonValR4::IPatternVisualizationTool::PrimitiveVec
 
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< toInt(ParamDefs::nPars)>
 

Enumerations

enum  HitWindow { HitWindow::tooLow = 0, HitWindow::inside, HitWindow::tooHigh }
 

Functions

double houghTanTheta (const Amg::Vector3D &v)
 Returns the hough tanTheta [y] / [z]. More...
 
double houghTanPhi (const Amg::Vector3D &v)
 : Returns the hough tanPhi [x] / [z] More...
 
Amg::Vector3D multiply (const CalibratedSpacePoint::Covariance_t &mat, const Amg::Vector3D &v)
 Multiplies a 3D vector with the covariance matrix which can be either 2x2 or 3x3 matrix. More...
 
Amg::Vector2D multiply (const CalibratedSpacePoint::Covariance_t &mat, const Amg::Vector2D &v)
 Multiplies a 2D vector with the covariance matrix which has to be a 2x2 matrix. More...
 
CalibratedSpacePoint::Covariance_t inverse (const CalibratedSpacePoint::Covariance_t &mat)
 Inverts the parsed matrix. More...
 
double contract (const CalibratedSpacePoint::Covariance_t &mat, const Amg::Vector3D &a, const Amg::Vector3D &b)
 
double contract (const CalibratedSpacePoint::Covariance_t &mat, const Amg::Vector2D &a, const Amg::Vector2D &b)
 
double contract (const CalibratedSpacePoint::Covariance_t &mat, const Amg::Vector3D &a)
 
double contract (const CalibratedSpacePoint::Covariance_t &mat, const Amg::Vector2D &a)
 
std::string toString (const CalibratedSpacePoint::Covariance_t &mat)
 Returns the matrix in string. More...
 
const AmgSymMatrix (2) &SpacePoint
 
HitVec stripSmartPtr (const SpacePointBucket &bucket)
 
const SegmentdetailedSegment (const xAOD::MuonSegment &seg)
 Helper function to navigate from the xAOD::MuonSegment to the MuonR4::Segment. More...
 
const xAOD::MuonSimHitgetTruthMatchedHit (const xAOD::UncalibratedMeasurement &prdHit)
 Returns the MuonSimHit, if there's any, matched to the uncalibrated muon measurement. More...
 
std::unordered_set< const xAOD::MuonSimHit * > getMatchingSimHits (const xAOD::MuonSegment &segment)
 : Returns all sim hits matched to a xAOD::MuonSegment More...
 
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. More...
 
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. More...
 
std::unordered_set< const xAOD::MuonSimHit * > getMatchingSimHits (const Segment &seg)
 Returns all sim hits that are matched to the reconstructed segment. More...
 
std::unordered_set< const xAOD::MuonSimHit * > getMatchingSimHits (const SegmentSeed &seed)
 Returns all sim hits that are matched to the segmentSeed. More...
 
std::unordered_set< const xAOD::MuonSimHit * > getMatchingSimHits (const SpacePointBucket &bucket)
 Returns all sim hits that are matched to the spacePoint bucket. More...
 
const xAOD::TruthParticlegetTruthMatchedParticle (const xAOD::MuonSegment &segment)
 Returns the particle truth-matched to the segment. More...
 
const xAOD::MuonSegmentgetMatchedTruthSegment (const xAOD::MuonSegment &segment)
 Returns the truth-matched segment. More...
 
constexpr TechIdx_t toTechIdx (const xAOD::UncalibMeasType aodType)
 
constexpr double sign (const double x)
 Returns the sign of a number. More...
 
constexpr unsigned int sumUp (unsigned k)
 Calculates the sum of 1 + 2 +3 +4 +... More...
 
template<unsigned int n>
constexpr unsigned int vecIdxFromSymMat (unsigned int i, unsigned k)
 If a n-dimensional Matrix is symmetric, it has n* (n+1) /2 parameters The following function returns the global index when filling the content of the matrix into a vector via for (i = 0; i < n; ++i) { for (k =i; k<n; ++k){ } }. More...
 
template<int n>
constexpr std::array< unsigned, 2 > symMatIdxFromVec (unsigned int k)
 Translates back the global index into the two matrix access indices under the assumption that the matrix is symmetric. More...
 
double driftCov (const CalibratedSpacePoint &dcHit)
 
constexpr bool passRangeCut (const std::array< double, 2 > &cutRange, const double value)
 
bool passesThrough (const SpacePointBucket::chamberLocation &loc, double y0, double tanTheta)
 
double proximity (const SpacePoint *dc, double y0, double tanTheta)
 
MuonR4::SegmentFitResult::HitVec copy (const MuonR4::SegmentFitResult::HitVec &hits)
 
MuonR4::SegmentFitResult copy (const MuonR4::SegmentFitResult &toCopy)
 
bool removeBeamSpot (MuonR4::SegmentFitResult::HitVec &hits)
 

Variables

constexpr unsigned int minLayers {4}
 

Detailed Description

This header ties the generic definitions in this package.

: 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.

The MsTrackSeed represents all segments which may be compatible with a single track trajectory.

copyright am arsch

the accumulator, and the peak finder.

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

Typedef Documentation

◆ ActsPeakFinderForMuon

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

Definition at line 24 of file MuonHoughDefs.h.

◆ ActsPeakFinderForMuonCfg

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

Definition at line 26 of file MuonHoughDefs.h.

◆ CalibSpacePointPtr

Definition at line 23 of file SpacePointCalibrator.cxx.

◆ CalibSpacePointVec

Definition at line 22 of file SpacePointCalibrator.cxx.

◆ Covariance_t

Definition at line 8 of file CalibratedSpacePoint.cxx.

◆ EtaHoughMaxContainer

Definition at line 14 of file MuonPatternContainer.h.

◆ HitLaySpan

using MuonR4::HitLaySpan = typedef std::span<const HitVec,std::dynamic_extent>

Definition at line 29 of file CombinatorialNSWSeedFinderAlg.h.

◆ HitLayVec

Definition at line 28 of file CombinatorialNSWSeedFinderAlg.h.

◆ HitType

Definition at line 36 of file MdtSegmentFitter.cxx.

◆ HitVec

Definition at line 11 of file SpacePointPerLayerSplitter.cxx.

◆ HoughEventData

Definition at line 71 of file HoughEventData.h.

◆ HoughHitType

Definition at line 18 of file MuonHoughDefs.h.

◆ HoughPlane

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

Definition at line 20 of file MuonHoughDefs.h.

◆ LinkHandle_t

Definition at line 21 of file MeasurementMarkerAlg.cxx.

◆ MarkerHandle_t

Definition at line 20 of file MeasurementMarkerAlg.cxx.

◆ MsTrackSeedContainer

using MuonR4::MsTrackSeedContainer = typedef std::vector<MsTrackSeed>

Definition at line 40 of file MsTrackSeed.h.

◆ PrdCont_t

Definition at line 19 of file xAODSegmentCnvAlg.cxx.

◆ PrdLink_t

Definition at line 20 of file xAODSegmentCnvAlg.cxx.

◆ PrdLinkVec_t

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

Definition at line 21 of file xAODSegmentCnvAlg.cxx.

◆ PrimitiveVec

Definition at line 59 of file SegmentFittingAlg.cxx.

◆ SegLink_t

Definition at line 18 of file xAODSegmentCnvAlg.cxx.

◆ SegLinkVec_t

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

Definition at line 15 of file MeasurementMarkerAlg.cxx.

◆ SegmentContainer

Definition at line 16 of file MuonPatternContainer.h.

◆ SegmentSeedContainer

Definition at line 15 of file MuonPatternContainer.h.

◆ SegmentVec

Definition at line 10 of file SegmentAmbiSolver.cxx.

◆ SegPars

Definition at line 15 of file SegmentFitParDecorAlg.cxx.

◆ SegPars_t

Definition at line 23 of file xAODSegmentCnvAlg.cxx.

◆ SpacePointContainer

◆ State

Definition at line 24 of file SpacePointCalibrator.cxx.

◆ TechIdx_t

Definition at line 26 of file xAODSegmentCnvAlg.cxx.

◆ WriteDecorKey_t

Definition at line 23 of file MeasurementMarkerAlg.cxx.

Enumeration Type Documentation

◆ HitWindow

enum MuonR4::HitWindow
strong
Enumerator
tooLow 
inside 
tooHigh 

Definition at line 31 of file CombinatorialNSWSeedFinderAlg.h.

31  {
32  tooLow = 0,
33 
34  inside,
35 
36  tooHigh
37 };

Function Documentation

◆ AmgSymMatrix()

const MuonR4::AmgSymMatrix ( ) &

Definition at line 150 of file MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/SpacePoint.cxx.

150  {
151  return m_measCovariance;
152  }
153  void SpacePoint::setInstanceCounts(std::shared_ptr<unsigned int> etaCounts,
154  std::shared_ptr<unsigned int> phiCounts) {
155  updateInstanceCounts(m_etaInstances, std::move(etaCounts));
156  updateInstanceCounts(m_phiInstances, std::move(phiCounts));
157  }

◆ contract() [1/4]

double MuonR4::contract ( const CalibratedSpacePoint::Covariance_t mat,
const Amg::Vector2D a 
)

Definition at line 24 of file MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/UtilFunctions.cxx.

24  {
25  return contract(mat,a,a);
26  }

◆ contract() [2/4]

double MuonR4::contract ( const CalibratedSpacePoint::Covariance_t mat,
const Amg::Vector2D a,
const Amg::Vector2D b 
)

Definition at line 27 of file MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/UtilFunctions.cxx.

27  {
28  return std::visit([&a,&b](const auto& cov) ->double {
29  using CovType = std::decay_t<decltype(cov)>;
30  if constexpr(std::is_same_v<CovType, AmgSymMatrix(2)>) {
31  return a.dot(cov*b);
32  } else {
33  THROW_EXCEPTION("Cannot perform the bilinear product between "<<Amg::toString(a)
34  <<", "<<Amg::toString(cov)<<", "<<Amg::toString(b));
35  }
36  return 0.;
37  }, mat);
38  }

◆ contract() [3/4]

double MuonR4::contract ( const CalibratedSpacePoint::Covariance_t mat,
const Amg::Vector3D a 
)

Definition at line 10 of file MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/UtilFunctions.cxx.

10  {
11  return contract(mat,a,a);
12  }

◆ contract() [4/4]

double MuonR4::contract ( const CalibratedSpacePoint::Covariance_t mat,
const Amg::Vector3D a,
const Amg::Vector3D b 
)

Definition at line 13 of file MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/UtilFunctions.cxx.

13  {
14  return std::visit([&a,&b](const auto& cov) ->double{
15  using CovType = std::decay_t<decltype(cov)>;
16  if constexpr(std::is_same_v<CovType, AmgSymMatrix(2)>) {
17  return a.block<2,1>(0,0).dot(cov*b.block<2,1>(0,0));
18  } else if constexpr(std::is_same_v<CovType, AmgSymMatrix(3)>){
19  return a.dot(static_cast<const CovType&>(cov)*b);
20  }
21  return 0.;
22  }, mat);
23  }

◆ copy() [1/2]

Definition at line 41 of file SegmentFittingAlg.cxx.

41  {
43  toRet.segmentPars = toCopy.segmentPars;
44  toRet.calibMeasurements = copy(toCopy.calibMeasurements);
45  toRet.chi2 = toCopy.chi2;
46  toRet.nDoF = toCopy.nDoF;
47  toRet.timeFit = toCopy.timeFit;
48  return toRet;
49  }

◆ copy() [2/2]

Definition at line 34 of file SegmentFittingAlg.cxx.

34  {
36  copied.reserve(hits.size());
37  std::ranges::transform(hits, std::back_inserter(copied),
38  [](const auto& hit) { return std::make_unique<MuonR4::CalibratedSpacePoint>(*hit);});
39  return copied;
40  }

◆ 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 7 of file TrackingHelpers.cxx.

7  {
9  static const SG::ConstAccessor<SegLink_t> acc{"parentSegment"};
10  if (acc.isAvailable(seg)){
11  const SegLink_t& link{acc(seg)};
12  if (link.isValid()){
13  return *link;
14  }
15  }
16  return nullptr;
17  }

◆ driftCov()

double MuonR4::driftCov ( const CalibratedSpacePoint dcHit)

Definition at line 22 of file MdtSegmentSeedGenerator.cxx.

22  {
23  return std::visit([](const auto& cov) ->double{
25  }, dcHit.covariance());
26  }

◆ getMatchedTruthSegment()

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

Returns the truth-matched segment.

Definition at line 111 of file MuonSimHitHelpers.cxx.

111  {
113  static const SG::ConstAccessor<SegLink_t> acc{"truthSegmentLink"};
114  if (acc.isAvailable(segment)) {
115  const SegLink_t& link{acc(segment)};
116  if (link.isValid()){
117  return *link;
118  }
119  }
120  return nullptr;
121  }

◆ 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 85 of file MuonSimHitHelpers.cxx.

85  {
86  std::vector<const CalibratedSpacePoint*> calibSps{};
87  calibSps.reserve(segment.measurements().size());
88  std::ranges::transform(segment.measurements(), std::back_inserter(calibSps), [](const auto& meas){return meas.get();});
89  return getMatchingSimHits(calibSps);
90  }

◆ 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 97 of file MuonSimHitHelpers.cxx.

97  {
98  return getMatchingSimHits(seed.getHitsInMax());
99  }

◆ 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 91 of file MuonSimHitHelpers.cxx.

91  {
92  std::vector<const SpacePoint*> spacePoints{};
93  spacePoints.reserve(bucket.size());
94  std::ranges::transform(bucket, std::back_inserter(spacePoints), [](const SpacePointBucket::value_type& sp){return sp.get();});
96  }

◆ 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 69 of file MuonSimHitHelpers.cxx.

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

◆ 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 54 of file MuonSimHitHelpers.cxx.

54  {
55  std::unordered_set<const xAOD::MuonSimHit*> hits{};
56  for (const SpacePoint* sp : spacePoints) {
57  const xAOD::MuonSimHit* primHit{getTruthMatchedHit(*sp->primaryMeasurement())};
58  const xAOD::MuonSimHit* secHit{sp->dimension() == 2 ? getTruthMatchedHit(*sp->secondaryMeasurement()) : nullptr};
59  if(primHit){
60  hits.insert(primHit);
61  }
62  if (secHit && secHit != primHit) {
63  hits.insert(secHit);
64  }
65  }
66  return hits;
67  }

◆ 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 27 of file MuonSimHitHelpers.cxx.

27  {
28 
29  using SimHitLinkVec_t = std::vector<ElementLink<xAOD::MuonSimHitContainer>>;
31  using PrdLinkVec_t = std::vector<PrdLink_t>;
32 
33  static const SG::ConstAccessor<SimHitLinkVec_t> acc_simLink{"simHitLinks"};
34  static const SG::ConstAccessor<PrdLinkVec_t> acc_prdLink{"prdLinks"};
35  std::unordered_set<const xAOD::MuonSimHit*> hits{};
36  if (acc_simLink.isAvailable(segment)){
37  hits.reserve(acc_simLink(segment).size());
38  for (const ElementLink<xAOD::MuonSimHitContainer>& link : acc_simLink(segment)) {
39  if (link.isValid()) {
40  hits.insert(*link);
41  }
42  }
43  } else if (acc_prdLink.isAvailable(segment)){
44  for (const PrdLink_t& link : acc_prdLink(segment)) {
45  const xAOD::MuonSimHit* hit = getTruthMatchedHit(**link);
46  if (hit){
47  hits.insert(hit);
48  }
49  }
50  }
51  return hits;
52  }

◆ getTruthMatchedHit()

const xAOD::MuonSimHit * MuonR4::getTruthMatchedHit ( const xAOD::UncalibratedMeasurement prdHit)

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

Definition at line 16 of file MuonSimHitHelpers.cxx.

16  {
18  if (acc.isAvailable(prdHit)){
19  const ElementLink<xAOD::MuonSimHitContainer>& link{acc(prdHit)};
20  if (link.isValid()) {
21  return (*link);
22  }
23  }
24  return nullptr;
25  }

◆ getTruthMatchedParticle()

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

Returns the particle truth-matched to the segment.

Definition at line 100 of file MuonSimHitHelpers.cxx.

100  {
102  static const SG::ConstAccessor<TruthLink_t> acc{"truthParticleLink"};
103  if (acc.isAvailable(segment)){
104  const TruthLink_t& link {acc(segment)};
105  if (link.isValid()) {
106  return *link;
107  }
108  }
109  return nullptr;
110  }

◆ houghTanPhi()

double MuonR4::houghTanPhi ( const Amg::Vector3D v)

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

Parameters
vArbitrary direction vector

Definition at line 18 of file SegmentFitterEventData.cxx.

18  {
19  constexpr double eps = std::numeric_limits<float>::epsilon();
20  return v.x() / ( std::abs(v.z()) > eps ? v.z() : eps);
21  }

◆ houghTanTheta()

double MuonR4::houghTanTheta ( const Amg::Vector3D v)

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

Parameters
vArbitrary direction vector

Definition at line 14 of file SegmentFitterEventData.cxx.

14  {
15  constexpr double eps = std::numeric_limits<float>::epsilon();
16  return v.y() / ( std::abs(v.z()) > eps ? v.z() : eps);
17  }

◆ inverse()

Inverts the parsed matrix.

Definition at line 65 of file MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/UtilFunctions.cxx.

65  {
66  return std::visit([](const auto& cov)-> CalibratedSpacePoint::Covariance_t {
67  using CovType = std::decay_t<decltype(cov)>;
68  if constexpr(std::is_same_v<CovType, AmgSymMatrix(2)>) {
69  return AmgSymMatrix(2){cov.inverse()};
70  } else {
71  return AmgSymMatrix(3){cov.inverse()};
72  }
73  }, mat);
74  }

◆ multiply() [1/2]

Multiplies a 2D vector with the covariance matrix which has to be a 2x2 matrix.

Otherwise, an exception is thrown

Parameters
matMatrix variant
vVector which shall be transformed

Definition at line 52 of file MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/UtilFunctions.cxx.

52  {
54  std::visit([&v, &result](const auto&cov) ->void {
55  using CovType = std::decay_t<decltype(cov)>;
56  if constexpr(std::is_same_v<CovType, AmgSymMatrix(2)>) {
57  result.block<2,1>(0,0) = cov * v.block<2,1>(0,0);
58  } else {
59  THROW_EXCEPTION("Cannot multiply "<<Amg::toString(cov)<<" with "<<Amg::toString(v));
60  }
61  }, mat);
62  return result;
63  }

◆ multiply() [2/2]

Multiplies a 3D vector with the covariance matrix which can be either 2x2 or 3x3 matrix.

In the former case, only the x-y components are transformed

Parameters
matMatrix variant
vVector which shall be transformed

Definition at line 40 of file MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/UtilFunctions.cxx.

40  {
42  std::visit([&v, &result](const auto&cov) ->void {
43  using CovType = std::decay_t<decltype(cov)>;
44  if constexpr(std::is_same_v<CovType, AmgSymMatrix(2)>) {
45  result.block<2,1>(0,0) = cov * v.block<2,1>(0,0);
46  } else{
47  result = cov * v;
48  }
49  },mat);
50  return result;
51  }

◆ passesThrough()

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

Definition at line 20 of file EtaHoughTransformAlg.cxx.

20  {
21  double yCross = (y0 + 0.5 * (loc.zBottom+loc.zTop) * tanTheta);
22  return (loc.yLeft < yCross && yCross < loc.yRight);
23  }

◆ passRangeCut()

constexpr bool MuonR4::passRangeCut ( const std::array< double, 2 > &  cutRange,
const double  value 
)
constexpr

Definition at line 27 of file MdtSegmentSeedGenerator.cxx.

27  {
28  return cutRange[0] <= value && value <= cutRange[1];
29  }

◆ proximity()

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

Definition at line 25 of file EtaHoughTransformAlg.cxx.

25  {
27  return std::min(std::abs(HoughHelpers::Eta::houghParamMdtLeft(tanTheta, dc) - y0),
28  std::abs(HoughHelpers::Eta::houghParamMdtRight(tanTheta, dc) - y0));
29  }
30  return std::abs(HoughHelpers::Eta::houghParamStrip(tanTheta, dc) - y0);
31  }

◆ removeBeamSpot()

bool MuonR4::removeBeamSpot ( MuonR4::SegmentFitResult::HitVec hits)

Definition at line 50 of file SegmentFittingAlg.cxx.

50  {
51  std::size_t before = hits.size();
52  hits.erase(std::remove_if(hits.begin(), hits.end(),
53  [](const auto& a){
54  return a->type() == xAOD::UncalibMeasType::Other;
55  }), hits.end());
56  return before != hits.size();
57  }

◆ sign()

constexpr double MuonR4::sign ( const double  x)
constexpr

Returns the sign of a number.

Definition at line 11 of file MatrixUtils.h.

11  {
12  return x > 0. ? 1. : x < 0. ? -1. : 0.;
13  }

◆ stripSmartPtr()

HitVec MuonR4::stripSmartPtr ( const SpacePointBucket bucket)
inline

Definition at line 12 of file SpacePointPerLayerSplitter.cxx.

12  {
13  HitVec hits{};
14  hits.reserve(bucket.size());
15  std::transform(bucket.begin(),bucket.end(),std::back_inserter(hits),
16  [](const SpacePointBucket::value_type& hit){return hit.get();});
17  return hits;
18  }

◆ sumUp()

constexpr unsigned int MuonR4::sumUp ( unsigned  k)
constexpr

Calculates the sum of 1 + 2 +3 +4 +...

  • k

Definition at line 15 of file MatrixUtils.h.

15  {
16  return k*(k+1)/ 2;
17  }

◆ symMatIdxFromVec()

template<int n>
constexpr std::array<unsigned, 2> MuonR4::symMatIdxFromVec ( unsigned int  k)
constexpr

Translates back the global index into the two matrix access indices under the assumption that the matrix is symmetric.

Parameters
kGlobal index

Definition at line 41 of file MatrixUtils.h.

41  {
42  static_assert(n>=0);
43  assert (k < sumUp(n));
44  if (k <n) {
45  return std::array{0u, k};
46  }
47  if constexpr(n > 0){
48  const auto [i, j] = symMatIdxFromVec<n-1>(k-n);
49  return std::array{i+1u, j+1u};
50  }
51  return make_array<unsigned, 2>(0);
52  }

◆ toString()

std::string MuonR4::toString ( const CalibratedSpacePoint::Covariance_t mat)

Returns the matrix in string.

Definition at line 75 of file MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/UtilFunctions.cxx.

75  {
76  return std::visit([](const auto& cov)-> std::string {
77  return Amg::toString(cov);
78  }, mat);
79  }

◆ toTechIdx()

constexpr TechIdx_t MuonR4::toTechIdx ( const xAOD::UncalibMeasType  aodType)
constexpr

Definition at line 28 of file xAODSegmentCnvAlg.cxx.

28  {
29  switch (aodType){
31  return TechIdx_t::MDT;
33  return TechIdx_t::RPC;
35  return TechIdx_t::TGC;
37  return TechIdx_t::MM;
39  return TechIdx_t::STGC;
40  default:
41  return TechIdx_t::TechnologyUnknown;
42  }
43  }

◆ vecIdxFromSymMat()

template<unsigned int n>
constexpr unsigned int MuonR4::vecIdxFromSymMat ( unsigned int  i,
unsigned  k 
)
constexpr

If a n-dimensional Matrix is symmetric, it has n* (n+1) /2 parameters The following function returns the global index when filling the content of the matrix into a vector via for (i = 0; i < n; ++i) { for (k =i; k<n; ++k){ } }.

Parameters
iIndex of the row
j: Index of the column

Definition at line 28 of file MatrixUtils.h.

28  {
29  assert(i<n);
30  assert(k<n);
31  if (k < i) {
32  return vecIdxFromSymMat<n>(k,i);
33  }
34  constexpr unsigned int nPars = sumUp(n);
35  return nPars - sumUp(n-i) + (k-i);
36  }

Variable Documentation

◆ minLayers

constexpr unsigned int MuonR4::minLayers {4}
constexpr

Definition at line 31 of file CombinatorialNSWSeedFinderAlg.cxx.

TGC
@ TGC
Definition: RegSelEnums.h:33
xAOD::MuonSimHit_v1
Definition: MuonSimHit_v1.h:18
STGC
@ STGC
Definition: RegSelEnums.h:39
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
get_generator_info.result
result
Definition: get_generator_info.py:21
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:55
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
MuonR4::PrdLink_t
ElementLink< PrdCont_t > PrdLink_t
Definition: xAODSegmentCnvAlg.cxx:20
MuonR4::SegmentFitResult::calibMeasurements
HitVec calibMeasurements
Calibrated measurements used in the fit.
Definition: SegmentFitterEventData.h:64
xAOD::UncalibMeasType::MMClusterType
@ MMClusterType
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
MM
@ MM
Definition: RegSelEnums.h:38
athena.value
value
Definition: athena.py:124
MuonR4::HitWindow::tooLow
@ tooLow
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
xAOD::UncalibMeasType::sTgcStripType
@ sTgcStripType
x
#define x
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
MuonR4::SegmentFitResult::HitVec
std::vector< HitType > HitVec
Definition: SegmentFitterEventData.h:53
SpacePoint
Definition: Trigger/TrigAccel/TrigCudaFitter/src/SpacePoint.h:7
xAOD::UncalibMeasType::TgcStripType
@ TgcStripType
MuonR4::SegmentFitResult::nDoF
int nDoF
degrees of freedom
Definition: SegmentFitterEventData.h:68
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
MuonR4::sumUp
constexpr unsigned int sumUp(unsigned k)
Calculates the sum of 1 + 2 +3 +4 +...
Definition: MatrixUtils.h:15
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
Generate_dsid_ranseed.seed
seed
Definition: Generate_dsid_ranseed.py:10
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
MuonR4::PrdLinkVec_t
std::vector< PrdLink_t > PrdLinkVec_t
Definition: xAODSegmentCnvAlg.cxx:21
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
MuonR4::symMatIdxFromVec
constexpr std::array< unsigned, 2 > symMatIdxFromVec(unsigned int k)
Translates back the global index into the two matrix access indices under the assumption that the mat...
Definition: MatrixUtils.h:41
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
MuonR4::SegmentFitResult::segmentPars
Parameters segmentPars
Final segment parameters.
Definition: SegmentFitterEventData.h:60
MuonR4::SegLink_t
ElementLink< MuonR4::SegmentContainer > SegLink_t
Definition: xAODSegmentCnvAlg.cxx:18
MuonR4::HoughHelpers::Eta::houghParamMdtLeft
double houghParamMdtLeft(double tanTheta, const MuonR4::HoughHitType &dc)
left-side straight line parametrisation for drift circles
Definition: HoughHelperFunctions.cxx:9
dot.dot
def dot(G, fn, nodesToHighlight=[])
Definition: dot.py:5
lumiFormat.array
array
Definition: lumiFormat.py:91
MuonR4::SegmentFit::ParamDefs::y0
@ y0
RPC
@ RPC
Definition: RegSelEnums.h:32
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
Amg::error
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
Definition: EventPrimitivesHelpers.h:40
MuonR4::SegmentFit::toInt
constexpr int toInt(const ParamDefs p)
Definition: MuonHoughDefs.h:42
MuonR4::HitVec
SpacePointPerLayerSplitter::HitVec HitVec
Definition: SpacePointPerLayerSplitter.cxx:11
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
THROW_EXCEPTION
#define THROW_EXCEPTION(MESSAGE)
Definition: throwExcept.h:10
MuonR4::copy
MuonR4::SegmentFitResult copy(const MuonR4::SegmentFitResult &toCopy)
Definition: SegmentFittingAlg.cxx:41
python.PyAthena.v
v
Definition: PyAthena.py:154
Trk::inside
@ inside
Definition: PropDirection.h:29
a
TList * a
Definition: liststreamerinfos.cxx:10
MuonR4::SegmentFitResult::timeFit
bool timeFit
Was the time fitted.
Definition: SegmentFitterEventData.h:56
MuonR4::getTruthMatchedHit
const xAOD::MuonSimHit * getTruthMatchedHit(const xAOD::UncalibratedMeasurement &prdHit)
Returns the MuonSimHit, if there's any, matched to the uncalibrated muon measurement.
Definition: MuonSimHitHelpers.cxx:16
MuonR4::HoughHelpers::Eta::houghParamMdtRight
double houghParamMdtRight(double tanTheta, const MuonR4::HoughHitType &dc)
right-side straight line parametrisation for drift circles
Definition: HoughHelperFunctions.cxx:13
MuonR4::SegmentFitResult
Definition: SegmentFitterEventData.h:46
MuonR4::SegmentFitResult::chi2
double chi2
chi2 of the fit
Definition: SegmentFitterEventData.h:66
MuonR4::Covariance_t
CalibratedSpacePoint::Covariance_t Covariance_t
Definition: CalibratedSpacePoint.cxx:8
MuonR4::HoughHelpers::Eta::houghParamStrip
double houghParamStrip(double tanTheta, const MuonR4::HoughHitType &strip)
straight line parametrisation for strip detector measurements
Definition: HoughHelperFunctions.cxx:17
MuonR4::HitWindow::tooHigh
@ tooHigh
python.FPGATrackSimAnalysisConfig.spacePoints
spacePoints
Definition: FPGATrackSimAnalysisConfig.py:642
MuonR4::SegmentFit::ParamDefs::nPars
@ nPars
xAOD::UncalibMeasType::RpcStripType
@ RpcStripType
xAOD::UncalibMeasType::MdtDriftCircleType
@ MdtDriftCircleType
MuonR4::getMatchingSimHits
std::unordered_set< const xAOD::MuonSimHit * > getMatchingSimHits(const xAOD::MuonSegment &segment)
: Returns all sim hits matched to a xAOD::MuonSegment
Definition: MuonSimHitHelpers.cxx:27
MDT
@ MDT
Definition: RegSelEnums.h:31
fitman.k
k
Definition: fitman.py:528
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
NSWL1::PadTriggerAdapter::segment
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
Definition: PadTriggerAdapter.cxx:5
MuonR4::contract
double contract(const CalibratedSpacePoint::Covariance_t &mat, const Amg::Vector3D &a, const Amg::Vector3D &b)
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/UtilFunctions.cxx:13