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