13 #include "GaudiKernel/MsgStream.h"
23 , m_referencePoint(nullptr)
24 , m_rotSymmetryAxis(nullptr)
30 , m_bounds(csf.m_bounds)
31 , m_referencePoint(nullptr)
32 , m_rotSymmetryAxis(nullptr)
39 , m_bounds(csf.m_bounds)
40 , m_referencePoint(nullptr)
41 , m_rotSymmetryAxis(nullptr)
49 , m_bounds(std::make_shared<
Trk::
ConeBounds>(alpha, symmetric))
50 , m_referencePoint(nullptr)
51 , m_rotSymmetryAxis(nullptr)
62 , m_referencePoint(nullptr)
63 , m_rotSymmetryAxis(nullptr)
71 , m_referencePoint(nullptr)
72 , m_rotSymmetryAxis(nullptr)
81 , m_referencePoint(nullptr)
82 , m_rotSymmetryAxis(nullptr)
91 m_referencePoint.store(
nullptr);
92 m_rotSymmetryAxis.store(
nullptr);
101 double l1,
double l2,
double phi,
double theta,
double qop,
103 return std::make_unique<ParametersT<5, Charged, ConeSurface>>(
112 return std::make_unique<ParametersT<5, Charged, ConeSurface>>(
120 double l1,
double l2,
double phi,
double theta,
double qop,
122 return std::make_unique<ParametersT<5, Neutral, ConeSurface>>(
132 return std::make_unique<ParametersT<5, Neutral, ConeSurface>>(
140 if (!m_referencePoint) {
146 m_referencePoint.set(std::make_unique<Amg::Vector3D>(
transform() * gp));
148 return (*m_referencePoint);
164 if (!m_rotSymmetryAxis) {
166 m_rotSymmetryAxis.set(std::make_unique<Amg::Vector3D>(
zAxis));
168 return (*m_rotSymmetryAxis);
182 mFrame.col(0) = measX;
183 mFrame.col(1) = measY;
184 mFrame.col(2) = measDepth;
196 double r = locpos[
Trk::locZ] * bounds().tanAlpha();
206 Amg::Vector3D loc3Dframe(inverseTransformMultHelper(glopos));
207 double r = loc3Dframe.z() * bounds().tanAlpha();
208 locpos =
Amg::Vector2D(
r * atan2(loc3Dframe.y(), loc3Dframe.x()), loc3Dframe.z());
212 double inttol = 0.01;
213 return ((loc3Dframe.perp() -
r) <= inttol);
227 double tan2Alpha = bounds().tanAlpha() * bounds().tanAlpha();
228 double A = tdir.x() * tdir.x() + tdir.y() * tdir.y() - tan2Alpha * tdir.z() * tdir.z();
229 double B = 2 * (tdir.x() * tpos1.x() + tdir.y() * tpos1.y() - tan2Alpha *
dir.z() * tpos1.z());
230 double C = tpos1.x() * tpos1.x() + tpos1.y() * tpos1.y() - tan2Alpha * tpos1.z() * tpos1.z();
252 if (
t1 *
t2 > 0. || !forceDir) {
286 return straightLineDistanceEstimate(
pos,
dir,
false);
299 double posLength = sqrt(dPos.dot(dPos));
301 return {1, 0.,
true, 0.};
302 double posProj = dPos.dot(
N);
303 double posProjAngle = acos(posProj / posLength);
304 double currDist = posLength *
sin(posProjAngle -
atan(bounds().tanAlpha()));
306 if (std::abs(currDist) < tol)
307 return {1, currDist,
true, 0.};
314 double tan2Alpha = bounds().tanAlpha() * bounds().tanAlpha();
315 double A = locFrameDir.x() * locFrameDir.x() + locFrameDir.y() * locFrameDir.y() -
316 tan2Alpha * locFrameDir.z() * locFrameDir.z();
317 double B = 2 * (locFrameDir.x() * locFramePos.x() + locFrameDir.y() * locFramePos.y() -
318 tan2Alpha * locFrameDir.z() * locFramePos.z());
319 double C = locFramePos.x() * locFramePos.x() + locFramePos.y() * locFramePos.y() -
320 tan2Alpha * locFramePos.z() * locFramePos.z();
328 std::optional<Amg::Vector2D>
p = std::nullopt;
329 if (std::abs(solns.
first) < std::abs(solns.
second)){
336 d2bound = bounds().minDistance(*
p);
342 double totDist = d2bound > 0. ? sqrt(d2bound * d2bound + currDist * currDist) : currDist;
346 return {0, totDist,
true, 0., 0.};
349 return {1, totDist,
true, solns.
first};
352 if (std::abs(solns.
first) < std::abs(solns.
second)){
353 return {2, totDist,
true, solns.
first, solns.
second};
355 return {2, totDist,
true, solns.
second, solns.
first};
358 return {0, totDist,
true, 0., 0.};
367 bool applyTransform = !(
transform().isApprox(Amg::Transform3D::Identity()));
369 double phi = posLocal.phi();
370 double sgn = posLocal.z() > 0. ? -1. : +1.;
375 double cAlpha = normalC.dot(
mom.unit());
376 return (cAlpha != 0.) ? std::abs(1. / cAlpha) : 1.;