BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
KalmanVertexFit Class Reference

#include <KalmanVertexFit.h>

Public Member Functions

 ~KalmanVertexFit ()
 
void init ()
 
void initVertex (const VertexParameter vtx)
 
void addTrack (const HTrackParameter)
 
int filter (const int k)
 
void filter ()
 
void inverse (const int k)
 
void smooth (const int k)
 
void smooth ()
 
void remove (const int k)
 
HepVector pull (const int k)
 
double pullmomentum (const int k)
 
VertexParameter vtx () const
 
HepVector x () const
 
HepSymMatrix Ex () const
 
int numTrack () const
 
int ndof () const
 
double chisq ()
 
int trackID (const int k) const
 
std::vector< int > trackIDList () const
 
double chiF (const int k) const
 
double chiS (const int k) const
 
HTrackParameter hTrack (const int k) const
 
WTrackParameter wTrack (const int k, const double mass) const
 
void setVertexIteration (const int num)
 
void setTrackIteration (const int num)
 
void setChisqCut (const double chicut)
 
void setTrackIterationCut (const double chicut)
 

Static Public Member Functions

static KalmanVertexFitinstance ()
 

Detailed Description

Definition at line 16 of file KalmanVertexFit.h.

Constructor & Destructor Documentation

◆ ~KalmanVertexFit()

KalmanVertexFit::~KalmanVertexFit ( )

Definition at line 25 of file KalmanVertexFit.cxx.

25{;}

Member Function Documentation

◆ addTrack()

void KalmanVertexFit::addTrack ( const HTrackParameter  htrk)

Definition at line 81 of file KalmanVertexFit.cxx.

81 {
82
83 int ifail;
84
85 HepVector p(3, 0);
86 p = htrk.p();
87
88 m_p.push_back(p);
89 m_flag.push_back(0);
90 m_chiF.push_back(999.);
91
92 HepMatrix A(5, 3, 0);
93 HepMatrix B(5, 3, 0);
94 HepSymMatrix G(5, 0);
95
96 G = (htrk.eHel()).inverse(ifail);
97
98 m_hTrkOrigin.push_back(htrk);
99
100 //xum
101 m_hTrkInfit.push_back(htrk);
102 //m_wTrkInfit.push_back(htrk.wTrack());
103
104 m_G.push_back(G);
105 m_A.push_back(A);
106 m_B.push_back(B);
107
108 HepSymMatrix W(3, 0);
109 HepSymMatrix GB(5, 0);
110 HepVector c(5, 0);
111
112 m_W.push_back(W);
113 m_GB.push_back(GB);
114 m_c.push_back(c);
115
116}
HepVector p() const
HepSymMatrix eHel() const
void inverse(const int k)

Referenced by BeamParams::execute(), and PrimaryVertex::execute().

◆ chiF()

double KalmanVertexFit::chiF ( const int  k) const
inline

Definition at line 83 of file KalmanVertexFit.h.

83{return m_chiF[k];} // chi-square of filter for track k

Referenced by BeamParams::execute(), and PrimaryVertex::execute().

◆ chiS()

double KalmanVertexFit::chiS ( const int  k) const

Definition at line 263 of file KalmanVertexFit.cxx.

263 {
264 if(m_flag[k]==1) return 999;
265 int ifail;
266 HepVector x(3, 0);
267 HepVector p(3, 0);
268 HepSymMatrix C(3, 0);
269 C = m_C - m_GB[k].similarity(m_A[k].T());
270 x = C.inverse(ifail)*(m_C*m_x-m_A[k].T() * m_GB[k] *
271 (m_hTrkOrigin[k].hel()-m_c[k]));
272 p = m_W[k]* m_B[k].T()*m_G[k]*
273 (m_hTrkOrigin[k].hel()-m_c[k]-m_A[k]*m_x);
274 HepSymMatrix chis(1, 0);
275 chis = C.similarity((x-m_x).T())+
276 m_G[k].similarity((m_hTrkOrigin[k].hel()-m_c[k]-
277 m_A[k]*m_x-m_B[k]*p).T());
278 return chis[0][0];
279}
***************************************************************************************Pseudo Class RRes *****************************************************************************************Parameters and physical constants **Maarten sept ************************************************************************DOUBLE PRECISION xsmu **************************************************************************PARTICLE DATA all others are from PDG *Only resonances with known widths into electron pairs are sept ************************************************************************C Declarations C
Definition: RRes.h:29
HepVector x() const

Referenced by BeamParams::execute(), PrimaryVertex::execute(), and filter().

◆ chisq()

double KalmanVertexFit::chisq ( )
inline

Definition at line 76 of file KalmanVertexFit.h.

76{return m_chisq;}

Referenced by BeamParams::execute(), PrimaryVertex::execute(), and filter().

◆ Ex()

HepSymMatrix KalmanVertexFit::Ex ( ) const

Definition at line 76 of file KalmanVertexFit.cxx.

76 {
77 int ifail;
78 return m_C.inverse(ifail);
79}

Referenced by PrimaryVertex::execute().

◆ filter() [1/2]

void KalmanVertexFit::filter ( )

Definition at line 221 of file KalmanVertexFit.cxx.

221 {
222
223 for(int iter = 0; iter < m_maxVertexIteration; iter++) {
224 //
225 // at start of each iteration,
226 // the covariance matrix take the initial values: m_C0
227 // the vertex position take the update value by the last iteration
228 //
229 m_C = m_C0; // covariance matrix of verter --> initial values
230 m_chisq = 0; // total chi-square of smooth
231 m_ndof = -3; // number of degrees of freedom
232
233 for(int k = 0; k < m_hTrkOrigin.size(); k++) {
234 if(m_flag[k]==1) continue;
235 if(filter(k)==0) // filter track k
236 m_ndof += 2;
237
238 }
239 //
240 // check the chi-square of smooth, make decision to remove bad tracks
241 // user may remove more bad track by tight chi-square cut
242 // through the following interface
243 // KalmanVertexFit::remove(k)
244 //
245 for(int k = 0; k < m_hTrkOrigin.size(); k++) {
246 if(m_flag[k]==1) continue;
247 double chi2 = chiS(k);
248 if(chi2 < 0) { // remove track k from vertex
249 remove(k);
250 continue;
251 }
252
253 if(chi2 > m_chisqCutforTrack) { // remove track k from vertex
254 remove(k);
255 continue;
256 }
257 m_chisq += chi2;
258
259 }
260 } // end of iteration
261}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
double chiS(const int k) const
void remove(const int k)

Referenced by filter().

◆ filter() [2/2]

int KalmanVertexFit::filter ( const int  k)

Definition at line 135 of file KalmanVertexFit.cxx.

135 {
136 int ifail;
137 double chisq[10];
138 ////////////////////////////////////////////////
139 // start iteration
140 ///////////////////////////////////////////////
141 HepVector pp(3, 0);
142 HepVector xp(3, 0);
143 HepSymMatrix CP(3, 0);
144 xp = m_x;
145 CP = m_C;
146 pp = m_p[k];
147
148 for(int iter = 0; iter < m_maxTrackIteration; iter++) {
149 //
150 // calculate derivative matrices for track k
151 //
152 updateMatrices(k, pp, xp);
153 //
154 // vertex covariance matrix updated
155 //
156 HepSymMatrix CK(3, 0);
157 CK = CP + (m_GB[k].similarity(m_A[k].T()));
158 //
159 // state vector x and p updated
160 //
161 HepVector x(3, 0);
162 HepVector p(3, 0);
163 x = CK.inverse(ifail) * (CP * xp + m_A[k].T() * m_GB[k] *
164 (m_hTrkOrigin[k].hel() - m_c[k]));
165 p = m_W[k] * m_B[k].T() * m_G[k] *(m_hTrkOrigin[k].hel()- m_c[k]-
166 m_A[k]*x);
167 // chi-square of filter
168 HepSymMatrix chif(1, 0);
169 chif = CP.similarity((x-xp).T()) +
170 m_G[k].similarity((m_hTrkOrigin[k].hel()-
171 m_c[k]- m_A[k]*x - m_B[k]*p).T());
172
173 //
174 // save current 3-momentum and vertex for track k
175 //
176 // 3-momentum
177 pp = p;
178 // current vertex and its covaiance matrix
179 xp = x;
180 CP = CK;
181 chisq[iter] = chif[0][0];
182 m_chiF[k] = chif[0][0];
183 // std::cout << "chisq, iter = " <<m_chiF[k] << ", " << iter << ", " << k <<std::endl;
184 if(iter > 0) {
185 double delchi = (chisq[iter]-chisq[iter-1]);
186 if(fabs(delchi) < m_chisqCutforTrackIteration) break;
187 }
188 }
189
190 if(m_chiF[k] > m_chisqCutforTrack) {
191 // do not update vertex if failed
192 m_flag[k]=1;
193 return 1;
194 } else {
195 // update vertex if filter success
196 m_x = xp;
197 m_C = CP;
198 m_p[k] = pp;
199 return 0;
200 }
201}

Referenced by BeamParams::execute(), and PrimaryVertex::execute().

◆ hTrack()

HTrackParameter KalmanVertexFit::hTrack ( const int  k) const

Definition at line 381 of file KalmanVertexFit.cxx.

381 {
382 //add xum
383 //HTrackParameter htrk;
384 //return htrk;
385 return m_hTrkInfit[k];
386}

◆ init()

void KalmanVertexFit::init ( )

Definition at line 29 of file KalmanVertexFit.cxx.

29 {
30 m_x = HepVector(3, 0);
31 m_C0 = HepSymMatrix(3, 0);
32 m_C = HepSymMatrix(3, 0);
33 m_chisq = 0;
34 m_ndof = -3;
35
36 m_flag.clear();
37 m_p.clear();
38 m_hTrkOrigin.clear();
39 m_hTrkInfit.clear(); //xum
40 //m_wTrkInfit.clear();
41
42 m_G.clear();
43 m_A.clear();
44 m_B.clear();
45 m_c.clear();
46 m_W.clear();
47 m_GB.clear();
48 m_chiF.clear();
49
50 //
51 // chi-square cut, number of iteration etc
52 //
53 m_chisqCutforTrack = 50;
54 m_maxVertexIteration = 3;
55 m_maxTrackIteration = 5;
56 m_chisqCutforTrackIteration = 0.1;
57}

Referenced by BeamParams::execute(), and PrimaryVertex::execute().

◆ initVertex()

void KalmanVertexFit::initVertex ( const VertexParameter  vtx)

Definition at line 59 of file KalmanVertexFit.cxx.

59 {
60 int ifail;
61 m_x = vtx.Vx();
62 m_C0 = (vtx.Evx()).inverse(ifail);
63 m_C = m_C0;
64}
VertexParameter vtx() const
HepSymMatrix Evx() const
HepVector Vx() const

Referenced by BeamParams::execute(), and PrimaryVertex::execute().

◆ instance()

KalmanVertexFit * KalmanVertexFit::instance ( )
static

Definition at line 19 of file KalmanVertexFit.cxx.

19 {
20 if(m_pointer) return m_pointer;
21 m_pointer = new KalmanVertexFit();
22 return m_pointer;
23}

Referenced by BeamParams::execute(), and PrimaryVertex::execute().

◆ inverse()

void KalmanVertexFit::inverse ( const int  k)

Definition at line 203 of file KalmanVertexFit.cxx.

203 {
204 //
205 // inverse kalman filter for track k
206 //
207
208 int ifail;
209 HepVector x(3, 0);
210 HepVector p(3, 0);
211 HepSymMatrix C(3, 0);
212 C = m_C - m_GB[k].similarity(m_A[k].T());
213 x = C.inverse(ifail)*(m_C*m_x-m_A[k].T() * m_GB[k] *
214 (m_hTrkOrigin[k].hel()-m_c[k]));
215 //
216 // update vertex position and its covariance matrix
217 //
218 m_x = x;
219 m_C = C;
220}

Referenced by addTrack(), initVertex(), and remove().

◆ ndof()

int KalmanVertexFit::ndof ( ) const
inline

Definition at line 75 of file KalmanVertexFit.h.

75{return m_ndof;}

Referenced by BeamParams::execute(), and PrimaryVertex::execute().

◆ numTrack()

int KalmanVertexFit::numTrack ( ) const

Definition at line 118 of file KalmanVertexFit.cxx.

118 {
119 int num = 0;
120 for(int k = 0; k < m_hTrkOrigin.size(); k++)
121 if(m_flag[k] == 0) num = num +1;
122
123 return num;
124}

Referenced by PrimaryVertex::execute().

◆ pull()

HepVector KalmanVertexFit::pull ( const int  k)

Definition at line 468 of file KalmanVertexFit.cxx.

468 {
469 HepVector n_pull(5, 0);
470 n_pull[0] = n_pull[1] = n_pull[2] = n_pull[3] = n_pull[4] = 999.;
471 if(m_flag[k] == 1) return n_pull;
472 for (int i = 0 ; i < 5; i++) {
473 double cov = m_hTrkOrigin[k].eHel()[i][i] - m_hTrkInfit[k].eHel()[i][i];
474 if (cov == 0.) continue;
475 n_pull[i] = (m_hTrkOrigin[k].hel()[i] - m_hTrkInfit[k].hel()[i]) / sqrt(cov);
476 }
477 return n_pull;
478}

Referenced by BeamParams::execute(), PrimaryVertex::execute(), and pullmomentum().

◆ pullmomentum()

double KalmanVertexFit::pullmomentum ( const int  k)

Definition at line 480 of file KalmanVertexFit.cxx.

480 {
481 double pull = 999.;
482 if(m_flag[k] == 1) return pull;
483
484 double kappa_origin = m_hTrkOrigin[k].kappa();
485 double kappa_infit = m_hTrkInfit[k].kappa();
486 double lamb_origin = m_hTrkOrigin[k].lambda();
487 double lamb_infit = m_hTrkInfit[k].lambda();
488
489 double Vkappa_origin = m_hTrkOrigin[k].eHel()[2][2];
490 double Vkappa_infit = m_hTrkInfit[k].eHel()[2][2];
491 double Vlamb_origin = m_hTrkOrigin[k].eHel()[4][4];
492 double Vlamb_infit = m_hTrkInfit[k].eHel()[4][4];
493 double V_kappa_lamb_origin = m_hTrkOrigin[k].eHel()[4][2];
494 double V_kappa_lamb_infit = m_hTrkInfit[k].eHel()[4][2];
495
496 double P_origin = calculationP(kappa_origin, lamb_origin);
497 //cout << "P_origin = " << P_origin << endl;
498 //P_origin = m_hTrkOrigin[k].p()[0] * m_hTrkOrigin[k].p()[0]
499 // + m_hTrkOrigin[k].p()[1] * m_hTrkOrigin[k].p()[1]
500 // + m_hTrkOrigin[k].p()[2] * m_hTrkOrigin[k].p()[2];
501 //cout << "P = " << P_origin << endl;
502 double P_infit = calculationP(kappa_infit, lamb_infit);
503
504 double SigmaP_origin = calculationSigmaP(kappa_origin, lamb_origin, Vkappa_origin,
505 Vlamb_origin, V_kappa_lamb_origin);
506 double SigmaP_infit = calculationSigmaP(kappa_infit, lamb_infit, Vkappa_infit,
507 Vlamb_infit, V_kappa_lamb_infit);
508 if ((SigmaP_origin - SigmaP_infit) <= 0.) return pull;
509 pull = (P_origin - P_infit) / sqrt (SigmaP_origin - SigmaP_infit);
510
511 return pull;
512}
HepVector pull(const int k)

Referenced by BeamParams::execute(), and PrimaryVertex::execute().

◆ remove()

void KalmanVertexFit::remove ( const int  k)

Definition at line 355 of file KalmanVertexFit.cxx.

355 {
356 //
357 // remove track k from the vertex fit
358 //
359 /*
360 m_hTrkOrigin.erase(m_hTrkOrigin.begin()+k);
361 m_p.erase(m_p.begin()+k);
362 m_flag.erase(m_flag.begin()+k);
363 m_A.erase(m_A.begin()+k);
364 m_B.erase(m_B.begin()+k);
365 m_c.erase(m_c.begin()+k);
366 m_G.erase(m_G.begin()+k);
367 m_GB.erase(m_GB.begin()+k);
368 m_W.erase(m_W.begin()+k);
369 m_chiF.erase(m_chiF.begin()+k);
370 */
371
372 if(m_flag[k]==1) return; // track k already removed
373 inverse(k);
374 m_ndof -= 2;
375 m_flag[k]=1;
376 //xum
377 //m_chisq -=chiS(k);
378}

Referenced by BeamParams::execute(), PrimaryVertex::execute(), and filter().

◆ setChisqCut()

void KalmanVertexFit::setChisqCut ( const double  chicut)
inline

Definition at line 97 of file KalmanVertexFit.h.

97{m_chisqCutforTrack = chicut;}

Referenced by BeamParams::execute(), and PrimaryVertex::execute().

◆ setTrackIteration()

void KalmanVertexFit::setTrackIteration ( const int  num)
inline

Definition at line 96 of file KalmanVertexFit.h.

96{m_maxTrackIteration = num;}

Referenced by BeamParams::execute(), and PrimaryVertex::execute().

◆ setTrackIterationCut()

void KalmanVertexFit::setTrackIterationCut ( const double  chicut)
inline

Definition at line 98 of file KalmanVertexFit.h.

98{m_chisqCutforTrackIteration = chicut;} //xum

Referenced by BeamParams::execute(), and PrimaryVertex::execute().

◆ setVertexIteration()

void KalmanVertexFit::setVertexIteration ( const int  num)
inline

Definition at line 95 of file KalmanVertexFit.h.

95{m_maxVertexIteration = num;}

Referenced by BeamParams::execute(), and PrimaryVertex::execute().

◆ smooth() [1/2]

void KalmanVertexFit::smooth ( )

◆ smooth() [2/2]

void KalmanVertexFit::smooth ( const int  k)

Definition at line 281 of file KalmanVertexFit.cxx.

281 {
282 // xum
283 //
284 // update htrk and wtrk parameters
285 //
286 if(m_flag[k] == 1) return;
287 int ifail;
288
289 HepVector pp(3, 0);
290 HepVector xp(3, 0);
291 HepSymMatrix CP(3, 0);
292 xp = m_x;
293 CP = m_C;
294 pp = m_p[k];
295
296 updateMatrices(k, pp, xp);
297 pp = m_W[k] * m_B[k].T() * m_G[k] * (m_hTrkOrigin[k].hel() - m_c[k] - m_A[k] * xp);
298
299 updateMatrices(k, pp, xp);
300 //for htrk
301 HepVector helix(5, 0);
302 helix = m_c[k] + m_A[k] * xp + m_B[k] * pp;
303 HepMatrix E(3, 3, 0);
304 E = -CP.inverse(ifail) * m_A[k].T() * m_G[k] * m_B[k] * m_W[k];
305 HepSymMatrix D(3, 0);
306 D = m_W[k] + CP.similarity(E.T());
307
308 HepMatrix middle(5, 5, 0);
309 HepSymMatrix error(5, 0);
310 middle = (CP.inverse(ifail)).similarity(m_A[k]) + m_A[k] * E * m_B[k].T() +
311 (m_A[k] * E * m_B[k].T()).T() + D.similarity(m_B[k]);
312 error.assign(middle);
313
314 m_hTrkInfit[k].setHel(helix);
315 m_hTrkInfit[k].setEHel(error);
316
317 m_p[k] = pp;
318/*
319 //for wtrk
320 double mass = m_hTrkOrigin[k].xmass(m_hTrkOrigin[k].partID());
321 double Energy = sqrt(pp[0]*pp[0] + pp[1]*pp[1] + pp[2]*pp[2] + mass * mass);
322
323 HepMatrix Awtrk(7, 3, 0), Bwtrk(7, 3, 0);
324 Awtrk[4][0] = Awtrk[5][1] = Awtrk[6][2] = 1;
325 Bwtrk[0][0] = Bwtrk[1][1] = Bwtrk[2][2] = 1;
326 Bwtrk[3][0] = pp[0] / Energy;
327 Bwtrk[3][1] = pp[1] / Energy;
328 Bwtrk[3][2] = pp[2] / Energy;
329
330 HepVector w(7, 0);
331 HepSymMatrix Ew(7, 0);
332 w[0] = pp[0]; w[1] = pp[1]; w[2] = pp[2]; w[3] = Energy;
333 w[4] = xp[0]; w[5] = xp[1]; w[6] = xp[2];
334
335 HepSymMatrix Gwtrk(7, 0);
336 Gwtrk = m_hTrkOrigin[k].wTrack().Ew().inverse(ifail);
337 HepSymMatrix Wwtrk(3, 0);
338 Wwtrk = Gwtrk.similarity(Bwtrk.T()).inverse(ifail);
339
340 HepMatrix Ewtrk(3, 3, 0);
341 Ewtrk = -CP.inverse(ifail) * m_Awtrk[k].T() * m_Gwtrk[k] * m_Bwtrk[k] * m_Wwtrk[k];
342 HepSymMatrix Dwtrk(3, 0);
343 Dwtrk = m_Wwtrk[k] + CP.similarity(Ewtrk.T());
344
345 HepMatrix Ewmiddle(7, 7, 0);
346 Ewmiddle = (CP.inverse(ifail)).similarity(m_Awtrk[k]) + m_Awtrk[k] * Ewtrk * m_Bwtrk[k].T() +
347 (m_Awtrk[k] * Ewtrk * m_Bwtrk[k].T()).T() + Dwtrk.similarity(m_Bwtrk[k]);
348 Ew.assign(Ewmiddle);
349
350 m_wTrkInfit[k].setCharge(m_hTrkOrigin[k].charge());
351 m_wTrkInfit[k].setW(w);
352 m_wTrkInfit[k].setEw(Ew);*/
353}
@ error
Definition: Core.h:24

Referenced by BeamParams::execute(), and PrimaryVertex::execute().

◆ trackID()

int KalmanVertexFit::trackID ( const int  k) const
inline

Definition at line 77 of file KalmanVertexFit.h.

77{return m_hTrkOrigin[k].trackID();}

Referenced by trackIDList().

◆ trackIDList()

std::vector< int > KalmanVertexFit::trackIDList ( ) const

Definition at line 126 of file KalmanVertexFit.cxx.

126 {
127 std::vector<int> trackid;
128 for(int k = 0; k < m_hTrkOrigin.size(); k++)
129 if(m_flag[k] == 0) trackid.push_back(trackID(k));
130
131 return trackid;
132}
int trackID(const int k) const

Referenced by PrimaryVertex::execute().

◆ vtx()

VertexParameter KalmanVertexFit::vtx ( ) const

Definition at line 66 of file KalmanVertexFit.cxx.

66 {
67 int ifail;
69 v.setVx(m_x);
70
71 std::vector<int> trackid;
72 v.setEvx(m_C.inverse(ifail));
73 return v;
74}
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition: KarLud.h:35

Referenced by initVertex().

◆ wTrack()

WTrackParameter KalmanVertexFit::wTrack ( const int  k,
const double  mass 
) const

Definition at line 388 of file KalmanVertexFit.cxx.

388 {
389 if(m_flag[k] == 1) return m_hTrkOrigin[k].wTrack();
390 int ifail;
391
392 HepVector pp(3, 0);
393 HepVector xp(3, 0);
394 HepSymMatrix CP(3, 0);
395 xp = m_x;
396 CP = m_C;
397 pp = m_p[k];
398
399 WTrackParameter wtrk;
400 double Energy = sqrt(pp[0]*pp[0] + pp[1]*pp[1] + pp[2]*pp[2] + mass * mass);
401
402 HepMatrix Awtrk(7, 3, 0), Bwtrk(7, 3, 0);
403 Awtrk[4][0] = Awtrk[5][1] = Awtrk[6][2] = 1;
404 Bwtrk[0][0] = Bwtrk[1][1] = Bwtrk[2][2] = 1;
405 Bwtrk[3][0] = pp[0] / Energy;
406 Bwtrk[3][1] = pp[1] / Energy;
407 Bwtrk[3][2] = pp[2] / Energy;
408
409 HepVector w(7, 0);
410 HepSymMatrix Ew(7, 0);
411 w[0] = pp[0]; w[1] = pp[1]; w[2] = pp[2]; w[3] = Energy;
412 w[4] = xp[0]; w[5] = xp[1]; w[6] = xp[2];
413
414 HepSymMatrix Gwtrk(7, 0);
415 Gwtrk = m_hTrkOrigin[k].wTrack().Ew().inverse(ifail);
416 HepSymMatrix Wwtrk(3, 0);
417 Wwtrk = Gwtrk.similarity(Bwtrk.T()).inverse(ifail);
418
419 HepMatrix Ewtrk(3, 3, 0);
420 Ewtrk = -CP.inverse(ifail) * Awtrk.T() * Gwtrk * Bwtrk * Wwtrk;
421 HepSymMatrix Dwtrk(3, 0);
422 Dwtrk = Wwtrk + CP.similarity(Ewtrk.T());
423
424 HepMatrix Ewmiddle(7, 7, 0);
425 Ewmiddle = (CP.inverse(ifail)).similarity(Awtrk) + Awtrk * Ewtrk * Bwtrk.T() +
426 (Awtrk * Ewtrk * Bwtrk.T()).T() + Dwtrk.similarity(Bwtrk);
427 Ew.assign(Ewmiddle);
428
429 wtrk.setCharge(m_hTrkOrigin[k].charge());
430 wtrk.setW(w);
431 wtrk.setEw(Ew);
432
433 return wtrk;
434}
double mass
double w
void setEw(const HepSymMatrix &Ew)
void setCharge(const int charge)
void setW(const HepVector &w)
float charge

◆ x()

HepVector KalmanVertexFit::x ( ) const
inline

Definition at line 68 of file KalmanVertexFit.h.

68{return m_x;}

Referenced by chiS(), BeamParams::execute(), PrimaryVertex::execute(), filter(), and inverse().


The documentation for this class was generated from the following files: