ATLAS Offline Software
Loading...
Searching...
No Matches
MuonCombinedR4 Namespace Reference

Classes

class  BeamSpotPreparatorAlg
 Data preparation algorithm to convert the beamspot position into an auxiliary measurement which can be used in the combined muon fit as an extra constaint at the vertex. More...
class  CombinedFitAlg
class  CombinedStacoAlg
 Prototype to combine ID + MS tracks using the statistical combination The ID + MS momentum are combined using the inverse of the respective q/p covariance values of the two tracks. More...
class  InDetTrackSelectionAlg
 Algorithm to select ID / ITk track candidates which may be suitable for the combined muon reconstruction chain. More...
class  MuonCreatorAlg
 Algorithm to create the xAOD::Muon analysis objects from the various muon reconstruction chains. More...
class  SegmentTaggingAlg
class  StandaloneMuonTagAlg
 Algorithm to transform the produced MS tracks into a muon tag container and to associate the segments with the MuonTag. More...

Functions

std::optional< Acts::BoundTrackParameters > makeDiffParameters (const Acts::GeometryContext &tgContext, const Acts::BoundTrackParameters &idParameters, const Acts::BoundTrackParameters &msParameters, const Acts::Logger &logger, const double boundTolerance=Acts::UnitConstants::km)
 Calculates the difference parameters between the ID and the MS If the parameters are expressed on different surfaces and the MS parameters are close to the boundary, then the MS parameters are linearliy extrapolated to the ID surface.
double longitudinalParam (const Acts::BoundTrackParameters &pars, const Acts::Logger &logger)
 Returns the longitudinal local track parameter which is defined as.
double localPolarAngle (const Acts::BoundTrackParameters &pars, const Acts::Logger &logger)
 Returns the local angular polar angle of the track parameter.

Function Documentation

◆ localPolarAngle()

double MuonCombinedR4::localPolarAngle ( const Acts::BoundTrackParameters & pars,
const Acts::Logger & logger )

Returns the local angular polar angle of the track parameter.

Parameters
parsReference to the parameters of interest
loggerThe logger instance for printing the debug message
parsReference to the parameters of interest

Definition at line 128 of file TrackMatchingUtils.cxx.

129 {
130 switch (pars.referenceSurface().type()) {
131 using enum Acts::Surface::SurfaceType;
132 case Disc:
133 return pars.get<Acts::eBoundLoc1>();
134 case Cylinder: {
135 using enum Acts::CylinderBounds::BoundValues;
136 const double R = static_cast<const Acts::CylinderBounds&>(pars.referenceSurface().bounds()).get(eR);
137 return pars.get<Acts::eBoundLoc0>() / R;
138 } default:
139 ACTS_WARNING(__func__<<"() "<<__LINE__<<" Surface type "<<pars.referenceSurface().type()
140 <<" is not implemented");
141 break;
142 }
143 return 360._degree;
144 }

◆ longitudinalParam()

double MuonCombinedR4::longitudinalParam ( const Acts::BoundTrackParameters & pars,
const Acts::Logger & logger )

Returns the longitudinal local track parameter which is defined as.

  • radial parameter in case of discs
  • displacement along the cylinder axis for cylinders
    Parameters
    parsReference to the parameters of interest
    loggerThe logger instance for printing the debug message

Definition at line 111 of file TrackMatchingUtils.cxx.

112 {
113 switch (pars.referenceSurface().type()) {
114 using enum Acts::Surface::SurfaceType;
115 case Disc:
116 return pars.get<Acts::eBoundLoc0>();
117 case Cylinder:
118 return pars.get<Acts::eBoundLoc1>();
119 default:
120 ACTS_WARNING(__func__<<"() "<<__LINE__<<" Surface type "<<pars.referenceSurface().type()
121 <<" is not implemented");
122 break;
123 }
124 return -1._km;
125 }

◆ makeDiffParameters()

std::optional< Acts::BoundTrackParameters > MuonCombinedR4::makeDiffParameters ( const Acts::GeometryContext & tgContext,
const Acts::BoundTrackParameters & idParameters,
const Acts::BoundTrackParameters & msParameters,
const Acts::Logger & logger,
const double boundTolerance = Acts::UnitConstants::km )

Calculates the difference parameters between the ID and the MS If the parameters are expressed on different surfaces and the MS parameters are close to the boundary, then the MS parameters are linearliy extrapolated to the ID surface.

If extrapolation fails or the boundary conditions are not fullfilled a std::nullopt is returned.

Parameters
tgContextThe geometry context to propagated the MS track parameters to the ID surface if needed
idParametersThe parameters from the Inner Detector to match
msParametersThe parameters from the MuonSpectrometer to match
loggerThe logger instance for printing the debug message
boundToleranceThe maximum distance that the MS parameters may be apart from the surface boundary to be extrapolated

Propagate the MS parameters to the ID parameters

Update the difference parameters

Update the MS covariance

Map the loc1 parameter to [-pi, pi]

Map the loc0 parameter to [-pi, pi] x R

Definition at line 20 of file TrackMatchingUtils.cxx.

24 {
25
26 ACTS_VERBOSE(__func__<<"() "<<__LINE__<<" - Calculate difference parameters between \n"
27 <<idParameters<<"\n\n and \n\n"<<msParameters);
28 Acts::BoundVector diffPars = msParameters.parameters() -idParameters.parameters();
29
30 const Acts::Surface& idSurf{idParameters.referenceSurface()};
31 const Acts::Surface& msSurf{msParameters.referenceSurface()};
32
33 std::optional<Acts::BoundMatrix> msCov{msParameters.covariance()};
34 const std::optional<Acts::BoundMatrix>& idCov{idParameters.covariance()};
35
36 if (idSurf.geometryId() != msSurf.geometryId() ||
37 (idSurf.geometryId() == Acts::GeometryIdentifier{} &&
38 idSurf.getSharedPtr() != msSurf.getSharedPtr())) {
39 switch (msSurf.type()) {
40 using enum Acts::Surface::SurfaceType;
41 case Disc:{
42 if (static_cast<const Acts::DiscBounds&>(msSurf.bounds()).rMax() - msParameters.get<Acts::eBoundLoc0>() > boundTolerance) {
43 ACTS_VERBOSE(__func__<<"() "<<__LINE__<<" - The parameters are too far apart from the bounds ");
44 return std::nullopt;
45 }
46 break;
47 } case Cylinder : {
48 using enum Acts::CylinderBounds::BoundValues;
49 if (static_cast<const Acts::CylinderBounds&>(msSurf.bounds()).get(eHalfLengthZ) -
50 std::abs(msParameters.get<Acts::eBoundLoc1>()) > boundTolerance) {
51 ACTS_VERBOSE(__func__<<"() "<<__LINE__<<" - The parameters are too far apart from the bounds ");
52 return std::nullopt;
53 }
54 break;
55 } default: {
56 ACTS_WARNING(__func__<<"() "<<__LINE__<<" - Surface type "<<msSurf.type()<<" is not implemented");
57 break;
58 }
59 }
61 const Acts::Intersection3D idIsect = idSurf.intersect(tgContext,
62 msParameters.position(tgContext),
63 msParameters.direction(),
64 Acts::BoundaryTolerance::Infinite()).closest();
65 if (!idIsect.isValid()) {
66 ACTS_WARNING(__func__<<"() "<<__LINE__<<" - The propgation of "<<msParameters<<" to "
67 <<idSurf.geometryId()<<", "<<idSurf.bounds()<<" failed.");
68 return std::nullopt;
69 }
70 auto locPos = idSurf.globalToLocal(tgContext, idIsect.position(), msParameters.direction());
71 if (!locPos.ok()) {
72 ACTS_WARNING(__func__<<"() "<<__LINE__<<" - Local to global of "<<Amg::toString(idIsect.position())
73 <<" is not on "<<idSurf.geometryId()<<", "<<idSurf.bounds()<<".");
74 return std::nullopt;
75 }
77 diffPars[Acts::eBoundLoc0] = (*locPos)[Acts::eX] - idParameters.get<Acts::eBoundLoc0>();
78 diffPars[Acts::eBoundLoc1] = (*locPos)[Acts::eY] - idParameters.get<Acts::eBoundLoc1>();
80 if (msCov) {
81 (*msCov) = idSurf.freeToBoundJacobian(tgContext, idIsect.position(), msParameters.direction()) *
82 msSurf.boundToFreeJacobian(tgContext, msParameters.position(tgContext),
83 msParameters.direction()) * (*msCov);
84 }
85 }
86 std::optional<Acts::BoundMatrix> diffCov{};
87 if (idCov || msCov) {
88 diffCov = idCov.value_or(Acts::BoundMatrix::Zero()) +
89 msCov.value_or(Acts::BoundMatrix::Zero());
90 }
92 if (idSurf.type() == Acts::Surface::SurfaceType::Disc) {
93 diffPars[Acts::eBoundLoc1] = deltaPhi(msParameters.get<Acts::eBoundLoc1>(),
94 idParameters.get<Acts::eBoundLoc1>());
95 } else if (idSurf.type() == Acts::Surface::SurfaceType::Cylinder) {
96 using enum Acts::CylinderBounds::BoundValues;
98 const double R = static_cast<const Acts::CylinderBounds&>(idSurf.bounds()).get(eR);
99 diffPars[Acts::eBoundLoc0] = deltaPhi(msParameters.get<Acts::eBoundLoc0>() / R,
100 idParameters.get<Acts::eBoundLoc0>() / R) * R;
101 }
102 Acts::BoundTrackParameters retPars{idSurf.getSharedPtr(),
103 /*Ensure that theta remains positive otherwise
104 the constructor flips the direction */
105 Acts::copySign(diffPars, diffPars[Acts::eBoundTheta]),
106 diffCov, msParameters.particleHypothesis()};
107 ACTS_VERBOSE(__func__<<"() "<<__LINE__<<" - Successfully created \n"<<retPars);
108 return retPars;
109 }
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)