ATLAS Offline Software
Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static 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
 
DoubleProperty m_surfaceTolerance
 
std::atomic< unsigned long long > m_countExtrapolations = 0
 
std::atomic< unsigned long long > m_countRKSwitches = 0
 

Static Private Attributes

static constexpr double m_deltaPhiTolerance = 0.01
 

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) {}

◆ ~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 99 of file SolenoidalIntersector.cxx.

102 { 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 106 of file SolenoidalIntersector.cxx.

109 { 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 163 of file SolenoidalIntersector.h.

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

◆ extrapolateToR()

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

Definition at line 261 of file SolenoidalIntersector.cxx.

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

◆ extrapolateToZ()

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

Definition at line 333 of file SolenoidalIntersector.cxx.

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

◆ finalize()

StatusCode Trk::SolenoidalIntersector::finalize ( )
overridevirtual

Definition at line 52 of file SolenoidalIntersector.cxx.

53 {
54  ATH_MSG_DEBUG( "finalized after " << m_countExtrapolations << " extrapolations with "
55  << m_countRKSwitches << " switches to RK integration");
56 
57  return StatusCode::SUCCESS;
58 }

◆ 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 44 of file SolenoidalIntersector.cxx.

45 {
48  return StatusCode::SUCCESS;
49 }

◆ 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 113 of file SolenoidalIntersector.cxx.

116 {
117  const SolenoidParametrization* solenoidParametrization =
119 
120  double endRadius = surface.globalReferencePoint().perp();
121  if (!solenoidParametrization || endRadius > solenoidParametrization->maximumR())
122  return m_rungeKuttaIntersector->intersectCylinderSurface(surface, trackIntersection, qOverP);
123 
124  Constants* com = nullptr;
125  std::optional<TrackSurfaceIntersection> isect = newIntersection(
126  trackIntersection, *solenoidParametrization, qOverP, com);
128 
129  double radius2 = isect->position().perp2();
130  if (std::abs(endRadius - sqrt(radius2)) > m_surfaceTolerance
131  && ! extrapolateToR(*isect, radius2, *com, endRadius)) return std::nullopt;
132 
133  return intersection(std::move(*isect), *com, surface);
134 }

◆ 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 138 of file SolenoidalIntersector.cxx.

141 {
142  const SolenoidParametrization* solenoidParametrization =
144 
145  double endZ = surface.center().z();
146  if (!solenoidParametrization || std::abs(endZ) > solenoidParametrization->maximumZ())
147  return m_rungeKuttaIntersector->intersectDiscSurface(surface, trackIntersection, qOverP);
148 
149  Constants* com = nullptr;
150  std::optional<TrackSurfaceIntersection> isect =
151  newIntersection (trackIntersection,
152  *solenoidParametrization,
153  qOverP,
154  com);
155 
157 
158  if (std::abs(endZ -trackIntersection.position().z()) > m_surfaceTolerance
159  && ! extrapolateToZ(*isect, *com, endZ))
160  {
161  return std::nullopt;
162  }
163 
164  return intersection(std::move(*isect), *com, surface);
165 }

◆ intersection()

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

Definition at line 239 of file SolenoidalIntersector.h.

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

◆ 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 169 of file SolenoidalIntersector.cxx.

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

◆ 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 63 of file SolenoidalIntersector.cxx.

66 {
67 
68  const auto surfaceType = surface.type();
69  if (surfaceType == Trk::SurfaceType::Plane) {
70  return intersectPlaneSurface(static_cast<const PlaneSurface&>(surface),
71  trackIntersection, qOverP);
72  }
73  if (surfaceType == Trk::SurfaceType::Line) {
74  return m_rungeKuttaIntersector->approachStraightLineSurface(
75  static_cast<const StraightLineSurface&>(surface), trackIntersection,
76  qOverP);
77  }
78  if (surfaceType == Trk::SurfaceType::Cylinder) {
80  static_cast<const CylinderSurface&>(surface), trackIntersection,
81  qOverP);
82  }
83  if (surfaceType == Trk::SurfaceType::Disc) {
84  return intersectDiscSurface(static_cast<const DiscSurface&>(surface),
85  trackIntersection, qOverP);
86  }
87  if (surfaceType == Trk::SurfaceType::Perigee) {
88  return m_rungeKuttaIntersector->approachPerigeeSurface(
89  static_cast<const PerigeeSurface&>(surface), trackIntersection,
90  qOverP);
91  }
92 
93  ATH_MSG_WARNING( " unrecognized Surface" );
94  return std::nullopt;
95 }

◆ 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 241 of file SolenoidalIntersector.cxx.

243 {
244  const SolenoidParametrization* solenoidParametrization =
246 
247  // check cylinder bounds for valid parametrization
248  return solenoidParametrization &&
249 
250  std::abs(endPosition.z()) < solenoidParametrization->maximumZ()
251 
252  && endPosition.perp() < solenoidParametrization->maximumR()
253 
254  && getSolenoidParametrization()->validOrigin(startPosition);
255 }

◆ linearArcLength()

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

Definition at line 219 of file SolenoidalIntersector.h.

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

◆ newIntersection()

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

Definition at line 386 of file SolenoidalIntersector.cxx.

390 {
391  const TrackSurfaceIntersection::IIntersectionCache* oldCache = isect.cache();
392  std::unique_ptr<Constants> cache;
393  Amg::Vector3D lastPosition;
394  lastPosition.setZero();
395 
396  if (oldCache) {
397  assert(typeid(*oldCache) == typeid(Constants));
398  cache =
399  std::make_unique<Constants>(*static_cast<const Constants*>(oldCache));
400  lastPosition = cache->m_lastPosition;
401  } else {
402  cache = std::make_unique<Constants>(solpar, isect, qOverP);
403  }
404 
405  com = cache.get();
406  auto newIsect =
407  std::make_optional<TrackSurfaceIntersection>(isect, std::move(cache));
408  if (oldCache) {
409  newIsect->position() = lastPosition;
410  }
411  return newIsect;
412 }

◆ throwMissingCondData()

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

Definition at line 414 of file SolenoidalIntersector.cxx.

414  {
415  std::stringstream msg;
416  msg << "Invalid read handle for SolenoidParametrization " << m_solenoidParametrizationKey.key();
417  throw std::logic_error(msg.str());
418 }

Member Data Documentation

◆ m_countExtrapolations

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

Definition at line 157 of file SolenoidalIntersector.h.

◆ m_countRKSwitches

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

Definition at line 158 of file SolenoidalIntersector.h.

◆ m_deltaPhiTolerance

constexpr double Trk::SolenoidalIntersector::m_deltaPhiTolerance = 0.01
staticconstexprprivate

Definition at line 152 of file SolenoidalIntersector.h.

◆ m_rungeKuttaIntersector

ToolHandle<IIntersector> Trk::SolenoidalIntersector::m_rungeKuttaIntersector
private
Initial value:
{this, "RungeKuttaIntersector",
"Trk::RungeKuttaIntersector/RungeKuttaIntersector"}

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

DoubleProperty Trk::SolenoidalIntersector::m_surfaceTolerance
private
Initial value:
{this, "SurfaceTolerance",

Definition at line 153 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:161
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:386
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:169
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:157
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
Trk::SolenoidalIntersector::extrapolateToZ
static bool extrapolateToZ(TrackSurfaceIntersection &isect, Constants &com, const double endZ)
Definition: SolenoidalIntersector.cxx:333
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:163
Trk::SolenoidalIntersector::intersection
std::optional< TrackSurfaceIntersection > intersection(TrackSurfaceIntersection &&isect, Constants &com, const Surface &surface) const
Definition: SolenoidalIntersector.h:239
python.SystemOfUnits.micrometer
float micrometer
Definition: SystemOfUnits.py:80
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
dot.dot
def dot(G, fn, nodesToHighlight=[])
Definition: dot.py:5
beamspotman.dir
string dir
Definition: beamspotman.py:621
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:138
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:113
Trk::SolenoidalIntersector::m_countRKSwitches
std::atomic< unsigned long long > m_countRKSwitches
Definition: SolenoidalIntersector.h:158
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
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:16
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:261
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:414
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
Trk::SolenoidalIntersector::m_surfaceTolerance
DoubleProperty m_surfaceTolerance
Definition: SolenoidalIntersector.h:153
Trk::SolenoidalIntersector::m_deltaPhiTolerance
static constexpr double m_deltaPhiTolerance
Definition: SolenoidalIntersector.h:152
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:219
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