![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
#include <SolenoidalIntersector.h>
|
| 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< TrackSurfaceIntersection > | intersectSurface (const Surface &surface, const TrackSurfaceIntersection &trackTrackSurfaceIntersection, const double qOverP) const override |
| IIntersector interface method for general Surface type. More...
|
|
virtual std::optional< TrackSurfaceIntersection > | approachPerigeeSurface (const PerigeeSurface &surface, const TrackSurfaceIntersection &trackTrackSurfaceIntersection, const double qOverP) const override |
| IIntersector interface method for specific Surface type : PerigeeSurface. More...
|
|
virtual std::optional< TrackSurfaceIntersection > | approachStraightLineSurface (const StraightLineSurface &surface, const TrackSurfaceIntersection &trackTrackSurfaceIntersection, const double qOverP) const override |
| IIntersector interface method for specific Surface type : StraightLineSurface. More...
|
|
virtual std::optional< TrackSurfaceIntersection > | intersectCylinderSurface (const CylinderSurface &surface, const TrackSurfaceIntersection &trackTrackSurfaceIntersection, const double qOverP) const override |
| IIntersector interface method for specific Surface type : CylinderSurface. More...
|
|
virtual std::optional< TrackSurfaceIntersection > | intersectDiscSurface (const DiscSurface &surface, const TrackSurfaceIntersection &trackTrackSurfaceIntersection, const double qOverP) const override |
| IIntersector interface method for specific Surface type : DiscSurface. More...
|
|
virtual std::optional< TrackSurfaceIntersection > | intersectPlaneSurface (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...
|
|
|
void | throwMissingCondData () const |
|
const SolenoidParametrization * | getSolenoidParametrization () 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< TrackSurfaceIntersection > | intersection (TrackSurfaceIntersection &&isect, Constants &com, const Surface &surface) const |
|
Definition at line 29 of file SolenoidalIntersector.h.
◆ SolenoidalIntersector()
Trk::SolenoidalIntersector::SolenoidalIntersector |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~SolenoidalIntersector()
virtual Trk::SolenoidalIntersector::~SolenoidalIntersector |
( |
| ) |
|
|
virtualdefault |
◆ approachPerigeeSurface()
◆ approachStraightLineSurface()
◆ 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.
166 double radiusSquared = xCentre * xCentre + yCentre * yCentre;
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.);
176 if (yCentre * term > 0.) {
177 sinPhiIntersect = term * (-xCentre + std::sqrt(dx2));
179 sinPhiIntersect = term * (-xCentre - std::sqrt(dx2));
182 (sinPhiIntersect * xCentre + radiusSquared * term) / yCentre;
185 double dy2 = xCentre * xCentre * (1. / (radiusSquared * term * term) - 1.);
189 if (xCentre * term > 0.) {
190 cosPhiIntersect = term * (yCentre + std::sqrt(dy2));
192 cosPhiIntersect = term * (yCentre - std::sqrt(dy2));
195 (cosPhiIntersect * yCentre - radiusSquared * term) / xCentre;
200 double sinDeltaPhi = sinPhiIntersect * cosPhi - cosPhiIntersect * sinPhi;
201 if (std::abs(sinDeltaPhi) > 0.1) {
204 deltaPhi = sinDeltaPhi * (1. + 0.166667 * sinDeltaPhi * sinDeltaPhi);
206 return (radiusOfCurvature *
deltaPhi);
208 cosPhiIntersect = cosPhi;
209 sinPhiIntersect = sinPhi;
◆ extrapolateToR()
Definition at line 270 of file SolenoidalIntersector.cxx.
278 double fieldComponent =
279 com.m_solPar.fieldComponent(
pos.z(), com.m_solParams);
280 double curvature = fieldComponent * com.m_qOverPt;
283 double radiusOfCurvature = 1. / curvature;
285 pos.x() - radiusOfCurvature *
dir.y() * com.m_oneOverSinTheta;
287 pos.y() + radiusOfCurvature *
dir.x() * com.m_oneOverSinTheta;
292 dir.x() * com.m_oneOverSinTheta,
293 dir.y() * com.m_oneOverSinTheta, cosPhi, sinPhi);
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;
306 double deltaZ = arcLength * com.m_cotTheta;
310 double cosPhi =
dir.x() * com.m_oneOverSinTheta;
311 double sinPhi =
dir.y() * com.m_oneOverSinTheta;
313 double sinDPhi = 0.5 * arcLength * curvature;
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;
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;
330 radius2 =
pos.perp2();
334 radius2 =
pos.perp2();
◆ extrapolateToZ()
Definition at line 342 of file SolenoidalIntersector.cxx.
349 double firstIntegral = 0.;
350 double secondIntegral = 0.;
351 com.m_solPar.fieldIntegrals(firstIntegral, secondIntegral,
pos.z(), endZ,
354 double cosPhi =
dir.x() * com.m_oneOverSinTheta;
355 double sinPhi =
dir.y() * com.m_oneOverSinTheta;
359 secondIntegral * com.m_qOverPt / std::abs(com.m_cotTheta);
362 sinBeta = 1. - 0.166667 * deltaPhi2Squared;
363 cosBeta = -0.5 *
deltaPhi2 * (1. - 0.083333 * deltaPhi2Squared);
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);
375 isect.pathlength() += radialDistance * com.m_oneOverSinTheta;
379 double deltaPhi1 = firstIntegral * com.m_qOverPt / std::abs(com.m_cotTheta);
382 sinAlpha =
deltaPhi1 * (1. - 0.166667 * deltaPhi1Squared);
384 1. - 0.5 * deltaPhi1Squared * (1. - 0.083333 * deltaPhi1Squared);
389 dir.x() = (cosPhi * cosAlpha - sinPhi * sinAlpha) * com.m_sinTheta;
390 dir.y() = (sinPhi * cosAlpha + cosPhi * sinAlpha) * com.m_sinTheta;
◆ finalize()
StatusCode Trk::SolenoidalIntersector::finalize |
( |
| ) |
|
|
overridevirtual |
◆ getSolenoidParametrization()
◆ initialize()
StatusCode Trk::SolenoidalIntersector::initialize |
( |
| ) |
|
|
overridevirtual |
◆ intersectCylinderSurface()
IIntersector interface method for specific Surface type : CylinderSurface.
Definition at line 122 of file SolenoidalIntersector.cxx.
126 const SolenoidParametrization* solenoidParametrization =
129 double endRadius = surface.globalReferencePoint().perp();
130 if (!solenoidParametrization || endRadius > solenoidParametrization->maximumR())
133 Constants* com =
nullptr;
135 trackIntersection, *solenoidParametrization,
qOverP, com);
138 double radius2 = isect->position().perp2();
140 && !
extrapolateToR(*isect, radius2, *com, endRadius))
return std::nullopt;
◆ intersectDiscSurface()
IIntersector interface method for specific Surface type : DiscSurface.
Definition at line 147 of file SolenoidalIntersector.cxx.
151 const SolenoidParametrization* solenoidParametrization =
154 double endZ = surface.center().z();
155 if (!solenoidParametrization || std::abs(endZ) > solenoidParametrization->maximumZ())
158 Constants* com =
nullptr;
159 std::optional<TrackSurfaceIntersection> isect =
161 *solenoidParametrization,
◆ intersection()
Definition at line 237 of file SolenoidalIntersector.h.
242 Intersection SLIntersect = surface.straightLineIntersection(
243 isect.position(), isect.direction(),
false,
false);
244 if (SLIntersect.valid) {
247 com.m_lastPosition = isect.position();
248 isect.position() = SLIntersect.position;
249 return std::move(isect);
◆ intersectPlaneSurface()
IIntersector interface method for specific Surface type : PlaneSurface.
Definition at line 178 of file SolenoidalIntersector.cxx.
182 const SolenoidParametrization* solenoidParametrization =
185 if (!solenoidParametrization ||
186 std::abs(surface.center().z()) > solenoidParametrization->maximumZ()
187 || surface.center().perp() > solenoidParametrization->maximumR())
190 Constants* com =
nullptr;
191 std::optional<TrackSurfaceIntersection> isect =
193 *solenoidParametrization,
199 double radius2 =
pos.perp2();
208 double dot = surface.normal().dot(
dir);
209 double offset = surface.normal().dot(surface.center() -
pos);
213 if (std::abs(
dot) < 0.0001)
218 if (com->m_sinTheta < 0.9) {
221 radius2 =
pos.perp2();
230 dot = surface.normal().dot(
dir);
231 offset = surface.normal().dot(surface.center() -
pos);
233 (++numberSteps > 5 ||
237 << numberSteps <<
" steps at offset " <<
offset
238 <<
" dot " << surface.normal().dot(
dir));
241 surface, trackIntersection,
qOverP);
◆ intersectSurface()
IIntersector interface method for general Surface type.
Definition at line 72 of file SolenoidalIntersector.cxx.
77 const auto surfaceType = surface.type();
80 trackIntersection,
qOverP);
84 static_cast<const StraightLineSurface&
>(surface), trackIntersection,
89 static_cast<const CylinderSurface&
>(surface), trackIntersection,
94 trackIntersection,
qOverP);
98 static_cast<const PerigeeSurface&
>(surface), trackIntersection,
◆ isValid()
IIntersector interface method to check validity of parametrization within extrapolation range.
Definition at line 250 of file SolenoidalIntersector.cxx.
253 const SolenoidParametrization* solenoidParametrization =
257 return solenoidParametrization &&
259 std::abs(endPosition.z()) < solenoidParametrization->maximumZ()
261 && endPosition.perp() < solenoidParametrization->maximumR()
◆ linearArcLength()
Definition at line 217 of file SolenoidalIntersector.h.
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);
231 arcLength -= std::sqrt(radiusSquared);
◆ newIntersection()
Definition at line 395 of file SolenoidalIntersector.cxx.
400 const TrackSurfaceIntersection::IIntersectionCache* oldCache = isect.cache();
401 std::unique_ptr<Constants> cache;
405 assert(
typeid(*oldCache) ==
typeid(Constants));
407 std::make_unique<Constants>(*
static_cast<const Constants*
>(oldCache));
410 cache = std::make_unique<Constants>(solpar, isect,
qOverP);
415 std::make_optional<TrackSurfaceIntersection>(isect, std::move(cache));
417 newIsect->position() = *lastPosition;
◆ throwMissingCondData()
void Trk::SolenoidalIntersector::throwMissingCondData |
( |
| ) |
const |
|
private |
◆ m_countExtrapolations
std::atomic<unsigned long long> Trk::SolenoidalIntersector::m_countExtrapolations |
|
mutableprivate |
◆ m_countRKSwitches
std::atomic<unsigned long long> Trk::SolenoidalIntersector::m_countRKSwitches |
|
mutableprivate |
◆ m_deltaPhiTolerance
double Trk::SolenoidalIntersector::m_deltaPhiTolerance |
|
private |
◆ m_rungeKuttaIntersector
ToolHandle<IIntersector> Trk::SolenoidalIntersector::m_rungeKuttaIntersector |
|
private |
◆ m_solenoidParametrizationKey
Initial value:{
this, "SolenoidParameterizationKey", "SolenoidParametrization", ""}
Definition at line 147 of file SolenoidalIntersector.h.
◆ m_surfaceTolerance
double Trk::SolenoidalIntersector::m_surfaceTolerance |
|
private |
The documentation for this class was generated from the following files:
Amg::Vector3D m_lastPosition
Scalar perp() const
perp method - perpenticular length
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
double m_surfaceTolerance
static std::optional< TrackSurfaceIntersection > newIntersection(const TrackSurfaceIntersection &oldIsect, const SolenoidParametrization &solpar, const double qOverP, Constants *&com)
virtual std::optional< TrackSurfaceIntersection > intersectPlaneSurface(const PlaneSurface &surface, const TrackSurfaceIntersection &trackTrackSurfaceIntersection, const double qOverP) const override
IIntersector interface method for specific Surface type : PlaneSurface.
SG::ReadCondHandleKey< SolenoidParametrization > m_solenoidParametrizationKey
std::atomic< unsigned long long > m_countExtrapolations
static bool extrapolateToZ(TrackSurfaceIntersection &isect, Constants &com, const double endZ)
@ deltaPhi1
difference between the cluster eta (1st sampling) and the eta of the track extrapolated to the 1st sa...
double circularArcLength(double, double, double, double, double, double, double &, double &) const
double m_deltaPhiTolerance
std::optional< TrackSurfaceIntersection > intersection(TrackSurfaceIntersection &&isect, Constants &com, const Surface &surface) const
def dot(G, fn, nodesToHighlight=[])
virtual std::optional< TrackSurfaceIntersection > intersectDiscSurface(const DiscSurface &surface, const TrackSurfaceIntersection &trackTrackSurfaceIntersection, const double qOverP) const override
IIntersector interface method for specific Surface type : DiscSurface.
virtual std::optional< TrackSurfaceIntersection > intersectCylinderSurface(const CylinderSurface &surface, const TrackSurfaceIntersection &trackTrackSurfaceIntersection, const double qOverP) const override
IIntersector interface method for specific Surface type : CylinderSurface.
std::atomic< unsigned long long > m_countRKSwitches
bool validOrigin(const Amg::Vector3D &origin) const
const SolenoidParametrization * getSolenoidParametrization() const
@ deltaPhi2
difference between the cluster phi (second sampling) and the phi of the track extrapolated to the sec...
Eigen::Matrix< double, 3, 1 > Vector3D
#define ATH_MSG_WARNING(x)
bool extrapolateToR(TrackSurfaceIntersection &isect, double &radius2, Constants &com, const double endRadius) const
void throwMissingCondData() const
double linearArcLength(const TrackSurfaceIntersection &isect, const Constants &com, const double radius2, const double endRadius) const
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
ToolHandle< IIntersector > m_rungeKuttaIntersector