ATLAS Offline Software
LinearizedTrack.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6  LinearizedTrack.cxx - Description
7  -------------------
8  begin : 11/2006
9  comments:
10  changes :
11 
12  ***************************************************************************/
13 
15 #include "GaudiKernel/MsgStream.h"
16 
17 namespace Trk {
18 
19 LinearizedTrack::LinearizedTrack(const AmgVector(5) & expectedParametersAtPCA,
20  const AmgSymMatrix(5) & expectedParErrorAtPCA,
21  const Amg::Vector3D& linPoint,
22  const AmgMatrix(5, 3) & positionJacobian,
23  const AmgMatrix(5, 3) & momentumJacobian,
24  const Amg::Vector3D& expectedPositionAtPCA,
25  const Amg::Vector3D& expectedMomentumAtPCA,
26  const AmgVector(5) & constantTerm)
27  : m_ExpectedParametersAtPOCA(expectedParametersAtPCA)
28  , m_ExpectedCovarianceAtPOCA(expectedParErrorAtPCA)
29  , m_linPoint(linPoint)
30  , m_PositionJacobian(positionJacobian)
31  , m_MomentumJacobian(momentumJacobian)
32  , m_ExpectedPositionAtPOCA(expectedPositionAtPCA)
33  , m_ExpectedMomentumAtPOCA(expectedMomentumAtPCA)
34  , m_ConstantTerm(constantTerm)
35  , m_vl(true)
36 {}
37 
38 // clone method implemetation
41 {
42  if (m_vl) {
43  return new LinearizedTrack(m_ExpectedParametersAtPOCA,
44  m_ExpectedCovarianceAtPOCA,
45  m_linPoint,
46  m_PositionJacobian,
47  m_MomentumJacobian,
50  m_ConstantTerm);
51  }
52  return new LinearizedTrack();
53 } // end of clone method
54 
55 const AmgSymMatrix(5) & LinearizedTrack::expectedCovarianceAtPCA() const
56 {
57  return m_ExpectedCovarianceAtPOCA;
58 }
59 
60 AmgSymMatrix(5) LinearizedTrack::expectedWeightAtPCA() const
61 {
62  // the m_ExpectedCovarianceAtPOCA stores a covariance matrix, need to invert
63  // to get weight matrix note: no check if matrix is invertible
64  return m_ExpectedCovarianceAtPOCA.inverse();
65 }
66 
67 const AmgVector(5) & LinearizedTrack::expectedParametersAtPCA() const
68 {
69  return m_ExpectedParametersAtPOCA;
70 }
71 
72 MsgStream&
73 LinearizedTrack::dump(MsgStream& sl) const
74 {
75  sl << "Printing Trk::LinearizedTrack" << endmsg;
76  sl << " Expected Position at POCA: " << m_ExpectedPositionAtPOCA << endmsg;
77  sl << " Expected Momentum at POCA: " << m_ExpectedMomentumAtPOCA << endmsg;
78  sl << " Expected parameters at POCA: " << m_ExpectedParametersAtPOCA
79  << endmsg;
80  sl << " Expected covariance at POCA: " << m_ExpectedCovarianceAtPOCA
81  << endmsg;
82  sl << " Position jacobian: " << m_PositionJacobian << endmsg;
83  sl << " Momentum jacobian: " << m_MomentumJacobian << endmsg;
84  sl << " Constant term: " << m_ConstantTerm << endmsg;
85  return sl;
86 }
87 
88 std::ostream&
89 LinearizedTrack::dump(std::ostream& sl) const
90 {
91  sl << "Printing Trk::LinearizedTrack" << std::endl;
92  sl << " Expected Position at POCA: " << m_ExpectedPositionAtPOCA
93  << std::endl;
94  sl << " Expected Momentum at POCA: " << m_ExpectedMomentumAtPOCA
95  << std::endl;
96  sl << " Expected parameters at POCA: " << m_ExpectedParametersAtPOCA
97  << std::endl;
98  sl << " Expected covariance at POCA: " << m_ExpectedCovarianceAtPOCA
99  << std::endl;
100  sl << " Position jacobian: " << m_PositionJacobian << std::endl;
101  sl << " Momentum jacobian: " << m_MomentumJacobian << std::endl;
102  sl << " Constant term: " << m_ConstantTerm << std::endl;
103  return sl;
104 }
105 
106 MsgStream&
107 operator<<(MsgStream& sl, const LinearizedTrack& sf)
108 {
109  return sf.dump(sl);
110 }
111 
112 std::ostream&
113 operator<<(std::ostream& sl, const LinearizedTrack& sf)
114 {
115  return sf.dump(sl);
116 }
117 
118 } // end of namespace
Trk::AmgMatrix
AmgMatrix(3, 3) NeutralParticleParameterCalculator
Definition: NeutralParticleParameterCalculator.cxx:233
Trk::LinearizedTrack::m_linPoint
Amg::Vector3D m_linPoint
Definition: LinearizedTrack.h:159
Trk::LinearizedTrack::m_vl
bool m_vl
Definition: LinearizedTrack.h:166
Trk::LinearizedTrack::clone
LinearizedTrack * clone() const
Definition: LinearizedTrack.cxx:47
Trk::LinearizedTrack::dump
MsgStream & dump(MsgStream &sl) const
Output Method for MsgStream, to be overloaded by child classes.
Trk::LinearizedTrack::m_ExpectedPositionAtPOCA
Amg::Vector3D m_ExpectedPositionAtPOCA
Definition: LinearizedTrack.h:162
Trk::AmgSymMatrix
AmgSymMatrix(5) &GXFTrackState
Definition: GXFTrackState.h:156
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
AmgVector
AmgVector(4) T2BSTrackFilterTool
Definition: T2BSTrackFilterTool.cxx:114
Trk::LinearizedTrack::LinearizedTrack
LinearizedTrack()=default
default operations
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
Trk::operator<<
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
Definition: AlignModule.cxx:204
LinearizedTrack.h
Trk::LinearizedTrack::m_ExpectedMomentumAtPOCA
Amg::Vector3D m_ExpectedMomentumAtPOCA
Definition: LinearizedTrack.h:163
Trk::LinearizedTrack
Definition: LinearizedTrack.h:43