ATLAS Offline Software
AlignTrack.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRKALIGNEVENT_ALIGNTRACK_H
6 #define TRKALIGNEVENT_ALIGNTRACK_H
7 
8 #include "GaudiKernel/MsgStream.h"
9 
13 #include "TrkTrack/Track.h"
14 
15 #include <vector>
16 #include <fstream>
17 
29 namespace CLHEP {
30  class HepSymMatrix;
31 }
32 
33 namespace Trk {
34 
35  class AlignVertex;
36 
39  typedef std::pair<AlignModule*, std::vector<Amg::VectorX> > AlignModuleDerivatives;
40 
41  class AlignTrack : public Track {
42 
43  public:
44 
46  Unknown = 0,
47  Original = 1,
52 
54  };
55 
57  AlignTrack(const Track& associatedTrack);
58 
60  AlignTrack(const Track& associatedTrack, AlignTSOSCollection * alignTSOSCollection);
61 
63  AlignTrack(const AlignTrack& alignTrack);
64 
66  virtual ~AlignTrack();
67 
69  AlignTrack& operator= (const AlignTrack& alignTrack);
70 
73 
76 
79 
82 
85 
88 
90  const Track * originalTrack() const { return m_originalTrack; }
91 
94 
96  inline AlignTrackType type() const {return m_type;}
98 
104  void doFindPerigee() const { findPerigee();}
105 
107  bool isSLTrack() const;
108 
110  static bool isSLTrack(const Track* track);
111 
113  static void dumpTrackInfo(const Track& track, MsgStream& msg) ;
114 
116  static void dumpLessTrackInfo(const Track& track, MsgStream& msg) ;
117 
119  void dump(MsgStream& msg) ;
120 
123 
126 
128  int nAlignTSOSMeas() const { return m_nAlignTSOSMeas; }
129 
133  const std::vector<AlignModuleDerivatives>* derivatives() const { return m_derivatives; }
134  void setDerivatives(std::vector<AlignModuleDerivatives>* vec) { m_derivatives=vec; }
135 
140  const std::vector<AlignModuleDerivatives>* derivativeErr() const { return m_derivativeErr; }
141  void setDerivativeErr(std::vector<AlignModuleDerivatives>* vec) { m_derivativeErr=vec; }
142 
146  const std::vector<std::pair<AlignModule*,std::vector<double> > >* actualSecondDerivatives() const { return m_actualSecondDerivatives; }
147  void setActualSecondDerivatives(std::vector<std::pair<AlignModule*,std::vector<double> > >* vec) { m_actualSecondDerivatives=vec; }
148 
150  const Amg::VectorX* residualVector() const { return m_residuals; }
152 
156  const Amg::SymMatrixX* weightMatrix() const { return m_weights; }
158 
163 
165  double chi2() const { return m_chi2; }
166  void setChi2(double chi2) { m_chi2=chi2; }
167 
169  double chi2dof() const { return m_chi2dof; }
171 
175 
179 
181  double trackAlignParamQuality(int i) const { return m_trackAlignParamQuality[i]; }
183 
185  const Trk::Track* trackWithoutScattering() const;
186 
188  const AlignVertex* getVtx() const { return m_vtx; }
189  AlignVertex* getVtx() { return m_vtx; }
190  void setVtx(AlignVertex * const vtx) { m_vtx = vtx; }
191 
193  bool refitD0() const { return m_refitD0; }
194  bool refitZ0() const { return m_refitZ0; }
195  bool refitPhi() const { return m_refitPhi; }
196  bool refitTheta() const { return m_refitTheta; }
197  bool refitQovP() const { return m_refitQovP; }
198 
200  void setRefitD0(bool flag) { m_refitD0 = flag; }
201  void setRefitZ0(bool flag) { m_refitZ0 = flag; }
202  void setRefitPhi(bool flag) { m_refitPhi = flag; }
204  void setRefitQovP(bool flag) { m_refitQovP = flag; }
205 
206  private:
207  // methods
209 
212 
215 
218 
221 
224 
226  Amg::SymMatrixX * m_localErrorMat; //Symmetric Matrix
227 
229  Amg::SymMatrixX * m_localErrorMatInv; //Symmetric Matrix
230 
233 
235  const Amg::SymMatrixX * m_fullCovarianceMatrix; //Symmetric Matrix
236 
237  std::vector<AlignModuleDerivatives > * m_derivatives;
238  std::vector<AlignModuleDerivatives > * m_derivativeErr;
239  std::vector<std::pair<AlignModule *,std::vector<double> > > * m_actualSecondDerivatives;
240 
242  Amg::MatrixX * m_weights; //Symmetric Matrix
243  Amg::MatrixX * m_weightsFirstDeriv; //Symmetric Matrix
244 
245  double m_chi2;
246  double m_chi2dof;
247 
250 
251  bool m_refitD0;
252  bool m_refitZ0;
256 
258 
260 
261  }; // end class
262 
263  MsgStream& operator<< (MsgStream& sl, const AlignTrack::AlignTrackType type);
264  std::ostream& operator<< (std::ostream& ol, const AlignTrack::AlignTrackType type);
266 
268 
272  }
273 
277  }
278 
281 
284 
285 } // end namespace
286 
287 #endif // TRKALIGNEVENT_ALIGNTRACK_H
Trk::AlignTrack::setAlignTSOSCollection
void setAlignTSOSCollection(AlignTSOSCollection *atsosColl)
sets collection of AlignTSOS
Definition: AlignTrack.cxx:341
Trk::AlignVertex
Definition: AlignVertex.h:39
Trk::AlignTrack::setTrackAlignParamQuality
void setTrackAlignParamQuality(int i, double val)
Definition: AlignTrack.h:182
Trk::AlignTrack::setActualSecondDerivatives
void setActualSecondDerivatives(std::vector< std::pair< AlignModule *, std::vector< double > > > *vec)
Definition: AlignTrack.h:147
Trk::AlignTrack::setOriginalTrack
void setOriginalTrack(const Track *track)
set pointer to original track
Definition: AlignTrack.h:93
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
Trk::AlignTSOSCollection
DataVector< AlignTSOS > AlignTSOSCollection
Definition: AlignTrack.h:35
Amg::VectorX
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
Definition: EventPrimitives.h:30
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
Trk::AlignTrack::refitZ0
bool refitZ0() const
Definition: AlignTrack.h:194
Trk::AlignTrack::refitQovP
bool refitQovP() const
Definition: AlignTrack.h:197
Trk::AlignTrack::m_fullCovarianceMatrix
const Amg::SymMatrixX * m_fullCovarianceMatrix
matrix containing full covariance matrix from track fitter
Definition: AlignTrack.h:235
Trk::AlignTrack::VertexMember
@ VertexMember
Refitted with 3DoF from the VTX.
Definition: AlignTrack.h:51
Trk::AlignTrack::m_refitTheta
bool m_refitTheta
Definition: AlignTrack.h:254
Trk::AlignTrack::setResidualVector
void setResidualVector(Amg::VectorX *vec)
Definition: AlignTrack.h:151
Trk::AlignTrack::refitPhi
bool refitPhi() const
Definition: AlignTrack.h:195
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Trk::AlignTrack::m_actualSecondDerivatives
std::vector< std::pair< AlignModule *, std::vector< double > > > * m_actualSecondDerivatives
Definition: AlignTrack.h:239
Trk::AlignTrack::m_localErrorMatInv
Amg::SymMatrixX * m_localErrorMatInv
inverse matrix containing local error matrices along diagonal
Definition: AlignTrack.h:229
Trk::AlignTrack::m_refitQovP
bool m_refitQovP
Definition: AlignTrack.h:255
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:55
CxxUtils::CachedUniquePtrT
Cached pointer with atomic update.
Definition: CachedUniquePtr.h:54
Trk::AlignTrack::m_residuals
Amg::VectorX * m_residuals
Definition: AlignTrack.h:241
Trk::AlignTrack::setRefitZ0
void setRefitZ0(bool flag)
Definition: AlignTrack.h:201
Trk::AlignTrack::Unknown
@ Unknown
default type
Definition: AlignTrack.h:46
Trk::AlignTrack::localErrorMatrixInv
const Amg::SymMatrixX * localErrorMatrixInv() const
inverse local error matrix, calculated by AlignTrack by calling atsos->hitDistanceVar()
Definition: AlignTrack.h:125
Trk::AlignTrack::setChi2dof
void setChi2dof(double chi2dof)
Definition: AlignTrack.h:170
Trk::AlignTrack::refitTheta
bool refitTheta() const
Definition: AlignTrack.h:196
Trk::AlignModule
Definition: AlignModule.h:45
Trk::AlignTrack::weightMatrixFirstDeriv
const Amg::SymMatrixX * weightMatrixFirstDeriv() const
First deriv weight matrix can be either W from Si alignment (see Eqn.
Definition: AlignTrack.h:161
Trk::AlignTrack::m_refitPhi
bool m_refitPhi
Definition: AlignTrack.h:253
DataVector::cend
const_iterator cend() const noexcept
Return a const_iterator pointing past the end of the collection.
Trk::AlignTrack::m_trackAlignParamQuality
double * m_trackAlignParamQuality
Definition: AlignTrack.h:257
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
Trk::AlignTrack::m_localErrorMat
Amg::SymMatrixX * m_localErrorMat
matrix containing local error matrices along diagonal
Definition: AlignTrack.h:226
Trk::AlignTrack::setRefitPhi
void setRefitPhi(bool flag)
Definition: AlignTrack.h:202
Trk::dumpAlignTrackType
std::string dumpAlignTrackType(const AlignTrack::AlignTrackType type)
Definition: AlignTrack.cxx:410
Trk::AlignTrack::AlignTrackType
AlignTrackType
Definition: AlignTrack.h:45
Trk::AlignTrack::isSLTrack
bool isSLTrack() const
method to determine whether a straight line track or not
Definition: AlignTrack.cxx:263
Trk::AlignTrack::localErrorMatrix
const Amg::SymMatrixX * localErrorMatrix() const
local error matrix, calculated by AlignTrack by calling atsos->hitDistanceVar()
Definition: AlignTrack.h:122
Trk::AlignTrack::m_originalTrack
const Track * m_originalTrack
point to original track
Definition: AlignTrack.h:214
Trk::AlignModuleDerivatives
std::pair< AlignModule *, std::vector< Amg::VectorX > > AlignModuleDerivatives
Definition: AlignTrack.h:39
Trk::AlignTrack::m_derivativeErr
std::vector< AlignModuleDerivatives > * m_derivativeErr
Definition: AlignTrack.h:238
Trk::AlignTrack::setFullCovarianceMatrix
void setFullCovarianceMatrix(const Amg::SymMatrixX *matrix)
Definition: AlignTrack.h:274
Trk::AlignTrack::m_nAlignTSOSMeas
int m_nAlignTSOSMeas
variables
Definition: AlignTrack.h:220
Trk::AlignTrack::refitD0
bool refitD0() const
get refit flags
Definition: AlignTrack.h:193
AlignTSOS.h
Trk::AlignTrack::m_derivatives
std::vector< AlignModuleDerivatives > * m_derivatives
Definition: AlignTrack.h:237
Track.h
CxxUtils::vec
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
Definition: vec.h:207
Trk::AlignTrack::derivativeErr
const std::vector< AlignModuleDerivatives > * derivativeErr() const
The Amg::VectorX is a vector of errors in first-derivatives of the alignTSOS on the alignTrack w....
Definition: AlignTrack.h:140
Trk::AlignTrack::derivativeMatrix
const Amg::MatrixX * derivativeMatrix() const
set and get derivative matrix
Definition: AlignTrack.h:173
Trk::Track::findPerigee
void findPerigee() const
Find perigee in the vector of track parameters.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:123
Trk::AlignTrack::derivatives
const std::vector< AlignModuleDerivatives > * derivatives() const
The Amg::VectorX is a vector of first-derivatives of the alignTSOS on the alignTrack w....
Definition: AlignTrack.h:133
Trk::AlignTrack::firstAtsos
AlignTSOSCollection::const_iterator firstAtsos() const
retrieve iterator pointer to first element in collection
Definition: AlignTrack.h:279
Trk::AlignTrack::BeamspotConstrained
@ BeamspotConstrained
refitted with beamspot constraint
Definition: AlignTrack.h:49
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
lumiFormat.i
int i
Definition: lumiFormat.py:85
Trk::AlignTrack::chi2dof
double chi2dof() const
locally calculated chi2
Definition: AlignTrack.h:169
Trk::AlignTrack::m_derivativeMatrix
const Amg::MatrixX * m_derivativeMatrix
matrix containing derivative matrix from track fitter
Definition: AlignTrack.h:232
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
master.flag
bool flag
Definition: master.py:29
Trk::AlignTrack::m_trackWithoutScattering
CxxUtils::CachedUniquePtr< Trk::Track > m_trackWithoutScattering
describes the quality of contribution to track to alignment parameter (used by shifting derivatives)
Definition: AlignTrack.h:259
CachedUniquePtr.h
Cached unique_ptr with atomic update.
Trk::AlignTrack::m_refitD0
bool m_refitD0
Definition: AlignTrack.h:251
Trk::AlignTrack::m_refitZ0
bool m_refitZ0
Definition: AlignTrack.h:252
Trk::AlignTrack::dump
void dump(MsgStream &msg)
dump align track information
Definition: AlignTrack.cxx:316
Trk::AlignTrack::getVtx
const AlignVertex * getVtx() const
set and get pointer to the associated vertex
Definition: AlignTrack.h:188
Trk::AlignTrack::residualVector
const Amg::VectorX * residualVector() const
Vector of residuals of the alignTSOS on the alignTrack, to be set by AlignTrackDresser.
Definition: AlignTrack.h:150
Trk::AlignTrack::m_weightsFirstDeriv
Amg::MatrixX * m_weightsFirstDeriv
Definition: AlignTrack.h:243
Trk::AlignTrack::setRefitTheta
void setRefitTheta(bool flag)
Definition: AlignTrack.h:203
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
Trk::AlignTrack::trackWithoutScattering
const Trk::Track * trackWithoutScattering() const
returns track with ScatteringAngle pointers all set to zero (used for refit by iPat)
Definition: AlignTrack.cxx:423
Trk::AlignTrack::setWeightMatrixFirstDeriv
void setWeightMatrixFirstDeriv(Amg::SymMatrixX *mat)
Definition: AlignTrack.h:162
Trk::AlignTrack::weightMatrix
const Amg::SymMatrixX * weightMatrix() const
Weight matrix is W from Si alignment (see Eqn.
Definition: AlignTrack.h:156
Trk::AlignTrack::actualSecondDerivatives
const std::vector< std::pair< AlignModule *, std::vector< double > > > * actualSecondDerivatives() const
The Amg::VectorX is a vector of first-derivatives of the alignTSOS on the alignTrack w....
Definition: AlignTrack.h:146
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::AlignTrack::m_chi2dof
double m_chi2dof
Definition: AlignTrack.h:246
Trk::AlignTrack::setDerivativeErr
void setDerivativeErr(std::vector< AlignModuleDerivatives > *vec)
Definition: AlignTrack.h:141
Trk::AlignTrack::setVtx
void setVtx(AlignVertex *const vtx)
Definition: AlignTrack.h:190
Trk::AlignTrack::m_chi2
double m_chi2
Definition: AlignTrack.h:245
Trk::AlignTrack::nAlignTSOSMeas
int nAlignTSOSMeas() const
number of alignTSOS (including scatterers if included on AlignTrack
Definition: AlignTrack.h:128
Trk::AlignTrack::originalTrack
const Track * originalTrack() const
retrieve pointer to original track
Definition: AlignTrack.h:90
Trk::AlignTrack
Definition: AlignTrack.h:41
Trk::AlignTrack::m_vtx
AlignVertex * m_vtx
pointer to the associated vertex
Definition: AlignTrack.h:249
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Trk::AlignTrack::m_alignTSOSCollection
AlignTSOSCollection * m_alignTSOSCollection
collection of alignTSOS that make up the alignTrack
Definition: AlignTrack.h:223
Trk::AlignTSOSIt
DataVector< AlignTSOS >::const_iterator AlignTSOSIt
Definition: AlignTrack.h:38
Trk::AlignTrack::alignTSOSCollection
const AlignTSOSCollection * alignTSOSCollection() const
returns collection of alignTSOS
Definition: AlignTrack.h:267
Trk::AlignTrack::m_type
AlignTrackType m_type
refit type of this alignTrack
Definition: AlignTrack.h:217
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
Trk::AlignTrack::chi2
double chi2() const
locally calculated chi2
Definition: AlignTrack.h:165
python.testIfMatch.matrix
matrix
Definition: testIfMatch.py:66
Trk::AlignTrack::dumpTrackInfo
static void dumpTrackInfo(const Track &track, MsgStream &msg)
dump track information
Definition: AlignTrack.cxx:269
Trk::AlignTrack::setWeightMatrix
void setWeightMatrix(Amg::SymMatrixX *mat)
Definition: AlignTrack.h:157
Trk::AlignTrack::Original
@ Original
not refitted, just copy constructed from original Track
Definition: AlignTrack.h:47
Trk::AlignTrack::NormalRefitted
@ NormalRefitted
normally refitted, without adding any pseudo-measurement
Definition: AlignTrack.h:48
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
Trk::operator<<
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
Definition: AlignModule.cxx:204
Trk::AlignTrack::setAlignParameters
void setAlignParameters()
sets derivatives of alignment parameters
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Trk::AlignTrack::doFindPerigee
void doFindPerigee() const
For the AlignTrack, if there is pseudo-measurement in the TSOS collection, the perigee will not alway...
Definition: AlignTrack.h:104
Trk::AlignTrack::setRefitD0
void setRefitD0(bool flag)
set refit flags
Definition: AlignTrack.h:200
Trk::AlignTrack::AlignTrack
AlignTrack()
Trk::AlignTrack::setChi2
void setChi2(double chi2)
Definition: AlignTrack.h:166
Trk::AlignTrack::trackAlignParamQuality
double trackAlignParamQuality(int i) const
set and get array (one entry per alignment parameter) of fit chi2 of chi2 vs.
Definition: AlignTrack.h:181
Trk::AlignTrack::setRefitQovP
void setRefitQovP(bool flag)
Definition: AlignTrack.h:204
Trk::AlignTrack::dumpLessTrackInfo
static void dumpLessTrackInfo(const Track &track, MsgStream &msg)
dump less track information
Definition: AlignTrack.cxx:276
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
DataVector::cbegin
const_iterator cbegin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
Trk::AlignTrack::operator=
AlignTrack & operator=(const AlignTrack &alignTrack)
assignment operator
Definition: AlignTrack.cxx:142
Trk::AlignTrack::NTrackTypes
@ NTrackTypes
total number of track types
Definition: AlignTrack.h:53
Trk::AlignTrack::VertexConstrained
@ VertexConstrained
refitted with vertex constraint
Definition: AlignTrack.h:50
AlignVertex
AlignVertex is a simple structure to store objects belonging to a vertex. Contains a pointer to the o...
Trk::AlignTrack::~AlignTrack
virtual ~AlignTrack()
destructor
Definition: AlignTrack.cxx:220
Trk::AlignTrack::setDerivativeMatrix
void setDerivativeMatrix(const Amg::MatrixX *matrix)
Definition: AlignTrack.h:269
Trk::AlignTrack::getVtx
AlignVertex * getVtx()
Definition: AlignTrack.h:189
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
Trk::AlignTrack::fullCovarianceMatrix
const Amg::SymMatrixX * fullCovarianceMatrix() const
set and get full covariance matrix
Definition: AlignTrack.h:177
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
Trk::AlignTrack::setType
void setType(AlignTrackType type)
Definition: AlignTrack.h:97
Trk::AlignTrack::setDerivatives
void setDerivatives(std::vector< AlignModuleDerivatives > *vec)
Definition: AlignTrack.h:134
Trk::AlignTrack::lastAtsos
AlignTSOSCollection::const_iterator lastAtsos() const
returns iterator pointer to last element in collection
Definition: AlignTrack.h:280
Trk::AlignTrack::type
AlignTrackType type() const
get and set the refit type
Definition: AlignTrack.h:96
Amg::SymMatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > SymMatrixX
Definition: EventPrimitives.h:28
Trk::AlignTrack::m_weights
Amg::MatrixX * m_weights
Definition: AlignTrack.h:242