ATLAS Offline Software
Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Trk::SolenoidalIntersector Class Referencefinal

#include <SolenoidalIntersector.h>

Inheritance diagram for Trk::SolenoidalIntersector:
Collaboration diagram for Trk::SolenoidalIntersector:

Classes

struct  Constants
 Constants of motion and other cached values. More...
 

Public Member Functions

 SolenoidalIntersector (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~SolenoidalIntersector ()=default
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual std::optional< TrackSurfaceIntersectionintersectSurface (const Surface &surface, const TrackSurfaceIntersection &trackTrackSurfaceIntersection, const double qOverP) const override
 IIntersector interface method for general Surface type. More...
 
virtual std::optional< TrackSurfaceIntersectionapproachPerigeeSurface (const PerigeeSurface &surface, const TrackSurfaceIntersection &trackTrackSurfaceIntersection, const double qOverP) const override
 IIntersector interface method for specific Surface type : PerigeeSurface. More...
 
virtual std::optional< TrackSurfaceIntersectionapproachStraightLineSurface (const StraightLineSurface &surface, const TrackSurfaceIntersection &trackTrackSurfaceIntersection, const double qOverP) const override
 IIntersector interface method for specific Surface type : StraightLineSurface. More...
 
virtual std::optional< TrackSurfaceIntersectionintersectCylinderSurface (const CylinderSurface &surface, const TrackSurfaceIntersection &trackTrackSurfaceIntersection, const double qOverP) const override
 IIntersector interface method for specific Surface type : CylinderSurface. More...
 
virtual std::optional< TrackSurfaceIntersectionintersectDiscSurface (const DiscSurface &surface, const TrackSurfaceIntersection &trackTrackSurfaceIntersection, const double qOverP) const override
 IIntersector interface method for specific Surface type : DiscSurface. More...
 
virtual std::optional< TrackSurfaceIntersectionintersectPlaneSurface (const PlaneSurface &surface, const TrackSurfaceIntersection &trackTrackSurfaceIntersection, const double qOverP) const override
 IIntersector interface method for specific Surface type : PlaneSurface. More...
 
virtual bool isValid (Amg::Vector3D startPosition, Amg::Vector3D endPosition) const override
 IIntersector interface method to check validity of parametrization within extrapolation range. More...
 

Private Member Functions

void throwMissingCondData () const
 
const SolenoidParametrizationgetSolenoidParametrization () const
 
double circularArcLength (double, double, double, double, double, double, double &, double &) const
 
double linearArcLength (const TrackSurfaceIntersection &isect, const Constants &com, const double radius2, const double endRadius) const
 
bool extrapolateToR (TrackSurfaceIntersection &isect, double &radius2, Constants &com, const double endRadius) const
 
std::optional< TrackSurfaceIntersectionintersection (TrackSurfaceIntersection &&isect, Constants &com, const Surface &surface) const
 

Static Private Member Functions

static bool extrapolateToZ (TrackSurfaceIntersection &isect, Constants &com, const double endZ)
 
static std::optional< TrackSurfaceIntersectionnewIntersection (const TrackSurfaceIntersection &oldIsect, const SolenoidParametrization &solpar, const double qOverP, Constants *&com)
 

Private Attributes

SG::ReadCondHandleKey< SolenoidParametrizationm_solenoidParametrizationKey
 
ToolHandle< IIntersectorm_rungeKuttaIntersector
 
double m_deltaPhiTolerance
 
double m_surfaceTolerance
 
std::atomic< unsigned long long > m_countExtrapolations
 
std::atomic< unsigned long long > m_countRKSwitches
 

Detailed Description

Definition at line 29 of file SolenoidalIntersector.h.

Constructor & Destructor Documentation

◆ SolenoidalIntersector()

Trk::SolenoidalIntersector::SolenoidalIntersector ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 38 of file SolenoidalIntersector.cxx.

41  : base_class(type, name, parent),
43  "Trk::RungeKuttaIntersector/RungeKuttaIntersector", this),
44  m_deltaPhiTolerance(0.01), // upper limit for small angle approx
48  declareProperty("RungeKuttaIntersector", m_rungeKuttaIntersector);
49  declareProperty("SurfaceTolerance", m_surfaceTolerance);
50 }

◆ ~SolenoidalIntersector()

virtual Trk::SolenoidalIntersector::~SolenoidalIntersector ( )
virtualdefault

Member Function Documentation

◆ approachPerigeeSurface()

std::optional< Trk::TrackSurfaceIntersection > Trk::SolenoidalIntersector::approachPerigeeSurface ( const PerigeeSurface surface,
const TrackSurfaceIntersection trackTrackSurfaceIntersection,
const double  qOverP 
) const
overridevirtual

IIntersector interface method for specific Surface type : PerigeeSurface.

Definition at line 108 of file SolenoidalIntersector.cxx.

111 { return m_rungeKuttaIntersector->approachPerigeeSurface(surface, trackIntersection, qOverP); }

◆ approachStraightLineSurface()

std::optional< Trk::TrackSurfaceIntersection > Trk::SolenoidalIntersector::approachStraightLineSurface ( const StraightLineSurface surface,
const TrackSurfaceIntersection trackTrackSurfaceIntersection,
const double  qOverP 
) const
overridevirtual

IIntersector interface method for specific Surface type : StraightLineSurface.

Definition at line 115 of file SolenoidalIntersector.cxx.

118 { return m_rungeKuttaIntersector->approachStraightLineSurface(surface, trackIntersection, qOverP); }

◆ circularArcLength()

double Trk::SolenoidalIntersector::circularArcLength ( double  endRadius,
double  radiusOfCurvature,
double  xCentre,
double  yCentre,
double  cosPhi,
double  sinPhi,
double &  cosPhiIntersect,
double &  sinPhiIntersect 
) const
inlineprivate

Definition at line 161 of file SolenoidalIntersector.h.

164  {
165  int trapped = 0;
166  double radiusSquared = xCentre * xCentre + yCentre * yCentre;
167  double term = 0.5 *
168  (radiusSquared + radiusOfCurvature * radiusOfCurvature -
169  endRadius * endRadius) /
170  (radiusSquared * radiusOfCurvature);
171  if (std::abs(xCentre) < std::abs(yCentre)) {
172  double dx2 = yCentre * yCentre * (1. / (radiusSquared * term * term) - 1.);
173  if (dx2 < 0.) {
174  trapped = 1;
175  } else {
176  if (yCentre * term > 0.) {
177  sinPhiIntersect = term * (-xCentre + std::sqrt(dx2));
178  } else {
179  sinPhiIntersect = term * (-xCentre - std::sqrt(dx2));
180  }
181  cosPhiIntersect =
182  (sinPhiIntersect * xCentre + radiusSquared * term) / yCentre;
183  }
184  } else {
185  double dy2 = xCentre * xCentre * (1. / (radiusSquared * term * term) - 1.);
186  if (dy2 < 0.) {
187  trapped = 1;
188  } else {
189  if (xCentre * term > 0.) {
190  cosPhiIntersect = term * (yCentre + std::sqrt(dy2));
191  } else {
192  cosPhiIntersect = term * (yCentre - std::sqrt(dy2));
193  }
194  sinPhiIntersect =
195  (cosPhiIntersect * yCentre - radiusSquared * term) / xCentre;
196  }
197  }
198  if (trapped == 0) {
199  double deltaPhi;
200  double sinDeltaPhi = sinPhiIntersect * cosPhi - cosPhiIntersect * sinPhi;
201  if (std::abs(sinDeltaPhi) > 0.1) {
202  deltaPhi = std::asin(sinDeltaPhi);
203  } else {
204  deltaPhi = sinDeltaPhi * (1. + 0.166667 * sinDeltaPhi * sinDeltaPhi);
205  }
206  return (radiusOfCurvature * deltaPhi);
207  } else {
208  cosPhiIntersect = cosPhi;
209  sinPhiIntersect = sinPhi;
210  return 0.;
211  }
212 }

◆ extrapolateToR()

bool Trk::SolenoidalIntersector::extrapolateToR ( TrackSurfaceIntersection isect,
double &  radius2,
Constants com,
const double  endRadius 
) const
private

Definition at line 270 of file SolenoidalIntersector.cxx.

274 {
275  Amg::Vector3D& pos = isect.position();
276  Amg::Vector3D& dir = isect.direction();
277 
278  double fieldComponent =
279  com.m_solPar.fieldComponent(pos.z(), com.m_solParams);
280  double curvature = fieldComponent * com.m_qOverPt;
281  double arcLength = linearArcLength(isect, com, radius2, endR);
282  if (std::abs(arcLength * curvature) > m_deltaPhiTolerance) {
283  double radiusOfCurvature = 1. / curvature;
284  double xCentre =
285  pos.x() - radiusOfCurvature * dir.y() * com.m_oneOverSinTheta;
286  double yCentre =
287  pos.y() + radiusOfCurvature * dir.x() * com.m_oneOverSinTheta;
288  double cosPhi;
289  double sinPhi;
290  arcLength =
291  circularArcLength(endR, radiusOfCurvature, xCentre, yCentre,
292  dir.x() * com.m_oneOverSinTheta,
293  dir.y() * com.m_oneOverSinTheta, cosPhi, sinPhi);
294  if (std::abs(arcLength * com.m_cotTheta) < m_surfaceTolerance) {
295  pos.x() = xCentre + radiusOfCurvature * sinPhi;
296  pos.y() = yCentre - radiusOfCurvature * cosPhi;
297  pos.z() += arcLength * com.m_cotTheta;
298  radius2 = endR * endR;
299  dir.x() = cosPhi * com.m_sinTheta;
300  dir.y() = sinPhi * com.m_sinTheta;
301  isect.pathlength() += arcLength * com.m_oneOverSinTheta;
302  arcLength = 0.;
303  }
304  }
305 
306  double deltaZ = arcLength * com.m_cotTheta;
307  if (std::abs(deltaZ) < m_surfaceTolerance) // avoid FPE with constant
308  // curvature parabolic approx
309  {
310  double cosPhi = dir.x() * com.m_oneOverSinTheta;
311  double sinPhi = dir.y() * com.m_oneOverSinTheta;
312  if (std::abs(arcLength) > m_surfaceTolerance) {
313  double sinDPhi = 0.5 * arcLength * curvature;
314  double cosDPhi =
315  1. - 0.5 * sinDPhi * sinDPhi * (1.0 + 0.25 * sinDPhi * sinDPhi);
316  double temp = cosPhi;
317  cosPhi = temp * cosDPhi - sinPhi * sinDPhi;
318  sinPhi = temp * sinDPhi + sinPhi * cosDPhi;
319  dir.x() = (cosPhi * cosDPhi - sinPhi * sinDPhi) * com.m_sinTheta;
320  dir.y() = (sinPhi * cosDPhi + cosPhi * sinDPhi) * com.m_sinTheta;
321  }
322 
323  pos.x() += arcLength * cosPhi;
324  pos.y() += arcLength * sinPhi;
325  pos.z() += arcLength * com.m_cotTheta;
326  radius2 = endR * endR;
327  isect.pathlength() += arcLength * com.m_oneOverSinTheta;
328  } else {
329  extrapolateToZ(isect, com, pos.z() + deltaZ);
330  radius2 = pos.perp2();
331  if (std::abs(endR - std::sqrt(radius2)) > m_surfaceTolerance) {
332  deltaZ = linearArcLength(isect, com, radius2, endR) * com.m_cotTheta;
333  extrapolateToZ(isect, com, pos.z() + deltaZ);
334  radius2 = pos.perp2();
335  }
336  }
337 
338  return true;
339 }

◆ extrapolateToZ()

bool Trk::SolenoidalIntersector::extrapolateToZ ( TrackSurfaceIntersection isect,
Constants com,
const double  endZ 
)
staticprivate

Definition at line 342 of file SolenoidalIntersector.cxx.

345 {
346  Amg::Vector3D& pos = isect.position();
347  Amg::Vector3D& dir = isect.direction();
348 
349  double firstIntegral = 0.;
350  double secondIntegral = 0.;
351  com.m_solPar.fieldIntegrals(firstIntegral, secondIntegral, pos.z(), endZ,
352  com.m_solParams);
353  double DFiMax = 0.1;
354  double cosPhi = dir.x() * com.m_oneOverSinTheta;
355  double sinPhi = dir.y() * com.m_oneOverSinTheta;
356  double cosBeta;
357  double sinBeta;
358  double deltaPhi2 =
359  secondIntegral * com.m_qOverPt / std::abs(com.m_cotTheta);
360  if (std::abs(deltaPhi2) < DFiMax) {
361  double deltaPhi2Squared = deltaPhi2 * deltaPhi2;
362  sinBeta = 1. - 0.166667 * deltaPhi2Squared;
363  cosBeta = -0.5 * deltaPhi2 * (1. - 0.083333 * deltaPhi2Squared);
364  } else if (2. * std::abs(deltaPhi2) < M_PI) {
365  sinBeta = std::sin(deltaPhi2) / deltaPhi2;
366  cosBeta = (std::cos(deltaPhi2) - 1.) / deltaPhi2;
367  } else {
368  return false;
369  }
370 
371  double radialDistance = (endZ - pos.z()) / com.m_cotTheta;
372  pos.x() += radialDistance * (sinPhi * cosBeta + cosPhi * sinBeta);
373  pos.y() += radialDistance * (sinPhi * sinBeta - cosPhi * cosBeta);
374  pos.z() = endZ;
375  isect.pathlength() += radialDistance * com.m_oneOverSinTheta;
376 
377  double cosAlpha;
378  double sinAlpha;
379  double deltaPhi1 = firstIntegral * com.m_qOverPt / std::abs(com.m_cotTheta);
380  if (std::abs(deltaPhi1) < DFiMax) {
381  double deltaPhi1Squared = deltaPhi1 * deltaPhi1;
382  sinAlpha = deltaPhi1 * (1. - 0.166667 * deltaPhi1Squared);
383  cosAlpha =
384  1. - 0.5 * deltaPhi1Squared * (1. - 0.083333 * deltaPhi1Squared);
385  } else {
386  sinAlpha = std::sin(deltaPhi1);
387  cosAlpha = std::cos(deltaPhi1);
388  }
389  dir.x() = (cosPhi * cosAlpha - sinPhi * sinAlpha) * com.m_sinTheta;
390  dir.y() = (sinPhi * cosAlpha + cosPhi * sinAlpha) * com.m_sinTheta;
391  return true;
392 }

◆ finalize()

StatusCode Trk::SolenoidalIntersector::finalize ( )
overridevirtual

Definition at line 61 of file SolenoidalIntersector.cxx.

62 {
63  ATH_MSG_DEBUG( "finalized after " << m_countExtrapolations << " extrapolations with "
64  << m_countRKSwitches << " switches to RK integration");
65 
66  return StatusCode::SUCCESS;
67 }

◆ getSolenoidParametrization()

const SolenoidParametrization* Trk::SolenoidalIntersector::getSolenoidParametrization ( ) const
inlineprivate

Definition at line 118 of file SolenoidalIntersector.h.

118  {
121  if (!handle.isValid()) {
123  }
124  return handle.cptr();
125  }

◆ initialize()

StatusCode Trk::SolenoidalIntersector::initialize ( )
overridevirtual

Definition at line 53 of file SolenoidalIntersector.cxx.

54 {
57  return StatusCode::SUCCESS;
58 }

◆ intersectCylinderSurface()

std::optional< Trk::TrackSurfaceIntersection > Trk::SolenoidalIntersector::intersectCylinderSurface ( const CylinderSurface surface,
const TrackSurfaceIntersection trackTrackSurfaceIntersection,
const double  qOverP 
) const
overridevirtual

IIntersector interface method for specific Surface type : CylinderSurface.

Definition at line 122 of file SolenoidalIntersector.cxx.

125 {
126  const SolenoidParametrization* solenoidParametrization =
128 
129  double endRadius = surface.globalReferencePoint().perp();
130  if (!solenoidParametrization || endRadius > solenoidParametrization->maximumR())
131  return m_rungeKuttaIntersector->intersectCylinderSurface(surface, trackIntersection, qOverP);
132 
133  Constants* com = nullptr;
134  std::optional<TrackSurfaceIntersection> isect = newIntersection(
135  trackIntersection, *solenoidParametrization, qOverP, com);
137 
138  double radius2 = isect->position().perp2();
139  if (std::abs(endRadius - sqrt(radius2)) > m_surfaceTolerance
140  && ! extrapolateToR(*isect, radius2, *com, endRadius)) return std::nullopt;
141 
142  return intersection(std::move(*isect), *com, surface);
143 }

◆ intersectDiscSurface()

std::optional< Trk::TrackSurfaceIntersection > Trk::SolenoidalIntersector::intersectDiscSurface ( const DiscSurface surface,
const TrackSurfaceIntersection trackTrackSurfaceIntersection,
const double  qOverP 
) const
overridevirtual

IIntersector interface method for specific Surface type : DiscSurface.

Definition at line 147 of file SolenoidalIntersector.cxx.

150 {
151  const SolenoidParametrization* solenoidParametrization =
153 
154  double endZ = surface.center().z();
155  if (!solenoidParametrization || std::abs(endZ) > solenoidParametrization->maximumZ())
156  return m_rungeKuttaIntersector->intersectDiscSurface(surface, trackIntersection, qOverP);
157 
158  Constants* com = nullptr;
159  std::optional<TrackSurfaceIntersection> isect =
160  newIntersection (trackIntersection,
161  *solenoidParametrization,
162  qOverP,
163  com);
164 
166 
167  if (std::abs(endZ -trackIntersection.position().z()) > m_surfaceTolerance
168  && ! extrapolateToZ(*isect, *com, endZ))
169  {
170  return std::nullopt;
171  }
172 
173  return intersection(std::move(*isect), *com, surface);
174 }

◆ intersection()

std::optional< TrackSurfaceIntersection > Trk::SolenoidalIntersector::intersection ( TrackSurfaceIntersection &&  isect,
Constants com,
const Surface surface 
) const
inlineprivate

Definition at line 237 of file SolenoidalIntersector.h.

239  {
240  // Improve the estimate of the intersection by calculating
241  // the straight-line intersection.
242  Intersection SLIntersect = surface.straightLineIntersection(
243  isect.position(), isect.direction(), false, false);
244  if (SLIntersect.valid) {
245  // But first save our current position, so that we can
246  // start from here on the next call.
247  com.m_lastPosition = isect.position();
248  isect.position() = SLIntersect.position;
249  return std::move(isect);
250  }
251 
252  return std::nullopt;
253 }

◆ intersectPlaneSurface()

std::optional< Trk::TrackSurfaceIntersection > Trk::SolenoidalIntersector::intersectPlaneSurface ( const PlaneSurface surface,
const TrackSurfaceIntersection trackTrackSurfaceIntersection,
const double  qOverP 
) const
overridevirtual

IIntersector interface method for specific Surface type : PlaneSurface.

Definition at line 178 of file SolenoidalIntersector.cxx.

181 {
182  const SolenoidParametrization* solenoidParametrization =
184 
185  if (!solenoidParametrization ||
186  std::abs(surface.center().z()) > solenoidParametrization->maximumZ()
187  || surface.center().perp() > solenoidParametrization->maximumR())
188  return m_rungeKuttaIntersector->intersectPlaneSurface(surface, trackIntersection, qOverP);
189 
190  Constants* com = nullptr;
191  std::optional<TrackSurfaceIntersection> isect =
192  newIntersection (trackIntersection,
193  *solenoidParametrization,
194  qOverP,
195  com);
196  Amg::Vector3D& pos = isect->position();
197  Amg::Vector3D& dir = isect->direction();
199  double radius2 = pos.perp2();
200 
201  // step until sufficiently near to plane surface
202  // this gives wrong answer!
203  // DistanceSolution solution = surface.straightLineDistanceEstimate(pos,dir);
204  // if (! solution.signedDistance()) return 0;
205  // double distance = solution.currentDistance(true);
206 
207  int numberSteps = 0;
208  double dot = surface.normal().dot(dir);
209  double offset = surface.normal().dot(surface.center() - pos);
210 
211  while (std::abs(offset) > m_surfaceTolerance * std::abs(dot)) {
212  // take care if grazing incidence - quit if looper
213  if (std::abs(dot) < 0.0001)
214  return std::nullopt;
215  double distance = offset / dot;
216 
217  // extrapolate
218  if (com->m_sinTheta < 0.9) {
219  if (!extrapolateToZ(*isect, *com, pos.z() + distance * dir.z()))
220  return std::nullopt;
221  radius2 = pos.perp2();
222  } else {
223  if (!extrapolateToR(*isect, radius2, *com,
224  (pos + distance * dir).perp()))
225  return std::nullopt;
226  }
227 
228  // check we are getting closer to the plane, switch to RK in case of
229  // difficulty
230  dot = surface.normal().dot(dir);
231  offset = surface.normal().dot(surface.center() - pos);
232  if (std::abs(offset) > m_surfaceTolerance * std::abs(dot) &&
233  (++numberSteps > 5 ||
234  std::abs(offset) > 0.5 * std::abs(distance * dot))) {
236  ATH_MSG_DEBUG(" switch to RK after "
237  << numberSteps << " steps at offset " << offset
238  << " dot " << surface.normal().dot(dir));
239 
240  return m_rungeKuttaIntersector->intersectPlaneSurface(
241  surface, trackIntersection, qOverP);
242  }
243  };
244 
245  return intersection(std::move(*isect), *com, surface);
246 }

◆ intersectSurface()

std::optional< Trk::TrackSurfaceIntersection > Trk::SolenoidalIntersector::intersectSurface ( const Surface surface,
const TrackSurfaceIntersection trackTrackSurfaceIntersection,
const double  qOverP 
) const
overridevirtual

IIntersector interface method for general Surface type.

Definition at line 72 of file SolenoidalIntersector.cxx.

75 {
76 
77  const auto surfaceType = surface.type();
78  if (surfaceType == Trk::SurfaceType::Plane) {
79  return intersectPlaneSurface(static_cast<const PlaneSurface&>(surface),
80  trackIntersection, qOverP);
81  }
82  if (surfaceType == Trk::SurfaceType::Line) {
83  return m_rungeKuttaIntersector->approachStraightLineSurface(
84  static_cast<const StraightLineSurface&>(surface), trackIntersection,
85  qOverP);
86  }
87  if (surfaceType == Trk::SurfaceType::Cylinder) {
89  static_cast<const CylinderSurface&>(surface), trackIntersection,
90  qOverP);
91  }
92  if (surfaceType == Trk::SurfaceType::Disc) {
93  return intersectDiscSurface(static_cast<const DiscSurface&>(surface),
94  trackIntersection, qOverP);
95  }
96  if (surfaceType == Trk::SurfaceType::Perigee) {
97  return m_rungeKuttaIntersector->approachPerigeeSurface(
98  static_cast<const PerigeeSurface&>(surface), trackIntersection,
99  qOverP);
100  }
101 
102  ATH_MSG_WARNING( " unrecognized Surface" );
103  return std::nullopt;
104 }

◆ isValid()

bool Trk::SolenoidalIntersector::isValid ( Amg::Vector3D  startPosition,
Amg::Vector3D  endPosition 
) const
overridevirtual

IIntersector interface method to check validity of parametrization within extrapolation range.

Definition at line 250 of file SolenoidalIntersector.cxx.

252 {
253  const SolenoidParametrization* solenoidParametrization =
255 
256  // check cylinder bounds for valid parametrization
257  return solenoidParametrization &&
258 
259  std::abs(endPosition.z()) < solenoidParametrization->maximumZ()
260 
261  && endPosition.perp() < solenoidParametrization->maximumR()
262 
263  && getSolenoidParametrization()->validOrigin(startPosition);
264 }

◆ linearArcLength()

double Trk::SolenoidalIntersector::linearArcLength ( const TrackSurfaceIntersection isect,
const Constants com,
const double  radius2,
const double  endRadius 
) const
inlineprivate

Definition at line 217 of file SolenoidalIntersector.h.

219  {
220  const Amg::Vector3D& pos = isect.position();
221  const Amg::Vector3D& dir = isect.direction();
222 
223  double arcLength =
224  (-dir.x() * pos.x() - dir.y() * pos.y()) * com.m_oneOverSinTheta;
225  double radiusSquared =
226  endRadius * endRadius - radius2 + arcLength * arcLength;
227  if (radiusSquared > 0.) {
228  if (endRadius > 0.) {
229  arcLength += std::sqrt(radiusSquared);
230  } else {
231  arcLength -= std::sqrt(radiusSquared);
232  }
233  }
234  return arcLength;
235 }

◆ newIntersection()

std::optional< TrackSurfaceIntersection > Trk::SolenoidalIntersector::newIntersection ( const TrackSurfaceIntersection oldIsect,
const SolenoidParametrization solpar,
const double  qOverP,
Constants *&  com 
)
staticprivate

Definition at line 395 of file SolenoidalIntersector.cxx.

399 {
400  const TrackSurfaceIntersection::IIntersectionCache* oldCache = isect.cache();
401  std::unique_ptr<Constants> cache;
402  Amg::Vector3D lastPosition;
403 
404  if (oldCache) {
405  assert(typeid(*oldCache) == typeid(Constants));
406  cache =
407  std::make_unique<Constants>(*static_cast<const Constants*>(oldCache));
408  lastPosition = cache->m_lastPosition;
409  } else {
410  cache = std::make_unique<Constants>(solpar, isect, qOverP);
411  }
412 
413  com = cache.get();
414  auto newIsect =
415  std::make_optional<TrackSurfaceIntersection>(isect, std::move(cache));
416  if (oldCache) {
417  newIsect->position() = lastPosition;
418  }
419  return newIsect;
420 }

◆ throwMissingCondData()

void Trk::SolenoidalIntersector::throwMissingCondData ( ) const
private

Definition at line 422 of file SolenoidalIntersector.cxx.

422  {
423  std::stringstream msg;
424  msg << "Invalid read handle for SolenoidParametrization " << m_solenoidParametrizationKey.key();
425  throw std::logic_error(msg.str());
426 }

Member Data Documentation

◆ m_countExtrapolations

std::atomic<unsigned long long> Trk::SolenoidalIntersector::m_countExtrapolations
mutableprivate

Definition at line 155 of file SolenoidalIntersector.h.

◆ m_countRKSwitches

std::atomic<unsigned long long> Trk::SolenoidalIntersector::m_countRKSwitches
mutableprivate

Definition at line 156 of file SolenoidalIntersector.h.

◆ m_deltaPhiTolerance

double Trk::SolenoidalIntersector::m_deltaPhiTolerance
private

Definition at line 151 of file SolenoidalIntersector.h.

◆ m_rungeKuttaIntersector

ToolHandle<IIntersector> Trk::SolenoidalIntersector::m_rungeKuttaIntersector
private

Definition at line 149 of file SolenoidalIntersector.h.

◆ m_solenoidParametrizationKey

SG::ReadCondHandleKey<SolenoidParametrization> Trk::SolenoidalIntersector::m_solenoidParametrizationKey
private
Initial value:
{
this, "SolenoidParameterizationKey", "SolenoidParametrization", ""}

Definition at line 147 of file SolenoidalIntersector.h.

◆ m_surfaceTolerance

double Trk::SolenoidalIntersector::m_surfaceTolerance
private

Definition at line 152 of file SolenoidalIntersector.h.


The documentation for this class was generated from the following files:
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
Trk::SolenoidalIntersector::Constants::m_lastPosition
Amg::Vector3D m_lastPosition
Definition: SolenoidalIntersector.h:62
perp
Scalar perp() const
perp method - perpenticular length
Definition: AmgMatrixBasePlugin.h:44
xAOD::deltaPhi
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
Definition: L2StandAloneMuon_v1.cxx:160
Trk::SolenoidalIntersector::m_surfaceTolerance
double m_surfaceTolerance
Definition: SolenoidalIntersector.h:152
M_PI
#define M_PI
Definition: ActiveFraction.h:11
Trk::SolenoidalIntersector::newIntersection
static std::optional< TrackSurfaceIntersection > newIntersection(const TrackSurfaceIntersection &oldIsect, const SolenoidParametrization &solpar, const double qOverP, Constants *&com)
Definition: SolenoidalIntersector.cxx:395
Trk::SolenoidalIntersector::intersectPlaneSurface
virtual std::optional< TrackSurfaceIntersection > intersectPlaneSurface(const PlaneSurface &surface, const TrackSurfaceIntersection &trackTrackSurfaceIntersection, const double qOverP) const override
IIntersector interface method for specific Surface type : PlaneSurface.
Definition: SolenoidalIntersector.cxx:178
Trk::SolenoidalIntersector::m_solenoidParametrizationKey
SG::ReadCondHandleKey< SolenoidParametrization > m_solenoidParametrizationKey
Definition: SolenoidalIntersector.h:147
Trk::SolenoidalIntersector::m_countExtrapolations
std::atomic< unsigned long long > m_countExtrapolations
Definition: SolenoidalIntersector.h:155
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
Trk::SolenoidalIntersector::extrapolateToZ
static bool extrapolateToZ(TrackSurfaceIntersection &isect, Constants &com, const double endZ)
Definition: SolenoidalIntersector.cxx:342
xAOD::EgammaParameters::deltaPhi1
@ deltaPhi1
difference between the cluster eta (1st sampling) and the eta of the track extrapolated to the 1st sa...
Definition: EgammaEnums.h:196
Trk::SolenoidalIntersector::circularArcLength
double circularArcLength(double, double, double, double, double, double, double &, double &) const
Definition: SolenoidalIntersector.h:161
Trk::SolenoidalIntersector::m_deltaPhiTolerance
double m_deltaPhiTolerance
Definition: SolenoidalIntersector.h:151
Trk::SolenoidalIntersector::intersection
std::optional< TrackSurfaceIntersection > intersection(TrackSurfaceIntersection &&isect, Constants &com, const Surface &surface) const
Definition: SolenoidalIntersector.h:237
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
python.SystemOfUnits.micrometer
int micrometer
Definition: SystemOfUnits.py:71
dot.dot
def dot(G, fn, nodesToHighlight=[])
Definition: dot.py:5
beamspotman.dir
string dir
Definition: beamspotman.py:623
Trk::SolenoidalIntersector::intersectDiscSurface
virtual std::optional< TrackSurfaceIntersection > intersectDiscSurface(const DiscSurface &surface, const TrackSurfaceIntersection &trackTrackSurfaceIntersection, const double qOverP) const override
IIntersector interface method for specific Surface type : DiscSurface.
Definition: SolenoidalIntersector.cxx:147
Trk::SurfaceType::Perigee
@ Perigee
Trk::SolenoidalIntersector::intersectCylinderSurface
virtual std::optional< TrackSurfaceIntersection > intersectCylinderSurface(const CylinderSurface &surface, const TrackSurfaceIntersection &trackTrackSurfaceIntersection, const double qOverP) const override
IIntersector interface method for specific Surface type : CylinderSurface.
Definition: SolenoidalIntersector.cxx:122
Trk::SolenoidalIntersector::m_countRKSwitches
std::atomic< unsigned long long > m_countRKSwitches
Definition: SolenoidalIntersector.h:156
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Trk::SolenoidParametrization::validOrigin
bool validOrigin(const Amg::Vector3D &origin) const
Definition: SolenoidParametrization.h:275
Trk::SolenoidalIntersector::getSolenoidParametrization
const SolenoidParametrization * getSolenoidParametrization() const
Definition: SolenoidalIntersector.h:118
xAOD::EgammaParameters::deltaPhi2
@ deltaPhi2
difference between the cluster phi (second sampling) and the phi of the track extrapolated to the sec...
Definition: EgammaEnums.h:204
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trk::SolenoidalIntersector::extrapolateToR
bool extrapolateToR(TrackSurfaceIntersection &isect, double &radius2, Constants &com, const double endRadius) const
Definition: SolenoidalIntersector.cxx:270
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
Trk::SurfaceType::Disc
@ Disc
Trk::SurfaceType::Cylinder
@ Cylinder
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
Trk::SolenoidalIntersector::throwMissingCondData
void throwMissingCondData() const
Definition: SolenoidalIntersector.cxx:422
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
Trk::SurfaceType::Plane
@ Plane
dot
Definition: dot.py:1
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
Trk::SolenoidalIntersector::linearArcLength
double linearArcLength(const TrackSurfaceIntersection &isect, const Constants &com, const double radius2, const double endRadius) const
Definition: SolenoidalIntersector.h:217
makeComparison.deltaZ
int deltaZ
Definition: makeComparison.py:46
Trk::SurfaceType::Line
@ Line
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
Trk::SolenoidalIntersector::m_rungeKuttaIntersector
ToolHandle< IIntersector > m_rungeKuttaIntersector
Definition: SolenoidalIntersector.h:149