CMS 3D CMS Logo

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