ATLAS Offline Software
Namespaces | Classes | Typedefs | 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  CalibSegmentChi2Minimizer
 
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 = CalibSegmentChi2Minimizer::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 * > getTruthMatchedHits (const xAOD::MuonSegment &segment)
 : Returns all truth hits matched to a xAOD::MuonSegment More...
 
std::unordered_set< const xAOD::MuonSimHit * > getTruthMatchedHits (const std::vector< const SpacePoint * > &spacePoints)
 Returns all truth hits that are matched to a collection of space points. More...
 
std::unordered_set< const xAOD::MuonSimHit * > getTruthMatchedHits (const std::vector< const CalibratedSpacePoint * > &measurements)
 Returns all truth hits that are matched to a collection of calibrated space points. More...
 
std::unordered_set< const xAOD::MuonSimHit * > getTruthMatchedHits (const Segment &seg)
 Returns all truth hits that are matched to the reconstructed segment. More...
 
std::unordered_set< const xAOD::MuonSimHit * > getTruthMatchedHits (const SegmentSeed &seed)
 Returns all truth hits that are matched to the segmentSeed. More...
 
std::unordered_set< const xAOD::MuonSimHit * > getTruthMatchedHits (const SpacePointBucket &bucket)
 Returns all truth hits that are matched to the spacePoint bucket. 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)
 

Variables

constexpr double inv_c = 1./ Gaudi::Units::c_light
 

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 15 of file CalibSegmentChi2Minimizer.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 60 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

using MuonR4::SegPars = typedef xAOD::MeasVector<toInt(ParamDefs::nPars)>

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

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

◆ copy() [2/2]

Definition at line 35 of file SegmentFittingAlg.cxx.

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

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

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

◆ getTruthMatchedHits() [1/6]

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

Returns all truth 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 getTruthMatchedHits(calibSps);
76  }

◆ getTruthMatchedHits() [2/6]

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

Returns all truth hits that are matched to the segmentSeed.

Definition at line 83 of file MuonSimHitHelpers.cxx.

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

◆ getTruthMatchedHits() [3/6]

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

Returns all truth 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 getTruthMatchedHits(spacePoints);
82  }

◆ getTruthMatchedHits() [4/6]

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

Returns all truth 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  }

◆ getTruthMatchedHits() [5/6]

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

Returns all truth 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  }

◆ getTruthMatchedHits() [6/6]

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

: Returns all truth 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  }

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

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

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

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

Variable Documentation

◆ inv_c

constexpr double MuonR4::inv_c = 1./ Gaudi::Units::c_light
constexpr

Definition at line 32 of file SegmentFittingAlg.cxx.

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
MuonR4::getTruthMatchedHits
std::unordered_set< const xAOD::MuonSimHit * > getTruthMatchedHits(const xAOD::MuonSegment &segment)
: Returns all truth hits matched to a xAOD::MuonSegment
Definition: MuonSimHitHelpers.cxx:24
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:68
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
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
MuonR4::SegmentFitResult::HitVec
std::vector< HitType > HitVec
Definition: SegmentFitterEventData.h:57
SpacePoint
Definition: Trigger/TrigAccel/TrigCudaFitter/src/SpacePoint.h:7
MuonR4::SegmentFitResult::nDoF
int nDoF
degrees of freedom
Definition: SegmentFitterEventData.h:74
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
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
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
MuonR4::SegmentFitResult::segmentPars
Parameters segmentPars
Final segment parameters.
Definition: SegmentFitterEventData.h:64
dot.dot
def dot(G, fn, nodesToHighlight=[])
Definition: dot.py:5
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:42
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:60
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:50
MuonR4::SegmentFitResult::chi2
double chi2
chi2 of the fit
Definition: SegmentFitterEventData.h:72
MuonR4::Covariance_t
CalibratedSpacePoint::Covariance_t Covariance_t
Definition: CalibratedSpacePoint.cxx:8
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