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

Classes

class  MdtSegmentSeedGenerator
 Helper class to generate valid seeds for the segment fit. More...
class  SegmentAmbiSolver
 The SegmentAmbiSolver removes ambiguities between segment candidates from the fit. More...
class  SegmentLineFitter
 The SegmentLineFitter is a standalone module to fit a straight line to calibrated muon space points. More...

Typedefs

using SeedingAux = SpacePoint::SeedingAux
 Abrivation of the CompSpacePointAuxiliaries.
using ParamDefs = SeedingAux::FitParIndex
 Use the same parameter indices as used by the CompSpacePointAuxiliaries.
using Line_t = SeedingAux::Line_t
 Abrivation of the line with partial derivatives.
using AxisDefs = SpacePoint::CovIdx
 Use the same mapping of the covariance space indicies as used by the SpacePoint.
using Parameters = Acts::Experimental::CompositeSpacePointLineFitter::ParamVec_t
using Covariance = Acts::Experimental::CompositeSpacePointLineFitter::CovMat_t
using HitVec = SpacePointPerLayerSplitter::HitVec
using HitLayerVec = SpacePointPerLayerSplitter::HitLayVec
using SegmentVec = SegmentAmbiSolver::SegmentVec
using Hit_t = SegmentLineFitter::Hit_t
using HitVec_t = SegmentLineFitter::HitVec_t
using Result_t = SegmentLineFitter::Result_t

Functions

std::pair< Amg::Vector3D, Amg::Vector3DmakeLine (const Parameters &pars)
 Returns the parsed parameters into an Eigen line parametrization.
std::string makeLabel (const Parameters &pars)
 Dumps the parameters into a string in the form of TLatex.
std::string toString (const Parameters &pars)
 Dumps the parameters into a string with labels in front of each number.
std::string toString (const ParamDefs par)
 Returns the parameter label.
Parameters localSegmentPars (const xAOD::MuonSegment &seg)
 Returns the localSegPars decoration from a xAODMuon::Segment.
Parameters localSegmentPars (const ActsTrk::GeometryContext &gctx, const Segment &segment)
 Returns the local segment parameters from a segment object.
Acts::BoundTrackParameters boundSegmentPars (const MuonGMR4::MuonDetectorManager &detMgr, const xAOD::MuonSegment &segment, std::optional< Acts::BoundMatrix > cov=std::nullopt, Acts::ParticleHypothesis hypot=Acts::ParticleHypothesis::muon())
 Returns the segment parameters as boundTrackParameters.
Acts::BoundTrackParameters boundSegmentPars (const ActsTrk::GeometryContext &gctx, const Segment &segment, const Acts::ParticleHypothesis hypot=Acts::ParticleHypothesis::muon())
 Returns the segment parameters as boundTrackParameters.
Muon::MdtDriftCircleStatus dcStatus (const SpacePoint &dc)
bool isGoodDC (const SpacePoint &dc)
 Returns whether the Mdt measurement has a valid space point.
bool moveToNextHit (const HitVec &hits, std::size_t &hitIdx)
 Move to the next space point with valid drift radius.
bool firstGoodHit (const HitVec &hits, std::size_t &hitIdx)
 Find the first good hit in a layer.

Variables

constexpr auto covIdx = Acts::toUnderlying(AxisDefs::etaCov)

Typedef Documentation

◆ AxisDefs

Use the same mapping of the covariance space indicies as used by the SpacePoint.

Definition at line 43 of file MuonHoughDefs.h.

◆ Covariance

using MuonR4::SegmentFit::Covariance = Acts::Experimental::CompositeSpacePointLineFitter::CovMat_t

Definition at line 47 of file MuonHoughDefs.h.

◆ Hit_t

◆ HitLayerVec

◆ HitVec

◆ HitVec_t

◆ Line_t

using MuonR4::SegmentFit::Line_t = SeedingAux::Line_t

Abrivation of the line with partial derivatives.

Definition at line 40 of file MuonHoughDefs.h.

◆ ParamDefs

using MuonR4::SegmentFit::ParamDefs = SeedingAux::FitParIndex

Use the same parameter indices as used by the CompSpacePointAuxiliaries.

Definition at line 38 of file MuonHoughDefs.h.

◆ Parameters

using MuonR4::SegmentFit::Parameters = Acts::Experimental::CompositeSpacePointLineFitter::ParamVec_t

Definition at line 46 of file MuonHoughDefs.h.

◆ Result_t

◆ SeedingAux

Abrivation of the CompSpacePointAuxiliaries.

Definition at line 36 of file MuonHoughDefs.h.

◆ SegmentVec

Function Documentation

◆ boundSegmentPars() [1/2]

Acts::BoundTrackParameters MuonR4::SegmentFit::boundSegmentPars ( const ActsTrk::GeometryContext & gctx,
const Segment & segment,
const Acts::ParticleHypothesis hypot = Acts::ParticleHypothesis::muon() )

Returns the segment parameters as boundTrackParameters.

The position is expressed locally on the sector surface & the direction in the global frame

Definition at line 112 of file SegmentFitterEventData.cxx.

114 {
115 const auto& surface = segment.msSector()->surface();
116
117 const Amg::Vector3D locPos = surface.transform(gctx.context()).inverse() *
118 segment.position();
119 Acts::BoundVector boundPars{};
120 boundPars[Acts::eBoundLoc0] = locPos.x();
121 boundPars[Acts::eBoundLoc1] = locPos.y();
122 boundPars[Acts::eBoundPhi] = segment.direction().phi();
123 boundPars[Acts::eBoundTheta] = segment.direction().theta();
124 boundPars[Acts::eBoundQOverP] = straightQoverP;
125 boundPars[Acts::eBoundTime] = ActsTrk::timeToActs(segment.position().mag() / Gaudi::Units::c_light +
126 segment.segementT0());
127 Acts::BoundMatrix cov{Acts::BoundMatrix::Identity()};
128
129 return Acts::BoundTrackParameters{surface.getSharedPtr(), std::move(boundPars),
130 cov, hypot};
131 }
Acts::GeometryContext context() const
const Acts::PlaneSurface & surface() const
Returns the associated surface.
double segementT0() const
Returns the fitted segment time, if there's any.
const MuonGMR4::SpectrometerSector * msSector() const
Returns the associated MS sector.
const Amg::Vector3D & position() const
Returns the global segment position.
const Amg::Vector3D & direction() const
Returns the global segment direction.
constexpr double timeToActs(const double athenaT)
Converts a time unit from Athena to Acts units.
Eigen::Matrix< double, 3, 1 > Vector3D

◆ boundSegmentPars() [2/2]

Acts::BoundTrackParameters MuonR4::SegmentFit::boundSegmentPars ( const MuonGMR4::MuonDetectorManager & detMgr,
const xAOD::MuonSegment & segment,
std::optional< Acts::BoundMatrix > cov = std::nullopt,
Acts::ParticleHypothesis hypot = Acts::ParticleHypothesis::muon() )

Returns the segment parameters as boundTrackParameters.

The position is expressed locally on the sector surface & the direction in the global frame

Parameters
detMgrDetector manager to pick up the proper sector object
segmentReference to the segment of interest
covUncertainty on the parsed parameters
hypotThe particle hypothesis to plugin (Muon by default)

Definition at line 85 of file SegmentFitterEventData.cxx.

88 {
89
90 const auto* msSector = detMgr.getSectorEnvelope(segment.chamberIndex(),
91 segment.sector(),
92 segment.etaIndex());
93 const Acts::Surface& surface = msSector->surface();
94
95 const auto locSegPars = localSegmentPars(segment);
96
97 const Amg::Vector3D globDir = segment.direction();
98
99
100 Acts::BoundVector boundPars{};
101 boundPars[Acts::eBoundLoc0] = locSegPars[toUnderlying(ParamDefs::x0)];
102 boundPars[Acts::eBoundLoc1] = locSegPars[toUnderlying(ParamDefs::y0)];
103 boundPars[Acts::eBoundPhi] = globDir.phi();
104 boundPars[Acts::eBoundTheta] = globDir.theta();
105 boundPars[Acts::eBoundQOverP] = straightQoverP;
106 boundPars[Acts::eBoundTime] = ActsTrk::timeToActs(segment.position().mag() / Gaudi::Units::c_light +
107 segment.t0());
108
109 return Acts::BoundTrackParameters{surface.getSharedPtr(), std::move(boundPars),
110 cov, hypot};
111 }
const SpectrometerSector * getSectorEnvelope(const Identifier &channelId) const
Retrieves the spectrometer envelope enclosing the channel's readout element.
float t0() const
Amg::Vector3D direction() const
Returns the direction as Amg::Vector.
::Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index.
Amg::Vector3D position() const
Returns the position as Amg::Vector.
int etaIndex() const
Returns the eta index, which corresponds to stationEta in the offline identifiers (and the ).
Parameters localSegmentPars(const xAOD::MuonSegment &seg)
Returns the localSegPars decoration from a xAODMuon::Segment.

◆ dcStatus()

Muon::MdtDriftCircleStatus MuonR4::SegmentFit::dcStatus ( const SpacePoint & dc)
inline

Definition at line 25 of file MdtSegmentSeedGenerator.cxx.

25 {
28 return static_cast<const xAOD::MdtDriftCircle*>(prd)->status();
29 }
30 return Muon::MdtDriftCircleStatus::MdtStatusUnDefined;
31 }
const xAOD::UncalibratedMeasurement * primaryMeasurement() const
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
MdtDriftCircle_v1 MdtDriftCircle
UncalibratedMeasurement_v1 UncalibratedMeasurement
Define the version of the uncalibrated measurement class.

◆ firstGoodHit()

bool MuonR4::SegmentFit::firstGoodHit ( const HitVec & hits,
std::size_t & hitIdx )
inline

Find the first good hit in a layer.

Parameters
hitsList of hits in a particular tube layer
hitIdxIndex of the current hit inside this list

Definition at line 47 of file MdtSegmentSeedGenerator.cxx.

47 {
48 hitIdx = 0;
49 return isGoodDC(*hits[hitIdx]) || moveToNextHit(hits, hitIdx);
50 }
bool moveToNextHit(const HitVec &hits, std::size_t &hitIdx)
Move to the next space point with valid drift radius.
bool isGoodDC(const SpacePoint &dc)
Returns whether the Mdt measurement has a valid space point.

◆ isGoodDC()

bool MuonR4::SegmentFit::isGoodDC ( const SpacePoint & dc)
inline

Returns whether the Mdt measurement has a valid space point.

Definition at line 33 of file MdtSegmentSeedGenerator.cxx.

33 {
34 return dcStatus(dc) == Muon::MdtDriftCircleStatus::MdtStatusDriftTime;
35 }
Muon::MdtDriftCircleStatus dcStatus(const SpacePoint &dc)

◆ localSegmentPars() [1/2]

Parameters MuonR4::SegmentFit::localSegmentPars ( const ActsTrk::GeometryContext & gctx,
const Segment & segment )

Returns the local segment parameters from a segment object.

Parameters
gctxGeometry context storing the local -> global transformation
segmentReference to the segment

Definition at line 50 of file SegmentFitterEventData.cxx.

51 {
52 Parameters pars{};
53 const Amg::Transform3D globToLoc = segment.msSector()->globalToLocalTrans(gctx);
54 const Amg::Vector3D locPos = globToLoc * segment.position();
55 const Amg::Vector3D locDir = globToLoc.linear() * segment.direction();
56 pars[toUnderlying(ParamDefs::x0)] = locPos.x();
57 pars[toUnderlying(ParamDefs::y0)] = locPos.y();
58 pars[toUnderlying(ParamDefs::theta)] = locDir.theta();
59 pars[toUnderlying(ParamDefs::phi)] = locDir.phi();
60 pars[toUnderlying(ParamDefs::t0)] = segment.segementT0();
61 return pars;
62 }
Amg::Transform3D globalToLocalTrans(const ActsTrk::GeometryContext &gctx) const
Returns the global -> local transformation from the ATLAS global.
Eigen::Affine3d Transform3D
Acts::Experimental::CompositeSpacePointLineFitter::ParamVec_t Parameters

◆ localSegmentPars() [2/2]

Parameters MuonR4::SegmentFit::localSegmentPars ( const xAOD::MuonSegment & seg)

Returns the localSegPars decoration from a xAODMuon::Segment.

Definition at line 42 of file SegmentFitterEventData.cxx.

42 {
43 static const SG::Accessor<xAOD::MeasVector<toUnderlying(ParamDefs::nPars)>> acc{"localSegPars"};
44 Parameters segPars{};
45 for (std::size_t p =0 ; p < segPars.size(); ++p) {
46 segPars[p] = acc(seg)[p];
47 }
48 return segPars;
49 }
Helper class to provide type-safe access to aux data.
Eigen::Matrix< float, N, 1 > MeasVector
Abrivation of the Matrix & Covariance definitions.

◆ makeLabel()

std::string MuonR4::SegmentFit::makeLabel ( const Parameters & pars)

Dumps the parameters into a string in the form of TLatex.

Distances are expressed in [mm], angles in [deg] and time in [ns]

Parameters
parsReference to the parameters to dump

Definition at line 64 of file SegmentFitterEventData.cxx.

64 {
65 std::stringstream sstr{};
66 sstr<<std::format("x_{{0}}={:.2f}", pars[toUnderlying(ParamDefs::x0)])<<", ";
67 sstr<<std::format("y_{{0}}={:.2f}", pars[toUnderlying(ParamDefs::y0)])<<", ";
68 sstr<<std::format("#theta={:.2f}^{{#circ}}", pars[toUnderlying(ParamDefs::theta)] / Gaudi::Units::deg )<<", ";
69 sstr<<std::format("#phi={:.2f}^{{#circ}}", pars[toUnderlying(ParamDefs::phi)] / Gaudi::Units::deg)<<", ";
70 sstr<<std::format("t_{{0}}={:.1f}", pars[toUnderlying(ParamDefs::t0)]);
71 return sstr.str();
72 }

◆ makeLine()

std::pair< Amg::Vector3D, Amg::Vector3D > MuonR4::SegmentFit::makeLine ( const Parameters & pars)

Returns the parsed parameters into an Eigen line parametrization.

The first operand is the position. The other is the direction.

Definition at line 35 of file SegmentFitterEventData.cxx.

35 {
36 using enum ParamDefs;
37 return std::make_pair(Amg::Vector3D(pars[toUnderlying(x0)],
38 pars[toUnderlying(y0)],0.),
39 Amg::dirFromAngles(pars[toUnderlying(phi)],
40 pars[toUnderlying(theta)]));
41 }
Scalar phi() const
phi method
Scalar theta() const
theta method
Amg::Vector3D dirFromAngles(const double phi, const double theta)
Constructs a direction vector from the azimuthal & polar angles.
SeedingAux::FitParIndex ParamDefs
Use the same parameter indices as used by the CompSpacePointAuxiliaries.

◆ moveToNextHit()

bool MuonR4::SegmentFit::moveToNextHit ( const HitVec & hits,
std::size_t & hitIdx )
inline

Move to the next space point with valid drift radius.

Parameters
hitsList of hits in a particular tube layer
hitIdxIndex of the current hit inside this list

Definition at line 39 of file MdtSegmentSeedGenerator.cxx.

39 {
40 while(++hitIdx < hits.size() && !isGoodDC(*hits[hitIdx])) {
41 }
42 return hitIdx < hits.size() && isGoodDC(*hits[hitIdx]);
43 }

◆ toString() [1/2]

std::string MuonR4::SegmentFit::toString ( const ParamDefs par)

Returns the parameter label.

Parameters
parParameter of interest

Definition at line 82 of file SegmentFitterEventData.cxx.

82 {
83 return SeedingAux::parName(a);
84 }
static Double_t a

◆ toString() [2/2]

std::string MuonR4::SegmentFit::toString ( const Parameters & pars)

Dumps the parameters into a string with labels in front of each number.

Distances are expressed in [mm], angles in [deg] and time in [ns]

Parameters
parsReference to the parameters to dump

Definition at line 73 of file SegmentFitterEventData.cxx.

73 {
74 std::stringstream sstr{};
75 sstr<< std::format("{}={:.2f}, ",toString(ParamDefs::x0), pars[toUnderlying(ParamDefs::x0)]);
76 sstr<< std::format("{}={:.2f}, ",toString(ParamDefs::y0), pars[toUnderlying(ParamDefs::y0)]);
77 sstr<< std::format("{}={:.2f}, ",toString(ParamDefs::theta), pars[toUnderlying(ParamDefs::theta)]/Gaudi::Units::deg);
78 sstr<< std::format("{}={:.2f}, ",toString(ParamDefs::phi), pars[toUnderlying(ParamDefs::phi)]/Gaudi::Units::deg);
79 sstr<< std::format("{}={:.2f}",toString(ParamDefs::t0), pars[toUnderlying(ParamDefs::t0)]);
80 return sstr.str();
81 }
std::string toString(const Parameters &pars)
Dumps the parameters into a string with labels in front of each number.

Variable Documentation

◆ covIdx

auto MuonR4::SegmentFit::covIdx = Acts::toUnderlying(AxisDefs::etaCov)
constexpr

Definition at line 22 of file MdtSegmentSeedGenerator.cxx.