12 #include "cetlib_except/exception.h" 52 throw cet::exception(
"KHitMulti") <<
"Attempt to add null measurement pointer.\n";
56 std::shared_ptr<const KHit<1> > pmeas1 =
62 throw cet::exception(
"KHitMulti") <<
"Dynamic cast for KHitBase pointer failed.\n";
77 throw cet::exception(
"KHitMulti") <<
"Attempt to add null measurement pointer.\n";
137 for(
unsigned int im = 0; ok && im <
fMeasVec.size(); ++im) {
142 ok = meas.
predict(tre, prop, ref);
156 for(
unsigned int j = 0; j < meas.
getH().size2(); ++j)
157 fH(im, j) = meas.
getH()(0, j);
164 ublas::matrix<double> temp(
fH.size2(),
fMeasDim);
167 temp2 = prod(
fH, temp);
168 fPerr = ublas::symmetric_adaptor<ublas::matrix<double> >(temp2);
180 ublas::vector<double> rtemp = prod(
fRinv, fRvec);
181 fChisq = inner_prod(fRvec, rtemp);
211 throw cet::exception(
"KHitMulti") <<
"Track surface not the same as prediction surface.\n";
215 TrackVector::size_type size = tvec.size();
219 ublas::matrix<double> temp(size,
fMeasDim);
220 ublas::matrix<double> gain(size,
fMeasDim);
222 gain = prod(terr, temp);
230 TrackMatrix fact = ublas::identity_matrix<TrackVector::value_type>(size);
231 fact -= prod(gain,
fH);
234 TrackError errtemp2s = ublas::symmetric_adaptor<TrackMatrix>(errtemp2);
235 ublas::matrix<double> errtemp3 = prod(
fMerr, trans(gain));
237 TrackError errtemp4s = ublas::symmetric_adaptor<TrackMatrix>(errtemp4);
250 out <<
"KHitMulti:\n";
const TrackError & getError() const
Track error matrix.
ublas::vector< double > fPvec
Prediction vector.
bool predict(const KETrack &tre, const Propagator *prop=0, const KTrack *ref=0) const
Prediction method (return false if fail).
const std::shared_ptr< const Surface > & getSurface() const
Surface.
KSymMatrix< 5 >::type TrackError
Track error matrix, dimension 5x5.
void setVector(const TrackVector &vec)
Set state vector.
const KSymMatrix< N >::type & getMeasError() const
Measurement error matrix.
Compound Kalman Filter measurement.
const KHMatrix< N >::type & getH() const
Kalman H-matrix.
std::vector< std::shared_ptr< const KHit< 1 > > > fMeasVec
Underlying measurements.
void setError(const TrackError &err)
Set error matrix.
const KVector< N >::type & getPredVector() const
Prediction vector.
std::shared_ptr< const Surface > fPredSurf
Prediction surface.
bool syminvert(ublas::symmetric_matrix< T, TRI, L, A > &m)
void addMeas(const std::shared_ptr< const KHitBase > &pmeas)
Add a measurement of unknown type.
ublas::symmetric_matrix< double > fRinv
Residual inverse error matrix.
KVector< 5 >::type TrackVector
Track state vector, dimension 5.
virtual std::ostream & Print(std::ostream &out, bool doTitle=true) const
Printout.
bool predict(const KETrack &tre, const Propagator *prop=0, const KTrack *ref=0) const
Prediction method (return false if fail).
KHitMulti()
Default constructor.
ublas::symmetric_matrix< double > fPerr
Prediction error matrix.
double fPredDist
Prediction distance.
ublas::vector< double > fRvec
Residual vector.
const TrackVector & getVector() const
Track state vector.
const KVector< N >::type & getMeasVector() const
Measurement vector.
ublas::matrix< double > fH
Kalman H-matrix.
KMatrix< 5, 5 >::type TrackMatrix
General 5x5 matrix.
ublas::symmetric_matrix< double > fRerr
Residual error matrix.
ublas::symmetric_matrix< double > fMerr
Measurement error matrix.
void update(KETrack &tre) const
Update track method.
double fChisq
Incremental chisquare.
cet::coded_exception< error, detail::translate > exception
ublas::vector< double > fMvec
Measurement vector.
const std::shared_ptr< const Surface > & getPredSurface() const
Predition surface.
virtual ~KHitMulti()
Destructor.
int fMeasDim
Measurement space dimension.