ATLAS Offline Software
Loading...
Searching...
No Matches
TrkVKalVrtCoreBase.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TrkVKalVrtCoreBase_VKalVrtCore_H
6#define TrkVKalVrtCoreBase_VKalVrtCore_H
7
11#include <vector>
12#include <iosfwd>
13
14namespace Trk {
15
16
17 class VKConstraintBase;
18 class VKVertex;
19
21 {
22 public:
25 double getSCALE() const {return m_SCALE;};
26 void setSCALE(double S) {m_SCALE=S;};
27 double getAccuracyConstraint() const { return m_accuracyConstraint; };
29 std::unique_ptr<double[]> fullCovMatrix;
30 std::vector< std::unique_ptr<VKVertex> > cascadeVertexList;
31 std::vector<int> matrixPnt;
34
35 private:
36 double m_SCALE;
38
39
40 };
41
42 class TWRK // collection of temporary arrays for
43 {
44 public:
45 TWRK() { }; // cppcheck-suppress uninitMemberVar; bypass initialization
46 ~TWRK() = default;//default destructor allows compiler to optimize out method in this case.
47
48 public:
49 double tt[3]; // U_i vector (see Billoir...)
50 double wb[9];
51 double wc[6];
52 double wci[6];
53 double wbci[9];
54 double drdp[2][3]; // for "pass near" constraint
55 double parf0[3]; // parameter shifts during iteration
56 double part[3]; // temporary array for fostfit optimization
57 };
58
59//
60// Main container for all track related information in vertex fit
61//--------------------------------------------------------------------
62 class VKTrack
63 {
64 public:
65 VKTrack(long int, const double[], const double[], VKVertex *, double);
66 ~VKTrack() = default; //default destructor allows compiler to optimize out method.
67// VKTrack(const VKTrack & src); //copy
68 friend std::ostream& operator<<( std::ostream& out, const VKTrack& track );
69
70 public:
71 long int Id; //track ID number
72 int Charge; //track charge
73
74 // Fitted track perameters at vertex VKVErtex->fitV
75 double fitP[3]{};
76 double Chi2;
77
78 // Track perameters at vertex VKVErtex->cnstV for constraint calculations
79 double cnstP[3]{};
80
81 // ALL is estimated at VKVErtex->iniV posision - start position of the fit
82 double iniP[3]{}; //perigee parameters assuming that track passes through iniXYZ
83
84 // ALL is estimated at VKVErtex->refIterV posision - iteration reference position
85 double Perig[5]{}; //perigee parameters prepared for vertex estimation
86 double WgtM[15]{}; //symmetric weight matrix prepared for vertex estimation
87 double WgtM_save[15]{}; //copy of weight matrix for speed optimisation
88
89 // All for robustification
90 double rmnd[5]{}; //remnants with respect to fitted vertex position
91 double e[5]{}; //eigenvalues of weight matrix
92 double v[5][5]{}; //corresponding eigenvectors of weight matrix
93
94 // ALL is estimated at VKVErtex->refXYZ posision - reference position for vertex fit
95 double refPerig[5]{}; //perigee parameters
96 double refCovar[15]{}; //symmetric covariance matrix
97
98 public:
99 double getMass() const {return m_mass;}
100 void setMass(double M){ m_mass=M;}
101 double a0() const { return Perig[0];}
102 double z() const { return Perig[1];}
103 double theta() const { return Perig[2];}
104 double phi() const { return Perig[3];}
105 double invR() const { return Perig[4];}
106 double r_a0() const { return refPerig[0];}
107 double r_z() const { return refPerig[1];}
108 double r_theta() const { return refPerig[2];}
109 double r_phi() const { return refPerig[3];}
110 double r_invR() const { return refPerig[4];}
111
112 public:
113 void setCurrent ( const double[], const double[]); // set iteration (current) track parameters
114 void setReference( const double[], const double[]); // set reference track parameters
115 void restoreCurrentWgt(); // restore track WGT from saved copy
116
117 private:
118
120 double m_mass; //track mass
121
122 };
123
124
125
127 {
128 public:
129 VKVertex(const VKalVrtControl &);
130 VKVertex(VKVertex &&) noexcept = default;
131 VKVertex();
133 VKVertex(const VKVertex & src); //copy
134 VKVertex& operator= (const VKVertex & src); //assign
135 VKVertex& operator= (VKVertex &&) noexcept = default; //move
136
137 public: // Relative coordinates with respect to refIterV[]
138 double Chi2; // vertex Chi2
139 double fitV[3]{}; //fitted vertex position on given iteration step
140 double fitVcov[6]{}; //symmetric covariance matrix of fitted vertex
141 double iniV[3]{}; //starting point for the fit.
142 double cnstV[3]{}; //position for constraint values calculation. May be different from fitV or iniV
143
144 public: //Global coordinates
145 double refIterV[3]{}; //initial point for iteration step and target for preparatory
146 //track extrapolation. At this point Perig[] and WgtM[] for each track are defined.
147 double refV[3]{}; //reference point for given vertex. At this point refPerig[] and refCovar[]
148 //for each track are defined
149
150 int useApriorVertex; //for a priory vertex position knowledge usage
151 double apriorV[3]{}; //global coordinates (the same as refV and refIterV)
152 double apriorVWGT[6]{}; //weight matrix of a priori vertex
153
154
155 bool passNearVertex; // needed for "passing near vertex" constraint
156 bool passWithTrkCov; // Vertex, CovVertex, Charge and derivatives
157 double fitMom[3]{}; // are in ForVrtClose structure
158 double fitCovXYZMom[21]{}; // Mom and CovMom are here because they are used also for other purposes
160
161
162 double T[3]{}; // save T(see Billoir) vector for futher use
163 double wa[6]{}; // save WA matrix for futher use
164 double dxyz0[3]{}; // unconstrained shift of vertex on current iteration. Needed for PostFit
165
166 std::vector<std::unique_ptr<VKTrack> > TrackList;
167 std::vector<std::unique_ptr<TWRK> > tmpArr;
168 std::vector<std::unique_ptr<VKConstraintBase> > ConstraintList;
169
170
171 void setRefV(double v[3]) noexcept;
172 void setCnstV(double v[3]) noexcept;
173 void setRefIterV(double v[]) noexcept;
174 void setIniV(double v[3]) noexcept;
175 void setFitV(double v[3]) noexcept;
176
177
179 std::vector<VKVertex*> includedVrt; // these vertices are NOT owned by given object.
180 double savedVrtMomCov[21]{}; // saved covariance WITHOUT pointing constraint
181 // for correct cascade error definition
182 public:
183
186 //this is quite large to 0 initialize here
187 double ader[(3*vkalNTrkM+3)*(3*vkalNTrkM+3)]; // was [903][903]
188
189 public: // Object with defining information for VKalVrtCore library.
190 // Each vertex has a copy of VKalVrtControl object what allows
191 // to fit it independently with individual set of constraints.
192 // See Cascade code.
193 std::unique_ptr<VKalVrtControl> vk_fitterControl;
194 };
195
196
197
198
199} // end of namespace bracket
200
201#endif
#define vkalNTrkM
Definition CommonPars.h:22
double getAccuracyConstraint() const
double getSCALE() const
void setSCALE(double S)
std::vector< int > matrixPnt
void setAccuracyConstraint(double C)
std::unique_ptr< double[]> fullCovMatrix
std::vector< std::unique_ptr< VKVertex > > cascadeVertexList
~TWRK()=default
double parf0[3]
double drdp[2][3]
friend std::ostream & operator<<(std::ostream &out, const VKTrack &track)
double getMass() const
double a0() const
double r_theta() const
double r_a0() const
~VKTrack()=default
double WgtM_save[15]
double r_z() const
double refCovar[15]
void setReference(const double[], const double[])
void setCurrent(const double[], const double[])
VKVertex * m_originVertex
double r_invR() const
double z() const
VKTrack(long int, const double[], const double[], VKVertex *, double)
double invR() const
double phi() const
double r_phi() const
double theta() const
void setMass(double M)
double savedVrtMomCov[21]
VKVertex(const VKalVrtControl &)
void setRefIterV(double v[]) noexcept
void setFitV(double v[3]) noexcept
void setCnstV(double v[3]) noexcept
std::vector< VKVertex * > includedVrt
void setIniV(double v[3]) noexcept
VKVertex(VKVertex &&) noexcept=default
std::vector< std::unique_ptr< VKTrack > > TrackList
double ader[(3 *vkalNTrkM+3) *(3 *vkalNTrkM+3)]
std::vector< std::unique_ptr< VKConstraintBase > > ConstraintList
double fitCovXYZMom[21]
void setRefV(double v[3]) noexcept
std::vector< std::unique_ptr< TWRK > > tmpArr
VKVertex * nextCascadeVrt
std::unique_ptr< VKalVrtControl > vk_fitterControl
struct color C
Ensure that the ATLAS eigen extensions are properly loaded.
@ v
Definition ParamDefs.h:78