13#include "GaudiKernel/MsgStream.h"
66 std::shared_ptr<const Trk::ConeBounds> cbounds)
98 double l1,
double l2,
double phi,
double theta,
double qop,
100 return std::make_unique<ParametersT<5, Charged, ConeSurface>>(
101 l1, l2,
phi,
theta, qop, *
this, std::move(cov));
109 return std::make_unique<ParametersT<5, Charged, ConeSurface>>(
110 position, momentum,
charge, *
this, std::move(cov));
117 double l1,
double l2,
double phi,
double theta,
double qop,
119 return std::make_unique<ParametersT<5, Neutral, ConeSurface>>(
120 l1, l2,
phi,
theta, qop, *
this, std::move(cov));
129 return std::make_unique<ParametersT<5, Neutral, ConeSurface>>(
130 position, momentum,
charge, *
this, std::move(cov));
179 mFrame.col(0) = measX;
180 mFrame.col(1) = measY;
181 mFrame.col(2) = measDepth;
204 double r = loc3Dframe.z() *
bounds().tanAlpha();
205 locpos =
Amg::Vector2D(
r * atan2(loc3Dframe.y(), loc3Dframe.x()), loc3Dframe.z());
209 double inttol = 0.01;
210 return ((loc3Dframe.perp() -
r) <= inttol);
224 double tan2Alpha =
bounds().tanAlpha() *
bounds().tanAlpha();
225 double A = tdir.x() * tdir.x() + tdir.y() * tdir.y() - tan2Alpha * tdir.z() * tdir.z();
226 double B = 2 * (tdir.x() * tpos1.x() + tdir.y() * tpos1.y() - tan2Alpha * dir.z() * tpos1.z());
227 double C = tpos1.x() * tpos1.x() + tpos1.y() * tpos1.y() - tan2Alpha * tpos1.z() * tpos1.z();
238 double t1 = solns.
first;
240 isValid = forceDir ? (t1 > 0.) :
true;
249 if (t1 * t2 > 0. || !forceDir) {
250 if (t1 * t1 < t2 * t2) {
296 double posLength = sqrt(dPos.dot(dPos));
298 return {1, 0.,
true, 0.};
299 double posProj = dPos.dot(N);
300 double posProjAngle = acos(posProj / posLength);
301 double currDist = posLength * sin(posProjAngle - atan(
bounds().tanAlpha()));
303 if (std::abs(currDist) < tol)
304 return {1, currDist,
true, 0.};
311 double tan2Alpha =
bounds().tanAlpha() *
bounds().tanAlpha();
312 double A = locFrameDir.x() * locFrameDir.x() + locFrameDir.y() * locFrameDir.y() -
313 tan2Alpha * locFrameDir.z() * locFrameDir.z();
314 double B = 2 * (locFrameDir.x() * locFramePos.x() + locFrameDir.y() * locFramePos.y() -
315 tan2Alpha * locFrameDir.z() * locFramePos.z());
316 double C = locFramePos.x() * locFramePos.x() + locFramePos.y() * locFramePos.y() -
317 tan2Alpha * locFramePos.z() * locFramePos.z();
325 std::optional<Amg::Vector2D> p = std::nullopt;
326 if (std::abs(solns.
first) < std::abs(solns.
second)){
333 d2bound =
bounds().minDistance(*p);
339 double totDist = d2bound > 0. ? sqrt(d2bound * d2bound + currDist * currDist) : currDist;
343 return {0, totDist,
true, 0., 0.};
346 return {1, totDist,
true, solns.
first};
349 if (std::abs(solns.
first) < std::abs(solns.
second)){
350 return {2, totDist,
true, solns.
first, solns.
second};
352 return {2, totDist,
true, solns.
second, solns.
first};
355 return {0, totDist,
true, 0., 0.};
364 bool applyTransform = !(
transform().isApprox(Amg::Transform3D::Identity()));
366 double phi = posLocal.phi();
367 double sgn = posLocal.z() > 0. ? -1. : +1.;
370 normalC =
transform().linear() * normalC;
372 double cAlpha = normalC.dot(mom.unit());
373 return (cAlpha != 0.) ? std::abs(1. / cAlpha) : 1.;
double charge(const T &p)
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
#define AmgSymMatrix(dim)
The BoundaryCheck class allows to steer the way surface boundaries are used for inside/outside checks...
Bounds for a conical Surface, the opening angle is stored in and always positively defined.
Class for a conical surface in the ATLAS detector.
CxxUtils::CachedUniquePtr< Amg::Vector3D > m_rotSymmetryAxis
virtual const ConeBounds & bounds() const override final
This method returns the ConeBounds by reference (NoBounds is not possible for cone)
virtual const Amg::Vector3D & rotSymmetryAxis() const
Return method for the rotational symmetry axis - the z-Axis of the HepTransform.
virtual const Amg::Vector3D & globalReferencePoint() const override final
Returns a global reference point: For the Cylinder this is Where denotes the averagePhi() of the cy...
virtual double pathCorrection(const Amg::Vector3D &, const Amg::Vector3D &) const override
the pathCorrection for derived classes with thickness
ConeSurface()
Default Constructor.
virtual Amg::Vector3D normal(const Amg::Vector2D &locpo) const override final
Return method for surface normal information at a given local point, overwrites the normal() from bas...
virtual DistanceSolution straightLineDistanceEstimate(const Amg::Vector3D &pos, const Amg::Vector3D &dir) const override final
fast straight line distance to Surface
virtual void localToGlobal(const Amg::Vector2D &locp, const Amg::Vector3D &mom, Amg::Vector3D &glob) const override final
Specialized for ConeSurface : LocalToGlobal method without dynamic memory allocation.
virtual Surface::ChargedTrackParametersUniquePtr createUniqueTrackParameters(double l1, double l2, double phi, double theta, double qop, std::optional< AmgSymMatrix(5)> cov=std::nullopt) const override final
Use the Surface as a ParametersBase constructor, from local parameters - charged.
std::shared_ptr< const ConeBounds > m_bounds
The global reference point (== a point on thesurface)
virtual bool operator==(const Surface &sf) const override
Equality operator.
ConeSurface & operator=(const ConeSurface &csf)
Assignment operator.
virtual NeutralTrackParametersUniquePtr createUniqueNeutralParameters(double l1, double l2, double phi, double theta, double qop, std::optional< AmgSymMatrix(5)> cov=std::nullopt) const override final
Use the Surface as a ParametersBase constructor, from local parameters - neutral.
virtual Amg::RotationMatrix3D measurementFrame(const Amg::Vector3D &glopos, const Amg::Vector3D &glomom) const override final
Return the measurement frame - this is needed for alignment, in particular for StraightLine and Perig...
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const override final
Specialized for ConeSurface : GlobalToLocal method without dynamic memory allocation - boolean checks...
CxxUtils::CachedUniquePtr< Amg::Vector3D > m_referencePoint
The rotational symmetry axis.
virtual Intersection straightLineIntersection(const Amg::Vector3D &pos, const Amg::Vector3D &dir, bool forceDir=false, BoundaryCheck bchk=false) const override final
fast straight line intersection schema - provides closest intersection and (signed) path length
Access to distance solutions.
Abstract Base Class for tracking surfaces.
Amg::Transform3D inverseTransformHelper() const
Helper method to factorize in one place common operations calculate inverse transofrm and multiply wi...
std::unique_ptr< ParametersBase< 5, Trk::Charged > > ChargedTrackParametersUniquePtr
Unique ptr types.
Surface & operator=(const Surface &sf)
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const =0
Specified by each surface type: GlobalToLocal method without dynamic memory allocation - boolean chec...
Amg::Vector3D inverseTransformMultHelper(const Amg::Vector3D &glopos) const
Surface()
Default Constructor for inheriting classes.
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
virtual bool isOnSurface(const Amg::Vector3D &glopo, const BoundaryCheck &bchk=true, double tol1=0., double tol2=0.) const
This method returns true if the GlobalPosition is on the Surface for both, within or without check of...
const Amg::Vector3D & center() const
Returns the center position of the Surface.
std::unique_ptr< ParametersBase< 5, Trk::Neutral > > NeutralTrackParametersUniquePtr
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
hold the test vectors and ease the comparison
RQESolutionType solutions