ATLAS Offline Software
Namespaces | Classes | Typedefs | Functions
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  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  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
 
class  MM_DigitizationTool
 
class  MmFastDigiTool
 
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
 
class  PrepDataToSimHitAssocAlg
 The PrepDataToSimHitAssocAlg matches the uncalibrated measurements to the MuonSimHits or to the MuonSDO objects. More...
 
class  RpcClusteringAlg
 
class  RpcFastDigiTool
 
class  RpcMeasViewAlg
 
class  RpcRdoToRpcPrepDataTool
 
class  Segment
 Placeholder for what will later be the muon segment EDM representation. More...
 
class  SegmentAmbiSolver
 
class  SegmentCnvAlg
 The SegmentCnvAlg 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  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  SegmentViewAlg
 
class  SimHitCsvDumperAlg
 
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 groups the space points by their layer Identifier. More...
 
class  sTgcFastDigiTool
 
class  sTgcMeasViewAlg
 
class  TgcFastDigiTool
 
class  TruthMeasMarkerAlg
 
class  TruthOverlay
 
class  TruthSegmentCsvDumperAlg
 
class  TruthSegmentMaker
 
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 = SpacePointPerLayerSorter::HitVec
 
using CalibSpacePointVec = ISpacePointCalibrator::CalibSpacePointVec
 
using CalibSpacePointPtr = ISpacePointCalibrator::CalibSpacePointPtr
 
using State = CalibratedSpacePoint::State
 
using HitType = SegmentFitResult::HitType
 
using SegmentVec = SegmentAmbiSolver::SegmentVec
 
using PrimitiveVec = MuonValR4::IPatternVisualizationTool::PrimitiveVec
 
using PrdCont_t = xAOD::UncalibratedMeasurementContainer
 
using SegLink_t = ElementLink< xAOD::MuonSegmentContainer >
 
using SegLinkVec_t = std::vector< SegLink_t >
 
using PrdLink_t = ElementLink< PrdCont_t >
 
using PrdLinkVec_t = std::vector< PrdLink_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)>
 
using PrdLinkVec = std::vector< PrdLink_t >
 
using TechIdx_t = Muon::MuonStationIndex::TechnologyIndex
 

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...
 
void sortByLayer (std::vector< const SpacePoint * > &spacePoints)
 Sorts the space points in a vector by z. More...
 
const AmgSymMatrix (2) &SpacePoint
 
HitVec stripSmartPtr (const SpacePointBucket &bucket)
 
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...
 
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)
 
MuonR4::SegmentFitResult::HitVec copy (const MuonR4::SegmentFitResult::HitVec &hits)
 
MuonR4::SegmentFitResult copy (const MuonR4::SegmentFitResult &toCopy)
 
bool removeBeamSpot (MuonR4::SegmentFitResult::HitVec &hits)
 

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.

The CsvMuonSimHitDumper reads a Simulation Hit container for muons and dumps information to csv files.

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

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.

◆ HitType

Definition at line 36 of file MdtSegmentFitter.cxx.

◆ HitVec

Definition at line 9 of file SpacePointPerLayerSorter.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.

◆ PrdCont_t

Definition at line 13 of file MeasurementMarkerAlg.cxx.

◆ PrdLink_t

Definition at line 17 of file MeasurementMarkerAlg.cxx.

◆ PrdLinkVec

using MuonR4::PrdLinkVec = typedef std::vector<PrdLink_t>

Definition at line 18 of file SegmentFitParDecorAlg.cxx.

◆ PrdLinkVec_t

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

Definition at line 18 of file MeasurementMarkerAlg.cxx.

◆ PrimitiveVec

Definition at line 57 of file SegmentFittingAlg.cxx.

◆ SegLink_t

Definition at line 14 of file MeasurementMarkerAlg.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.

◆ SpacePointContainer

◆ State

Definition at line 24 of file SpacePointCalibrator.cxx.

◆ TechIdx_t

Definition at line 19 of file SegmentFitParDecorAlg.cxx.

◆ WriteDecorKey_t

Definition at line 23 of file MeasurementMarkerAlg.cxx.

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 39 of file SegmentFittingAlg.cxx.

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

◆ copy() [2/2]

Definition at line 32 of file SegmentFittingAlg.cxx.

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

◆ 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  }

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

71  {
72  std::vector<const CalibratedSpacePoint*> calibSps{};
73  calibSps.reserve(segment.measurements().size());
74  std::ranges::transform(segment.measurements(), std::back_inserter(calibSps), [](const auto& meas){return meas.get();});
75  return getMatchingSimHits(calibSps);
76  }

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

83  {
84  return getMatchingSimHits(seed.getHitsInMax());
85  }

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

77  {
78  std::vector<const SpacePoint*> spacePoints{};
79  spacePoints.reserve(bucket.size());
80  std::ranges::transform(bucket, std::back_inserter(spacePoints), [](const SpacePointBucket::value_type& sp){return sp.get();});
81  return getMatchingSimHits(spacePoints);
82  }

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

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

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

40  {
41  std::unordered_set<const xAOD::MuonSimHit*> hits{};
42  for (const SpacePoint* sp : spacePoints) {
43  const xAOD::MuonSimHit* primHit{getTruthMatchedHit(*sp->primaryMeasurement())};
44  const xAOD::MuonSimHit* secHit{sp->dimension() == 2 ? getTruthMatchedHit(*sp->secondaryMeasurement()) : nullptr};
45  if(primHit){
46  hits.insert(primHit);
47  }
48  if (secHit && secHit != primHit) {
49  hits.insert(secHit);
50  }
51  }
52  return hits;
53  }

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

24  {
25  using SimHitLinkVec = std::vector<ElementLink<xAOD::MuonSimHitContainer>>;
26  static const SG::ConstAccessor<SimHitLinkVec> acc{"simHitLinks"};
27  std::unordered_set<const xAOD::MuonSimHit*> hits{};
28  if (!acc.isAvailable(segment)){
29  return hits;
30  }
31  hits.reserve(acc(segment).size());
33  if (link.isValid()) {
34  hits.insert(*link);
35  }
36  }
37  return hits;
38  }

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

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

◆ 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  }

◆ 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  }

◆ removeBeamSpot()

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

Definition at line 48 of file SegmentFittingAlg.cxx.

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

◆ 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  }

◆ sortByLayer()

void MuonR4::sortByLayer ( std::vector< const SpacePoint * > &  spacePoints)

Sorts the space points in a vector by z.

Parameters
spacePointsList of hits to be sorted

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

80  {
81  std::ranges::sort(spacePoints,
82  [](const SpacePoint*& a, const SpacePoint*& b){
83  const Amg::Vector3D& hitA{a->positionInChamber()};
84  const Amg::Vector3D& hitB{b->positionInChamber()};
85  constexpr double layerTol = 1.*Gaudi::Units::mm;
86  if (std::abs(hitA.z() - hitB.z()) > layerTol) {
87  return hitA.z() < hitB.z();
88  }
89  return hitA.y() < hitB.y();
90  });
91  }

◆ stripSmartPtr()

HitVec MuonR4::stripSmartPtr ( const SpacePointBucket bucket)
inline

Definition at line 10 of file SpacePointPerLayerSorter.cxx.

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

◆ 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  }

◆ 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  }
xAOD::MuonSimHit_v1
Definition: MuonSimHit_v1.h:18
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
MuonR4::SegmentFitResult::calibMeasurements
HitVec calibMeasurements
Calibrated measurements used in the fit.
Definition: SegmentFitterEventData.h:64
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
MuonR4::HitVec
SpacePointPerLayerSorter::HitVec HitVec
Definition: SpacePointPerLayerSorter.cxx:9
athena.value
value
Definition: athena.py:124
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
THROW_EXCEPTION
#define THROW_EXCEPTION(MSG)
Definition: MMReadoutElement.cxx:48
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
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
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
dot.dot
def dot(G, fn, nodesToHighlight=[])
Definition: dot.py:5
lumiFormat.array
array
Definition: lumiFormat.py:91
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
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonR4::copy
MuonR4::SegmentFitResult copy(const MuonR4::SegmentFitResult &toCopy)
Definition: SegmentFittingAlg.cxx:39
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
python.PyAthena.v
v
Definition: PyAthena.py:154
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: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::SegmentFit::ParamDefs::nPars
@ nPars
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:24
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