25std::unique_ptr<Trk::TrackParameters>
34 p[0], p[1], p[2], p[3], p[4], std::move(e))
47 if (!T->hasSurface()) {
51 m_surface.reset(T->associatedSurface().isFree() ? T->associatedSurface().clone() : &T->associatedSurface());
53 m_parameters = T->parameters();
62 for (std::size_t i = 0; i < 5; i++) {
63 for (std::size_t j = 0; j <= i; j++) {
88std::ostream& Trk::operator <<
94MsgStream& Trk::operator <<
106 std::stringstream
ss;
109 const std::string name{s?s->name():
""};
110 const std::string N(
"\n");
111 ss <<
"Track parameters for " << name <<
" surface " << N;
112 ss.unsetf(std::ios::fixed);
113 ss.setf (std::ios::showpos);
114 ss.setf (std::ios::scientific);
117 ss << std::setprecision(4) <<
118 P[ 0]<<
" |"<<V(0, 0) << N;
119 ss << std::setprecision(4) <<
120 P[ 1]<<
" |"<<V(0, 1)<<
" "<<V(1, 1) << N;
121 ss << std::setprecision(4) <<
122 P[ 2]<<
" |"<<V(0, 2)<<
" "<<V(1, 2)<<
" "<<V(2, 2) << N;
123 ss << std::setprecision(4) <<
124 P[ 3]<<
" |"<<V(0, 3)<<
" "<<V(1, 3)<<
" "<<V(2, 3)<<
" "<<V(3, 3) << N;
125 ss << std::setprecision(4) <<
126 P[ 4]<<
" |"<<V(0, 4)<<
" "<<V(1, 4)<<
" "<<V(2, 4)<<
" "<<V(3, 4)<<
" "<<V(4, 4) << N;
129 ss << std::setprecision(4) <<
P[ 0] <<
" |" << N;
130 ss << std::setprecision(4) <<
P[ 1] <<
" |" << N;
131 ss << std::setprecision(4) <<
P[ 2] <<
" |" << N;
132 ss << std::setprecision(4) <<
P[ 3] <<
" |" << N;
133 ss << std::setprecision(4) <<
P[ 4] <<
" |" << N;
171 double Ax[3] = {T(0,0),T(1,0),T(2,0)};
172 double Ay[3] = {T(0,1),T(1,1),T(2,1)};
174 Amg::Vector3D gp (m_parameters[0]*Ax[0]+m_parameters[1]*Ay[0]+T(0,3),
175 m_parameters[0]*Ax[1]+m_parameters[1]*Ay[1]+T(1,3),
176 m_parameters[0]*Ax[2]+m_parameters[1]*Ay[2]+T(2,3));
188 double A[3] = {T(0,2),T(1,2),T(2,2)};
191 double Cf; sincos(m_parameters[2],&Sf,&Cf);
193 double Ce; sincos(m_parameters[3],&Se,&Ce);
198 double Bx =
A[1]*P5-
A[2]*P4;
199 double By =
A[2]*P3-
A[0]*P5;
200 double Bz =
A[0]*P4-
A[1]*P3;
201 double Bn = 1./std::sqrt(Bx*Bx+By*By+Bz*Bz); Bx*=Bn; By*=Bn; Bz*=Bn;
204 (m_parameters[1]*
A[0]+Bx*m_parameters[0]+T(0,3),
205 m_parameters[1]*
A[1]+By*m_parameters[0]+T(1,3),
206 m_parameters[1]*
A[2]+Bz*m_parameters[0]+T(2,3));
218 double Ax[3] = {T(0,0),T(1,0),T(2,0)};
219 double Ay[3] = {T(0,1),T(1,1),T(2,1)};
222 double Cf; sincos(m_parameters[1],&Sf,&Cf);
224 double d0 = Cf*Ax[0]+Sf*Ay[0];
225 double d1 = Cf*Ax[1]+Sf*Ay[1];
226 double d2 = Cf*Ax[2]+Sf*Ay[2];
229 (m_parameters[0]*
d0+T(0,3),
230 m_parameters[0]*d1+T(1,3),
231 m_parameters[0]*d2+T(2,3));
243 double Ax[3] = {T(0,0),T(1,0),T(2,0)};
244 double Ay[3] = {T(0,1),T(1,1),T(2,1)};
245 double Az[3] = {T(0,2),T(1,2),T(2,2)};
248 double fr = m_parameters[0]/R;
251 double Cf; sincos(fr,&Sf,&Cf);
254 (R*(Cf*Ax[0]+Sf*Ay[0])+m_parameters[1]*Az[0]+T(0,3),
255 R*(Cf*Ax[1]+Sf*Ay[1])+m_parameters[1]*Az[1]+T(1,3),
256 R*(Cf*Ax[2]+Sf*Ay[2])+m_parameters[1]*Az[2]+T(2,3));
268 double A[3] = {T(0,2),T(1,2),T(2,2)};
271 double Cf; sincos(m_parameters[2],&Sf,&Cf);
273 double Ce; sincos(m_parameters[3],&Se,&Ce);
278 double Bx =
A[1]*P5-
A[2]*P4;
279 double By =
A[2]*P3-
A[0]*P5;
280 double Bz =
A[0]*P4-
A[1]*P3;
281 double Bn = 1./std::sqrt(Bx*Bx+By*By+Bz*Bz); Bx*=Bn; By*=Bn; Bz*=Bn;
284 (m_parameters[1]*
A[0]+Bx*m_parameters[0]+T(0,3),
285 m_parameters[1]*
A[1]+By*m_parameters[0]+T(1,3),
286 m_parameters[1]*
A[2]+Bz*m_parameters[0]+T(2,3));
298 double Ax[3] = {T(0,0),T(1,0),T(2,0)};
299 double Ay[3] = {T(0,1),T(1,1),T(2,1)};
300 double Az[3] = {T(0,2),T(1,2),T(2,2)};
304 double Cf; sincos((m_parameters[0]/
r),&Sf,&Cf);
310 (Ax[0]*xl+Ay[0]*yl+Az[0]*m_parameters[1]+T(0,3),
311 Ax[1]*xl+Ay[1]*yl+Az[1]*m_parameters[1]+T(1,3),
312 Ax[2]*xl+Ay[2]*yl+Az[2]*m_parameters[1]+T(2,3));
324 int n = E.rows();
if(n<=0 || n>2) {
return false;
327 if (
Tp.m_covariance != std::nullopt) {
339 m_parameters[0] =
P (0);
344 m_parameters[ 1] =
P(1);
349 m_parameters[ 1] =
Tp.m_parameters[ 1];
351 m_parameters[ 2] =
Tp.m_parameters[ 2];
352 m_parameters[ 3] =
Tp.m_parameters[ 3];
353 m_parameters[ 4] =
Tp.m_parameters[ 4];
355 if (
Tp.m_surface !=
nullptr) {
356 m_surface.reset(
Tp.m_surface->isFree() ?
Tp.m_surface->clone() :
Tp.m_surface.get());
370 constexpr double pi =
M_PI;
371 constexpr double pi2 = 2.*
M_PI;
373 m_parameters[ 2] = m_parameters[2]-
pi;
374 m_parameters[ 3] =
pi-m_parameters[3];
375 m_parameters[ 4] = -m_parameters[4] ;
377 if (m_parameters[2] < -
pi) {
378 m_parameters[2] += pi2;
398 m_parameters[ 0] = -m_parameters[ 0];
443 double Sf = std::sin(m_parameters[2]), Cf = std::cos(m_parameters[2]);
444 double Se = std::sin(m_parameters[3]), Ce = std::cos(m_parameters[3]);
445 return {p * Se * Cf, p * Se * Sf, p * Ce};
#define AmgSymMatrix(dim)
double tanAlpha() const
This method returns the average phi.
Class for a conical surface in the ATLAS detector.
virtual const ConeBounds & bounds() const override final
This method returns the ConeBounds by reference (NoBounds is not possible for cone)
virtual double r() const override final
This method returns the radius.
Class for a CylinderSurface in the ATLAS detector.
virtual const CylinderBounds & bounds() const override final
This method returns the CylinderBounds by reference (NoBounds is not possible for cylinder)
Class for a DiscSurface in the ATLAS detector.
The base class for neutral and charged Track parameters.
std::optional< AmgSymMatrix(DIM)> m_covariance
bool production(const TrackParameters *)
double absoluteMomentum() const
Amg::Vector3D calculateMomentum(void) const
std::ostream & dump(std::ostream &) const
SurfaceUniquePtrT< const Surface > m_surface
Amg::Vector3D position() const
Amg::Vector3D localToGlobal(const PlaneSurface *) const
std::string to_string() const
Amg::Vector3D calculatePosition(void) const
bool initiate(PatternTrackParameters &, const Amg::Vector2D &, const Amg::MatrixX &)
std::unique_ptr< TrackParameters > convert(bool) const
Class describing the Line to which the Perigee refers to.
Class for a planaer rectangular or trapezoidal surface in the ATLAS detector.
Class for a StraightLineSurface in the ATLAS detector to describe dirft tube and straw like detectors...
Abstract Base Class for tracking surfaces.
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
hold the test vectors and ease the comparison