13 #include "cetlib_except/exception.h" 46 KTrack(psurf, vec, dir, pdg),
77 throw cet::exception(
"KETrack") <<
"Pointing error requested for invalid track.\n";
101 throw cet::exception(
"KETrack") <<
"Track combination surfaces are not the same.\n";
105 boost::optional<double> result(
false, 0.);
122 for(
unsigned int i=0; i<err1->size1(); ++i)
126 for(
unsigned int i=0; i<err2->size1(); ++i)
165 TrackError terr2s = ublas::symmetric_adaptor<TrackMatrix>(terr2);
173 double chisq = inner_prod(dvec, dvec1);
174 result = boost::optional<double>(
true, chisq);
180 result = boost::optional<double>(
false, 0.);
199 out <<
" Diagonal errors:\n" 201 for(
unsigned int i = 0; i <
fErr.size1(); ++i) {
204 double err =
fErr(i,i);
205 err = (err >= 0. ? std::sqrt(err) : -std::sqrt(-err));
212 out <<
" Correlation matrix:";
213 for(
unsigned int i = 0; i <
fErr.size1(); ++i) {
218 for(
unsigned int j = 0; j <= i; ++j) {
224 double eiijj =
fErr(i,i) *
fErr(j,j);
225 double eij =
fErr(i,j);
227 eij /= std::sqrt(std::abs(eiijj));
const TrackError & getError() const
Track error matrix.
TrackDirection
Track direction enum.
const std::shared_ptr< const Surface > & getSurface() const
Surface.
double PointingError() const
Pointing error (radians).
KSymMatrix< 5 >::type TrackError
Track error matrix, dimension 5x5.
void setVector(const TrackVector &vec)
Set state vector.
KETrack()
Default constructor.
boost::optional< double > combineTrack(const KETrack &tre)
Combine two tracks.
void setError(const TrackError &err)
Set error matrix.
virtual ~KETrack()
Destructor.
bool syminvert(ublas::symmetric_matrix< T, TRI, L, A > &m)
KVector< 5 >::type TrackVector
Track state vector, dimension 5.
virtual std::ostream & Print(std::ostream &out, bool doTitle=true) const
Printout.
const TrackVector & getVector() const
Track state vector.
KMatrix< 5, 5 >::type TrackMatrix
General 5x5 matrix.
TrackError fErr
Track error matrix.
virtual std::ostream & Print(std::ostream &out, bool doTitle=true) const
Printout.
Basic Kalman filter track class, with error.
cet::coded_exception< error, detail::translate > exception
bool isValid() const
Test if track is valid.