GFDaf.cxx
Go to the documentation of this file.
1 /* Copyright 2008-2010, Technische Universitaet Muenchen,
2  Authors: Christian Hoeppner & Sebastian Neubert
3 
4  This file is part of GENFIT.
5 
6  GENFIT is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published
8  by the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  GENFIT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 /*
21  The DAF algorithm stems from the following sources:
22  R. Fruehwirth & A. Strandlie,
23  Computer Physics Communications 120 (199) 197-214
24  &
25  CERN thesis: Dissertation by Matthias Winkler
26  */
27 
28 
29 #include "larreco/Genfit/GFDaf.h"
33 
34 #include "TMath.h"
35 #include <math.h>
36 
37 #include "larreco/Genfit/GFTrack.h"
40 
41 #define COVEXC "cov_is_zero"
42 
43 
44 genf::GFDaf::GFDaf():fBlowUpFactor(500.){
45  setProbCut(0.01);
46  setBetas(81,8,4,1,1,1);
47 }
48 
49 
51 
53  trk->clearBookkeeping();
54 
55 
56 
57  unsigned int nreps=trk->getNumReps();
58  unsigned int nhits=trk->getNumHits();
59 
60  for(unsigned int i=0; i<nreps; ++i){
61  GFBookkeeping *bk = trk->getBK(i);
62  bk->setNhits(nhits);
63  bk->bookMatrices("fPredSt");
64  bk->bookMatrices("fPredCov");
65  bk->bookMatrices("bPredSt");
66  bk->bookMatrices("bPredCov");
67  bk->bookMatrices("H");
68  bk->bookMatrices("m");
69  bk->bookMatrices("V");
70  bk->bookGFDetPlanes("pl");
71  bk->bookMatrices("smooResid");
72  bk->bookNumbers("p",1.);
73  }
74 
75  //plane grouping
76  std::vector< std::vector<int>* > planes;
77  trk->getHitsByPlane(planes);
78  int nPlanes = planes.size();
79 
80  trk->clearFailedHits();
81  for(unsigned int iBeta=0; iBeta<fBeta.size(); iBeta++){
82  //std::cout << "@@ beta " << fBeta.at(iBeta) << std::endl;
83  if(iBeta>0) blowUpCovs(trk);
84  for(int ipl=0; ipl<nPlanes; ++ipl){
85  //std::cout << "@@ plane " << ipl << std::endl;
86  std::vector< GFAbsRecoHit* > hits;
87  unsigned int nhitsInPlane = planes.at(ipl)->size();
88  for(unsigned int ihitInPl=0;ihitInPl<nhitsInPlane;++ihitInPl){
89  hits.push_back( trk->getHit(planes.at(ipl)->at(ihitInPl)) );
90  }
91  //now hits contains pointers to all hits in the next plane
92  //for non-planar detectors this will always be just one hit
93  for(unsigned int irep=0; irep<nreps; ++irep){
94  GFAbsTrackRep* rep=trk->getTrackRep(irep);
95  if(rep->getStatusFlag()!=0) continue;
96  //std::cout << "@@ rep " << irep << std::endl;
97  GFBookkeeping *bk = trk->getBK(irep);
98  if(bk->hitFailed(planes.at(ipl)->at(0))>0) continue;
99  GFDetPlane pl;
100  // get prototypes for matrices
101  int repDim=rep->getDim();
102  TMatrixT<Double_t> state(repDim,1);
103  TMatrixT<Double_t> cov(repDim,repDim);;
104 
105  if(ipl>0 || (ipl==0 && iBeta==0) ){
106  // get the (virtual) detector plane
107  //std::cout << "forward ### iBeta, ipl, irep " << iBeta<< " " << ipl << " " << irep << std::endl;
108  // rep->getState().Print();
109  try{
110  hits.at(0);
111  pl=hits.at(0)->getDetPlane(rep);
112  //do the extrapolation
113  rep->extrapolate(pl,state,cov);
114 
115  if(cov[0][0]<1.E-50){
116  GFException exc(COVEXC,__LINE__,__FILE__);
117  throw exc;
118  }
119  }
120  catch (GFException& exc){
121  std::cerr << exc.what();
122  exc.info();
123  for(unsigned int i=0;i<planes.at(ipl)->size();++i) trk->addFailedHit(irep,planes.at(ipl)->at(i));
124  if(exc.isFatal()){
125  rep->setStatusFlag(1);
126  //abort();
127  }
128  continue;//go to next rep immediately
129  }
130  }
131  else{
132  pl = rep->getReferencePlane();
133  state = rep->getState();
134  cov = rep->getCov();
135  }
136  //the H matrix has to be identical for all hits in the plane
137  TMatrixT<Double_t> H=hits.at(0)->getHMatrix(rep);
138  bk->setMatrix("fPredSt",planes.at(ipl)->at(0),state);
139  bk->setMatrix("fPredCov",planes.at(ipl)->at(0),cov);
140 
141  TMatrixT<Double_t> covInv;
142  invertMatrix(cov,covInv);
143 
144  TMatrixT<Double_t> Htransp(H);
145  Htransp.T();
146 
147  bk->setMatrix("H",planes.at(ipl)->at(0),H);
148  bk->setDetPlane("pl",planes.at(ipl)->at(0),pl);
149 
150  TMatrixT<Double_t> stMod(state.GetNrows(),1);
151 
152  double sumPk(0);
153  for(unsigned int ihit=0;ihit<nhitsInPlane;++ihit){
154  double pki;
155  bk->getNumber("p",planes.at(ipl)->at(ihit),pki);
156  sumPk+=pki;
157  }
158  TMatrixT<Double_t> V = hits.at(0)->getHitCov(pl);
159  TMatrixT<Double_t> Vinv;
160  invertMatrix(V,Vinv);
161  bk->setMatrix("V",planes.at(ipl)->at(0),V);
162  for(unsigned int ihit=0;ihit<nhitsInPlane;++ihit){
163  //std::cout << "%%%% forward hit " << planes.at(ipl)->at(ihit) << std::endl;
164 
165  TMatrixT<Double_t> m = hits.at(ihit)->getHitCoord(pl);
166  bk->setMatrix("m",planes.at(ipl)->at(ihit),m);
167 
168  double pki;
169  bk->getNumber("p",planes.at(ipl)->at(ihit),pki);
170  TMatrixT<Double_t> Gain = calcGain(cov,V,H,sumPk);
171  //std::cout << "using weight " << pki << std::endl;
172  stMod += pki*Gain*(m-H*state);
173  }
174  state += stMod;
175  invertMatrix( covInv + sumPk*Htransp*Vinv*H ,cov);
176  rep->setData(state,pl,&cov);
177 
178  }//loop over reps
179  }//loop over planes for forward fit
180  blowUpCovs(trk);
181  //now do the loop over the planes in backward direction
182  for(int ipl=nPlanes-1; ipl>=0; --ipl){
183  //std::cout << "@bw@ plane " << ipl << std::endl;
184  std::vector< GFAbsRecoHit* > hits;
185  unsigned int nhitsInPlane = planes.at(ipl)->size();
186  for(unsigned int ihitInPl=0;ihitInPl<nhitsInPlane;++ihitInPl){
187  hits.push_back( trk->getHit(planes.at(ipl)->at(ihitInPl)) );
188  }
189  //now hits contains pointers to all hits in the next plane
190  //for non-planar detectors this will always be just one hit
191  for(unsigned int irep=0; irep<nreps; ++irep){
192  GFAbsTrackRep* rep=trk->getTrackRep(irep);
193  if(rep->getStatusFlag()!=0) continue;
194  //std::cout << "@bw@ rep " << irep << std::endl;
195  GFBookkeeping *bk = trk->getBK(irep);
196  if(bk->hitFailed(planes.at(ipl)->at(0))>0) continue;
197  // get prototypes for matrices
198  int repDim=rep->getDim();
199  TMatrixT<Double_t> state(repDim,1);
200  TMatrixT<Double_t> cov(repDim,repDim);;
201 
202  TMatrixT<Double_t> H;
203  bk->getMatrix("H",planes.at(ipl)->at(0),H);
204  TMatrixT<Double_t> Htransp(H);
205  Htransp.T();
206  GFDetPlane pl;
207  bk->getDetPlane("pl",planes.at(ipl)->at(0),pl);
208  //std::cout << "backward ### iBeta, ipl, irep " << iBeta<< " " << ipl << " " << irep << std::endl;
209  if(ipl<(nPlanes-1)){
210  try{
211  //do the extrapolation
212  rep->extrapolate(pl,state,cov);
213  if(cov[0][0]<1.E-50){
214  GFException exc(COVEXC,__LINE__,__FILE__);
215  throw exc;
216  }
217  }
218  catch(GFException& exc){
219  //std::cout << __FILE__ << " " << __LINE__ << std::endl;
220  std::cerr << exc.what();
221  exc.info();
222  //TAG
223  for(unsigned int i=0;i<planes.at(ipl)->size();++i) trk->addFailedHit(irep,planes.at(ipl)->at(i));
224  if(exc.isFatal()){
225  rep->setStatusFlag(1);
226  }
227  continue;//go to next rep immediately
228  }
229  }
230  else{
231  state = rep->getState();
232  cov = rep->getCov();
233  }
234  TMatrixT<Double_t> covInv;
235  invertMatrix(cov,covInv);
236 
237  bk->setMatrix("bPredSt",planes.at(ipl)->at(0),state);
238  bk->setMatrix("bPredCov",planes.at(ipl)->at(0),cov);
239 
240 
241  TMatrixT<Double_t> stMod(state.GetNrows(),1);
242 
243  double sumPk(0);
244  for(unsigned int ihit=0;ihit<nhitsInPlane;++ihit){
245  double pki;
246  bk->getNumber("p",planes.at(ipl)->at(ihit),pki);
247  sumPk+=pki;
248  }
249 
250  TMatrixT<Double_t> V;
251  bk->getMatrix("V",planes.at(ipl)->at(0),V);
252  TMatrixT<Double_t> Vinv;
253  invertMatrix(V,Vinv);
254 
255 
256  for(unsigned int ihit=0;ihit<nhitsInPlane;++ihit){
257  //std::cout << "%%bw%% hit " << planes.at(ipl)->at(ihit) << std::endl;
258  TMatrixT<Double_t> m;
259  bk->getMatrix("m",planes.at(ipl)->at(ihit),m);
260 
261  double pki;
262  bk->getNumber("p",planes.at(ipl)->at(ihit),pki);
263  TMatrixT<Double_t> Gain = calcGain(cov,V,H,sumPk);
264  //std::cout << "using pki " << pki << std::endl;
265 
266  stMod += pki*Gain*(m-H*state);
267  }
268  state += stMod;
269  invertMatrix( covInv + sumPk*Htransp*Vinv*H , cov);
270 
271  rep->setData(state,pl,&cov);
272  }//done with loop over reps
273  }//loop over planes for backward
274  //calculate smoothed states and covs
275  TMatrixT<Double_t> fSt,fCov,bSt,bCov,smooSt,smooCov,fCovInv,bCovInv,m,H,smooResid;
276  for(int ipl=0; ipl<nPlanes; ++ipl){
277  for(unsigned int irep=0; irep<nreps; ++irep){
278  if(trk->getTrackRep(irep)->getStatusFlag()!=0) continue;
279  GFBookkeeping *bk = trk->getBK(irep);
280  if(bk->hitFailed(planes.at(ipl)->at(0))>0) continue;
281  bk->getMatrix("fPredSt",planes.at(ipl)->at(0),fSt);
282  bk->getMatrix("bPredSt",planes.at(ipl)->at(0),bSt);
283  bk->getMatrix("fPredCov",planes.at(ipl)->at(0),fCov);
284  bk->getMatrix("bPredCov",planes.at(ipl)->at(0),bCov);
285  fCovInv.ResizeTo(fCov);
286  bCovInv.ResizeTo(bCov);
287  invertMatrix(fCov,fCovInv);
288  invertMatrix(bCov,bCovInv);
289  smooCov.ResizeTo(fCov);
290  invertMatrix( fCovInv + bCovInv , smooCov);
291  smooSt.ResizeTo(fSt.GetNrows(),1);
292  smooSt = smooCov * (fCovInv*fSt + bCovInv*bSt);
293  //std::cout << "#@#@#@#@#@# smooResid ipl, irep " << ipl << " " << irep << std::endl;
294  bk->getMatrix("H",planes.at(ipl)->at(0),H);
295  for(unsigned int ihit=0;ihit<planes.at(ipl)->size();++ihit){
296  //TAG
297  bk->getMatrix("m",planes.at(ipl)->at(ihit),m);
298  smooResid.ResizeTo(m.GetNrows(),1);
299  smooResid = m - H*smooSt;
300  //std::cout << "%%%% hit " << planes.at(ipl)->at(ihit) << std::endl;
301  //smooResid.Print();
302  bk->setMatrix("smooResid",planes.at(ipl)->at(ihit),smooResid);
303  }
304  }
305  }//end loop over planes for smoothed state calculation
306 
307  //calculate the new weights
308  if(iBeta!=fBeta.size()-1){//dont do it for the last beta, ause fitting will stop
309  for(unsigned int irep=0; irep<nreps; ++irep){
310  GFBookkeeping *bk = trk->getBK(irep);
311  for(int ipl=0; ipl<nPlanes; ++ipl){
312  if(trk->getTrackRep(irep)->getStatusFlag()!=0) continue;
313  if(bk->hitFailed(planes.at(ipl)->at(0))>0) continue;
314  double sumPhi=0.;
315  double sumPhiCut=0.;
316  std::vector<double> phi;
317  TMatrixT<Double_t> V;
318  bk->getMatrix("V",planes.at(ipl)->at(0),V);
319  V *= fBeta.at(iBeta);
320  TMatrixT<Double_t> Vinv;
321  invertMatrix(V,Vinv);
322  for(unsigned int ihit=0;ihit<planes.at(ipl)->size();++ihit){
323  //TMatrixT<Double_t> smooResid;
324  bk->getMatrix("smooResid",planes.at(ipl)->at(ihit),smooResid);
325  TMatrixT<Double_t> smooResidTransp(smooResid);
326  smooResidTransp.T();
327  int dimV = V.GetNrows();
328  double detV = V.Determinant();
329  TMatrixT<Double_t> expArg = smooResidTransp*Vinv*smooResid;
330  if (expArg.GetNrows() != 1)
331  throw std::runtime_error("genf::GFDaf::processTrack(): wrong matrix dimensions!");
332  double thisPhi = 1./(pow(2.*TMath::Pi(),dimV/2.)*sqrt(detV))*exp(-0.5*expArg[0][0]);
333  phi.push_back(thisPhi);
334  sumPhi += thisPhi;
335 
336  double cutVal = chi2Cuts[dimV];
337  if (cutVal <= 1.E-6)
338  throw std::runtime_error("genf::GFDaf::processTrack(): chi2 cut too low");
339  sumPhiCut += 1./(2*TMath::Pi()*sqrt(detV))*exp(-0.5*cutVal/fBeta.at(iBeta));
340  }
341  for(unsigned int ihit=0;ihit<planes.at(ipl)->size();++ihit){
342  bk->setNumber("p",planes.at(ipl)->at(ihit), phi.at(ihit)/(sumPhi+sumPhiCut));
343  }
344  }
345  }
346  }
347 
348  }//loop over betas
349 
350 
351  return;
352 
353  }
354 
356  int nreps=trk->getNumReps();
357  for(int irep=0; irep<nreps; ++irep){
358  GFAbsTrackRep* arep=trk->getTrackRep(irep);
359  //dont do it for already compromsied reps, since they wont be fitted anyway
360  if(arep->getStatusFlag()==0) {
361  TMatrixT<Double_t> cov = arep->getCov();
362  for(int i=0;i<cov.GetNrows();++i){
363  for(int j=0;j<cov.GetNcols();++j){
364  if(i!=j){//off diagonal
365  cov[i][j]=0.;
366  }
367  else{//diagonal
368  cov[i][j] = cov[i][j] * fBlowUpFactor;
369  }
370  }
371  }
372  arep->setCov(cov);
373  }
374  }
375 }
376 
377 
378 
379 
380 void genf::GFDaf::invertMatrix(const TMatrixT<Double_t>& mat, TMatrixT<Double_t>& inv){
381  inv.ResizeTo(mat);
382  inv = (mat);
383  double det=0;
384  inv.Invert(&det);
385  if(TMath::IsNaN(det)) {
386  GFException e("Daf Gain: det of matrix is nan",__LINE__,__FILE__);
387  e.setFatal();
388  throw e;
389  }
390  if(det==0){
391  GFException e("cannot invert matrix in Daf - det=0",
392  __LINE__,__FILE__);
393  e.setFatal();
394  throw e;
395  }
396 
397 }
398 
399  TMatrixT<Double_t> genf::GFDaf::calcGain(const TMatrixT<Double_t>& C,
400  const TMatrixT<Double_t>& V,
401  const TMatrixT<Double_t>& H,
402  const double& p){
403 
404  //get C^-1
405  TMatrixT<Double_t> Cinv;
406  invertMatrix(C,Cinv);
407  TMatrixT<Double_t> Vinv;
408  invertMatrix(V,Vinv);
409  //get H^T
410  TMatrixT<Double_t> Htransp(H);
411  Htransp.T();
412 
413  TMatrixT<Double_t> covsum = Cinv + (p*Htransp*Vinv*H);
414  TMatrixT<Double_t> covsumInv;
415  invertMatrix(covsum,covsumInv);
416 
417  return (covsumInv*Htransp*Vinv);
418  }
419 
420 
422 
423  if(fabs(val-0.01)<1.E-10){
424  chi2Cuts[1] = 6.63;
425  chi2Cuts[2] = 9.21;
426  chi2Cuts[3] = 11.34;
427  chi2Cuts[4] = 13.23;
428  chi2Cuts[5] = 15.09;
429  }
430  else if(fabs(val-0.005)<1.E-10){
431  chi2Cuts[1] = 7.88;
432  chi2Cuts[2] = 10.60;
433  chi2Cuts[3] = 12.84;
434  chi2Cuts[4] = 14.86;
435  chi2Cuts[5] = 16.75;
436  }
437  else if(fabs(val-0.001)<1.E-10){
438  chi2Cuts[1] = 10.83;
439  chi2Cuts[2] = 13.82;
440  chi2Cuts[3] = 16.27;
441  chi2Cuts[4] = 18.47;
442  chi2Cuts[5] = 20.51;
443  }
444  else{
445  throw GFException("genf::GFTrackCand::GFDafsetProbCut(): value not supported", __LINE__, __FILE__)
446  .setFatal().setNumbers("value", { val });
447  }
448 
449 }
450 
452  double b1, double b2,
453  double b3 /* = -1. */,
454  double b4 /* = -1. */,
455  double b5 /* = -1. */,
456  double b6 /* = -1. */,
457  double b7 /* = -1. */,
458  double b8 /* = -1. */,
459  double b9 /* = -1. */,
460  double b10 /* = -1. */
461 ) {
462 
463  /* // asserting version
464  assert(b1>0);fBeta.push_back(b1);
465  assert(b2>0 && b2<=b1);fBeta.push_back(b2);
466  if(b3>=0.) {
467  assert(b3<=b2);fBeta.push_back(b3);
468  if(b4>=0.) {
469  assert(b4<=b3);fBeta.push_back(b4);
470  if(b5>=0.) {
471  assert(b5<=b4);fBeta.push_back(b5);
472  if(b6>=0.) {
473  assert(b6<=b5);fBeta.push_back(b6);
474  if(b7>=0.) {
475  assert(b7<=b6);fBeta.push_back(b7);
476  if(b8>=0.) {
477  assert(b8<=b7);fBeta.push_back(b8);
478  if(b9>=0.) {
479  assert(b9<=b8);fBeta.push_back(b9);
480  if(b10>=0.) {
481  assert(b10<=b9);fBeta.push_back(b10);
482  }
483  }
484  }
485  }
486  }
487  }
488  }
489  }
490  */
491  if (b1 <= 0)
492  throw std::runtime_error("genf::GFDaf::setBetas(): b1 <= 0");
493  fBeta.push_back(b1);
494 
495  if (b2 <= 0 || b2 > b1)
496  throw std::runtime_error("genf::GFDaf::setBetas(): b2 in wrong range");
497  fBeta.push_back(b2);
498 
499  if(b3 < 0.) return;
500  if (b3 > b2)
501  throw std::runtime_error("genf::GFDaf::setBetas(): b3 > b2");
502  fBeta.push_back(b3);
503 
504  if(b4 < 0.) return;
505  if (b4 > b3)
506  throw std::runtime_error("genf::GFDaf::setBetas(): b4 > b3");
507  fBeta.push_back(b4);
508 
509  if(b5 < 0.) return;
510  if (b5 > b4)
511  throw std::runtime_error("genf::GFDaf::setBetas(): b5 > b4");
512  fBeta.push_back(b5);
513 
514  if(b6 < 0.) return;
515  if (b6 > b5)
516  throw std::runtime_error("genf::GFDaf::setBetas(): b6 > b5");
517  fBeta.push_back(b6);
518 
519  if(b7 < 0.) return;
520  if (b7 > b6)
521  throw std::runtime_error("genf::GFDaf::setBetas(): b7 > b6");
522  fBeta.push_back(b7);
523 
524  if(b8 < 0.) return;
525  if (b8 > b7)
526  throw std::runtime_error("genf::GFDaf::setBetas(): b8 > b7");
527  fBeta.push_back(b8);
528 
529  if(b9 < 0.) return;
530  if (b9 > b8)
531  throw std::runtime_error("genf::GFDaf::setBetas(): b9 > b8");
532  fBeta.push_back(b9);
533 
534  if(b10 < 0.) return;
535  if (b10 > b9)
536  throw std::runtime_error("genf::GFDaf::setBetas(): b10 > b9");
537  fBeta.push_back(b10);
538 
539 }
void setDetPlane(std::string key, unsigned int index, const GFDetPlane &pl)
GFException & setNumbers(std::string, const std::vector< double > &)
set list of numbers with description
Definition: GFException.cxx:34
GFDaf()
Standard CTOR. Sets default values for annealing scheme and probablity cut.
Definition: GFDaf.cxx:44
const GFDetPlane & getReferencePlane() const
constexpr T pow(T x)
Definition: pow.h:72
void invertMatrix(const TMatrixT< Double_t > &, TMatrixT< Double_t > &)
invert a matrix. First argument is matrix to be inverted, second is return by ref.
Definition: GFDaf.cxx:380
void setBetas(double b1, double b2, double b3=-1., double b4=-1., double b5=-1., double b6=-1., double b7=-1., double b8=-1., double b9=-1., double b10=-1.)
Configure the annealing scheme. In the current implementation you need to provide at least two temper...
Definition: GFDaf.cxx:451
virtual const char * what() const
standard error message handling for exceptions. use like "std::cerr << e.what();" ...
Definition: GFException.cxx:48
GFAbsTrackRep * getTrackRep(int id) const
Accessor for track representations.
Definition: GFTrack.h:196
void setNumber(std::string key, unsigned int index, const double &num)
const TMatrixT< Double_t > & getState() const
void setNhits(int n)
Definition: GFBookkeeping.h:50
void processTrack(GFTrack *)
Performs DAF fit on all track representations in a GFTrack.
Definition: GFDaf.cxx:52
double fBlowUpFactor
Definition: GFDaf.h:106
Base Class for genfit track representations. Defines interface for track parameterizations.
Definition: GFAbsTrackRep.h:83
void setCov(const TMatrixT< Double_t > &aCov)
void setMatrix(std::string key, unsigned int index, const TMatrixT< Double_t > &mat)
std::map< int, double > chi2Cuts
Definition: GFDaf.h:108
const double e
void bookGFDetPlanes(std::string key)
unsigned int getNumReps() const
Get number of track represenatations.
Definition: GFTrack.h:202
std::vector< double > fBeta
Definition: GFDaf.h:107
virtual void setData(const TMatrixT< Double_t > &st, const GFDetPlane &pl, const TMatrixT< Double_t > *cov=NULL)
void addFailedHit(unsigned int irep, unsigned int id)
Definition: GFTrack.h:294
bool isFatal()
get fatal flag.
Definition: GFException.h:80
GFAbsRecoHit * getHit(int id) const
Definition: GFTrack.h:160
TMatrixT< Double_t > calcGain(const TMatrixT< Double_t > &cov, const TMatrixT< Double_t > &HitCov, const TMatrixT< Double_t > &H, const double &p)
Calculate Kalman Gain.
Definition: GFDaf.cxx:399
p
Definition: test.py:223
virtual double extrapolate(const GFDetPlane &plane, TMatrixT< Double_t > &statePred)
returns the tracklength spanned in this extrapolation
unsigned int hitFailed(unsigned int)
const TMatrixT< Double_t > & getCov() const
GFBookkeeping * getBK(int index=-1)
get GFBookKeeping object for particular track rep (default is cardinal rep)
Definition: GFTrack.h:335
void setProbCut(double val)
Set the probabilty cut for the weight calculation for the hits. Currently supported are the values 0...
Definition: GFDaf.cxx:421
void info()
print information in the exception object
Definition: GFException.cxx:58
bool getNumber(std::string key, unsigned int index, double &num) const
unsigned int getNumHits() const
Definition: GFTrack.h:164
void clearFailedHits()
Definition: GFTrack.h:423
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
Definition: GFException.h:48
void setStatusFlag(int _val)
void bookMatrices(std::string key)
bool getMatrix(std::string key, unsigned int index, TMatrixT< Double_t > &mat) const
void bookNumbers(std::string key, double val=0.)
GFException & setFatal(bool b=true)
set fatal flag. if this is true, the fit stops for this current track repr.
Definition: GFException.h:78
void getHitsByPlane(std::vector< std::vector< int > * > &retVal)
Definition: GFTrack.cxx:220
#define COVEXC
Definition: GFDaf.cxx:41
unsigned int getDim() const
returns dimension of state vector
void blowUpCovs(GFTrack *trk)
This is needed to blow up the covariance matrix before a fitting pass. The method drops off-diagonal ...
Definition: GFDaf.cxx:355
bool getDetPlane(std::string key, unsigned int index, GFDetPlane &pl) const
void clearBookkeeping()
Definition: GFTrack.h:417