|
ATLAS Offline Software
|
#include <RungeKuttaIntersector.h>
|
| RungeKuttaIntersector (const std::string &type, const std::string &name, const IInterface *parent) |
|
virtual | ~RungeKuttaIntersector ()=default |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | finalize () override |
|
virtual std::optional< TrackSurfaceIntersection > | intersectSurface (const Surface &surface, const TrackSurfaceIntersection &trackIntersection, const double qOverP) const override |
| IIntersector interface method for general Surface type. More...
|
|
virtual std::optional< TrackSurfaceIntersection > | approachPerigeeSurface (const PerigeeSurface &surface, const TrackSurfaceIntersection &trackIntersection, const double qOverP) const override |
| IIntersector interface method for specific Surface type : PerigeeSurface. More...
|
|
virtual std::optional< TrackSurfaceIntersection > | approachStraightLineSurface (const StraightLineSurface &surface, const TrackSurfaceIntersection &trackIntersection, const double qOverP) const override |
| IIntersector interface method for specific Surface type : StraightLineSurface. More...
|
|
virtual std::optional< TrackSurfaceIntersection > | intersectCylinderSurface (const CylinderSurface &surface, const TrackSurfaceIntersection &trackIntersection, const double qOverP) const override |
| IIntersector interface method for specific Surface type : CylinderSurface. More...
|
|
virtual std::optional< TrackSurfaceIntersection > | intersectDiscSurface (const DiscSurface &surface, const TrackSurfaceIntersection &trackIntersection, const double qOverP) const override |
| IIntersector interface method for specific Surface type : DiscSurface. More...
|
|
virtual std::optional< TrackSurfaceIntersection > | intersectPlaneSurface (const PlaneSurface &surface, const TrackSurfaceIntersection &trackIntersection, const double qOverP) const override |
| IIntersector interface method for specific Surface type : PlaneSurface. More...
|
|
virtual bool | isValid (Amg::Vector3D, Amg::Vector3D) const override |
| IIntersector interface method for validity check over a particular extrapolation range. More...
|
|
|
void | assignStepLength (const TrackSurfaceIntersection &isect, double &stepLength) const |
|
void | debugFailure (TrackSurfaceIntersection &&isect, const Surface &surface, const double qOverP, const double rStart, const double zStart, const bool trapped) const |
|
double | distanceToCylinder (const TrackSurfaceIntersection &isect, const double cylinderRadius, const double offsetRadius, const Amg::Vector3D &offset, double &stepLength) const |
|
double | distanceToDisc (const TrackSurfaceIntersection &isect, const double discZ, double &stepLength) const |
|
double | distanceToLine (const TrackSurfaceIntersection &isect, const Amg::Vector3D &linePosition, const Amg::Vector3D &lineDirection, double &stepLength) const |
|
double | distanceToPlane (const TrackSurfaceIntersection &isect, const Amg::Vector3D &planePosition, const Amg::Vector3D &planeNormal, double &stepLength) const |
|
Amg::Vector3D | field (const Amg::Vector3D &point, MagField::AtlasFieldCache &fieldCache) const |
|
void | initializeFieldCache (MagField::AtlasFieldCache &fieldCache) const |
|
std::optional< TrackSurfaceIntersection > | newIntersection (TrackSurfaceIntersection &&isect, const Surface &surface, const double qOverP, const double rStart, const double zStart) const |
|
void | shortStep (TrackSurfaceIntersection &isect, const Amg::Vector3D &fieldValue, const double stepLength, const double qOverP) const |
|
void | step (TrackSurfaceIntersection &isect, Amg::Vector3D &fieldValue, double &stepLength, const double qOverP, MagField::AtlasFieldCache &fieldCache) const |
|
Definition at line 28 of file RungeKuttaIntersector.h.
◆ RungeKuttaIntersector()
Trk::RungeKuttaIntersector::RungeKuttaIntersector |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~RungeKuttaIntersector()
virtual Trk::RungeKuttaIntersector::~RungeKuttaIntersector |
( |
| ) |
|
|
virtualdefault |
◆ approachPerigeeSurface()
IIntersector interface method for specific Surface type : PerigeeSurface.
Definition at line 196 of file RungeKuttaIntersector.cxx.
201 TrackSurfaceIntersection isect = trackIntersection;
203 const double rStart =
pos.perp();
204 const double zStart =
pos.z();
210 const Amg::Vector3D& lineDirection = (surface.transform().rotation()).
col(2);
211 double stepLength = 0;
214 double previousDistance = 1.1*
distance;
219 if (isTrapped(
distance, previousDistance, stepsUntilTrapped)) {
222 rStart, zStart,
true);
◆ approachStraightLineSurface()
◆ assignStepLength()
Definition at line 436 of file RungeKuttaIntersector.cxx.
440 const double sinTheta = isect.direction().perp();
445 const double zCurrent = std::abs(
pos.z());
446 const double rCurrent =
pos.perp();
460 }
else if (zCurrent >
m_inDetZ2 || sinTheta < 0.35) {
466 else if (zCurrent >
m_inDetZ1 && sinTheta < 0.60) {
489 else if (rCurrent < 1000.)
491 if (zCurrent > 700.) {
498 else if (zCurrent > 420. && sinTheta < 0.60) {
503 if (rCurrent > 900.) {
514 if (zCurrent < 3000.)
545 }
else if (
radius < 5300.) {
553 else if (
phi > 0.04 ||
604 }
else if (zCurrent < m_toroidZ0 || zCurrent >
m_toroidZ1 ||
629 if (std::abs(stepLength) < stepMax)
631 if (stepLength > 0.) {
632 stepLength = stepMax;
634 stepLength = -stepMax;
◆ debugFailure()
Definition at line 639 of file RungeKuttaIntersector.cxx.
650 const double sinTheta = isect.direction().perp();
653 const double rCurrent = isect.position().perp();
656 if (rCurrent > rStart)
658 log <<
MSG::DEBUG << std::setiosflags(std::ios::fixed|std::ios::right)
659 <<
" fail to intersect surface when extrapolating outwards from R,Z"
660 << std::setw(8) << std::setprecision(1) << rStart <<
","
661 << std::setw(7) << std::setprecision(0) << zStart <<
" mm, with pt"
662 << std::setw(7) << std::setprecision(2) <<
pt <<
" GeV, direction eta"
663 << std::setw(5) << std::setprecision(2) << isect.direction().eta();
667 log <<
MSG::DEBUG << std::setiosflags(std::ios::fixed|std::ios::right)
668 <<
" fail to intersect surface when extrapolating inwards from R,Z"
669 << std::setw(8) << std::setprecision(1) << rStart <<
","
670 << std::setw(7) << std::setprecision(0) << zStart <<
" mm, with pt"
671 << std::setw(7) << std::setprecision(2) <<
pt <<
" GeV, direction eta"
672 << std::setw(5) << std::setprecision(2) << isect.direction().eta();
677 if (
dynamic_cast<const PlaneSurface*
>(&surface))
679 double stepLength = 0;
680 (void)
distanceToPlane (isect, surface.center(),surface.normal(), stepLength);
681 log <<
MSG::DEBUG << std::setiosflags(std::ios::fixed|std::ios::right) <<
" PlaneSurface"
682 <<
" at R,Z" << std::setw(8) << std::setprecision(1) << surface.center().perp() <<
","
683 << std::setw(7) << std::setprecision(0) << surface.center().z()
684 <<
" at line distance " << std::setw(9) << std::setprecision(1) << stepLength;
688 else if (
dynamic_cast<const CylinderSurface*
>(&surface))
690 double cylinderRadius = (surface.globalReferencePoint() - surface.center()).
perp();
692 double rCurrent =
offset.perp();
693 double stepLength = 0;
697 log <<
MSG::DEBUG << std::setiosflags(std::ios::fixed|std::ios::right)
698 <<
" closest approach to CylinderSurface at radius "
699 << std::setw(9) << std::setprecision(4) << rCurrent
700 <<
" mm. Cylinder radius " << std::setw(9) << std::setprecision(4) << cylinderRadius <<
" mm"
705 log <<
MSG::DEBUG << std::setiosflags(std::ios::fixed|std::ios::right) <<
" CylinderSurface"
706 <<
" radius " << std::setw(6) << std::setprecision(1) << cylinderRadius
707 <<
" rCurrent " << std::setw(6) << std::setprecision(1) << rCurrent
708 <<
" distance " << std::setw(6) << std::setprecision(1) << stepLength;
713 else if (
dynamic_cast<const DiscSurface*
>(&surface))
715 double stepLength = 0;
717 log <<
MSG::DEBUG << std::setiosflags(std::ios::fixed|std::ios::right) <<
" DiscSurface"
718 <<
" at R,Z" << std::setw(8) << std::setprecision(1) << surface.center().perp() <<
","
719 << std::setw(7) << std::setprecision(0) << surface.center().z()
720 <<
" at line distance " << std::setw(9) << std::setprecision(1) << stepLength;
724 else if (
dynamic_cast<const PerigeeSurface*
>(&surface))
726 log <<
MSG::DEBUG << std::setiosflags(std::ios::fixed|std::ios::right) <<
" PerigeeSurface "
729 else if (
dynamic_cast<const StraightLineSurface*
>(&surface))
731 log <<
MSG::DEBUG << std::setiosflags(std::ios::fixed|std::ios::right) <<
" StraightLineSurface "
◆ distanceToCylinder()
Definition at line 186 of file RungeKuttaIntersector.h.
192 double sinThsqinv = 1. /
dir.perp2();
194 double deltaRSq = (cylinderRadius - offsetRadius) *
195 (cylinderRadius + offsetRadius) * sinThsqinv +
196 stepLength * stepLength;
198 stepLength += sqrt(deltaRSq);
199 return std::abs(stepLength);
◆ distanceToDisc()
◆ distanceToLine()
Definition at line 213 of file RungeKuttaIntersector.h.
226 double cosAngle = lineDirection.dot(
dir);
227 stepLength = (linePosition -
pos).
dot(
dir - lineDirection * cosAngle) /
228 (1. - cosAngle * cosAngle);
229 return std::abs(stepLength);
◆ distanceToPlane()
◆ field()
◆ finalize()
StatusCode Trk::RungeKuttaIntersector::finalize |
( |
| ) |
|
|
overridevirtual |
Definition at line 133 of file RungeKuttaIntersector.cxx.
139 msg(MSG::INFO) << std::setiosflags(std::ios::fixed)
140 <<
" taking an average" << std::setw(7) << std::setprecision(1)
142 <<
" full steps," << std::setw(5) << std::setprecision(2)
144 <<
" step reductions and" << std::setw(5) << std::setprecision(2)
146 <<
" short final steps";
150 return StatusCode::SUCCESS;
◆ initialize()
StatusCode Trk::RungeKuttaIntersector::initialize |
( |
| ) |
|
|
overridevirtual |
◆ initializeFieldCache()
Definition at line 246 of file RungeKuttaIntersector.h.
250 if (!fieldCondObj.isValid()) {
251 ATH_MSG_FATAL(
"Failed to get magnetic field conditions data "
254 fieldCondObj->getInitializedCache(fieldCache);
◆ intersectCylinderSurface()
IIntersector interface method for specific Surface type : CylinderSurface.
Definition at line 280 of file RungeKuttaIntersector.cxx.
285 TrackSurfaceIntersection isect = trackIntersection;
287 const double rStart =
pos.perp();
288 const double zStart =
pos.z();
294 double cylinderRadius = (surface.globalReferencePoint() - surface.center()).
perp();
296 double rCurrent =
offset.perp();
297 double stepLength = 0;
300 double previousDistance = 1.1*
distance;
301 bool trapped =
false;
306 if (isTrapped(
distance, previousDistance, stepsUntilTrapped)) {
311 double rPrevious= rCurrent;
313 offset = surface.center() - isect.position();
315 double deltaR1 = rCurrent - rPrevious;
316 double deltaR2 = cylinderRadius - rCurrent;
346 rStart, zStart,
true);
◆ intersectDiscSurface()
IIntersector interface method for specific Surface type : DiscSurface.
Definition at line 352 of file RungeKuttaIntersector.cxx.
357 TrackSurfaceIntersection isect = trackIntersection;
359 const double rStart =
pos.perp();
360 const double zStart =
pos.z();
366 double stepLength = 0;
369 double previousDistance = 1.1*
distance;
374 if (isTrapped(
distance, previousDistance, stepsUntilTrapped)) {
377 rStart, zStart,
true);
◆ intersectPlaneSurface()
IIntersector interface method for specific Surface type : PlaneSurface.
Definition at line 393 of file RungeKuttaIntersector.cxx.
398 TrackSurfaceIntersection isect = trackIntersection;
400 const double rStart =
pos.perp();
401 const double zStart =
pos.z();
407 double stepLength = 0;
410 double previousDistance = 1.1*
distance;
415 if (isTrapped(
distance, previousDistance, stepsUntilTrapped)) {
418 rStart, zStart,
true);
◆ intersectSurface()
IIntersector interface method for general Surface type.
Definition at line 155 of file RungeKuttaIntersector.cxx.
166 const auto surfaceType = surface.type();
169 trackIntersection,
qOverP);
173 static_cast<const StraightLineSurface&
>(surface), trackIntersection,
178 static_cast<const CylinderSurface&
>(surface), trackIntersection,
183 trackIntersection,
qOverP);
187 trackIntersection,
qOverP);
◆ isValid()
◆ newIntersection()
Definition at line 265 of file RungeKuttaIntersector.h.
269 Intersection SLIntersect = surface.straightLineIntersection(
270 isect.position(), isect.direction(),
false,
false);
271 if (SLIntersect.valid) {
272 isect.position() = SLIntersect.position;
273 return std::move(isect);
◆ shortStep()
Definition at line 738 of file RungeKuttaIntersector.cxx.
748 double stepOverP = 0.5*stepLength*cOverP;
756 pos += stepLength*(
dir +
m_third*(product0+product1+product2));
759 dir +=
m_third*(product0+product3 + 2.*(product1+product2));
760 isect.pathlength() += stepLength;
◆ step()
Definition at line 765 of file RungeKuttaIntersector.cxx.
775 double stepOverP = 0.5*stepLength*cOverP;
782 Amg::Vector3D product1 = stepOverP*direction1.cross(fieldValue1);
784 Amg::Vector3D product2 = stepOverP*direction2.cross(fieldValue1);
791 if ((fieldValue1 - 0.5 * (
fieldValue + fieldAtEnd)).
mag() > 0.00001 &&
793 if (stepLength > 0.) {
799 stepOverP = 0.5 * stepLength * cOverP;
803 pos + 0.5 * stepLength * (
dir + 0.5 * product0);
806 product1 = stepOverP * direction1p.cross(fieldValue1p);
808 product2 = stepOverP * direction2p.cross(fieldValue1p);
811 stepLength * (
dir +
m_third * (product0 + product1 + product2));
812 fieldAtEnd =
field(
pos + offsetAtEnd, fieldCache);
816 Amg::Vector3D product3 = stepOverP * direction3.cross(fieldAtEnd);
817 dir +=
m_third * (product0 + product3 + 2. * (product1 + product2));
820 isect.pathlength() += stepLength;
◆ m_caloR0
const double Trk::RungeKuttaIntersector::m_caloR0 |
|
private |
◆ m_caloR1
const double Trk::RungeKuttaIntersector::m_caloR1 |
|
private |
◆ m_caloR2
const double Trk::RungeKuttaIntersector::m_caloR2 |
|
private |
◆ m_caloR3
const double Trk::RungeKuttaIntersector::m_caloR3 |
|
private |
◆ m_caloR4
const double Trk::RungeKuttaIntersector::m_caloR4 |
|
private |
◆ m_caloZ0
const double Trk::RungeKuttaIntersector::m_caloZ0 |
|
private |
◆ m_caloZ1
const double Trk::RungeKuttaIntersector::m_caloZ1 |
|
private |
◆ m_caloZ2
const double Trk::RungeKuttaIntersector::m_caloZ2 |
|
private |
◆ m_caloZ3
const double Trk::RungeKuttaIntersector::m_caloZ3 |
|
private |
◆ m_countExtrapolations
std::atomic<unsigned long long> Trk::RungeKuttaIntersector::m_countExtrapolations |
|
mutableprivate |
◆ m_countShortStep
std::atomic<unsigned long long> Trk::RungeKuttaIntersector::m_countShortStep |
|
mutableprivate |
◆ m_countStep
std::atomic<unsigned long long> Trk::RungeKuttaIntersector::m_countStep |
|
mutableprivate |
◆ m_countStepReduction
std::atomic<unsigned long long> Trk::RungeKuttaIntersector::m_countStepReduction |
|
mutableprivate |
◆ m_fieldCacheCondObjInputKey
Initial value:{
this, "AtlasFieldCacheCondObj", "fieldCondObj",
"Name of the Magnetic Field conditions object key"}
Definition at line 125 of file RungeKuttaIntersector.h.
◆ m_inDetR0
const double Trk::RungeKuttaIntersector::m_inDetR0 |
|
private |
◆ m_inDetR1
const double Trk::RungeKuttaIntersector::m_inDetR1 |
|
private |
◆ m_inDetR2
const double Trk::RungeKuttaIntersector::m_inDetR2 |
|
private |
◆ m_inDetZ0
const double Trk::RungeKuttaIntersector::m_inDetZ0 |
|
private |
◆ m_inDetZ1
const double Trk::RungeKuttaIntersector::m_inDetZ1 |
|
private |
◆ m_inDetZ2
const double Trk::RungeKuttaIntersector::m_inDetZ2 |
|
private |
◆ m_momentumThreshold
const double Trk::RungeKuttaIntersector::m_momentumThreshold |
|
private |
◆ m_momentumWarnThreshold
const double Trk::RungeKuttaIntersector::m_momentumWarnThreshold |
|
private |
◆ m_muonR0
const double Trk::RungeKuttaIntersector::m_muonR0 |
|
private |
◆ m_muonZ0
const double Trk::RungeKuttaIntersector::m_muonZ0 |
|
private |
◆ m_productionMode
bool Trk::RungeKuttaIntersector::m_productionMode |
|
private |
◆ m_shortStepMax
double Trk::RungeKuttaIntersector::m_shortStepMax |
|
private |
◆ m_shortStepMin
const double Trk::RungeKuttaIntersector::m_shortStepMin |
|
private |
◆ m_solenoidR
const double Trk::RungeKuttaIntersector::m_solenoidR |
|
private |
◆ m_solenoidZ
const double Trk::RungeKuttaIntersector::m_solenoidZ |
|
private |
◆ m_stepMax0
double Trk::RungeKuttaIntersector::m_stepMax0 |
|
private |
◆ m_stepMax1
double Trk::RungeKuttaIntersector::m_stepMax1 |
|
private |
◆ m_stepMax2
double Trk::RungeKuttaIntersector::m_stepMax2 |
|
private |
◆ m_stepMax3
double Trk::RungeKuttaIntersector::m_stepMax3 |
|
private |
◆ m_stepMax4
double Trk::RungeKuttaIntersector::m_stepMax4 |
|
private |
◆ m_stepsUntilTrapped
int Trk::RungeKuttaIntersector::m_stepsUntilTrapped |
|
private |
◆ m_third
const double Trk::RungeKuttaIntersector::m_third |
|
private |
◆ m_toroidR0
const double Trk::RungeKuttaIntersector::m_toroidR0 |
|
private |
◆ m_toroidR1
const double Trk::RungeKuttaIntersector::m_toroidR1 |
|
private |
◆ m_toroidR2
const double Trk::RungeKuttaIntersector::m_toroidR2 |
|
private |
◆ m_toroidR3
const double Trk::RungeKuttaIntersector::m_toroidR3 |
|
private |
◆ m_toroidZ0
const double Trk::RungeKuttaIntersector::m_toroidZ0 |
|
private |
◆ m_toroidZ1
const double Trk::RungeKuttaIntersector::m_toroidZ1 |
|
private |
◆ m_toroidZ2
const double Trk::RungeKuttaIntersector::m_toroidZ2 |
|
private |
◆ m_toroidZ3
const double Trk::RungeKuttaIntersector::m_toroidZ3 |
|
private |
◆ m_toroidZ4
const double Trk::RungeKuttaIntersector::m_toroidZ4 |
|
private |
◆ m_toroidZ5
const double Trk::RungeKuttaIntersector::m_toroidZ5 |
|
private |
◆ m_toroidZ6
const double Trk::RungeKuttaIntersector::m_toroidZ6 |
|
private |
◆ m_toroidZ7
const double Trk::RungeKuttaIntersector::m_toroidZ7 |
|
private |
◆ m_toroidZ8
const double Trk::RungeKuttaIntersector::m_toroidZ8 |
|
private |
The documentation for this class was generated from the following files:
double distanceToPlane(const TrackSurfaceIntersection &isect, const Amg::Vector3D &planePosition, const Amg::Vector3D &planeNormal, double &stepLength) const
const double m_momentumWarnThreshold
std::atomic< unsigned long long > m_countStepReduction
Scalar perp() const
perp method - perpenticular length
std::atomic< unsigned long long > m_countExtrapolations
virtual std::optional< TrackSurfaceIntersection > intersectPlaneSurface(const PlaneSurface &surface, const TrackSurfaceIntersection &trackIntersection, const double qOverP) const override
IIntersector interface method for specific Surface type : PlaneSurface.
double distanceToCylinder(const TrackSurfaceIntersection &isect, const double cylinderRadius, const double offsetRadius, const Amg::Vector3D &offset, double &stepLength) const
Amg::Vector3D field(const Amg::Vector3D &point, MagField::AtlasFieldCache &fieldCache) const
const std::string & key() const
Return the StoreGate ID for the referenced object.
double deltaR2(double rapidity1, double phi1, double rapidity2, double phi2)
from bare rapidity,phi
const double m_momentumThreshold
msgSvc
Provide convenience handles for various services.
double distanceToDisc(const TrackSurfaceIntersection &isect, const double discZ, double &stepLength) const
void step(TrackSurfaceIntersection &isect, Amg::Vector3D &fieldValue, double &stepLength, const double qOverP, MagField::AtlasFieldCache &fieldCache) const
void shortStep(TrackSurfaceIntersection &isect, const Amg::Vector3D &fieldValue, const double stepLength, const double qOverP) const
double distanceToLine(const TrackSurfaceIntersection &isect, const Amg::Vector3D &linePosition, const Amg::Vector3D &lineDirection, double &stepLength) const
void initializeFieldCache(MagField::AtlasFieldCache &fieldCache) const
std::atomic< unsigned long long > m_countShortStep
def dot(G, fn, nodesToHighlight=[])
void assignStepLength(const TrackSurfaceIntersection &isect, double &stepLength) const
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
StatusCode initialize(bool used=true)
Eigen::Matrix< double, 3, 1 > Vector3D
virtual std::optional< TrackSurfaceIntersection > intersectCylinderSurface(const CylinderSurface &surface, const TrackSurfaceIntersection &trackIntersection, const double qOverP) const override
IIntersector interface method for specific Surface type : CylinderSurface.
#define ATH_MSG_WARNING(x)
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
void getField(const double *ATH_RESTRICT xyz, double *ATH_RESTRICT bxyz, double *ATH_RESTRICT deriv=nullptr)
get B field value at given position xyz[3] is in mm, bxyz[3] is in kT if deriv[9] is given,...
virtual std::optional< TrackSurfaceIntersection > approachPerigeeSurface(const PerigeeSurface &surface, const TrackSurfaceIntersection &trackIntersection, const double qOverP) const override
IIntersector interface method for specific Surface type : PerigeeSurface.
std::atomic< unsigned long long > m_countStep
virtual std::optional< TrackSurfaceIntersection > approachStraightLineSurface(const StraightLineSurface &surface, const TrackSurfaceIntersection &trackIntersection, const double qOverP) const override
IIntersector interface method for specific Surface type : StraightLineSurface.
virtual std::optional< TrackSurfaceIntersection > intersectDiscSurface(const DiscSurface &surface, const TrackSurfaceIntersection &trackIntersection, const double qOverP) const override
IIntersector interface method for specific Surface type : DiscSurface.
std::optional< TrackSurfaceIntersection > newIntersection(TrackSurfaceIntersection &&isect, const Surface &surface, const double qOverP, const double rStart, const double zStart) const
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
const double m_shortStepMin
Scalar mag() const
mag method
void debugFailure(TrackSurfaceIntersection &&isect, const Surface &surface, const double qOverP, const double rStart, const double zStart, const bool trapped) const