12 #include "cetlib_except/exception.h" 46 throw cet::exception(
"KHitMulti") <<
"Attempt to add null measurement pointer.\n";
50 std::shared_ptr<const KHit<1>> pmeas1 =
55 if (pmeas1.get() == 0)
56 throw cet::exception(
"KHitMulti") <<
"Dynamic cast for KHitBase pointer failed.\n";
71 throw cet::exception(
"KHitMulti") <<
"Attempt to add null measurement pointer.\n";
131 for (
unsigned int im = 0; ok && im <
fMeasVec.size(); ++im) {
136 ok = meas.
predict(tre, prop, ref);
149 for (
unsigned int j = 0; j < meas.
getH().size2(); ++j)
150 fH(im, j) = meas.
getH()(0, j);
157 ublas::matrix<double> temp(
fH.size2(),
fMeasDim);
160 temp2 = prod(
fH, temp);
161 fPerr = ublas::symmetric_adaptor<ublas::matrix<double>>(temp2);
173 ublas::vector<double> rtemp = prod(
fRinv, fRvec);
174 fChisq = inner_prod(fRvec, rtemp);
204 throw cet::exception(
"KHitMulti") <<
"Track surface not the same as prediction surface.\n";
208 TrackVector::size_type
size = tvec.size();
212 ublas::matrix<double> temp(size,
fMeasDim);
213 ublas::matrix<double> gain(size,
fMeasDim);
215 gain = prod(terr, temp);
223 TrackMatrix fact = ublas::identity_matrix<TrackVector::value_type>(
size);
224 fact -= prod(gain,
fH);
227 TrackError errtemp2s = ublas::symmetric_adaptor<TrackMatrix>(errtemp2);
228 ublas::matrix<double> errtemp3 = prod(
fMerr, trans(gain));
230 TrackError errtemp4s = ublas::symmetric_adaptor<TrackMatrix>(errtemp4);
242 if (doTitle) out <<
"KHitMulti:\n";
bool predict(const KETrack &tre, const Propagator &prop, const KTrack *ref=0) const
Prediction method (return false if fail).
const TrackError & getError() const
Track error matrix.
ublas::vector< double > fPvec
Prediction vector.
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.
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
KMatrix< 5, 5 >::type TrackMatrix
General 5x5 matrix.
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.
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.
bool predict(const KETrack &tre, const Propagator &prop, const KTrack *ref=0) const
Prediction method (return false if fail).
const KVector< N >::type & getMeasVector() const
Measurement vector.
ublas::matrix< double > fH
Kalman H-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.