22 const double elmass = 0.000510998;
23 const double mumass = 0.105658367;
24 const double pimass = 0.13957;
25 const double kmass = 0.493677;
26 const double pmass = 0.938272;
63 std::ostream&
dump(std::ostream& out = std::cout)
const 98 bool trackAlongPlaneDir,
100 : fTrackStatePar(trackStatePar), fTrackStateCov(trackStateCov),
fPlane(plane), fPid(pid)
103 fPos =
Point_t(par6d[0], par6d[1], par6d[2]);
104 fMom =
Point_t(par6d[3], par6d[4], par6d[5]);
118 int pID()
const {
return fPid; }
122 if (
abs(fPid) == 11) {
return elmass; }
123 if (
abs(fPid) == 13) {
return mumass; }
124 if (
abs(fPid) == 211) {
return pimass; }
125 if (
abs(fPid) == 321) {
return kmass; }
126 if (
abs(fPid) == 2212) {
return pmass; }
132 return SVector6(fPos.X(), fPos.Y(), fPos.Z(), fMom.X(), fMom.Y(), fMom.Z());
144 std::ostream&
dump(std::ostream& out = std::cout)
const 146 out <<
"TrackState with pID=" << pID() <<
" mass=" << mass() <<
"\npars=" << parameters()
147 <<
" position=" << position() <<
" momentum=" << momentum() <<
"\ncov=\n" 148 << covariance() <<
"\non plane with pos=" <<
plane().
position()
149 <<
" and dir=" <<
plane().
direction() <<
" along=" << isTrackAlongPlaneDir() <<
"\n";
156 return hitstate.
hitMeas() - fTrackStatePar(0);
162 return hitstate.
hitMeasErr2() + fTrackStateCov(0, 0);
168 return sqrt(combinedError2(hitstate));
174 return residual(hitstate) * residual(hitstate) / combinedError2(hitstate);
183 fTrackStatePar = trackStatePar;
185 fPos =
Point_t(par6d[0], par6d[1], par6d[2]);
186 fMom =
Vector_t(par6d[3], par6d[4], par6d[5]);
int fPid
particle id hypthesis of the track
Plane fPlane
plane where the parameters are defined
Class for track parameters (and errors) defined on a recob::tracking::Plane.
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
Vector_t const & direction() const
Reference direction orthogonal to the plane.
const geo::WireID & wireId() const
Reconstruction base classes.
void setCovariance(const SMatrixSym55 &trackStateCov)
Set the covariance matrix of the TrackState.
recob::tracking::Point_t Point_t
recob::tracking::Vector_t Vector_t
const Vector_t & momentum() const
momentum of the track
const SVector5 & parameters() const
track parameters defined on the plane
recob::tracking::SMatrixSym55 SMatrixSym55
constexpr auto abs(T v)
Returns the absolute value of the argument.
ROOT::Math::SMatrix< Double32_t, 5, 5, ROOT::Math::MatRepSym< Double32_t, 5 >> SMatrixSym55
SMatrixSym66 covariance6D() const
track parameter covariance matrix in global cartesian coordinates
ROOT::Math::SMatrix< Double32_t, 6, 6, ROOT::Math::MatRepSym< Double32_t, 6 >> SMatrixSym66
WireID_t Wire
Index of the wire within its plane.
recob::tracking::SMatrix55 SMatrix55
double mass() const
mass hypthesis of the track
const Point_t & position() const
position of the track
double hitMeasErr2() const
const Plane & plane() const
bool isTrackAlongPlaneDir() const
is the track momentum along the plane direction?
recob::tracking::SVector5 SVector5
int pID() const
particle id hypthesis of the track
Vector_t fMom
momentum of the track (cached)
Point_t const & position() const
Reference position on the plane.
SMatrixSym66 Local5DToGlobal6DCovariance(SMatrixSym55 cov5d, bool hasMomentum, const Vector_t &trackMomOrDir) const
Translate track covariance from local to global coordinates. The track momentum (or direction) is nee...
void setParameters(const SVector5 &trackStatePar)
Set the parameters of the TrackState; also update the global position and momentum accordingly...
ROOT::Math::SVector< Double32_t, 6 > SVector6
ROOT::Math::SMatrix< Double32_t, 5, 5 > SMatrix55
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< Coord_t >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space. See recob::tracking::Coord_t for more details on the ...
Plane makePlane(recob::tracking::Point_t const &pos, recob::tracking::Vector_t const &dir)
helper function to construct a recob::tracking::Plane from a Point_t and a Vector_t; the point is on ...
SMatrixSym55 fTrackStateCov
track parameter covariance matrix on the plane
PlaneID_t Plane
Index of the plane within its TPC.
Definition of data types for geometry description.
SVector6 Local5DToGlobal6DParameters(const SVector5 &par5d, bool trackAlongPlaneDir=true) const
Function to convert parameters from local to global coordinates. Local coordinates are on the plane w...
Class defining a plane for tracking. It provides various functionalities to convert track parameters ...
double chi2(const HitState &hitstate) const
Chi2 of the TrackState with respect to a HitState. The two states must be on the same plane; it is re...
double combinedError(const HitState &hitstate) const
Combined error of the TrackState with respect to a HitState. The two states must be on the same plane...
SVector6 parameters6D() const
track parameters in global cartesian coordinates
const geo::WireID fWireId
ROOT::Math::SVector< Double32_t, 5 > SVector5
std::ostream & dump(std::ostream &out=std::cout) const
const SMatrixSym55 & covariance() const
track parameter covariance matrix on the plane
recob::tracking::SMatrixSym66 SMatrixSym66
std::ostream & dump(std::ostream &out=std::cout) const
Printout information.
double residual(const HitState &hitstate) const
Residual of the TrackState with respect to a HitState. The two states must be on the same plane; it i...
HitState(double hitMeas, double hitMeasErr2, geo::WireID const &wireId, const geo::WireGeo &wgeom)
recob::tracking::SVector6 SVector6
constexpr double kBogusD
obviously bogus double value
Class for a measurement on a recob::tracking::Plane (plane defined by a wire and the drift direction)...
Point_t fPos
position of the track (cached)
Collection of Physical constants used in LArSoft.
const Plane & plane() const
plane where the parameters are defined
recob::tracking::Plane Plane
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< Coord_t >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space. See recob::tracking::Coord_t for more detai...
TrackState(const SVector5 &trackStatePar, const SMatrixSym55 &trackStateCov, const Plane &plane, bool trackAlongPlaneDir, int pid)
SVector5 fTrackStatePar
track parameters defined on the plane
HitState(double hitMeas, double hitMeasErr2, geo::WireID &&wireId, const geo::WireGeo &wgeom)
double combinedError2(const HitState &hitstate) const
Combined squared error of the TrackState with respect to a HitState. The two states must be on the sa...