CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TKinFitter.cc
Go to the documentation of this file.
1 // Classname: TKinFitter
2 // Author: Jan E. Sundermann, Verena Klose (TU Dresden)
3 
4 //________________________________________________________________
5 //
6 // TKinFitter::
7 // --------------------
8 //
9 // Class to perform kinematic fit with non-linear constraints
10 //
11 
12 #include <iostream>
13 #include <iomanip>
18 
20  : TNamed("UnNamed", "UnTitled"),
21  _A(1, 1),
22  _AT(1, 1),
23  _B(1, 1),
24  _BT(1, 1),
25  _V(1, 1),
26  _Vinv(1, 1),
27  _VB(1, 1),
28  _VBinv(1, 1),
29  _VA(1, 1),
30  _VAinv(1, 1),
31  _c(1, 1),
32  _C11(1, 1),
33  _C11T(1, 1),
34  _C21(1, 1),
35  _C21T(1, 1),
36  _C22(1, 1),
37  _C22T(1, 1),
38  _C31(1, 1),
39  _C31T(1, 1),
40  _C32(1, 1),
41  _C32T(1, 1),
42  _C33(1, 1),
43  _C33T(1, 1),
44  _deltaA(1, 1),
45  _deltaY(1, 1),
46  _deltaAstar(1, 1),
47  _deltaYstar(1, 1),
48  _lambda(1, 1),
49  _lambdaT(1, 1),
50  _lambdaVFit(1, 1),
51  _yaVFit(1, 1),
52  _constraints(0),
53  _measParticles(0),
54  _unmeasParticles(0) {
55  reset();
56 }
57 
58 TKinFitter::TKinFitter(const TString& name, const TString& title)
59  : TNamed(name, title),
60  _A(1, 1),
61  _AT(1, 1),
62  _B(1, 1),
63  _BT(1, 1),
64  _V(1, 1),
65  _Vinv(1, 1),
66  _VB(1, 1),
67  _VBinv(1, 1),
68  _VA(1, 1),
69  _VAinv(1, 1),
70  _c(1, 1),
71  _C11(1, 1),
72  _C11T(1, 1),
73  _C21(1, 1),
74  _C21T(1, 1),
75  _C22(1, 1),
76  _C22T(1, 1),
77  _C31(1, 1),
78  _C31T(1, 1),
79  _C32(1, 1),
80  _C32T(1, 1),
81  _C33(1, 1),
82  _C33T(1, 1),
83  _deltaA(1, 1),
84  _deltaY(1, 1),
85  _deltaAstar(1, 1),
86  _deltaYstar(1, 1),
87  _lambda(1, 1),
88  _lambdaT(1, 1),
89  _lambdaVFit(1, 1),
90  _yaVFit(1, 1),
91  _constraints(0),
92  _measParticles(0),
93  _unmeasParticles(0) {
94  reset();
95 }
96 
98  // reset all internal parameters of the fitter
99 
100  _status = -1;
101  _nbIter = 0;
102  _nParA = 0;
103  _nParB = 0;
104  _verbosity = 1;
105  _A.ResizeTo(1, 1);
106  _AT.ResizeTo(1, 1);
107  _B.ResizeTo(1, 1);
108  _BT.ResizeTo(1, 1);
109  _V.ResizeTo(1, 1);
110  _Vinv.ResizeTo(1, 1);
111  _VB.ResizeTo(1, 1);
112  _VBinv.ResizeTo(1, 1);
113  _VA.ResizeTo(1, 1);
114  _VAinv.ResizeTo(1, 1);
115  _c.ResizeTo(1, 1);
116  _C11.ResizeTo(1, 1);
117  _C11T.ResizeTo(1, 1);
118  _C21.ResizeTo(1, 1);
119  _C21T.ResizeTo(1, 1);
120  _C22.ResizeTo(1, 1);
121  _C22T.ResizeTo(1, 1);
122  _C31.ResizeTo(1, 1);
123  _C31T.ResizeTo(1, 1);
124  _C32.ResizeTo(1, 1);
125  _C32T.ResizeTo(1, 1);
126  _C33.ResizeTo(1, 1);
127  _C33T.ResizeTo(1, 1);
128  _deltaA.ResizeTo(1, 1);
129  _deltaY.ResizeTo(1, 1);
130  _deltaAstar.ResizeTo(1, 1);
131  _deltaYstar.ResizeTo(1, 1);
132  _lambda.ResizeTo(1, 1);
133  _lambdaT.ResizeTo(1, 1);
134  _lambdaVFit.ResizeTo(1, 1);
135  _yaVFit.ResizeTo(1, 1);
136 
137  _constraints.clear();
138  _measParticles.clear();
139  _unmeasParticles.clear();
140 
141  // Set to default values
142  _maxNbIter = 50;
143  _maxDeltaS = 5e-3;
144  _maxF = 1e-4;
145 }
146 
148  // reset status of the fit
149 
150  _status = -1;
151  _nbIter = 0;
152 }
153 
155  // reset all particles to their initial parameters
156 
157  for (unsigned int iP = 0; iP < _measParticles.size(); iP++) {
158  TAbsFitParticle* particle = _measParticles[iP];
159  particle->reset();
160  }
161  for (unsigned int iP = 0; iP < _unmeasParticles.size(); iP++) {
162  TAbsFitParticle* particle = _unmeasParticles[iP];
163  particle->reset();
164  }
165  for (unsigned int iC = 0; iC < _constraints.size(); iC++) {
167  constraint->reset();
168  }
169 }
170 
172 
174  // count number of measured parameters
175 
176  _nParB = 0;
177  for (unsigned int indexParticle = 0; indexParticle < _measParticles.size(); indexParticle++) {
178  _nParB += _measParticles[indexParticle]->getNPar();
179  }
180  for (unsigned int indexConstraint = 0; indexConstraint < _constraints.size(); indexConstraint++) {
181  _nParB += _constraints[indexConstraint]->getNPar();
182  }
183 }
184 
186  // count number of unmeasured parameters
187 
188  _nParA = 0;
189  for (unsigned int indexParticle = 0; indexParticle < _unmeasParticles.size(); indexParticle++) {
190  _nParA += _unmeasParticles[indexParticle]->getNPar();
191  }
192 }
193 
195  // add one measured particle
196 
197  resetStatus();
198 
199  if (particle != nullptr) {
200  _measParticles.push_back(particle);
201  } else {
202  edm::LogError("NullPointer") << "Measured particle points to NULL. It will not be added to the KinFitter.";
203  }
204 
205  countMeasParams();
206 }
207 
210  TAbsFitParticle* p3,
211  TAbsFitParticle* p4,
212  TAbsFitParticle* p5,
213  TAbsFitParticle* p6,
214  TAbsFitParticle* p7,
215  TAbsFitParticle* p8,
216  TAbsFitParticle* p9) {
217  // add many measured particles
218 
219  resetStatus();
220 
221  if (p1 != nullptr)
222  _measParticles.push_back(p1);
223  if (p2 != nullptr)
224  _measParticles.push_back(p2);
225  if (p3 != nullptr)
226  _measParticles.push_back(p3);
227  if (p4 != nullptr)
228  _measParticles.push_back(p4);
229  if (p5 != nullptr)
230  _measParticles.push_back(p5);
231  if (p6 != nullptr)
232  _measParticles.push_back(p6);
233  if (p7 != nullptr)
234  _measParticles.push_back(p7);
235  if (p8 != nullptr)
236  _measParticles.push_back(p8);
237  if (p9 != nullptr)
238  _measParticles.push_back(p9);
239 
240  countMeasParams();
241 }
242 
244  // add one unmeasured particle
245 
246  resetStatus();
247 
248  if (particle != nullptr) {
249  _unmeasParticles.push_back(particle);
250  } else {
251  edm::LogError("NullPointer") << "Unmeasured particle points to NULL. It will not be added to the KinFitter.";
252  }
253 
255 }
256 
259  TAbsFitParticle* p3,
260  TAbsFitParticle* p4,
261  TAbsFitParticle* p5,
262  TAbsFitParticle* p6,
263  TAbsFitParticle* p7,
264  TAbsFitParticle* p8,
265  TAbsFitParticle* p9) {
266  // add many unmeasured particles
267 
268  resetStatus();
269 
270  if (p1 != nullptr)
271  _unmeasParticles.push_back(p1);
272  if (p2 != nullptr)
273  _unmeasParticles.push_back(p2);
274  if (p3 != nullptr)
275  _unmeasParticles.push_back(p3);
276  if (p4 != nullptr)
277  _unmeasParticles.push_back(p4);
278  if (p5 != nullptr)
279  _unmeasParticles.push_back(p5);
280  if (p6 != nullptr)
281  _unmeasParticles.push_back(p6);
282  if (p7 != nullptr)
283  _unmeasParticles.push_back(p7);
284  if (p8 != nullptr)
285  _unmeasParticles.push_back(p8);
286  if (p9 != nullptr)
287  _unmeasParticles.push_back(p9);
288 
290 }
291 
293  // add a constraint
294 
295  resetStatus();
296 
297  if (constraint != nullptr) {
298  _constraints.push_back(constraint);
299  }
300 
301  countMeasParams();
302 }
303 
305  // Set verbosity of the fitter:
306  // 0: quiet
307  // 1: print information before and after the fit
308  // 2: print output for every iteration of the fit
309  // 3: print debug information
310 
311  if (verbosity < 0)
312  verbosity = 0;
313  if (verbosity > 3)
314  verbosity = 3;
316 }
317 
319  // Perform the fit
320  // Returns:
321  // 0: converged
322  // 1: not converged
323 
324  resetParams();
325  resetStatus();
326 
327  _nbIter = 0;
328  Bool_t isConverged = false;
329  Double_t prevF;
330  Double_t currF = getF();
331  Double_t prevS;
332  Double_t currS = 0.;
333 
334  // Calculate covariance matrix V
335  calcV();
336 
337  // print status
338  if (_verbosity >= 1) {
339  print();
340  }
341 
342  do {
343  // Reset status to "RUNNING"
344  // (if it was not aborted already due to singular covariance matrix)
345  if (_status != -10) {
346  _status = 10;
347  }
348 
349  // Calculate matrices
350  calcB();
351  calcVB();
352  if (_nParA > 0) {
353  calcA();
354  calcVA();
355  calcC32();
356  }
357  calcC31();
358  calcC33();
359  calcC();
360 
361  // Calculate corretion for a, y, and lambda
362  if (_nParA > 0) {
363  calcDeltaA();
364  }
365  calcDeltaY();
366  calcLambda();
367 
368  if (_verbosity >= 3) {
369  printMatrix(_A, "A");
370  printMatrix(_B, "B");
371  printMatrix(_VBinv, "VBinv");
372  printMatrix(_VB, "VB");
373  printMatrix(_V, "V");
374  printMatrix(_deltaY, "deltaY");
375  printMatrix(_deltaA, "deltaA");
376  printMatrix(_C32T, "C32T");
377  printMatrix(_c, "C");
378  }
379 
380  if (_verbosity >= 2) {
381  print();
382  }
383 
384  // Apply calculated corrections to measured and unmeasured particles
385  if (_nParA > 0) {
386  applyDeltaA();
387  }
388  applyDeltaY();
389 
390  _nbIter++;
391 
392  //calculate F and S
393  prevF = currF;
394  currF = getF();
395  prevS = currS;
396  currS = getS();
397 
398  if (TMath::IsNaN(currF)) {
399  edm::LogInfo("KinFitter") << "The current value of F is NaN. Fit will be aborted.";
400  _status = -10;
401  }
402  if (TMath::IsNaN(currS)) {
403  edm::LogInfo("KinFitter") << "The current value of S is NaN. Fit will be aborted.";
404  _status = -10;
405  }
406 
407  // Reduce step width if F is not getting smaller
408  Int_t nstep = 0;
409  while (currF >= prevF) {
410  nstep++;
411  if (nstep == 10)
412  break;
413  if (_nParA > 0)
414  _deltaA -= (0.5) * (_deltaA - _deltaAstar);
415  _deltaY -= (0.5) * (_deltaY - _deltaYstar);
416  _lambda *= 0.5;
417  _lambdaT *= 0.5;
418  if (_nParA > 0)
419  applyDeltaA();
420  applyDeltaY();
421  currF = getF();
422  currS = getS();
423  }
424 
425  // Test convergence
426  isConverged = converged(currF, prevS, currS);
427 
428  } while ((!isConverged) && (_nbIter < _maxNbIter) && (_status != -10));
429 
430  // Calculate covariance matrices
431  calcB();
432  calcVB();
433 
434  if (_nParA > 0) {
435  calcA();
436  calcVA();
437  calcC21();
438  calcC22();
439  calcC32();
440  }
441  calcC11();
442  calcC31();
443  calcC33();
444  calcVFit();
445  applyVFit();
446 
447  // Set status information
448  if (isConverged) {
449  _status = 0;
450  } else if (_status != -10) {
451  _status = 1;
452  }
453 
454  // print status
455  if (_verbosity >= 1) {
456  print();
457  }
458 
459  return _status;
460 }
461 
462 void TKinFitter::setCovMatrix(TMatrixD& V) {
463  // Set the covariance matrix of the measured particles
464 
465  if ((V.GetNrows() != _nParB) || (V.GetNcols() != _nParB)) {
466  edm::LogError("WrongMatrixSize") << "Covariance matrix of measured particles needs to be a " << _nParB << "x"
467  << _nParB << " matrix.";
468  } else {
469  _V.ResizeTo(V);
470  _V = V;
471  }
472 }
473 
475  // Combines the covariance matrices of all measured particles
476 
477  _V.ResizeTo(_nParB, _nParB);
478  _V.Zero();
479 
480  Int_t offsetP = 0;
481  for (unsigned int iP = 0; iP < _measParticles.size(); iP++) {
482  TAbsFitParticle* particle = _measParticles[iP];
483  Int_t nParP = particle->getNPar();
484  const TMatrixD* covMatrix = particle->getCovMatrix();
485 
486  for (int iX = offsetP; iX < offsetP + nParP; iX++) {
487  for (int iY = offsetP; iY < offsetP + nParP; iY++) {
488  _V(iX, iY) = (*covMatrix)(iX - offsetP, iY - offsetP);
489  }
490  }
491 
492  offsetP += nParP;
493  }
494 
495  for (unsigned int iC = 0; iC < _constraints.size(); iC++) {
497  Int_t nParP = constraint->getNPar();
498  const TMatrixD* covMatrix = constraint->getCovMatrix();
499 
500  for (int iX = offsetP; iX < offsetP + nParP; iX++) {
501  for (int iY = offsetP; iY < offsetP + nParP; iY++) {
502  _V(iX, iY) = (*covMatrix)(iX - offsetP, iY - offsetP);
503  }
504  }
505 
506  offsetP += nParP;
507  }
508 
509  _Vinv.ResizeTo(_V);
510  _Vinv = _V;
511  try {
512  _Vinv.Invert();
513  } catch (cms::Exception& e) {
514  edm::LogInfo("KinFitter") << "Failed to invert covariance matrix V. Fit will be aborted.";
515  _status = -10;
516  }
517 
518  return true;
519 }
520 
522  // Calculate the Jacobi matrix of unmeasured parameters df_i/da_i
523  // Row i contains the derivatives of constraint f_i. Column q contains
524  // the derivative wrt. a_q.
525 
526  _A.ResizeTo(_constraints.size(), _nParA);
527 
528  for (unsigned int indexConstr = 0; indexConstr < _constraints.size(); indexConstr++) {
529  int offsetParam = 0;
530  for (unsigned int indexParticle = 0; indexParticle < _unmeasParticles.size(); indexParticle++) {
531  // Calculate matrix product df/dP * dP/dy = (df/dr, df/dtheta, df/dphi, ...)
532 
533  TAbsFitParticle* particle = _unmeasParticles[indexParticle];
534  TMatrixD* derivParticle = particle->getDerivative();
535  TMatrixD* derivConstr = _constraints[indexConstr]->getDerivative(particle);
536  TMatrixD deriv(*derivConstr, TMatrixD::kMult, *derivParticle);
537 
538  for (int indexParam = 0; indexParam < deriv.GetNcols(); indexParam++) {
539  _A(indexConstr, indexParam + offsetParam) = deriv(0, indexParam);
540  }
541  offsetParam += deriv.GetNcols();
542 
543  delete derivParticle;
544  delete derivConstr;
545  }
546  }
547 
548  // Calculate transposed matrix
549  TMatrixD AT(TMatrixD::kTransposed, _A);
550  _AT.ResizeTo(AT);
551  _AT = AT;
552 
553  return true;
554 }
555 
557  // Calculate the Jacobi matrix of measured parameters df_i/da_i
558  // Row i contains the derivatives of constraint f_i. Column q contains
559  // the derivative wrt. a_q.
560 
561  _B.ResizeTo(_constraints.size(), _nParB);
562 
563  int offsetParam = 0;
564  for (unsigned int indexConstr = 0; indexConstr < _constraints.size(); indexConstr++) {
565  offsetParam = 0;
566  for (unsigned int indexParticle = 0; indexParticle < _measParticles.size(); indexParticle++) {
567  // Calculate matrix product df/dP * dP/dy = (df/dr, df/dtheta, df/dphi, ...)
568  TAbsFitParticle* particle = _measParticles[indexParticle];
569  TMatrixD* derivParticle = particle->getDerivative();
570  TMatrixD* derivConstr = _constraints[indexConstr]->getDerivative(particle);
571  TMatrixD deriv(*derivConstr, TMatrixD::kMult, *derivParticle);
572  if (_verbosity >= 3) {
573  TString matrixName = "B deriv: Particle -> ";
574  matrixName += particle->GetName();
575  printMatrix(*derivParticle, matrixName);
576  matrixName = "B deriv: Constraint -> ";
577  matrixName += _constraints[indexConstr]->GetName();
578  matrixName += " , Particle -> ";
579  matrixName += particle->GetName();
580  printMatrix(*derivConstr, matrixName);
581  }
582  for (int indexParam = 0; indexParam < deriv.GetNcols(); indexParam++) {
583  _B(indexConstr, indexParam + offsetParam) = deriv(0, indexParam);
584  }
585  offsetParam += deriv.GetNcols();
586 
587  delete derivParticle;
588  delete derivConstr;
589  }
590  }
591 
592  for (unsigned int iC = 0; iC < _constraints.size(); iC++) {
594  TMatrixD* deriv = constraint->getDerivativeAlpha();
595 
596  if (deriv != nullptr) {
597  if (_verbosity >= 3) {
598  TString matrixName = "B deriv alpha: Constraint -> ";
599  matrixName += constraint->GetName();
600  printMatrix(*deriv, matrixName);
601  }
602  for (int indexParam = 0; indexParam < deriv->GetNcols(); indexParam++) {
603  _B(iC, indexParam + offsetParam) = (*deriv)(0, indexParam);
604  }
605  offsetParam += deriv->GetNcols();
606 
607  delete deriv;
608  }
609  }
610 
611  TMatrixD BT(TMatrixD::kTransposed, _B);
612  _BT.ResizeTo(BT);
613  _BT = BT;
614 
615  return true;
616 }
617 
619  // Calculate the matrix V_B = (B*V*B^T)^-1
620 
621  TMatrixD BV(_B, TMatrixD::kMult, _V);
622  TMatrixD VBinv(BV, TMatrixD::kMult, _BT);
623  _VBinv.ResizeTo(VBinv);
624  _VBinv = VBinv;
625 
626  _VB.ResizeTo(_VBinv);
627  _VB = _VBinv;
628  try {
629  _VB.Invert();
630  } catch (cms::Exception& e) {
631  edm::LogInfo("KinFitter") << "Failed to invert matrix VB. Fit will be aborted.";
632  _status = -10;
633  }
634 
635  return true;
636 }
637 
639  // Calculate the matrix VA = (A^T*VB*A)
640 
641  TMatrixD ATVB(_AT, TMatrixD::kMult, _VB);
642  TMatrixD VA(ATVB, TMatrixD::kMult, _A);
643  _VA.ResizeTo(VA);
644  _VA = VA;
645 
646  _VAinv.ResizeTo(_VA);
647  _VAinv = _VA;
648  try {
649  _VAinv.Invert();
650  } catch (cms::Exception& e) {
651  edm::LogInfo("KinFitter") << "Failed to invert matrix VA. Fit will be aborted.";
652  _status = -10;
653  }
654 
655  return true;
656 }
657 
659  // Calculate the matrix C11 = V^(-1) - V^(-1)*BT*VB*B*V^(-1) + V^(-1)*BT*VB*A*VA^(-1)*AT*VB*B*V^(-1)
660 
661  TMatrixD VBT(_V, TMatrixD::kMult, _BT);
662  TMatrixD VBB(_VB, TMatrixD::kMult, _B);
663  TMatrixD VBTVBB(VBT, TMatrixD::kMult, VBB);
664  TMatrixD m2(VBTVBB, TMatrixD::kMult, _V);
665 
666  _C11.ResizeTo(_V);
667  _C11 = _V;
668  _C11 -= m2;
669 
670  if (_nParA > 0) {
671  TMatrixD VBA(_VB, TMatrixD::kMult, _A);
672  TMatrixD VBTVBA(VBT, TMatrixD::kMult, VBA);
673  TMatrixD VAinvAT(_VAinv, TMatrixD::kMult, _AT);
674  TMatrixD VBTVBAVAinvAT(VBTVBA, TMatrixD::kMult, VAinvAT);
675  TMatrixD VBTVBAVAinvATVBB(VBTVBAVAinvAT, TMatrixD::kMult, VBB);
676  TMatrixD m3(VBTVBAVAinvATVBB, TMatrixD::kMult, _V);
677  _C11 += m3;
678  }
679 
680  TMatrixD C11T(TMatrixD::kTransposed, _C11);
681  _C11T.ResizeTo(C11T);
682  _C11T = C11T;
683 
684  return true;
685 }
686 
688  // Calculate the matrix C21 = -VA^(-1)*AT*VB*B*V^(-1)
689 
690  TMatrixD VAinvAT(_VAinv, TMatrixD::kMult, _AT);
691  TMatrixD VBB(_VB, TMatrixD::kMult, _B);
692  TMatrixD VAinvATVBB(VAinvAT, TMatrixD::kMult, VBB);
693  TMatrixD C21(VAinvATVBB, TMatrixD::kMult, _V);
694  C21 *= -1.;
695  _C21.ResizeTo(C21);
696  _C21 = C21;
697 
698  TMatrixD C21T(TMatrixD::kTransposed, _C21);
699  _C21T.ResizeTo(C21T);
700  _C21T = C21T;
701 
702  return true;
703 }
704 
706  // Calculate the matrix C22 = VA^(-1)
707 
708  _C22.ResizeTo(_VAinv);
709  _C22 = _VAinv;
710 
711  TMatrixD C22T(TMatrixD::kTransposed, _C22);
712  _C22T.ResizeTo(C22T);
713  _C22T = C22T;
714 
715  return true;
716 }
717 
719  // Calculate the matrix C31 = VB*B*V^(-1) - VB*A*VA^(-1)*AT*VB*B*V^(-1)
720 
721  TMatrixD VbB(_VB, TMatrixD::kMult, _B);
722  TMatrixD m1(VbB, TMatrixD::kMult, _V);
723 
724  _C31.ResizeTo(m1);
725  _C31 = m1;
726 
727  if (_nParA > 0) {
728  TMatrixD VbA(_VB, TMatrixD::kMult, _A);
729  TMatrixD VAinvAT(_VAinv, TMatrixD::kMult, _AT);
730  TMatrixD VbBV(VbB, TMatrixD::kMult, _V);
731  TMatrixD VbAVAinvAT(VbA, TMatrixD::kMult, VAinvAT);
732  TMatrixD m2(VbAVAinvAT, TMatrixD::kMult, VbBV);
733 
734  _C31 -= m2;
735  }
736 
737  TMatrixD C31T(TMatrixD::kTransposed, _C31);
738  _C31T.ResizeTo(C31T);
739  _C31T = C31T;
740 
741  return true;
742 }
743 
745  // Calculate the matrix C32 = VB*A*VA^(-1)
746 
747  TMatrixD VbA(_VB, TMatrixD::kMult, _A);
748  TMatrixD C32(VbA, TMatrixD::kMult, _VAinv);
749  _C32.ResizeTo(C32);
750  _C32 = C32;
751 
752  TMatrixD C32T(TMatrixD::kTransposed, _C32);
753  _C32T.ResizeTo(C32T);
754  _C32T = C32T;
755 
756  return true;
757 }
758 
760  // Calculate the matrix C33 = -VB + VB*A*VA^(-1)*AT*VB
761 
762  _C33.ResizeTo(_VB);
763  _C33 = _VB;
764  _C33 *= -1.;
765 
766  if (_nParA > 0) {
767  TMatrixD VbA(_VB, TMatrixD::kMult, _A);
768  TMatrixD VAinvAT(_VAinv, TMatrixD::kMult, _AT);
769  TMatrixD VbAVAinvAT(VbA, TMatrixD::kMult, VAinvAT);
770  TMatrixD C33(VbAVAinvAT, TMatrixD::kMult, _VB);
771  _C33 += C33;
772  }
773 
774  TMatrixD C33T(TMatrixD::kTransposed, _C33);
775  _C33T.ResizeTo(C33T);
776  _C33T = C33T;
777 
778  return true;
779 }
780 
782  // Calculate the matrix c = A*deltaAStar + B*deltaYStar - fStar
783 
784  int offsetParam = 0;
785 
786  // calculate delta(a*), = 0 in the first iteration
787  TMatrixD deltaastar(1, 1);
788  if (_nParA > 0) {
789  deltaastar.ResizeTo(_nParA, 1);
790  for (unsigned int indexParticle = 0; indexParticle < _unmeasParticles.size(); indexParticle++) {
791  TAbsFitParticle* particle = _unmeasParticles[indexParticle];
792  const TMatrixD* astar = particle->getParCurr();
793  const TMatrixD* a = particle->getParIni();
794  TMatrixD deltaastarpart(*astar);
795  deltaastarpart -= *a;
796 
797  for (int indexParam = 0; indexParam < deltaastarpart.GetNrows(); indexParam++) {
798  deltaastar(indexParam + offsetParam, 0) = deltaastarpart(indexParam, 0);
799  }
800  offsetParam += deltaastarpart.GetNrows();
801  }
802 
803  if (_verbosity >= 3) {
804  printMatrix(deltaastar, "deltaastar");
805  }
806  }
807 
808  // calculate delta(y*), = 0 in the first iteration
809  TMatrixD deltaystar(_nParB, 1);
810  offsetParam = 0;
811  for (unsigned int indexParticle = 0; indexParticle < _measParticles.size(); indexParticle++) {
812  TAbsFitParticle* particle = _measParticles[indexParticle];
813  const TMatrixD* ystar = particle->getParCurr();
814  const TMatrixD* y = particle->getParIni();
815  TMatrixD deltaystarpart(*ystar);
816  deltaystarpart -= *y;
817 
818  for (int indexParam = 0; indexParam < deltaystarpart.GetNrows(); indexParam++) {
819  deltaystar(indexParam + offsetParam, 0) = deltaystarpart(indexParam, 0);
820  }
821  offsetParam += deltaystarpart.GetNrows();
822  }
823 
824  for (unsigned int iC = 0; iC < _constraints.size(); iC++) {
826 
827  if (constraint->getNPar() > 0) {
828  const TMatrixD* alphastar = constraint->getParCurr();
829  const TMatrixD* alpha = constraint->getParIni();
830 
831  TMatrixD deltaalphastarpart(*alphastar);
832  deltaalphastarpart -= *alpha;
833 
834  for (int indexParam = 0; indexParam < deltaalphastarpart.GetNrows(); indexParam++) {
835  deltaystar(indexParam + offsetParam, 0) = deltaalphastarpart(indexParam, 0);
836  }
837  offsetParam += deltaalphastarpart.GetNrows();
838  }
839  }
840 
841  if (_verbosity >= 3) {
842  printMatrix(deltaystar, "deltaystar");
843  }
844 
845  // calculate f*
846  TMatrixD fstar(_constraints.size(), 1);
847  for (unsigned int indexConstr = 0; indexConstr < _constraints.size(); indexConstr++) {
848  fstar(indexConstr, 0) = _constraints[indexConstr]->getCurrentValue();
849  }
850 
851  // calculate c
852  _c.ResizeTo(fstar);
853  _c = fstar;
854  _c *= (-1.);
855  TMatrixD Bdeltaystar(_B, TMatrixD::kMult, deltaystar);
856  _c += Bdeltaystar;
857  if (_nParA) {
858  TMatrixD Adeltaastar(_A, TMatrixD::kMult, deltaastar);
859  _c += Adeltaastar;
860  }
861 
862  return true;
863 }
864 
866  // Calculate the matrix deltaA = C32T * c
867  // (corrections to unmeasured parameters)
868 
869  TMatrixD deltaA(_C32T, TMatrixD::kMult, _c);
870  _deltaA.ResizeTo(deltaA);
871 
872  if (_nbIter == 0) {
873  _deltaAstar.ResizeTo(deltaA);
874  _deltaAstar.Zero();
875  } else
877 
878  _deltaA = deltaA;
879 
880  return true;
881 }
882 
884  // Calculate the matrix deltaY = C31T * c
885  // (corrections to measured parameters)
886 
887  TMatrixD deltaY(_C31T, TMatrixD::kMult, _c);
888  _deltaY.ResizeTo(deltaY);
889 
890  if (_nbIter == 0) {
891  _deltaYstar.ResizeTo(deltaY);
892  _deltaYstar.Zero();
893  } else
895 
896  _deltaY = deltaY;
897 
898  return true;
899 }
900 
902  // Calculate the matrix Lambda = C33 * c
903  // (Lagrange Multipliers)
904 
905  TMatrixD lambda(_C33, TMatrixD::kMult, _c);
906  _lambda.ResizeTo(lambda);
907  _lambda = lambda;
908 
909  TMatrixD lambdaT(TMatrixD::kTransposed, _lambda);
910  _lambdaT.ResizeTo(lambdaT);
911  _lambdaT = lambdaT;
912 
913  return true;
914 }
915 
917  // Calculate the covariance matrix of fitted parameters
918  //
919  // Vfit(y) = ( C11 C21T )
920  // (a) ( C21 C22 )
921  //
922  // Vfit(lambda) = (-C33)
923 
924  // Calculate covariance matrix of lambda
925  _lambdaVFit.ResizeTo(_C33);
926  _lambdaVFit = _C33;
927  _lambdaVFit *= -1.;
928 
929  // Calculate combined covariance matrix of y and a
930  Int_t nbRows = _C11.GetNrows();
931  Int_t nbCols = _C11.GetNcols();
932  if (_nParA > 0) {
933  nbRows += _C21.GetNrows();
934  nbCols += _C21T.GetNcols();
935  }
936  _yaVFit.ResizeTo(nbRows, nbCols);
937 
938  for (int iRow = 0; iRow < nbRows; iRow++) {
939  for (int iCol = 0; iCol < nbCols; iCol++) {
940  if (iRow >= _C11.GetNrows()) {
941  if (iCol >= _C11.GetNcols()) {
942  _yaVFit(iRow, iCol) = _C22(iRow - _C11.GetNrows(), iCol - _C11.GetNcols());
943  } else {
944  _yaVFit(iRow, iCol) = _C21(iRow - _C11.GetNrows(), iCol);
945  }
946  } else {
947  if (iCol >= _C11.GetNcols()) {
948  _yaVFit(iRow, iCol) = _C21T(iRow, iCol - _C11.GetNcols());
949  } else {
950  _yaVFit(iRow, iCol) = _C11(iRow, iCol);
951  }
952  }
953  }
954  }
955 
956  return true;
957 }
958 
960  // apply fit covariance matrix to measured and unmeasured particles
961 
962  int offsetParam = 0;
963  for (unsigned int indexParticle = 0; indexParticle < _measParticles.size(); indexParticle++) {
964  TAbsFitParticle* particle = _measParticles[indexParticle];
965  Int_t nbParams = particle->getNPar();
966  TMatrixD vfit(nbParams, nbParams);
967  for (Int_t c = 0; c < nbParams; c++) {
968  for (Int_t r = 0; r < nbParams; r++) {
969  vfit(r, c) = _yaVFit(r + offsetParam, c + offsetParam);
970  }
971  }
972  particle->setCovMatrixFit(&vfit);
973  offsetParam += nbParams;
974  }
975 
976  for (unsigned int indexConstraint = 0; indexConstraint < _constraints.size(); indexConstraint++) {
977  TAbsFitConstraint* constraint = _constraints[indexConstraint];
978  Int_t nbParams = constraint->getNPar();
979  if (nbParams > 0) {
980  TMatrixD vfit(nbParams, nbParams);
981  for (Int_t c = 0; c < nbParams; c++) {
982  for (Int_t r = 0; r < nbParams; r++) {
983  vfit(r, c) = _yaVFit(r + offsetParam, c + offsetParam);
984  }
985  }
986  constraint->setCovMatrixFit(&vfit);
987  offsetParam += nbParams;
988  }
989  }
990 
991  for (unsigned int indexParticle = 0; indexParticle < _unmeasParticles.size(); indexParticle++) {
992  TAbsFitParticle* particle = _unmeasParticles[indexParticle];
993  Int_t nbParams = particle->getNPar();
994  TMatrixD vfit(nbParams, nbParams);
995  for (Int_t c = 0; c < nbParams; c++) {
996  for (Int_t r = 0; r < nbParams; r++) {
997  vfit(r, c) = _yaVFit(r + offsetParam, c + offsetParam);
998  }
999  }
1000  particle->setCovMatrixFit(&vfit);
1001  offsetParam += nbParams;
1002  }
1003 }
1004 
1006  //apply corrections to unmeasured particles
1007 
1008  int offsetParam = 0;
1009  for (unsigned int indexParticle = 0; indexParticle < _unmeasParticles.size(); indexParticle++) {
1010  TAbsFitParticle* particle = _unmeasParticles[indexParticle];
1011  Int_t nbParams = particle->getNPar();
1012  TMatrixD params(nbParams, 1);
1013  for (Int_t index = 0; index < nbParams; index++) {
1014  params(index, 0) = _deltaA(index + offsetParam, 0);
1015  }
1016  particle->applycorr(&params);
1017  offsetParam += nbParams;
1018  }
1019 
1020  return true;
1021 }
1022 
1024  //apply corrections to measured particles
1025 
1026  int offsetParam = 0;
1027  for (unsigned int indexParticle = 0; indexParticle < _measParticles.size(); indexParticle++) {
1028  TAbsFitParticle* particle = _measParticles[indexParticle];
1029  Int_t nbParams = particle->getNPar();
1030  TMatrixD params(nbParams, 1);
1031  for (Int_t index = 0; index < nbParams; index++) {
1032  params(index, 0) = _deltaY(index + offsetParam, 0);
1033  }
1034  particle->applycorr(&params);
1035  offsetParam += nbParams;
1036  }
1037 
1038  for (unsigned int indexConstraint = 0; indexConstraint < _constraints.size(); indexConstraint++) {
1039  TAbsFitConstraint* constraint = _constraints[indexConstraint];
1040  Int_t nbParams = constraint->getNPar();
1041  if (nbParams > 0) {
1042  TMatrixD params(nbParams, 1);
1043  for (Int_t index = 0; index < nbParams; index++) {
1044  params(index, 0) = _deltaY(index + offsetParam, 0);
1045  }
1046  constraint->applyDeltaAlpha(&params);
1047  offsetParam += nbParams;
1048  }
1049  }
1050 
1051  return true;
1052 }
1053 
1054 Double_t TKinFitter::getF() {
1055  // calculate current absolut value of constraints
1056  // F = Sum[ Abs(f_k( aStar, yStar)) ]
1057 
1058  Double_t F = 0.;
1059  for (unsigned int indexConstr = 0; indexConstr < _constraints.size(); indexConstr++) {
1060  F += TMath::Abs(_constraints[indexConstr]->getCurrentValue());
1061  }
1062 
1063  return F;
1064 }
1065 
1066 Double_t TKinFitter::getS() {
1067  // calculate current value of Chi2
1068  // S = deltaYT * V^-1 * deltaY
1069 
1070  Double_t S = 0.;
1071 
1072  if (_nbIter > 0) {
1073  TMatrixD deltaYTVinv(_deltaY, TMatrixD::kTransposeMult, _Vinv);
1074  TMatrixD S2(deltaYTVinv, TMatrixD::kMult, _deltaY);
1075  S = S2(0, 0);
1076  }
1077 
1078  return S;
1079 }
1080 
1081 Bool_t TKinFitter::converged(Double_t F, Double_t prevS, Double_t currS) {
1082  // check whether convergence criteria are fulfilled
1083 
1084  Bool_t isConverged = false;
1085 
1086  // calculate F, delta(a) and delta(y) already applied
1087  isConverged = (F < _maxF);
1088 
1089  // Calculate current Chi^2 and delta(S)
1090  Double_t deltaS = currS - prevS;
1091  isConverged = isConverged && (TMath::Abs(deltaS) < _maxDeltaS);
1092 
1093  return isConverged;
1094 }
1095 
1097  TString statusstring = "";
1098 
1099  switch (_status) {
1100  case -1: {
1101  statusstring = "NO FIT PERFORMED";
1102  break;
1103  }
1104  case 10: {
1105  statusstring = "RUNNING";
1106  break;
1107  }
1108  case -10: {
1109  statusstring = "ABORTED";
1110  break;
1111  }
1112  case 0: {
1113  statusstring = "CONVERGED";
1114  break;
1115  }
1116  case 1: {
1117  statusstring = "NOT CONVERGED";
1118  break;
1119  }
1120  }
1121 
1122  return statusstring;
1123 }
1124 
1126  edm::LogVerbatim log("KinFitter");
1127  log << "\n"
1128  << "\n";
1129  // Print status of fit
1130  log << "Status: " << getStatusString() << " F=" << getF() << " S=" << getS() << " N=" << _nbIter
1131  << " NDF=" << getNDF() << "\n";
1132  // Print measured particles
1133  log << "measured particles: \n";
1134  Int_t parIndex = 0;
1135  for (unsigned int iP = 0; iP < _measParticles.size(); iP++) {
1136  TAbsFitParticle* particle = _measParticles[iP];
1137  Int_t nParP = particle->getNPar();
1138  const TMatrixD* par = particle->getParCurr();
1139  const TMatrixD* covP = particle->getCovMatrix();
1140  log << std::setw(3) << setiosflags(std::ios::right) << iP;
1141  log << std::setw(15) << setiosflags(std::ios::right) << particle->GetName();
1142  log << std::setw(3) << " ";
1143  for (int iPar = 0; iPar < nParP; iPar++) {
1144  if (iPar > 0) {
1145  log << setiosflags(std::ios::right) << std::setw(21) << " ";
1146  }
1147  TString colstr = "";
1148  colstr += parIndex;
1149  colstr += ":";
1150  log << std::setw(4) << colstr;
1151  log << std::setw(2) << " ";
1152  log << setiosflags(std::ios::left) << setiosflags(std::ios::scientific) << std::setprecision(3);
1153  log << std::setw(15) << (*par)(iPar, 0);
1154  if (_nbIter > 0 && _status < 10) {
1155  log << std::setw(15) << TMath::Sqrt(_yaVFit(iPar, iPar));
1156  } else {
1157  log << std::setw(15) << " ";
1158  }
1159  log << std::setw(15) << TMath::Sqrt((*covP)(iPar, iPar));
1160  log << "\n";
1161  parIndex++;
1162  }
1163  log << particle->getInfoString();
1164  }
1165  // Print unmeasured particles
1166  log << "unmeasured particles: \n";
1167  parIndex = 0;
1168  for (unsigned int iP = 0; iP < _unmeasParticles.size(); iP++) {
1169  TAbsFitParticle* particle = _unmeasParticles[iP];
1170  Int_t nParP = particle->getNPar();
1171  const TMatrixD* par = particle->getParCurr();
1172  log << std::setw(3) << setiosflags(std::ios::right) << iP;
1173  log << std::setw(15) << particle->GetName();
1174  log << std::setw(3) << " ";
1175  for (int iPar = 0; iPar < nParP; iPar++) {
1176  if (iPar > 0) {
1177  log << setiosflags(std::ios::right) << std::setw(21) << " ";
1178  }
1179  TString colstr = "";
1180  colstr += parIndex;
1181  colstr += ":";
1182  log << std::setw(4) << colstr;
1183  log << std::setw(2) << " ";
1184  log << setiosflags(std::ios::left) << setiosflags(std::ios::scientific) << std::setprecision(3);
1185  log << std::setw(15) << (*par)(iPar, 0);
1186  if (_nbIter > 0 && _status < 10) {
1187  log << std::setw(15) << TMath::Sqrt(_yaVFit(iPar + _nParB, iPar + _nParB));
1188  } else {
1189  log << std::setw(15) << " ";
1190  }
1191  log << "\n";
1192  parIndex++;
1193  }
1194  log << particle->getInfoString();
1195  }
1196  log << "\n";
1197  // Print constraints
1198  log << "constraints: \n";
1199  for (unsigned int indexConstr = 0; indexConstr < _constraints.size(); indexConstr++) {
1200  log << _constraints[indexConstr]->getInfoString();
1201  }
1202  log << "\n";
1203 }
1204 
1205 void TKinFitter::printMatrix(const TMatrixD& matrix, const TString& name) {
1206  // produce a tabular printout for matrices
1207  // this function is a modified version of Root's TMatrixTBase<Element>::Print method
1208  // which could not be used together with the MessageLogger
1209 
1210  if (!matrix.IsValid()) {
1211  edm::LogWarning("InvalidMatrix") << "Matrix " << name << " is invalid.";
1212  return;
1213  }
1214 
1215  edm::LogVerbatim log("KinFitter");
1216 
1217  const Int_t nCols = matrix.GetNcols();
1218  const Int_t nRows = matrix.GetNrows();
1219  const Int_t colsPerSheet = 5;
1220  char topbar[100];
1221  Int_t nk = 6 + 13 * TMath::Min(colsPerSheet, nCols);
1222  for (Int_t i = 0; i < nk; i++)
1223  topbar[i] = '-';
1224  topbar[nk] = 0;
1225 
1226  Int_t sw = (70 - name.Length()) / 2;
1227 
1228  log << std::setfill('=') << std::setw(sw) << "= " << name << std::setw(sw) << std::left << " ="
1229  << "\n"
1230  << std::setfill(' ') << std::right << "\n";
1231 
1232  log << nRows << "x" << nCols << " matrix is as follows \n";
1233 
1234  for (Int_t iSheet = 0; iSheet < nCols; iSheet += colsPerSheet) {
1235  log << "\n"
1236  << " |";
1237  for (Int_t iCol = iSheet; iCol < nCols; iCol++) {
1238  if (iCol < iSheet + colsPerSheet)
1239  log << std::setw(8) << iCol << " |";
1240  }
1241  log << "\n" << topbar << " \n";
1242  for (Int_t iRow = 0; iRow < nRows; iRow++) {
1243  log << std::setw(4) << iRow << " |";
1244  for (Int_t iCol = iSheet; iCol < nCols; iCol++) {
1245  if (iCol < iSheet + colsPerSheet)
1246  log << std::setw(12) << matrix(iRow, iCol) << " ";
1247  }
1248  log << "\n";
1249  }
1250  }
1251 }
TMatrixD _deltaY
Definition: TKinFitter.h:140
virtual void applyDeltaAlpha(TMatrixD *corrMatrix)
TMatrixD _C11
Definition: TKinFitter.h:126
float alpha
Definition: AMPTWrapper.h:105
Bool_t calcC33()
Definition: TKinFitter.cc:759
Bool_t calcV()
Definition: TKinFitter.cc:474
void countMeasParams()
Definition: TKinFitter.cc:173
static std::vector< std::string > checklist log
const edm::EventSetup & c
Bool_t converged(Double_t F, Double_t prevS, Double_t currS)
Definition: TKinFitter.cc:1081
virtual void reset()
Bool_t calcVFit()
Definition: TKinFitter.cc:916
std::vector< TAbsFitParticle * > _measParticles
Definition: TKinFitter.h:153
Bool_t calcVB()
Definition: TKinFitter.cc:618
Bool_t calcC11()
Definition: TKinFitter.cc:658
virtual const TMatrixD * getCovMatrix() const
TString getInfoString()
Int_t fit()
Definition: TKinFitter.cc:318
const TString p2
Definition: fwPaths.cc:13
#define _B
TString getStatusString()
Definition: TKinFitter.cc:1096
Int_t _nParA
Definition: TKinFitter.h:149
TMatrixD _C33T
Definition: TKinFitter.h:137
TMatrixD _lambda
Definition: TKinFitter.h:143
TMatrixD _C32T
Definition: TKinFitter.h:135
Bool_t calcC21()
Definition: TKinFitter.cc:687
TMatrixD _V
Definition: TKinFitter.h:118
void reset()
Definition: TKinFitter.cc:97
TMatrixD _C21T
Definition: TKinFitter.h:129
virtual TMatrixD * getDerivativeAlpha()
void addUnmeasParticles(TAbsFitParticle *p1, TAbsFitParticle *p2=nullptr, TAbsFitParticle *p3=nullptr, TAbsFitParticle *p4=nullptr, TAbsFitParticle *p5=nullptr, TAbsFitParticle *p6=nullptr, TAbsFitParticle *p7=nullptr, TAbsFitParticle *p8=nullptr, TAbsFitParticle *p9=nullptr)
Definition: TKinFitter.cc:257
TMatrixD _VB
Definition: TKinFitter.h:120
void addMeasParticles(TAbsFitParticle *p1, TAbsFitParticle *p2=nullptr, TAbsFitParticle *p3=nullptr, TAbsFitParticle *p4=nullptr, TAbsFitParticle *p5=nullptr, TAbsFitParticle *p6=nullptr, TAbsFitParticle *p7=nullptr, TAbsFitParticle *p8=nullptr, TAbsFitParticle *p9=nullptr)
Definition: TKinFitter.cc:208
virtual void reset()
TMatrixD _C31T
Definition: TKinFitter.h:133
T Min(T a, T b)
Definition: MathUtil.h:39
Log< level::Error, false > LogError
void resetParams()
Definition: TKinFitter.cc:154
TMatrixD _yaVFit
Definition: TKinFitter.h:147
TMatrixD _C32
Definition: TKinFitter.h:134
tuple m2
Definition: callgraph.py:57
std::vector< TAbsFitParticle * > _unmeasParticles
Definition: TKinFitter.h:154
TMatrixD _VA
Definition: TKinFitter.h:122
Double_t getS()
Definition: TKinFitter.cc:1066
virtual void setCovMatrixFit(const TMatrixD *theCovMatrixFit)
TMatrixD _deltaA
Definition: TKinFitter.h:139
virtual TMatrixD * getDerivative()=0
void applyVFit()
Definition: TKinFitter.cc:959
Bool_t applyDeltaY()
Definition: TKinFitter.cc:1023
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t V
~TKinFitter() override
Definition: TKinFitter.cc:171
Int_t _maxNbIter
Definition: TKinFitter.h:109
Bool_t calcB()
Definition: TKinFitter.cc:556
void print()
Definition: TKinFitter.cc:1125
TMatrixD _C33
Definition: TKinFitter.h:136
TMatrixD _deltaAstar
Definition: TKinFitter.h:141
Bool_t calcDeltaY()
Definition: TKinFitter.cc:883
void addConstraint(TAbsFitConstraint *constraint)
Definition: TKinFitter.cc:292
Bool_t calcA()
Definition: TKinFitter.cc:521
Bool_t calcLambda()
Definition: TKinFitter.cc:901
Bool_t calcC31()
Definition: TKinFitter.cc:718
T Abs(T a)
Definition: MathUtil.h:49
void countUnmeasParams()
Definition: TKinFitter.cc:185
const TString p1
Definition: fwPaths.cc:12
Int_t _status
Definition: TKinFitter.h:156
TMatrixD _B
Definition: TKinFitter.h:116
TMatrixD _C22T
Definition: TKinFitter.h:131
void addUnmeasParticle(TAbsFitParticle *particle)
Definition: TKinFitter.cc:243
TMatrixD _VAinv
Definition: TKinFitter.h:123
Int_t getNPar() const
Int_t getNDF()
Definition: TKinFitter.h:45
void addMeasParticle(TAbsFitParticle *particle)
Definition: TKinFitter.cc:194
TMatrixD _C22
Definition: TKinFitter.h:130
virtual void applycorr(TMatrixD *corrMatrix)
TMatrixD _c
Definition: TKinFitter.h:124
Double_t _maxDeltaS
Definition: TKinFitter.h:110
void setCovMatrix(TMatrixD &V)
Definition: TKinFitter.cc:462
TMatrixD _A
Definition: TKinFitter.h:114
TMatrixD _lambdaT
Definition: TKinFitter.h:144
void setVerbosity(Int_t verbosity=1)
Definition: TKinFitter.cc:304
Log< level::Info, false > LogInfo
const TMatrixD * getParIni()
Bool_t calcVA()
Definition: TKinFitter.cc:638
void printMatrix(const TMatrixD &matrix, const TString &name="")
Definition: TKinFitter.cc:1205
TMatrixD _lambdaVFit
Definition: TKinFitter.h:146
TMatrixD _C31
Definition: TKinFitter.h:132
void resetStatus()
Definition: TKinFitter.cc:147
Bool_t applyDeltaA()
Definition: TKinFitter.cc:1005
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:97
const TMatrixD * getParIni()
std::vector< TAbsFitConstraint * > _constraints
Definition: TKinFitter.h:152
TMatrixD _deltaYstar
Definition: TKinFitter.h:142
TMatrixD _BT
Definition: TKinFitter.h:117
TMatrixD _AT
Definition: TKinFitter.h:115
virtual const TMatrixD * getCovMatrix() const
Int_t _nbIter
Definition: TKinFitter.h:157
double a
Definition: hdecay.h:119
Bool_t calcC32()
Definition: TKinFitter.cc:744
Int_t _verbosity
Definition: TKinFitter.h:112
Double_t getF()
Definition: TKinFitter.cc:1054
TMatrixD _VBinv
Definition: TKinFitter.h:121
Bool_t calcC22()
Definition: TKinFitter.cc:705
Bool_t calcC()
Definition: TKinFitter.cc:781
Int_t _nParB
Definition: TKinFitter.h:150
TMatrixD _C11T
Definition: TKinFitter.h:127
Log< level::Warning, false > LogWarning
virtual void setCovMatrixFit(const TMatrixD *theCovMatrixFit)
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
const TMatrixD * getParCurr()
TMatrixD _C21
Definition: TKinFitter.h:128
TMatrixD _Vinv
Definition: TKinFitter.h:119
Bool_t calcDeltaA()
Definition: TKinFitter.cc:865
Double_t _maxF
Definition: TKinFitter.h:111
const TMatrixD * getParCurr()