LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
trkf::KHit< N > Class Template Referenceabstract

#include "KHit.h"

Inheritance diagram for trkf::KHit< N >:
trkf::KHitBase

Public Member Functions

 KHit ()
 Default constructor. More...
 
 KHit (const std::shared_ptr< const Surface > &psurf)
 Initializing Constructor – surface only. More...
 
 KHit (const std::shared_ptr< const Surface > &psurf, const typename KVector< N >::type &mvec, const typename KSymMatrix< N >::type &merr)
 Fully Initializing Constructor. More...
 
virtual ~KHit ()
 Destructor. More...
 
void setMeasVector (const typename KVector< N >::type &mvec)
 Set measurement vector. More...
 
void setMeasError (const typename KSymMatrix< N >::type &merr)
 Set measurement error. More...
 
const KVector< N >::type & getMeasVector () const
 Measurement vector. More...
 
const KSymMatrix< N >::type & getMeasError () const
 Measurement error matrix. More...
 
const KVector< N >::type & getPredVector () const
 Prediction vector. More...
 
const KSymMatrix< N >::type & getPredError () const
 Prediction matrix. More...
 
const KVector< N >::type & getResVector () const
 Residual vector. More...
 
const KSymMatrix< N >::type & getResError () const
 Residual error matrix. More...
 
const KSymMatrix< N >::type & getResInvError () const
 Residual inv. error matrix. More...
 
const KHMatrix< N >::type & getH () const
 Kalman H-matrix. More...
 
double getChisq () const
 Incremental chisquare. More...
 
bool predict (const KETrack &tre, const Propagator *prop=0, const KTrack *ref=0) const
 Prediction method (return false if fail). More...
 
void update (KETrack &tre) const
 Update track method. More...
 
virtual bool subpredict (const KETrack &tre, typename KVector< N >::type &pvec, typename KSymMatrix< N >::type &perr, typename KHMatrix< N >::type &hmatrix) const =0
 Calculate prediction function (return via arguments). More...
 
virtual std::ostream & Print (std::ostream &out, bool doTitle=true) const
 Printout. More...
 
const std::shared_ptr< const Surface > & getPredSurface () const
 Predition surface. More...
 
double getPredDistance () const
 Prediction distance. More...
 
const std::shared_ptr< const Surface > & getMeasSurface () const
 Measurement surface. More...
 
int getMeasPlane () const
 Measurement plane index. More...
 
int getID () const
 Unique id. More...
 
void setMeasSurface (const std::shared_ptr< const Surface > &psurf)
 Measurement surface. More...
 
void setMeasPlane (int plane)
 Measurement plane. More...
 

Protected Attributes

std::shared_ptr< const SurfacefPredSurf
 Prediction surface. More...
 
double fPredDist
 Prediction distance. More...
 
int fID
 Unique id. More...
 

Private Attributes

KVector< N >::type fMvec
 Measurement vector. More...
 
KSymMatrix< N >::type fMerr
 Measurement error matrix. More...
 
KVector< N >::type fPvec
 Prediction vector. More...
 
KSymMatrix< N >::type fPerr
 Prediction error matrix. More...
 
KVector< N >::type fRvec
 Residual vector. More...
 
KSymMatrix< N >::type fRerr
 Residual error matrix. More...
 
KSymMatrix< N >::type fRinv
 Residual inverse error matrix. More...
 
KHMatrix< N >::type fH
 Kalman H-matrix. More...
 
double fChisq
 Incremental chisquare. More...
 

Detailed Description

template<int N>
class trkf::KHit< N >

Definition at line 73 of file KHit.h.

Constructor & Destructor Documentation

template<int N>
trkf::KHit< N >::KHit ( )

Default constructor.

Definition at line 167 of file KHit.h.

167  :
168  fChisq(0.)
169  {}
double fChisq
Incremental chisquare.
Definition: KHit.h:160
template<int N>
trkf::KHit< N >::KHit ( const std::shared_ptr< const Surface > &  psurf)

Initializing Constructor – surface only.

Initializing Constructor – surface only.

Arguments:

psurf - Surface pointer.

Definition at line 178 of file KHit.h.

178  :
179  KHitBase(psurf),
180  fChisq(0.)
181  {}
KHitBase()
Default constructor.
Definition: KHitBase.cxx:16
double fChisq
Incremental chisquare.
Definition: KHit.h:160
template<int N>
trkf::KHit< N >::KHit ( const std::shared_ptr< const Surface > &  psurf,
const typename KVector< N >::type &  mvec,
const typename KSymMatrix< N >::type &  merr 
)

Fully Initializing Constructor.

Fully Initializing Constructor.

Arguments:

psurf - Surface pointer. mvec - Measurement vector. merr - Measurement error.

Definition at line 192 of file KHit.h.

194  :
195  KHitBase(psurf),
196  fMvec(mvec),
197  fMerr(merr),
198  fChisq(0.)
199  {}
KVector< N >::type fMvec
Measurement vector.
Definition: KHit.h:152
KHitBase()
Default constructor.
Definition: KHitBase.cxx:16
KSymMatrix< N >::type fMerr
Measurement error matrix.
Definition: KHit.h:153
double fChisq
Incremental chisquare.
Definition: KHit.h:160
template<int N>
trkf::KHit< N >::~KHit ( )
virtual

Destructor.

Definition at line 203 of file KHit.h.

204  {}

Member Function Documentation

template<int N>
double trkf::KHit< N >::getChisq ( ) const
inlinevirtual

Incremental chisquare.

Implements trkf::KHitBase.

Definition at line 126 of file KHit.h.

126 {return fChisq;}
double fChisq
Incremental chisquare.
Definition: KHit.h:160
template<int N>
const KHMatrix<N>::type& trkf::KHit< N >::getH ( ) const
inline

Kalman H-matrix.

Definition at line 123 of file KHit.h.

Referenced by trkf::KHitMulti::predict().

123 {return fH;}
KHMatrix< N >::type fH
Kalman H-matrix.
Definition: KHit.h:159
int trkf::KHitBase::getID ( ) const
inlineinherited
template<int N>
const KSymMatrix<N>::type& trkf::KHit< N >::getMeasError ( ) const
inline

Measurement error matrix.

Definition at line 105 of file KHit.h.

Referenced by trkf::KHitMulti::predict().

105 {return fMerr;}
KSymMatrix< N >::type fMerr
Measurement error matrix.
Definition: KHit.h:153
int trkf::KHitBase::getMeasPlane ( ) const
inlineinherited

Measurement plane index.

Definition at line 84 of file KHitBase.h.

References trkf::KHitBase::fMeasPlane.

Referenced by trkf::KalmanFilterAlg::buildTrack(), trkf::KalmanFilterAlg::cleanTrack(), trkf::KalmanFilterAlg::extendTrack(), and trkf::KGTrack::Print().

84 {return fMeasPlane;}
int fMeasPlane
Measurement plane index.
Definition: KHitBase.h:123
const std::shared_ptr<const Surface>& trkf::KHitBase::getMeasSurface ( ) const
inlineinherited

Measurement surface.

Definition at line 81 of file KHitBase.h.

References trkf::KHitBase::fMeasSurf.

Referenced by trkf::KHit< N >::predict(), trkf::KHitWireX::subpredict(), and trkf::KHitWireLine::subpredict().

81 {return fMeasSurf;}
std::shared_ptr< const Surface > fMeasSurf
Measurement surface.
Definition: KHitBase.h:122
template<int N>
const KVector<N>::type& trkf::KHit< N >::getMeasVector ( ) const
inline

Measurement vector.

Definition at line 102 of file KHit.h.

Referenced by trkf::KHitMulti::predict().

102 {return fMvec;}
KVector< N >::type fMvec
Measurement vector.
Definition: KHit.h:152
double trkf::KHitBase::getPredDistance ( ) const
inlineinherited

Prediction distance.

Definition at line 78 of file KHitBase.h.

References trkf::KHitBase::fPredDist.

Referenced by trkf::KalmanFilterAlg::buildTrack(), and trkf::KalmanFilterAlg::extendTrack().

78 {return fPredDist;}
double fPredDist
Prediction distance.
Definition: KHitBase.h:117
template<int N>
const KSymMatrix<N>::type& trkf::KHit< N >::getPredError ( ) const
inline

Prediction matrix.

Definition at line 111 of file KHit.h.

111 {return fPerr;}
KSymMatrix< N >::type fPerr
Prediction error matrix.
Definition: KHit.h:155
const std::shared_ptr<const Surface>& trkf::KHitBase::getPredSurface ( ) const
inlineinherited

Predition surface.

Definition at line 75 of file KHitBase.h.

References trkf::KHitBase::fPredSurf.

Referenced by trkf::KHitMulti::update(), and trkf::KHit< N >::update().

75 {return fPredSurf;}
std::shared_ptr< const Surface > fPredSurf
Prediction surface.
Definition: KHitBase.h:116
template<int N>
const KVector<N>::type& trkf::KHit< N >::getPredVector ( ) const
inline

Prediction vector.

Definition at line 108 of file KHit.h.

Referenced by trkf::KHitMulti::predict().

108 {return fPvec;}
KVector< N >::type fPvec
Prediction vector.
Definition: KHit.h:154
template<int N>
const KSymMatrix<N>::type& trkf::KHit< N >::getResError ( ) const
inline

Residual error matrix.

Definition at line 117 of file KHit.h.

Referenced by trkf::Track3DKalmanHit::fillHistograms(), and trkf::TrackKalmanCheater::produce().

117 {return fRerr;}
KSymMatrix< N >::type fRerr
Residual error matrix.
Definition: KHit.h:157
template<int N>
const KSymMatrix<N>::type& trkf::KHit< N >::getResInvError ( ) const
inline

Residual inv. error matrix.

Definition at line 120 of file KHit.h.

120 {return fRinv;}
KSymMatrix< N >::type fRinv
Residual inverse error matrix.
Definition: KHit.h:158
template<int N>
const KVector<N>::type& trkf::KHit< N >::getResVector ( ) const
inline

Residual vector.

Definition at line 114 of file KHit.h.

Referenced by trkf::Track3DKalmanHit::fillHistograms(), and trkf::TrackKalmanCheater::produce().

114 {return fRvec;}
KVector< N >::type fRvec
Residual vector.
Definition: KHit.h:156
template<int N>
bool trkf::KHit< N >::predict ( const KETrack tre,
const Propagator prop = 0,
const KTrack ref = 0 
) const
virtual

Prediction method (return false if fail).

Prediction method.

Arguments;

tre - Track prediction. prop - Propagator. ref - Reference track.

Implements trkf::KHitBase.

Definition at line 215 of file KHit.h.

References trkf::Propagator::err_prop(), trkf::KHit< N >::fChisq, trkf::KHit< N >::fH, trkf::KHit< N >::fMerr, trkf::KHit< N >::fMvec, trkf::KHit< N >::fPerr, trkf::KHitBase::fPredDist, trkf::KHitBase::fPredSurf, trkf::KHit< N >::fPvec, trkf::KHit< N >::fRerr, trkf::KHit< N >::fRinv, trkf::KHit< N >::fRvec, trkf::KHitBase::getMeasSurface(), trkf::KTrack::getSurface(), trkf::KHit< N >::subpredict(), trkf::syminvert(), and trkf::Propagator::UNKNOWN.

Referenced by trkf::KHit< 1 >::getChisq(), and trkf::KHitMulti::predict().

216  {
217  // Update the prediction surface to be the track surface.
218 
219  fPredSurf = tre.getSurface();
220  fPredDist = 0.;
221 
222  // Default result.
223 
224  bool ok = false;
225 
226  // Update prediction vector, error matrox, and H-matrix.
227 
228  // First test whether the prediction surface matches the
229  // measurement surface.
230 
231  if(getMeasSurface()->isEqual(*fPredSurf)) {
232 
233  // Prediction and measurement surfaces agree.
234  //Just call subpredict method (don't do propagation).
235 
236  ok = subpredict(tre, fPvec, fPerr, fH);
237  }
238  else {
239 
240  // Track surface does not match the prediction surface, so an
241  // internal propagation will be required. Throw an exception if
242  // no propagator was provided.
243 
244  if(prop == 0)
245  throw cet::exception("KHit") << "Track surface does not match measurement surface and no propagator.\n";
246 
247  // First make a copy of the original KETrack.
248 
249  KETrack treprop(tre);
250 
251  // Also make a copy of the reference track (if specified).
252 
253  KTrack refprop;
254  KTrack* prefprop = 0;
255  if(ref != 0) {
256  refprop = *ref;
257  prefprop = &refprop;
258  }
259 
260 
261  // Make a no-noise, no-dE/dx propagation to the measurement
262  // surface. But do calculate the propagation matrix, which we
263  // will use to update the H-matrix calculated in the derived
264  // class.
265 
266  TrackMatrix prop_matrix;
267  boost::optional<double> dist = prop->err_prop(treprop, getMeasSurface(),
268  Propagator::UNKNOWN, false,
269  prefprop, &prop_matrix);
270  ok = !!dist;
271  if(ok) {
272 
273  // Update prediction distance.
274 
275  fPredDist = *dist;
276 
277  // Now we are ready to calculate the prediction on the
278  // measurement surface.
279 
280  typename KHMatrix<N>::type hmatrix;
281  ok = subpredict(treprop, fPvec, fPerr, hmatrix);
282  if(ok) {
283 
284  // Use the propagation matrix to transform the H-matrix back
285  // to the prediction surface.
286 
287  fH = prod(hmatrix, prop_matrix);
288  }
289  }
290  }
291  if(ok) {
292 
293  // Update residual
294 
295  fRvec = fMvec - fPvec;
296  fRerr = fMerr + fPerr;
297  fRinv = fRerr;
298  ok = syminvert(fRinv);
299  if(ok) {
300 
301  // Calculate incremental chisquare.
302 
303  // (workaround: if we use the copy constructor, gcc emits a spurious warning)
304 // typename KVector<N>::type rtemp = prod(fRinv, fRvec);
305  fChisq = inner_prod(fRvec, prod(fRinv, fRvec));
306  }
307  }
308 
309  // If a problem occured at any step, clear the prediction surface pointer.
310 
311  if(!ok) {
312  fPredSurf.reset();
313  fPredDist = 0.;
314  }
315 
316  // Done.
317 
318  return ok;
319  }
virtual bool subpredict(const KETrack &tre, typename KVector< N >::type &pvec, typename KSymMatrix< N >::type &perr, typename KHMatrix< N >::type &hmatrix) const =0
Calculate prediction function (return via arguments).
KVector< N >::type fPvec
Prediction vector.
Definition: KHit.h:154
KMatrix< N, 5 >::type type
KVector< N >::type fMvec
Measurement vector.
Definition: KHit.h:152
KVector< N >::type fRvec
Residual vector.
Definition: KHit.h:156
std::shared_ptr< const Surface > fPredSurf
Prediction surface.
Definition: KHitBase.h:116
bool syminvert(ublas::symmetric_matrix< T, TRI, L, A > &m)
KHMatrix< N >::type fH
Kalman H-matrix.
Definition: KHit.h:159
KSymMatrix< N >::type fRinv
Residual inverse error matrix.
Definition: KHit.h:158
double fPredDist
Prediction distance.
Definition: KHitBase.h:117
KSymMatrix< N >::type fRerr
Residual error matrix.
Definition: KHit.h:157
KMatrix< 5, 5 >::type TrackMatrix
General 5x5 matrix.
KSymMatrix< N >::type fPerr
Prediction error matrix.
Definition: KHit.h:155
KSymMatrix< N >::type fMerr
Measurement error matrix.
Definition: KHit.h:153
const std::shared_ptr< const Surface > & getMeasSurface() const
Measurement surface.
Definition: KHitBase.h:81
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
double fChisq
Incremental chisquare.
Definition: KHit.h:160
template<int N>
std::ostream & trkf::KHit< N >::Print ( std::ostream &  out,
bool  doTitle = true 
) const
virtual

Printout.

Reimplemented from trkf::KHitBase.

Definition at line 371 of file KHit.h.

References trkf::KHit< N >::fChisq, trkf::KHit< N >::fMerr, trkf::KHit< N >::fMvec, trkf::KHit< N >::fPerr, trkf::KHit< N >::fPvec, trkf::KHit< N >::fRerr, trkf::KHit< N >::fRvec, and trkf::KHitBase::Print().

Referenced by trkf::KHit< 1 >::getChisq().

372  {
373  if(doTitle)
374  out << "KHit<" << N << ">:\n";
375 
376  // Print base class.
377 
378  KHitBase::Print(out, false);
379 
380  // Print measurement vector.
381 
382  out << " Measurement vector:\n"
383  << " [";
384  for(unsigned int i = 0; i < fMvec.size(); ++i) {
385  if(i != 0)
386  out << ", ";
387  out << fMvec(i);
388  }
389  out << "]\n";
390 
391  // Print diagonal measurement errors.
392 
393  out << " Diagonal measurement errors:\n"
394  << " [";
395  for(unsigned int i = 0; i < fMerr.size1(); ++i) {
396  if(i != 0)
397  out << ", ";
398  double err = fMerr(i,i);
399  err = (err >= 0. ? std::sqrt(err) : -std::sqrt(-err));
400  out << err;
401  }
402  out << "]\n";
403 
404  // Print measurement correlations.
405 
406  if(fMerr.size1() > 1) {
407  out << " Measurement correlation matrix:";
408  for(unsigned int i = 0; i < fMerr.size1(); ++i) {
409  if(i == 0)
410  out << "\n [";
411  else
412  out << "\n ";
413  for(unsigned int j = 0; j <= i; ++j) {
414  if(j != 0)
415  out << ", ";
416  if(i == j)
417  out << 1.;
418  else {
419  double eiijj = fMerr(i,i) * fMerr(j,j);
420  double eij = fMerr(i,j);
421  if(eiijj != 0.)
422  eij /= std::sqrt(std::abs(eiijj));
423  else
424  eij = 0.;
425  out << eij;
426  }
427  }
428  }
429  out << "]\n";
430  }
431 
432  // Print prediction vector.
433 
434  out << " Prediction vector:\n"
435  << " [";
436  for(unsigned int i = 0; i < fPvec.size(); ++i) {
437  if(i != 0)
438  out << ", ";
439  out << fPvec(i);
440  }
441  out << "]\n";
442 
443  // Print diagonal prediction errors.
444 
445  out << " Diagonal prediction errors:\n"
446  << " [";
447  for(unsigned int i = 0; i < fPerr.size1(); ++i) {
448  if(i != 0)
449  out << ", ";
450  double err = fPerr(i,i);
451  err = (err >= 0. ? std::sqrt(err) : -std::sqrt(-err));
452  out << err;
453  }
454  out << "]\n";
455 
456  // Print prediction correlations.
457 
458  if(fPerr.size1() > 1) {
459  out << " Prediction correlation matrix:";
460  for(unsigned int i = 0; i < fPerr.size1(); ++i) {
461  if(i == 0)
462  out << "\n [";
463  else
464  out << "\n ";
465  for(unsigned int j = 0; j <= i; ++j) {
466  if(j != 0)
467  out << ", ";
468  if(i == j)
469  out << 1.;
470  else {
471  double eiijj = fPerr(i,i) * fPerr(j,j);
472  double eij = fPerr(i,j);
473  if(eiijj != 0.)
474  eij /= std::sqrt(std::abs(eiijj));
475  else
476  eij = 0.;
477  out << eij;
478  }
479  }
480  }
481  out << "]\n";
482  }
483 
484  // Print residual vector.
485 
486  out << " Residual vector:\n"
487  << " [";
488  for(unsigned int i = 0; i < fRvec.size(); ++i) {
489  if(i != 0)
490  out << ", ";
491  out << fRvec(i);
492  }
493  out << "]\n";
494 
495  // Print diagonal residual errors.
496 
497  out << " Diagonal residual errors:\n"
498  << " [";
499  for(unsigned int i = 0; i < fRerr.size1(); ++i) {
500  if(i != 0)
501  out << ", ";
502  double err = fRerr(i,i);
503  err = (err >= 0. ? std::sqrt(err) : -std::sqrt(-err));
504  out << err;
505  }
506  out << "]\n";
507 
508  // Print residual correlations.
509 
510  if(fRerr.size1() > 1) {
511  out << " Residual correlation matrix:";
512  for(unsigned int i = 0; i < fRerr.size1(); ++i) {
513  if(i == 0)
514  out << "\n [";
515  else
516  out << "\n ";
517  for(unsigned int j = 0; j <= i; ++j) {
518  if(j != 0)
519  out << ", ";
520  if(i == j)
521  out << 1.;
522  else {
523  double eiijj = fRerr(i,i) * fRerr(j,j);
524  double eij = fRerr(i,j);
525  if(eiijj != 0.)
526  eij /= std::sqrt(std::abs(eiijj));
527  else
528  eij = 0.;
529  out << eij;
530  }
531  }
532  }
533  out << "]\n";
534  }
535 
536  // Print incremental chisquare.
537 
538  out << " Incremental chisquare = " << fChisq << "\n";
539 
540  // Done.
541 
542  return out;
543  }
STL namespace.
virtual std::ostream & Print(std::ostream &out, bool doTitle=true) const
Printout.
Definition: KHitBase.cxx:40
KVector< N >::type fPvec
Prediction vector.
Definition: KHit.h:154
KVector< N >::type fMvec
Measurement vector.
Definition: KHit.h:152
KVector< N >::type fRvec
Residual vector.
Definition: KHit.h:156
KSymMatrix< N >::type fRerr
Residual error matrix.
Definition: KHit.h:157
KSymMatrix< N >::type fPerr
Prediction error matrix.
Definition: KHit.h:155
KSymMatrix< N >::type fMerr
Measurement error matrix.
Definition: KHit.h:153
double fChisq
Incremental chisquare.
Definition: KHit.h:160
template<int N>
void trkf::KHit< N >::setMeasError ( const typename KSymMatrix< N >::type &  merr)
inline

Set measurement error.

Definition at line 97 of file KHit.h.

97 {fMerr = merr;}
KSymMatrix< N >::type fMerr
Measurement error matrix.
Definition: KHit.h:153
void trkf::KHitBase::setMeasPlane ( int  plane)
inlineinherited
void trkf::KHitBase::setMeasSurface ( const std::shared_ptr< const Surface > &  psurf)
inlineinherited

Measurement surface.

Definition at line 92 of file KHitBase.h.

References trkf::KHitBase::fMeasSurf.

Referenced by trkf::KHitWireLine::KHitWireLine(), and trkf::KHitWireX::KHitWireX().

92 {fMeasSurf = psurf;}
std::shared_ptr< const Surface > fMeasSurf
Measurement surface.
Definition: KHitBase.h:122
template<int N>
void trkf::KHit< N >::setMeasVector ( const typename KVector< N >::type &  mvec)
inline

Set measurement vector.

Definition at line 94 of file KHit.h.

94 {fMvec = mvec;}
KVector< N >::type fMvec
Measurement vector.
Definition: KHit.h:152
template<int N>
virtual bool trkf::KHit< N >::subpredict ( const KETrack tre,
typename KVector< N >::type &  pvec,
typename KSymMatrix< N >::type &  perr,
typename KHMatrix< N >::type &  hmatrix 
) const
pure virtual

Calculate prediction function (return via arguments).

Referenced by trkf::KHit< 1 >::getChisq(), and trkf::KHit< N >::predict().

template<int N>
void trkf::KHit< N >::update ( KETrack tre) const
virtual

Update track method.

Update track method.

Arguments:

tre - Track to be updated.

Implements trkf::KHitBase.

Definition at line 328 of file KHit.h.

References trkf::KHit< N >::fH, trkf::KHit< N >::fMerr, trkf::KHit< N >::fRinv, trkf::KHit< N >::fRvec, trkf::KETrack::getError(), trkf::KHitBase::getPredSurface(), trkf::KTrack::getSurface(), trkf::KTrack::getVector(), trkf::KETrack::setError(), and trkf::KTrack::setVector().

Referenced by trkf::KHit< 1 >::getChisq().

329  {
330  // Make sure that the track surface and the prediction surface are the same.
331  // Throw an exception if they are not.
332 
333  if(!getPredSurface()->isEqual(*tre.getSurface()))
334  throw cet::exception("KHit") << "Track surface not the same as prediction surface.\n";
335 
336  const TrackVector& tvec = tre.getVector();
337  const TrackError& terr = tre.getError();
338  TrackVector::size_type size = tvec.size();
339 
340  // Calculate gain matrix.
341 
342  typename KGMatrix<N>::type temp(size, N);
343  typename KGMatrix<N>::type gain(size, N);
344  temp = prod(trans(fH), fRinv);
345  gain = prod(terr, temp);
346 
347  // Calculate updated track state.
348 
349  TrackVector newvec = tre.getVector() + prod(gain, fRvec);
350 
351  // Calculate updated error matrix.
352 
353  TrackMatrix fact = ublas::identity_matrix<TrackVector::value_type>(size);
354  fact -= prod(gain, fH);
355  TrackMatrix errtemp1 = prod(terr, trans(fact));
356  TrackMatrix errtemp2 = prod(fact, errtemp1);
357  TrackError errtemp2s = ublas::symmetric_adaptor<TrackMatrix>(errtemp2);
358  typename KHMatrix<N>::type errtemp3 = prod(fMerr, trans(gain));
359  TrackMatrix errtemp4 = prod(gain, errtemp3);
360  TrackError errtemp4s = ublas::symmetric_adaptor<TrackMatrix>(errtemp4);
361  TrackError newerr = errtemp2s + errtemp4s;
362 
363  // Update track.
364 
365  tre.setVector(newvec);
366  tre.setError(newerr);
367  }
KSymMatrix< 5 >::type TrackError
Track error matrix, dimension 5x5.
KMatrix< N, 5 >::type type
KVector< N >::type fRvec
Residual vector.
Definition: KHit.h:156
KHMatrix< N >::type fH
Kalman H-matrix.
Definition: KHit.h:159
KSymMatrix< N >::type fRinv
Residual inverse error matrix.
Definition: KHit.h:158
KVector< 5 >::type TrackVector
Track state vector, dimension 5.
KMatrix< 5, 5 >::type TrackMatrix
General 5x5 matrix.
KMatrix< 5, N >::type type
KSymMatrix< N >::type fMerr
Measurement error matrix.
Definition: KHit.h:153
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
const std::shared_ptr< const Surface > & getPredSurface() const
Predition surface.
Definition: KHitBase.h:75

Member Data Documentation

template<int N>
double trkf::KHit< N >::fChisq
mutableprivate

Incremental chisquare.

Definition at line 160 of file KHit.h.

Referenced by trkf::KHit< 1 >::getChisq(), trkf::KHit< N >::predict(), and trkf::KHit< N >::Print().

template<int N>
KHMatrix<N>::type trkf::KHit< N >::fH
mutableprivate

Kalman H-matrix.

Definition at line 159 of file KHit.h.

Referenced by trkf::KHit< 1 >::getH(), trkf::KHit< N >::predict(), and trkf::KHit< N >::update().

int trkf::KHitBase::fID
protectedinherited

Unique id.

Definition at line 118 of file KHitBase.h.

Referenced by trkf::KHitBase::getID(), trkf::KHitWireLine::KHitWireLine(), and trkf::KHitWireX::KHitWireX().

template<int N>
KSymMatrix<N>::type trkf::KHit< N >::fMerr
private
template<int N>
KVector<N>::type trkf::KHit< N >::fMvec
private
template<int N>
KSymMatrix<N>::type trkf::KHit< N >::fPerr
mutableprivate

Prediction error matrix.

Definition at line 155 of file KHit.h.

Referenced by trkf::KHit< 1 >::getPredError(), trkf::KHit< N >::predict(), and trkf::KHit< N >::Print().

double trkf::KHitBase::fPredDist
mutableprotectedinherited
std::shared_ptr<const Surface> trkf::KHitBase::fPredSurf
mutableprotectedinherited
template<int N>
KVector<N>::type trkf::KHit< N >::fPvec
mutableprivate

Prediction vector.

Definition at line 154 of file KHit.h.

Referenced by trkf::KHit< 1 >::getPredVector(), trkf::KHit< N >::predict(), and trkf::KHit< N >::Print().

template<int N>
KSymMatrix<N>::type trkf::KHit< N >::fRerr
mutableprivate

Residual error matrix.

Definition at line 157 of file KHit.h.

Referenced by trkf::KHit< 1 >::getResError(), trkf::KHit< N >::predict(), and trkf::KHit< N >::Print().

template<int N>
KSymMatrix<N>::type trkf::KHit< N >::fRinv
mutableprivate

Residual inverse error matrix.

Definition at line 158 of file KHit.h.

Referenced by trkf::KHit< 1 >::getResInvError(), trkf::KHit< N >::predict(), and trkf::KHit< N >::update().

template<int N>
KVector<N>::type trkf::KHit< N >::fRvec
mutableprivate

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