ATLAS Offline Software
AlignVertex.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRKALIGNEVENT_ALIGNVERTEX_H
6 #define TRKALIGNEVENT_ALIGNVERTEX_H
7 
8 #include "GaudiKernel/MsgStream.h"
10 
11 #include "TrkTrack/Track.h"
12 #include "VxVertex/VxCandidate.h"
13 #include "xAODTracking/Vertex.h"
15 
17 
19 #include <vector>
20 #include <fstream>
21 
33 namespace Trk {
34 
35  typedef std::vector<AlignTrack**> AlignTrackCollection;
36  typedef std::vector<AlignTrack**>::const_iterator AlignTrackIt;
37  typedef std::pair<const AlignModule*, std::vector<Amg::VectorX> > AlignModuleVertexDerivatives;
38 
39  class AlignVertex {
40 
41  public:
42 
44  Unknown = 0,
45  Primary = 1,
46  Refitted = 2,
48 
50  };
51 
53  AlignVertex();
54 
57 
59  AlignVertex( const AlignVertex & rhs);
60 
62  AlignVertex & operator=( const AlignVertex & rhs);
63 
65  ~AlignVertex();
66 
67 
70 
72  AlignTrackCollection::const_iterator firstATrack() const;
73 
75  AlignTrackCollection::const_iterator lastATrack() const;
76 
78  const xAOD::Vertex * originalVertex() const { return m_original; }
79  inline const Amg::Vector3D* originalPosition() const {return m_originalPosition;}
80 
83 
85  inline AlignVertexType type() const {return m_type;}
87 
89  inline const Amg::Vector3D* position() const {return m_position;}
90  inline const AmgSymMatrix(3)* covariance() const {return m_covariance;}
91 
95  const std::vector<AlignModuleVertexDerivatives>* derivatives() const { return m_derivatives; }
96  void setDerivatives(std::vector<AlignModuleVertexDerivatives>* vec) { m_derivatives=vec; }
97  void addDerivatives(std::vector<AlignModuleVertexDerivatives>* vec);
98 
99 
101  void dump(MsgStream& msg) ;
102 
104  void incrementVector(const Amg::Vector3D& vtxV) { (*m_vVector)+=vtxV; }
105  void incrementMatrix(const AmgSymMatrix(3) vtxM) { (*m_matrix)+=vtxM; }
106 
107 
109  void fitVertex();
110 
112  int Ntracks() const { return m_nTracks; }
113 
116 
117  const AmgSymMatrix(3)* Qmatrix() const { return m_qMatrix; }
118 
119  const Amg::Vector3D* Vvector() const { return m_vVector; }
120 
121  void setUnconstrained() { m_constrained=false; }
122 
123  bool Constrained() const { return m_constrained; }
124 
125 
126  private:
128 
129  AmgSymMatrix(3)* m_matrix;
131 
134 
136 
138  AmgSymMatrix(3) * m_covariance;
139 
140  std::vector<AlignModuleVertexDerivatives > * m_derivatives;
141 
142  AmgSymMatrix(3)* m_qMatrix;
145 
146 
148 
149  }; // end class
150 
151 
152 } // end namespace
153 
154 #endif // TRKALIGNEVENT_ALIGNVERTEX_H
Trk::AlignVertex::m_constrained
bool m_constrained
Definition: AlignVertex.h:144
Trk::AlignVertex::setUnconstrained
void setUnconstrained()
Definition: AlignVertex.h:121
Trk::AlignVertex
Definition: AlignVertex.h:39
Trk::AlignVertex::AlignVertexType
AlignVertexType
Definition: AlignVertex.h:43
Trk::AlignVertex::m_position
Amg::Vector3D * m_position
Definition: AlignVertex.h:137
Trk::AlignVertex::AmgSymMatrix
const AmgSymMatrix(3) *Qmatrix() const
Definition: AlignVertex.h:117
Trk::AlignVertex::AmgSymMatrix
AmgSymMatrix(3) *m_matrix
Trk::AlignVertex::lastATrack
AlignTrackCollection::const_iterator lastATrack() const
returns iterator pointer to last element in collection
Trk::AlignVertex::incrementMatrix
void incrementMatrix(const AmgSymMatrix(3) vtxM)
Definition: AlignVertex.h:105
Trk::AlignVertex::m_original
const xAOD::Vertex * m_original
Definition: AlignVertex.h:132
Trk::AlignVertex::derivatives
const std::vector< AlignModuleVertexDerivatives > * derivatives() const
The Amg::VectorX is a vector of first-derivatives of the alignTSOS on the alignTrack w....
Definition: AlignVertex.h:95
Trk::AlignVertex::setDerivatives
void setDerivatives(std::vector< AlignModuleVertexDerivatives > *vec)
Definition: AlignVertex.h:96
Trk::AlignVertex::AmgSymMatrix
const AmgSymMatrix(3) *covariance() const
Definition: AlignVertex.h:90
Trk::AlignVertex::Unknown
@ Unknown
default type
Definition: AlignVertex.h:44
Trk::AlignVertex::m_type
AlignVertexType m_type
Definition: AlignVertex.h:147
Trk::AlignVertex::m_derivatives
std::vector< AlignModuleVertexDerivatives > * m_derivatives
Definition: AlignVertex.h:140
Trk::AlignVertex::m_vVector
Amg::Vector3D * m_vVector
Definition: AlignVertex.h:143
Trk::AlignVertex::alignTrackCollection
const AlignTrackCollection * alignTrackCollection() const
returns collection of alignTracks
Trk::AlignVertex::Constrained
bool Constrained() const
Definition: AlignVertex.h:123
Trk::AlignVertex::setType
void setType(AlignVertexType type)
Definition: AlignVertex.h:86
Trk::AlignVertex::Accumulated
@ Accumulated
accumulated by the GX algorithm.
Definition: AlignVertex.h:47
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
Trk::AlignVertex::dump
void dump(MsgStream &msg)
dump align vertex information
Definition: AlignVertex.cxx:218
Trk::AlignVertex::Ntracks
int Ntracks() const
get the number of contributing tracks
Definition: AlignVertex.h:112
Trk::AlignVertex::AmgSymMatrix
AmgSymMatrix(3) *m_covariance
Trk::AlignVertex::fitVertex
void fitVertex()
fit the vertex internally
Definition: AlignVertex.cxx:144
Track.h
Trk::AlignVertex::position
const Amg::Vector3D * position() const
get the vertex position and covariance
Definition: AlignVertex.h:89
CxxUtils::vec
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
Definition: vec.h:207
Trk::AlignVertex::AmgSymMatrix
AmgSymMatrix(3) *m_qMatrix
Trk::AlignVertex::originalPosition
const Amg::Vector3D * originalPosition() const
Definition: AlignVertex.h:79
Trk::AlignVertex::setConstraint
void setConstraint(AmgSymMatrix(3) *, Amg::Vector3D *)
set and get the constraint on VTX position
Definition: AlignVertex.cxx:114
AlignTrack.h
Trk::AlignVertex::originalVertex
const xAOD::Vertex * originalVertex() const
retrieve pointer to original vertex and its position
Definition: AlignVertex.h:78
Trk::AlignTrackIt
std::vector< AlignTrack ** >::const_iterator AlignTrackIt
Definition: AlignVertex.h:36
AthAlgTool.h
Trk::AlignVertex::m_vector
Amg::Vector3D * m_vector
Definition: AlignVertex.h:130
Trk::AlignVertex::firstATrack
AlignTrackCollection::const_iterator firstATrack() const
retrieve iterator pointer to first element in collection
Trk::AlignVertex::setOriginalVertex
void setOriginalVertex(const xAOD::Vertex *vertex)
set pointer to original vertex
Definition: AlignVertex.h:82
Vertex.h
ParticleHypothesis.h
Trk::AlignVertex::Vvector
const Amg::Vector3D * Vvector() const
Definition: AlignVertex.h:119
Trk::AlignVertex::m_originalPosition
Amg::Vector3D * m_originalPosition
Definition: AlignVertex.h:133
VxCandidate.h
Trk::AlignVertex::incrementVector
void incrementVector(const Amg::Vector3D &vtxV)
increment algebra objects for this verterx:
Definition: AlignVertex.h:104
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
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
Trk::AlignVertex::~AlignVertex
~AlignVertex()
destructor
Definition: AlignVertex.cxx:98
Trk::AlignVertex::m_alignTracks
AlignTrackCollection m_alignTracks
Definition: AlignVertex.h:135
Trk::AlignVertex::addDerivatives
void addDerivatives(std::vector< AlignModuleVertexDerivatives > *vec)
Definition: AlignVertex.cxx:132
Trk::AlignVertex::NVertexTypes
@ NVertexTypes
total number of track types
Definition: AlignVertex.h:49
Trk::AlignVertex::AlignVertex
AlignVertex()
default constructor
Definition: AlignVertex.cxx:11
Trk::AlignVertex::Refitted
@ Refitted
normally refitted, without adding any pseudo-measurement
Definition: AlignVertex.h:46
Trk::AlignVertex::type
AlignVertexType type() const
get and set the refit type
Definition: AlignVertex.h:85
Trk::AlignTrackCollection
std::vector< AlignTrack ** > AlignTrackCollection
Definition: AlignVertex.h:35
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
Trk::AlignVertex::m_nTracks
int m_nTracks
Definition: AlignVertex.h:127
Trk::AlignModuleVertexDerivatives
std::pair< const AlignModule *, std::vector< Amg::VectorX > > AlignModuleVertexDerivatives
Definition: AlignVertex.h:37
Trk::AlignVertex::operator=
AlignVertex & operator=(const AlignVertex &rhs)
assignment
Definition: AlignVertex.cxx:51
Trk::AlignVertex::Primary
@ Primary
not refitted, just copy constructed from original Track
Definition: AlignVertex.h:45