ATLAS Offline Software
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 
14 namespace Trk {
15 
16 
17  class VKConstraintBase;
18  class VKVertex;
19 
21  {
22  public:
23  int cascadeNV;
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;
33  matrixPnt(0), m_SCALE(1.), m_accuracyConstraint(1.e-4) {};
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 
127  class VKVertex
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
Trk::VKTrack::r_invR
double r_invR() const
Definition: TrkVKalVrtCoreBase.h:111
Trk::VKTrack::cnstP
double cnstP[3]
Definition: TrkVKalVrtCoreBase.h:80
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
CommonPars.h
Trk::CascadeEvent::m_SCALE
double m_SCALE
Definition: TrkVKalVrtCoreBase.h:37
Trk::VKTrack::WgtM
double WgtM[15]
Definition: TrkVKalVrtCoreBase.h:87
Trk::TWRK::parf0
double parf0[3]
Definition: TrkVKalVrtCoreBase.h:56
Trk::TWRK::tt
double tt[3]
Definition: TrkVKalVrtCoreBase.h:50
Trk::CascadeEvent::setSCALE
void setSCALE(double S)
Definition: TrkVKalVrtCoreBase.h:26
Trk::VKVertex::tmpArr
std::vector< std::unique_ptr< TWRK > > tmpArr
Definition: TrkVKalVrtCoreBase.h:168
WriteCellNoiseToCool.src
src
Definition: WriteCellNoiseToCool.py:513
Trk::TWRK
Definition: TrkVKalVrtCoreBase.h:44
ForVrtClose.h
Trk::VKVertex::T
double T[3]
Definition: TrkVKalVrtCoreBase.h:163
Trk::TWRK::part
double part[3]
Definition: TrkVKalVrtCoreBase.h:57
Trk::VKTrack::Chi2
double Chi2
Definition: TrkVKalVrtCoreBase.h:77
Trk::TWRK::~TWRK
~TWRK()=default
Trk::VKTrack::r_phi
double r_phi() const
Definition: TrkVKalVrtCoreBase.h:110
Trk::VKVertex::useApriorVertex
int useApriorVertex
Definition: TrkVKalVrtCoreBase.h:151
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
Trk::TWRK::TWRK
TWRK()
Definition: TrkVKalVrtCoreBase.h:46
Trk::VKVertex::FVC
ForVrtClose FVC
Definition: TrkVKalVrtCoreBase.h:160
Trk::VKVertex::refIterV
double refIterV[3]
Definition: TrkVKalVrtCoreBase.h:146
Trk::VKTrack::VKTrack
VKTrack(long int, const double[], const double[], VKVertex *, double)
Definition: TrkVKalVrtCoreBase.cxx:47
Trk::VKTrack::Id
long int Id
Definition: TrkVKalVrtCoreBase.h:72
Trk::VKTrack
Definition: TrkVKalVrtCoreBase.h:64
Trk::CascadeEvent::getSCALE
double getSCALE() const
Definition: TrkVKalVrtCoreBase.h:25
Trk::VKTrack::Charge
int Charge
Definition: TrkVKalVrtCoreBase.h:73
Trk::CascadeEvent::m_accuracyConstraint
double m_accuracyConstraint
Definition: TrkVKalVrtCoreBase.h:38
Trk::VKVertex::ader
double ader[(3 *vkalNTrkM+3) *(3 *vkalNTrkM+3)]
Definition: TrkVKalVrtCoreBase.h:188
Trk::VKTrack::refPerig
double refPerig[5]
Definition: TrkVKalVrtCoreBase.h:96
Trk::VKTrack::setReference
void setReference(const double[], const double[])
Definition: TrkVKalVrtCoreBase.cxx:76
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
Trk::VKVertex::apriorV
double apriorV[3]
Definition: TrkVKalVrtCoreBase.h:152
Trk::VKTrack::z
double z() const
Definition: TrkVKalVrtCoreBase.h:103
Trk::VKTrack::Perig
double Perig[5]
Definition: TrkVKalVrtCoreBase.h:86
JetTiledMap::S
@ S
Definition: TiledEtaPhiMap.h:44
Trk::VKTrack::operator<<
friend std::ostream & operator<<(std::ostream &out, const VKTrack &track)
Definition: TrkVKalVrtCoreBase.cxx:94
Trk::VKVertex::ConstraintList
std::vector< std::unique_ptr< VKConstraintBase > > ConstraintList
Definition: TrkVKalVrtCoreBase.h:169
Trk::VKVertex::apriorVWGT
double apriorVWGT[6]
Definition: TrkVKalVrtCoreBase.h:153
Trk::CascadeEvent::fullCovMatrix
std::unique_ptr< double[]> fullCovMatrix
Definition: TrkVKalVrtCoreBase.h:28
Trk::VKTrack::fitP
double fitP[3]
Definition: TrkVKalVrtCoreBase.h:76
Trk::CascadeEvent::matrixPnt
std::vector< int > matrixPnt
Definition: TrkVKalVrtCoreBase.h:31
Trk::VKVertex::TrackList
std::vector< std::unique_ptr< VKTrack > > TrackList
Definition: TrkVKalVrtCoreBase.h:167
Trk::VKVertex::setFitV
void setFitV(double v[3]) noexcept
Definition: TrkVKalVrtCoreBase.cxx:150
Trk::VKTrack::a0
double a0() const
Definition: TrkVKalVrtCoreBase.h:102
Trk::VKVertex::fitV
double fitV[3]
Definition: TrkVKalVrtCoreBase.h:140
Trk::CascadeEvent::setAccuracyConstraint
void setAccuracyConstraint(double C)
Definition: TrkVKalVrtCoreBase.h:28
Trk::VKVertex::VKVertex
VKVertex(VKVertex &&) noexcept=default
Trk::VKVertex::includedVrt
std::vector< VKVertex * > includedVrt
Definition: TrkVKalVrtCoreBase.h:180
Trk::VKTrack::~VKTrack
~VKTrack()=default
Trk::VKTrack::rmnd
double rmnd[5]
Definition: TrkVKalVrtCoreBase.h:91
Trk::VKVertex::setRefIterV
void setRefIterV(double v[]) noexcept
Definition: TrkVKalVrtCoreBase.cxx:148
Trk::VKVertex::setIniV
void setIniV(double v[3]) noexcept
Definition: TrkVKalVrtCoreBase.cxx:149
Trk::VKTrack::invR
double invR() const
Definition: TrkVKalVrtCoreBase.h:106
Trk::TWRK::wb
double wb[9]
Definition: TrkVKalVrtCoreBase.h:51
Trk::VKVertex::fitMom
double fitMom[3]
Definition: TrkVKalVrtCoreBase.h:158
Trk::VKTrack::setCurrent
void setCurrent(const double[], const double[])
Definition: TrkVKalVrtCoreBase.cxx:70
TrkVKalVrtCore.h
Trk::VKVertex::refV
double refV[3]
Definition: TrkVKalVrtCoreBase.h:148
Trk::VKVertex::passNearVertex
bool passNearVertex
Definition: TrkVKalVrtCoreBase.h:156
Trk::VKTrack::r_a0
double r_a0() const
Definition: TrkVKalVrtCoreBase.h:107
Trk::VKTrack::e
double e[5]
Definition: TrkVKalVrtCoreBase.h:92
Trk::VKVertex::fitVcov
double fitVcov[6]
Definition: TrkVKalVrtCoreBase.h:141
Trk::VKTrack::m_mass
double m_mass
Definition: TrkVKalVrtCoreBase.h:121
Trk::VKTrack::m_originVertex
VKVertex * m_originVertex
Definition: TrkVKalVrtCoreBase.h:120
Trk::VKVertex::existFullCov
int existFullCov
Definition: TrkVKalVrtCoreBase.h:186
Trk::VKTrack::restoreCurrentWgt
void restoreCurrentWgt()
Definition: TrkVKalVrtCoreBase.cxx:81
Trk::CascadeEvent::getAccuracyConstraint
double getAccuracyConstraint() const
Definition: TrkVKalVrtCoreBase.h:27
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::TWRK::drdp
double drdp[2][3]
Definition: TrkVKalVrtCoreBase.h:55
Trk::VKVertex::vk_fitterControl
std::unique_ptr< VKalVrtControl > vk_fitterControl
Definition: TrkVKalVrtCoreBase.h:194
Trk::VKVertex::setRefV
void setRefV(double v[3]) noexcept
Definition: TrkVKalVrtCoreBase.cxx:147
Trk::VKTrack::WgtM_save
double WgtM_save[15]
Definition: TrkVKalVrtCoreBase.h:88
Trk::CascadeEvent::nearPrmVertex
int nearPrmVertex
Definition: TrkVKalVrtCoreBase.h:24
vkalNTrkM
#define vkalNTrkM
Definition: CommonPars.h:22
Trk::VKTrack::phi
double phi() const
Definition: TrkVKalVrtCoreBase.h:105
Trk::VKVertex::cnstV
double cnstV[3]
Definition: TrkVKalVrtCoreBase.h:143
Trk::VKVertex::setCnstV
void setCnstV(double v[3]) noexcept
Definition: TrkVKalVrtCoreBase.cxx:151
Trk::CascadeEvent::CascadeEvent
CascadeEvent()
Definition: TrkVKalVrtCoreBase.h:32
Trk::CascadeEvent
Definition: TrkVKalVrtCoreBase.h:21
Trk::VKTrack::r_z
double r_z() const
Definition: TrkVKalVrtCoreBase.h:108
Trk::VKTrack::r_theta
double r_theta() const
Definition: TrkVKalVrtCoreBase.h:109
Trk::VKTrack::setMass
void setMass(double M)
Definition: TrkVKalVrtCoreBase.h:101
Trk::VKVertex::VKVertex
VKVertex()
Definition: TrkVKalVrtCoreBase.cxx:131
Trk::CascadeEvent::cascadeNV
int cascadeNV
Definition: TrkVKalVrtCoreBase.h:23
Trk::VKTrack::refCovar
double refCovar[15]
Definition: TrkVKalVrtCoreBase.h:97
Trk::VKalVrtControl
Definition: TrkVKalVrtCore.h:44
Trk::VKVertex::Chi2
double Chi2
Definition: TrkVKalVrtCoreBase.h:139
Trk::VKVertex::fitCovXYZMom
double fitCovXYZMom[21]
Definition: TrkVKalVrtCoreBase.h:159
Trk::TWRK::wci
double wci[6]
Definition: TrkVKalVrtCoreBase.h:53
Trk::VKVertex::nextCascadeVrt
VKVertex * nextCascadeVrt
Definition: TrkVKalVrtCoreBase.h:179
Trk::VKVertex::wa
double wa[6]
Definition: TrkVKalVrtCoreBase.h:164
Trk::VKVertex::dxyz0
double dxyz0[3]
Definition: TrkVKalVrtCoreBase.h:165
Trk::VKVertex
Definition: TrkVKalVrtCoreBase.h:128
Trk::ForVrtClose
Definition: ForVrtClose.h:21
Trk::VKVertex::iniV
double iniV[3]
Definition: TrkVKalVrtCoreBase.h:142
Trk::VKTrack::iniP
double iniP[3]
Definition: TrkVKalVrtCoreBase.h:83
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
Trk::VKTrack::getMass
double getMass() const
Definition: TrkVKalVrtCoreBase.h:100
Trk::VKVertex::savedVrtMomCov
double savedVrtMomCov[21]
Definition: TrkVKalVrtCoreBase.h:181
python.CaloScaleNoiseConfig.default
default
Definition: CaloScaleNoiseConfig.py:79
Trk::VKTrack::theta
double theta() const
Definition: TrkVKalVrtCoreBase.h:104
Trk::VKTrack::v
double v[5][5]
Definition: TrkVKalVrtCoreBase.h:93
Trk::CascadeEvent::cascadeVertexList
std::vector< std::unique_ptr< VKVertex > > cascadeVertexList
Definition: TrkVKalVrtCoreBase.h:30
Trk::VKVertex::passWithTrkCov
bool passWithTrkCov
Definition: TrkVKalVrtCoreBase.h:157
Trk::TWRK::wbci
double wbci[9]
Definition: TrkVKalVrtCoreBase.h:54
Trk::VKVertex::truncatedStep
bool truncatedStep
Definition: TrkVKalVrtCoreBase.h:185
Trk::v
@ v
Definition: ParamDefs.h:78
Trk::CascadeEvent::~CascadeEvent
~CascadeEvent()=default
Trk::TWRK::wc
double wc[6]
Definition: TrkVKalVrtCoreBase.h:52