ATLAS Offline Software
Classes | Typedefs | Functions | Variables
MuonR4::SegmentFit Namespace Reference

Classes

class  MdtSegmentFitter
 
class  MdtSegmentSeedGenerator
 Helper class to generate valid seeds for the segment fit. More...
 
class  SegmentAmbiSolver
 

Typedefs

using SeedingAux = SpacePoint::SeedingAux
 Abrivation of the CompSpacePointAuxiliaries. More...
 
using ParamDefs = SeedingAux::FitParIndex
 Use the same parameter indices as used by the CompSpacePointAuxiliaries. More...
 
using Line_t = SeedingAux::Line_t
 Abrivation of the line with partial derivatives. More...
 
using AxisDefs = SpacePoint::CovIdx
 Use the same mapping of the covariance space indicies as used by the SpacePoint. More...
 
using Parameters = AmgVector(Acts::toUnderlying(ParamDefs::nPars))
 
using Covariance = AmgSymMatrix(Acts::toUnderlying(ParamDefs::nPars))
 
using FastFitter_t = Acts::Experimental::detail::FastStrawLineFitter
 
using HitType = SegmentFitResult::HitType
 
using HitVec = SegmentFitResult::HitVec
 
using HitLayerVec = SpacePointPerLayerSplitter::HitLayVec
 
using SegmentVec = SegmentAmbiSolver::SegmentVec
 

Functions

std::pair< Amg::Vector3D, Amg::Vector3DmakeLine (const Parameters &pars)
 Returns the parsed parameters into an Eigen line parametrization. More...
 
std::string makeLabel (const Parameters &pars)
 
std::string toString (const Parameters &pars)
 
std::string toString (const ParamDefs par)
 
Amg::Vector3D dirFromTangents (const double tanPhi, const double tanTheta)
 Constructs a direction vector from tanPhi & tanTheta. More...
 
Parameters localSegmentPars (const xAOD::MuonSegment &seg)
 Returns the localSegPars decoration from a xAODMuon::Segment. More...
 
Parameters localSegmentPars (const ActsGeometryContext &gctx, const Segment &segment)
 Returns the local segment parameters from a segment object. More...
 
constexpr Line_t::ParamVector spatialLinePars (const Parameters &segmentPars)
 Converts the 5 segment parameters into the 4-dimensional Line_t parameters. More...
 
void symmetrizeHessian (const std::vector< ParamDefs > &indices, SeedingAux::ChiSqWithDerivatives &chi2Obj)
 Copy the indices from the upper triangle to the lower triangle. More...
 
std::string print (const SeedingAux &aux)
 
Muon::MdtDriftCircleStatus dcStatus (const SpacePoint &dc)
 
bool isGoodDC (const SpacePoint &dc)
 Returns whether the Mdt measurement has a valid space point. More...
 
bool moveToNextHit (const HitVec &hits, std::size_t &hitIdx)
 Move to the next space point with valid drift radius. More...
 
bool firstGoodHit (const HitVec &hits, std::size_t &hitIdx)
 Find the first good hit in a layer. More...
 

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 42 of file MuonHoughDefs.h.

◆ Covariance

using MuonR4::SegmentFit::Covariance = typedef AmgSymMatrix(Acts::toUnderlying(ParamDefs::nPars))

Definition at line 46 of file MuonHoughDefs.h.

◆ FastFitter_t

using MuonR4::SegmentFit::FastFitter_t = typedef Acts::Experimental::detail::FastStrawLineFitter

Definition at line 27 of file MdtSegmentFitter.cxx.

◆ HitLayerVec

Definition at line 22 of file MdtSegmentSeedGenerator.cxx.

◆ HitType

Definition at line 53 of file MdtSegmentFitter.cxx.

◆ HitVec

Definition at line 54 of file MdtSegmentFitter.cxx.

◆ Line_t

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

Abrivation of the line with partial derivatives.

Definition at line 39 of file MuonHoughDefs.h.

◆ ParamDefs

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

Use the same parameter indices as used by the CompSpacePointAuxiliaries.

Definition at line 37 of file MuonHoughDefs.h.

◆ Parameters

using MuonR4::SegmentFit::Parameters = typedef AmgVector(Acts::toUnderlying(ParamDefs::nPars))

Definition at line 45 of file MuonHoughDefs.h.

◆ SeedingAux

Abrivation of the CompSpacePointAuxiliaries.

Definition at line 35 of file MuonHoughDefs.h.

◆ SegmentVec

Definition at line 9 of file SegmentAmbiSolver.cxx.

Function Documentation

◆ dcStatus()

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

Definition at line 26 of file MdtSegmentSeedGenerator.cxx.

26  {
27  const xAOD::UncalibratedMeasurement* prd = dc.primaryMeasurement();
29  return static_cast<const xAOD::MdtDriftCircle*>(prd)->status();
30  }
32  }

◆ dirFromTangents()

Amg::Vector3D MuonR4::SegmentFit::dirFromTangents ( const double  tanPhi,
const double  tanTheta 
)

Constructs a direction vector from tanPhi & tanTheta.

Parameters
tanPhiTangent of the [x] to [z] axis
tanThetaTangent of the [y] to [z] axis

Definition at line 24 of file SegmentFitterEventData.cxx.

24  {
25  return Amg::Vector3D(tanPhi, tanTheta, 1.).unit();
26  }

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

48  {
49  hitIdx = 0;
50  return isGoodDC(*hits[hitIdx]) || moveToNextHit(hits, hitIdx);
51  }

◆ isGoodDC()

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

Returns whether the Mdt measurement has a valid space point.

Definition at line 34 of file MdtSegmentSeedGenerator.cxx.

34  {
36  }

◆ localSegmentPars() [1/2]

Parameters MuonR4::SegmentFit::localSegmentPars ( const ActsGeometryContext 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 37 of file SegmentFitterEventData.cxx.

38  {
40  const Amg::Transform3D globToLoc = segment.msSector()->globalToLocalTrans(gctx);
41  const Amg::Vector3D locPos = globToLoc * segment.position();
42  const Amg::Vector3D locDir = globToLoc.linear() * segment.direction();
43  pars[toUnderlying(ParamDefs::x0)] = locPos.x();
44  pars[toUnderlying(ParamDefs::y0)] = locPos.y();
45  pars[toUnderlying(ParamDefs::theta)] = locDir.theta();
46  pars[toUnderlying(ParamDefs::phi)] = locDir.phi();
47  pars[toUnderlying(ParamDefs::t0)] = segment.segementT0();
48  return pars;
49  }

◆ localSegmentPars() [2/2]

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

Returns the localSegPars decoration from a xAODMuon::Segment.

Definition at line 33 of file SegmentFitterEventData.cxx.

33  {
34  static const SG::Accessor<xAOD::MeasVector<toUnderlying(ParamDefs::nPars)>> acc{"localSegPars"};
35  return xAOD::toEigen(xAOD::ConstVectorMap<toUnderlying(ParamDefs::nPars)>{acc(seg).data()});
36  }

◆ makeLabel()

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

Definition at line 51 of file SegmentFitterEventData.cxx.

51  {
52  std::stringstream sstr{};
53  sstr<<std::format("x_{{0}}={:.2f}", pars[toUnderlying(ParamDefs::x0)])<<", ";
54  sstr<<std::format("y_{{0}}={:.2f}", pars[toUnderlying(ParamDefs::y0)])<<", ";
55  sstr<<std::format("#theta={:.2f}^{{#circ}}", pars[toUnderlying(ParamDefs::theta)] / Gaudi::Units::deg )<<", ";
56  sstr<<std::format("#phi={:.2f}^{{#circ}}", pars[toUnderlying(ParamDefs::phi)] / Gaudi::Units::deg)<<", ";
57  sstr<<std::format("t_{{0}}={:.1f}", pars[toUnderlying(ParamDefs::t0)]);
58  return sstr.str();
59  }

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

27  {
28  return std::make_pair(Amg::Vector3D(pars[toUnderlying(ParamDefs::x0)],
29  pars[toUnderlying(ParamDefs::y0)],0.),
30  Amg::dirFromAngles(pars[toUnderlying(ParamDefs::phi)],
31  pars[toUnderlying(ParamDefs::theta)]));
32  }

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

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

◆ print()

std::string MuonR4::SegmentFit::print ( const SeedingAux aux)

Definition at line 44 of file MdtSegmentFitter.cxx.

44  {
45  std::stringstream sstr{};
46  sstr<<"residual: "<<Amg::toString(aux.residual());
47  sstr<<" -- gradient:\n";
48  for (const auto par : {ParamDefs::x0, ParamDefs::y0, ParamDefs::phi, ParamDefs::theta}) {
49  sstr<<" "<<SeedingAux::parName(par)<<": "<<Amg::toString(aux.gradient(par))<<"\n";
50  }
51  return sstr.str();
52  }

◆ spatialLinePars()

constexpr Line_t::ParamVector MuonR4::SegmentFit::spatialLinePars ( const Parameters segmentPars)
constexpr

Converts the 5 segment parameters into the 4-dimensional Line_t parameters.

◆ symmetrizeHessian()

void MuonR4::SegmentFit::symmetrizeHessian ( const std::vector< ParamDefs > &  indices,
SeedingAux::ChiSqWithDerivatives &  chi2Obj 
)
inline

Copy the indices from the upper triangle to the lower triangle.

Parameters
indicesList of parameter indices to consider
chi2ObjRefrence to the chi2 object carrying the Hessian

Definition at line 31 of file MdtSegmentFitter.cxx.

32  {
33  for (const auto P : indices) {
34  for (const auto P1 : indices) {
35  if (P1 >= P) {
36  break;
37  }
38  chi2Obj.hessian(toUnderlying(P1), toUnderlying(P)) =
39  chi2Obj.hessian(toUnderlying(P), toUnderlying(P1));
40  }
41  }
42  }

◆ toString() [1/2]

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

Definition at line 69 of file SegmentFitterEventData.cxx.

◆ toString() [2/2]

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

Definition at line 60 of file SegmentFitterEventData.cxx.

60  {
61  std::stringstream sstr{};
62  sstr<< std::format("{}={:.2f}, ",toString(ParamDefs::x0), pars[toUnderlying(ParamDefs::x0)]);
63  sstr<< std::format("{}={:.2f}, ",toString(ParamDefs::y0), pars[toUnderlying(ParamDefs::y0)]);
64  sstr<< std::format("{}={:.2f}, ",toString(ParamDefs::theta), pars[toUnderlying(ParamDefs::theta)]/Gaudi::Units::deg);
65  sstr<< std::format("{}={:.2f}, ",toString(ParamDefs::phi), pars[toUnderlying(ParamDefs::phi)]/Gaudi::Units::deg);
66  sstr<< std::format("{}={:.2f}",toString(ParamDefs::t0), pars[toUnderlying(ParamDefs::t0)]);
67  return sstr.str();
68  }

Variable Documentation

◆ covIdx

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

Definition at line 23 of file MdtSegmentSeedGenerator.cxx.

make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
vtune_athena.format
format
Definition: vtune_athena.py:14
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
DMTest::P
P_v1 P
Definition: P.h:23
Trk::indices
std::pair< long int, long int > indices
Definition: AlSymMatBase.h:24
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:75
ALFA_EventTPCnv_Dict::t0
std::vector< ALFA_RawData_p1 > t0
Definition: ALFA_EventTPCnvDict.h:42
deg
#define deg
Definition: SbPolyhedron.cxx:17
Muon::MdtStatusDriftTime
@ MdtStatusDriftTime
The tube produced a vaild measurement.
Definition: MdtDriftCircleStatus.h:34
xAOD::UncalibratedMeasurement_v1
Definition: UncalibratedMeasurement_v1.h:13
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
xAOD::UncalibratedMeasurement_v1::type
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
beamspotnt.parName
list parName
Definition: bin/beamspotnt.py:1286
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
xAOD::MeasVector
Eigen::Matrix< float, N, 1 > MeasVector
Abrivation of the Matrix & Covariance definitions.
Definition: MeasurementDefs.h:53
MuonR4::SegmentFit::isGoodDC
bool isGoodDC(const SpacePoint &dc)
Returns whether the Mdt measurement has a valid space point.
Definition: MdtSegmentSeedGenerator.cxx:34
MuonR4::SegmentFit::dcStatus
Muon::MdtDriftCircleStatus dcStatus(const SpacePoint &dc)
Definition: MdtSegmentSeedGenerator.cxx:26
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:28
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.copyTCTOutput.locDir
locDir
Definition: copyTCTOutput.py:110
Amg::dirFromAngles
Amg::Vector3D dirFromAngles(const double phi, const double theta)
Constructs a direction vector from the azimuthal & polar angles.
Definition: GeoPrimitivesHelpers.h:299
MuonR4::SegmentFit::moveToNextHit
bool moveToNextHit(const HitVec &hits, std::size_t &hitIdx)
Move to the next space point with valid drift radius.
Definition: MdtSegmentSeedGenerator.cxx:40
a
TList * a
Definition: liststreamerinfos.cxx:10
Muon::MdtStatusUnDefined
@ MdtStatusUnDefined
Undefined.
Definition: MdtDriftCircleStatus.h:43
merge.status
status
Definition: merge.py:16
xAOD::MdtDriftCircle_v1
https://gitlab.cern.ch/atlas/athena/-/blob/master/MuonSpectrometer/MuonReconstruction/MuonRecEvent/Mu...
Definition: MdtDriftCircle_v1.h:21
MuonR4::SegmentFit::Parameters
AmgVector(Acts::toUnderlying(ParamDefs::nPars)) Parameters
Definition: MuonHoughDefs.h:45
xAOD::UncalibMeasType::MdtDriftCircleType
@ MdtDriftCircleType
xAOD::ConstVectorMap
Eigen::Map< const MeasVector< N > > ConstVectorMap
Definition: MeasurementDefs.h:60
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