LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
recob::tracking::Plane Class Reference

Class defining a plane for tracking. It provides various functionalities to convert track parameters and covariance matrices from global to local coordinates. More...

#include "TrackingPlane.h"

Classes

struct  TrigCache
 Struct caching trigonometric function results. More...
 

Public Member Functions

 Plane (const Point_t &planePos, const Vector_t &planeDir)
 Constructor from reference position on the plane and direction orthogonal to the plane. More...
 
Point_t const & position () const
 Reference position on the plane. More...
 
Vector_t const & direction () const
 Reference direction orthogonal to the plane. More...
 
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 needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic). More...
 
SMatrixSym55 Global6DToLocal5DCovariance (SMatrixSym66 cov6d, bool hasMomentum, const Vector_t &trackMomOrDir) const
 Translate track covariance from global to local coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic). Warning: some information may be lost in degenerate cases, e.g. the unceratinty along z position when converting to a x-y plane (fixed z) More...
 
SVector5 Global6DToLocal5DParameters (const SVector6 &par6d) const
 Function to convert parameters from global to local coordinates. Local coordinates are on the plane with origin at planePos and orthogonal to planeDir. It is responsibility of the user to make sure the global position lies on the plane. More...
 
SVector5 Global6DToLocal5DParameters (const SVector6 &par6d, const Point_t &planePos, const Vector_t &planeDir, const TrigCache &trigCache) const
 Function to convert parameters from global to local coordinates. Local coordinates are on the plane with origin at planePos and orthogonal to planeDir. It is responsibility of the user to make sure the global position lies on the plane. More...
 
SVector6 Local5DToGlobal6DParameters (const SVector5 &par5d, bool trackAlongPlaneDir=true) const
 Function to convert parameters from local to global coordinates. Local coordinates are on the plane with origin at planePos and orthogonal to planeDir. trackAlongPlaneDir is as given by trackDir.Dot(planeDir)>0. More...
 
SVector6 Local5DToGlobal6DParameters (const SVector5 &par5d, const Point_t &planePos, const Vector_t &planeDir, const TrigCache &trigCache, bool trackAlongPlaneDir=true) const
 Function to convert parameters from local to global coordinates. Local coordinates are on the plane with origin at planePos and orthogonal to planeDir. trackAlongPlaneDir is as given by trackDir.Dot(planeDir)>0. More...
 
SMatrix65 Local5DToGlobal6DJacobian (bool hasMomentum, const Vector_t &trackMomOrDir) const
 Compute the jacobian to translate track covariance from local to global coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic). More...
 
SMatrix65 Local5DToGlobal6DJacobian (bool hasMomentum, const Vector_t &trackMomOrDir, const Vector_t &planeDir, const TrigCache &trigCache) const
 Compute the jacobian to translate track covariance from local to global coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic). More...
 
SMatrix56 Global6DToLocal5DJacobian (bool hasMomentum, const Vector_t &trackMomOrDir) const
 Compute the jacobian to translate track covariance from global to local coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic). Warning: some information may be lost in degenerate cases, e.g. the unceratinty along z position when converting to a x-y plane (fixed z) More...
 
SMatrix56 Global6DToLocal5DJacobian (bool hasMomentum, const Vector_t &trackMomOrDir, const Vector_t &planeDir, const TrigCache &trigCache) const
 Compute the jacobian to translate track covariance from global to local coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic). Warning: some information may be lost in degenerate cases, e.g. the unceratinty along z position when converting to a x-y plane (fixed z) More...
 
Rotation_t Global3DToLocal3DRotation () const
 Calculate rotation matrices from global (x,y,z) to local (u,v,w) coordinates. More...
 
Rotation_t Global3DToLocal3DRotation (const Vector_t &planeDir, const TrigCache &trigCache) const
 Calculate rotation matrices from global (x,y,z) to local (u,v,w) coordinates. More...
 
Rotation_t Local3DToGlobal3DRotation () const
 Calculate rotation matrices from local (u,v,w) to global (x,y,z) coordinates. More...
 
Rotation_t Local3DToGlobal3DRotation (const Vector_t &planeDir, const TrigCache &trigCache) const
 Calculate rotation matrices from local (u,v,w) to global (x,y,z) coordinates. More...
 
double cosAlpha () const
 Return cached values of trigonometric function for angles defining the plane. More...
 
double sinAlpha () const
 Return cached values of trigonometric function for angles defining the plane. More...
 
double cosBeta () const
 Return cached values of trigonometric function for angles defining the plane. More...
 
double sinBeta () const
 Return cached values of trigonometric function for angles defining the plane. More...
 

Static Public Member Functions

static SVector5 Global6DToLocal5DParameters (const SVector6 &par6d, const Point_t &planePos, const Vector_t &planeDir)
 Function to convert parameters from global to local coordinates. Local coordinates are on the plane with origin at planePos and orthogonal to planeDir. It is responsibility of the user to make sure the global position lies on the plane. More...
 
static SVector6 Local5DToGlobal6DParameters (const SVector5 &par5d, const Point_t &planePos, const Vector_t &planeDir, bool trackAlongPlaneDir=true)
 Function to convert parameters from local to global coordinates. Local coordinates are on the plane with origin at planePos and orthogonal to planeDir. trackAlongPlaneDir is as given by trackDir.Dot(planeDir)>0. More...
 
static SMatrix65 Local5DToGlobal6DJacobian (bool hasMomentum, const Vector_t &trackMomOrDir, const Vector_t &planeDir)
 Compute the jacobian to translate track covariance from local to global coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic). More...
 
static SMatrix65 Local5DToGlobal6DJacobian (bool hasMomentum, const SVector6 &par6d, const Vector_t &planeDir)
 Compute the jacobian to translate track covariance from local to global coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic). More...
 
static SMatrix56 Global6DToLocal5DJacobian (bool hasMomentum, const Vector_t &trackMomOrDir, const Vector_t &planeDir)
 Compute the jacobian to translate track covariance from global to local coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic). Warning: some information may be lost in degenerate cases, e.g. the unceratinty along z position when converting to a x-y plane (fixed z) More...
 
static SMatrix56 Global6DToLocal5DJacobian (bool hasMomentum, const SVector6 &par6d, const Vector_t &planeDir)
 Compute the jacobian to translate track covariance from global to local coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic). Warning: some information may be lost in degenerate cases, e.g. the unceratinty along z position when converting to a x-y plane (fixed z) More...
 
static SMatrixSym66 Local5DToGlobal6DCovariance (SMatrixSym55 cov5d, bool hasMomentum, const Vector_t &trackMomOrDir, const Vector_t &planeDir)
 Translate track covariance from local to global coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic). More...
 
static SMatrixSym55 Global6DToLocal5DCovariance (SMatrixSym66 cov6d, bool hasMomentum, const Vector_t &trackMomOrDir, const Vector_t &planeDir)
 Translate track covariance from global to local coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic). Warning: some information may be lost in degenerate cases, e.g. the unceratinty along z position when converting to a x-y plane (fixed z) More...
 
static Rotation_t Global3DToLocal3DRotation (const Vector_t &planeDir)
 Calculate rotation matrices from global (x,y,z) to local (u,v,w) coordinates. More...
 
static Rotation_t Local3DToGlobal3DRotation (const Vector_t &planeDir)
 Calculate rotation matrices from local (u,v,w) to global (x,y,z) coordinates. More...
 

Private Attributes

Point_t fPlanePos
 Position of a point on the plane. More...
 
Vector_t fPlaneDir
 Direction vector othogonal to the plane. More...
 
TrigCache fTrigCache
 Cached trigonometric function values. More...
 

Detailed Description

Class defining a plane for tracking. It provides various functionalities to convert track parameters and covariance matrices from global to local coordinates.

Author
G. Cerati (FNAL, MicroBooNE)
Date
2017
Version
1.0

The plane is constructed from a point in global coordinates, and a direction unit vector orthogonal to the plane. For instance, they may refer to the position and direction of a trajectory at a given point, or to the center of a wire and the direction orthogonal to both the wire and drift directions.

The plane and parameters are defined along the lines of trkf::SurfXYZPlane, but with a different notation for the angles which are now called alpha and beta to avoid confusion with theta and phi in global spherical coordinates: (alpha, beta) correspond to (alpha := Rotation angle about y'-axis (projected Lorentz angle) = atan2(nx, hypot(ny, nz)), beta := Rotation angle about x-axis (wire angle) = atan2(-ny, nz)) The 3D local positions are defined in terms of the unit vectors u,v,w where w is along the normal direction to the plane, u is perpendicular to w and coplanar to the global x axis and with position sign along the positive sign of x, v forms a right handed orthonormal basis with u and w. The 5D track parameters are u,v,du/dw,dv/dw,1/p: u,v are the local positions, du, dv, and dw are the local directions, and 1/p is the inverse of the track momentum. The global 6D coordinates are formed by the track position and momentum (or direction) at a given point.

The discussion above refers to a detector with drift direction along the x axis; this class will have to be extended for a detector with a different drift direction.

Definition at line 37 of file TrackingPlane.h.

Constructor & Destructor Documentation

recob::tracking::Plane::Plane ( const Point_t planePos,
const Vector_t planeDir 
)
inline

Constructor from reference position on the plane and direction orthogonal to the plane.

Definition at line 60 of file TrackingPlane.h.

Referenced by evd::RecoBaseDrawer::Cluster2D(), and cluster::ClusterMatchTQ::MatchedClusters().

61  : fPlanePos(planePos), fPlaneDir(planeDir.Unit()), fTrigCache(planeDir.Unit())
62  {}
Point_t fPlanePos
Position of a point on the plane.
TrigCache fTrigCache
Cached trigonometric function values.
Vector_t fPlaneDir
Direction vector othogonal to the plane.

Member Function Documentation

double recob::tracking::Plane::cosAlpha ( ) const
inline

Return cached values of trigonometric function for angles defining the plane.

Definition at line 163 of file TrackingPlane.h.

Referenced by Global6DToLocal5DCovariance(), and trkf::TrackStatePropagator::rotateToPlane().

163 { return fTrigCache.fCosA; }
TrigCache fTrigCache
Cached trigonometric function values.
double recob::tracking::Plane::cosBeta ( ) const
inline

Return cached values of trigonometric function for angles defining the plane.

Definition at line 165 of file TrackingPlane.h.

References recob::tracking::Plane::TrigCache::fCosB, and fTrigCache.

Referenced by trkf::TrackStatePropagator::rotateToPlane().

165 { return fTrigCache.fCosB; }
TrigCache fTrigCache
Cached trigonometric function values.
Rotation_t recob::tracking::Plane::Global3DToLocal3DRotation ( ) const
inline

Calculate rotation matrices from global (x,y,z) to local (u,v,w) coordinates.

Definition at line 143 of file TrackingPlane.h.

Referenced by Global3DToLocal3DRotation(), Global6DToLocal5DCovariance(), and recob::Trajectory::GlobalToLocalRotationAtPoint().

144  {
146  }
Rotation_t Global3DToLocal3DRotation() const
Calculate rotation matrices from global (x,y,z) to local (u,v,w) coordinates.
TrigCache fTrigCache
Cached trigonometric function values.
Vector_t fPlaneDir
Direction vector othogonal to the plane.
Rotation_t recob::tracking::Plane::Global3DToLocal3DRotation ( const Vector_t planeDir,
const TrigCache trigCache 
) const

Calculate rotation matrices from global (x,y,z) to local (u,v,w) coordinates.

Definition at line 211 of file TrackingPlane.cxx.

References recob::tracking::Plane::TrigCache::fCosA, recob::tracking::Plane::TrigCache::fCosB, recob::tracking::Plane::TrigCache::fSinA, and recob::tracking::Plane::TrigCache::fSinB.

213  {
214  const double& sinalpha = trigCache.fSinA;
215  const double& cosalpha = trigCache.fCosA;
216  const double& sinbeta = trigCache.fSinB;
217  const double& cosbeta = trigCache.fCosB;
218  return {
219  cosalpha /* xx */,
220  sinalpha * sinbeta /* xy */,
221  -sinalpha * cosbeta /* xz */,
222  0.0 /* yx */,
223  cosbeta /* yy */,
224  sinbeta /* yz */,
225  sinalpha /* zx */,
226  -cosalpha * sinbeta /* zy */,
227  cosalpha * cosbeta /* zz */
228  };
229  }
static Rotation_t recob::tracking::Plane::Global3DToLocal3DRotation ( const Vector_t planeDir)
inlinestatic

Calculate rotation matrices from global (x,y,z) to local (u,v,w) coordinates.

Definition at line 237 of file TrackingPlane.h.

References Global3DToLocal3DRotation().

238  {
239  Plane p(Point_t(), planeDir);
240  return p.Global3DToLocal3DRotation();
241  }
Plane(const Point_t &planePos, const Vector_t &planeDir)
Constructor from reference position on the plane and direction orthogonal to the plane.
Definition: TrackingPlane.h:60
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...
Definition: TrackingTypes.h:27
SMatrixSym55 recob::tracking::Plane::Global6DToLocal5DCovariance ( SMatrixSym66  cov6d,
bool  hasMomentum,
const Vector_t trackMomOrDir 
) const
inline

Translate track covariance from global to local coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic). Warning: some information may be lost in degenerate cases, e.g. the unceratinty along z position when converting to a x-y plane (fixed z)

Definition at line 134 of file TrackingPlane.h.

References cosAlpha(), recob::tracking::Plane::TrigCache::fCosA, fPlaneDir, fTrigCache, Global3DToLocal3DRotation(), and Local3DToGlobal3DRotation().

Referenced by trkf::Geometric3DVertexFitter::getParsCovsOnPlane().

137  {
138  return Global6DToLocal5DCovariance(cov6d, hasMomentum, trackMomOrDir, fPlaneDir);
139  }
Vector_t fPlaneDir
Direction vector othogonal to the plane.
SMatrixSym55 Global6DToLocal5DCovariance(SMatrixSym66 cov6d, bool hasMomentum, const Vector_t &trackMomOrDir) const
Translate track covariance from global to local coordinates. The track momentum (or direction) is nee...
static SMatrixSym55 recob::tracking::Plane::Global6DToLocal5DCovariance ( SMatrixSym66  cov6d,
bool  hasMomentum,
const Vector_t trackMomOrDir,
const Vector_t planeDir 
)
inlinestatic

Translate track covariance from global to local coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic). Warning: some information may be lost in degenerate cases, e.g. the unceratinty along z position when converting to a x-y plane (fixed z)

Definition at line 228 of file TrackingPlane.h.

References Global6DToLocal5DJacobian().

232  {
233  return ROOT::Math::Similarity(
234  Global6DToLocal5DJacobian(hasMomentum, trackMomOrDir, planeDir), cov6d);
235  }
SMatrix56 Global6DToLocal5DJacobian(bool hasMomentum, const Vector_t &trackMomOrDir) const
Compute the jacobian to translate track covariance from global to local coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic). Warning: some information may be lost in degenerate cases, e.g. the unceratinty along z position when converting to a x-y plane (fixed z)
SMatrix56 recob::tracking::Plane::Global6DToLocal5DJacobian ( bool  hasMomentum,
const Vector_t trackMomOrDir 
) const
inline

Compute the jacobian to translate track covariance from global to local coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic). Warning: some information may be lost in degenerate cases, e.g. the unceratinty along z position when converting to a x-y plane (fixed z)

Definition at line 114 of file TrackingPlane.h.

Referenced by direction(), Global6DToLocal5DCovariance(), and Global6DToLocal5DJacobian().

116  {
117  return Global6DToLocal5DJacobian(hasMomentum, trackMomOrDir, fPlaneDir, fTrigCache);
118  }
TrigCache fTrigCache
Cached trigonometric function values.
Vector_t fPlaneDir
Direction vector othogonal to the plane.
SMatrix56 Global6DToLocal5DJacobian(bool hasMomentum, const Vector_t &trackMomOrDir) const
Compute the jacobian to translate track covariance from global to local coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic). Warning: some information may be lost in degenerate cases, e.g. the unceratinty along z position when converting to a x-y plane (fixed z)
SMatrix56 recob::tracking::Plane::Global6DToLocal5DJacobian ( bool  hasMomentum,
const Vector_t trackMomOrDir,
const Vector_t planeDir,
const TrigCache trigCache 
) const

Compute the jacobian to translate track covariance from global to local coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic). Warning: some information may be lost in degenerate cases, e.g. the unceratinty along z position when converting to a x-y plane (fixed z)

Definition at line 145 of file TrackingPlane.cxx.

References recob::tracking::Plane::TrigCache::fCosA, recob::tracking::Plane::TrigCache::fCosB, recob::tracking::Plane::TrigCache::fSinA, and recob::tracking::Plane::TrigCache::fSinB.

149  {
150  const double& sinalpha = trigCache.fSinA;
151  const double& cosalpha = trigCache.fCosA;
152  const double& sinbeta = trigCache.fSinB;
153  const double& cosbeta = trigCache.fCosB;
154  const double den23 = (cosalpha * (cosbeta * trackMomOrDir.Z() - sinbeta * trackMomOrDir.Y()) +
155  sinalpha * trackMomOrDir.X()) *
156  (cosalpha * (cosbeta * trackMomOrDir.Z() - sinbeta * trackMomOrDir.Y()) +
157  sinalpha * trackMomOrDir.X());
158  const double den4 =
159  sqrt(trackMomOrDir.X() * trackMomOrDir.X() + trackMomOrDir.Y() * trackMomOrDir.Y() +
160  trackMomOrDir.Z() * trackMomOrDir.Z()) *
161  (trackMomOrDir.X() * trackMomOrDir.X() + trackMomOrDir.Y() * trackMomOrDir.Y() +
162  trackMomOrDir.Z() * trackMomOrDir.Z());
163  SMatrix56 j;
164  //
165  j(0, 0) = cosalpha;
166  j(0, 1) = sinalpha * sinbeta;
167  j(0, 2) = -sinalpha * cosbeta;
168  j(0, 3) = 0.;
169  j(0, 4) = 0.;
170  j(0, 5) = 0.;
171  //
172  j(1, 0) = 0.;
173  j(1, 1) = cosbeta;
174  j(1, 2) = sinbeta;
175  j(1, 3) = 0.;
176  j(1, 4) = 0.;
177  j(1, 5) = 0.;
178  //
179  j(2, 0) = 0.;
180  j(2, 1) = 0.;
181  j(2, 2) = 0.;
182  j(2, 3) = ((cosalpha * cosalpha + sinalpha * sinalpha) *
183  (cosbeta * trackMomOrDir.Z() - sinbeta * trackMomOrDir.Y())) /
184  den23;
185  j(2, 4) = (sinbeta * trackMomOrDir.X() * (cosalpha * cosalpha + sinalpha * sinalpha)) / den23;
186  j(2, 5) =
187  -(cosbeta * trackMomOrDir.X() * (cosalpha * cosalpha + sinalpha * sinalpha)) / den23;
188  //
189  j(3, 0) = 0.;
190  j(3, 1) = 0.;
191  j(3, 2) = 0.;
192  j(3, 3) = -(sinalpha * (cosbeta * trackMomOrDir.Y() + sinbeta * trackMomOrDir.Z())) / den23;
193  j(3, 4) = (cosalpha * trackMomOrDir.Z() * (cosbeta * cosbeta + sinbeta * sinbeta) +
194  cosbeta * sinalpha * trackMomOrDir.X()) /
195  den23;
196  j(3, 5) = (-cosalpha * cosbeta * cosbeta * trackMomOrDir.Y() -
197  cosalpha * sinbeta * sinbeta * trackMomOrDir.Y() +
198  sinalpha * sinbeta * trackMomOrDir.X()) /
199  den23;
200  //
201  j(4, 0) = 0.;
202  j(4, 1) = 0.;
203  j(4, 2) = 0.;
204  j(4, 3) = (hasMomentum ? -trackMomOrDir.X() / den4 : 0.);
205  j(4, 4) = (hasMomentum ? -trackMomOrDir.Y() / den4 : 0.);
206  j(4, 5) = (hasMomentum ? -trackMomOrDir.Z() / den4 : 0.);
207  //
208  return j;
209  }
ROOT::Math::SMatrix< Double32_t, 5, 6 > SMatrix56
static SMatrix56 recob::tracking::Plane::Global6DToLocal5DJacobian ( bool  hasMomentum,
const Vector_t trackMomOrDir,
const Vector_t planeDir 
)
inlinestatic

Compute the jacobian to translate track covariance from global to local coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic). Warning: some information may be lost in degenerate cases, e.g. the unceratinty along z position when converting to a x-y plane (fixed z)

Definition at line 203 of file TrackingPlane.h.

References Global6DToLocal5DJacobian().

206  {
207  Plane p(Point_t(), planeDir);
208  return p.Global6DToLocal5DJacobian(hasMomentum, trackMomOrDir);
209  }
Plane(const Point_t &planePos, const Vector_t &planeDir)
Constructor from reference position on the plane and direction orthogonal to the plane.
Definition: TrackingPlane.h:60
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...
Definition: TrackingTypes.h:27
static SMatrix56 recob::tracking::Plane::Global6DToLocal5DJacobian ( bool  hasMomentum,
const SVector6 par6d,
const Vector_t planeDir 
)
inlinestatic

Compute the jacobian to translate track covariance from global to local coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic). Warning: some information may be lost in degenerate cases, e.g. the unceratinty along z position when converting to a x-y plane (fixed z)

Definition at line 211 of file TrackingPlane.h.

References Global6DToLocal5DJacobian().

214  {
215  Plane p(Point_t(), planeDir);
216  return p.Global6DToLocal5DJacobian(hasMomentum, Vector_t(par6d[3], par6d[4], par6d[5]));
217  }
Plane(const Point_t &planePos, const Vector_t &planeDir)
Constructor from reference position on the plane and direction orthogonal to the plane.
Definition: TrackingPlane.h:60
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 ...
Definition: TrackingTypes.h:31
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...
Definition: TrackingTypes.h:27
SVector5 recob::tracking::Plane::Global6DToLocal5DParameters ( const SVector6 par6d) const
inline

Function to convert parameters from global to local coordinates. Local coordinates are on the plane with origin at planePos and orthogonal to planeDir. It is responsibility of the user to make sure the global position lies on the plane.

Definition at line 74 of file TrackingPlane.h.

Referenced by direction(), trkf::Geometric3DVertexFitter::getParsCovsOnPlane(), and Global6DToLocal5DParameters().

75  {
77  }
Point_t fPlanePos
Position of a point on the plane.
SVector5 Global6DToLocal5DParameters(const SVector6 &par6d) const
Function to convert parameters from global to local coordinates. Local coordinates are on the plane w...
Definition: TrackingPlane.h:74
TrigCache fTrigCache
Cached trigonometric function values.
Vector_t fPlaneDir
Direction vector othogonal to the plane.
SVector5 recob::tracking::Plane::Global6DToLocal5DParameters ( const SVector6 par6d,
const Point_t planePos,
const Vector_t planeDir,
const TrigCache trigCache 
) const

Function to convert parameters from global to local coordinates. Local coordinates are on the plane with origin at planePos and orthogonal to planeDir. It is responsibility of the user to make sure the global position lies on the plane.

Definition at line 45 of file TrackingPlane.cxx.

References recob::tracking::Plane::TrigCache::fCosA, recob::tracking::Plane::TrigCache::fCosB, recob::tracking::Plane::TrigCache::fSinA, and recob::tracking::Plane::TrigCache::fSinB.

49  {
50  const double& sinalpha = trigCache.fSinA;
51  const double& cosalpha = trigCache.fCosA;
52  const double& sinbeta = trigCache.fSinB;
53  const double& cosbeta = trigCache.fCosB;
54  const double pu =
55  par6d[3] * cosalpha + par6d[4] * sinalpha * sinbeta - par6d[5] * sinalpha * cosbeta;
56  const double pv = par6d[4] * cosbeta + par6d[5] * sinbeta;
57  const double pw =
58  par6d[3] * sinalpha - par6d[4] * cosalpha * sinbeta + par6d[5] * cosalpha * cosbeta;
59  const double pval = sqrt(par6d[3] * par6d[3] + par6d[4] * par6d[4] + par6d[5] * par6d[5]);
60  SVector5 par5d;
61  par5d[0] = (par6d[0] - planePos.X()) * cosalpha +
62  (par6d[1] - planePos.Y()) * sinalpha * sinbeta -
63  (par6d[2] - planePos.Z()) * sinalpha * cosbeta;
64  par5d[1] = (par6d[1] - planePos.Y()) * cosbeta + (par6d[2] - planePos.Z()) * sinbeta;
65  par5d[2] = pu / pw;
66  par5d[3] = pv / pw;
67  par5d[4] = (pval > 0 ? 1. / pval : 1.);
68  return par5d;
69  }
ROOT::Math::SVector< Double32_t, 5 > SVector5
static SVector5 recob::tracking::Plane::Global6DToLocal5DParameters ( const SVector6 par6d,
const Point_t planePos,
const Vector_t planeDir 
)
inlinestatic

Function to convert parameters from global to local coordinates. Local coordinates are on the plane with origin at planePos and orthogonal to planeDir. It is responsibility of the user to make sure the global position lies on the plane.

Definition at line 170 of file TrackingPlane.h.

References Global6DToLocal5DParameters().

173  {
174  Plane p(planePos, planeDir);
175  return p.Global6DToLocal5DParameters(par6d);
176  }
Plane(const Point_t &planePos, const Vector_t &planeDir)
Constructor from reference position on the plane and direction orthogonal to the plane.
Definition: TrackingPlane.h:60
Rotation_t recob::tracking::Plane::Local3DToGlobal3DRotation ( ) const
inline

Calculate rotation matrices from local (u,v,w) to global (x,y,z) coordinates.

Definition at line 153 of file TrackingPlane.h.

Referenced by Global6DToLocal5DCovariance(), Local3DToGlobal3DRotation(), and recob::Trajectory::LocalToGlobalRotationAtPoint().

154  {
156  }
TrigCache fTrigCache
Cached trigonometric function values.
Vector_t fPlaneDir
Direction vector othogonal to the plane.
Rotation_t Local3DToGlobal3DRotation() const
Calculate rotation matrices from local (u,v,w) to global (x,y,z) coordinates.
Rotation_t recob::tracking::Plane::Local3DToGlobal3DRotation ( const Vector_t planeDir,
const TrigCache trigCache 
) const

Calculate rotation matrices from local (u,v,w) to global (x,y,z) coordinates.

Definition at line 231 of file TrackingPlane.cxx.

References recob::tracking::Plane::TrigCache::fCosA, recob::tracking::Plane::TrigCache::fCosB, recob::tracking::Plane::TrigCache::fSinA, and recob::tracking::Plane::TrigCache::fSinB.

233  {
234  const double& sinalpha = trigCache.fSinA;
235  const double& cosalpha = trigCache.fCosA;
236  const double& sinbeta = trigCache.fSinB;
237  const double& cosbeta = trigCache.fCosB;
238  return {
239  cosalpha /* xx */,
240  0. /* xy */,
241  sinalpha /* xz */,
242  sinalpha * sinbeta /* yx */,
243  cosbeta /* yy */,
244  -cosalpha * sinbeta /* yz */,
245  -sinalpha * cosbeta /* zx */,
246  sinbeta /* zy */,
247  cosalpha * cosbeta /* zz */
248  };
249  }
static Rotation_t recob::tracking::Plane::Local3DToGlobal3DRotation ( const Vector_t planeDir)
inlinestatic

Calculate rotation matrices from local (u,v,w) to global (x,y,z) coordinates.

Definition at line 243 of file TrackingPlane.h.

References Local3DToGlobal3DRotation().

244  {
245  Plane p(Point_t(), planeDir);
246  return p.Local3DToGlobal3DRotation();
247  }
Plane(const Point_t &planePos, const Vector_t &planeDir)
Constructor from reference position on the plane and direction orthogonal to the plane.
Definition: TrackingPlane.h:60
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...
Definition: TrackingTypes.h:27
SMatrixSym66 recob::tracking::Plane::Local5DToGlobal6DCovariance ( SMatrixSym55  cov5d,
bool  hasMomentum,
const Vector_t trackMomOrDir 
) const
inline

Translate track covariance from local to global coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic).

Definition at line 126 of file TrackingPlane.h.

References fPlaneDir.

Referenced by trkf::TrackState::covariance6D(), recob::Track::EndCovarianceGlobal6D(), and recob::Track::VertexCovarianceGlobal6D().

129  {
130  return Local5DToGlobal6DCovariance(cov5d, hasMomentum, trackMomOrDir, fPlaneDir);
131  }
Vector_t fPlaneDir
Direction vector othogonal to 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...
static SMatrixSym66 recob::tracking::Plane::Local5DToGlobal6DCovariance ( SMatrixSym55  cov5d,
bool  hasMomentum,
const Vector_t trackMomOrDir,
const Vector_t planeDir 
)
inlinestatic

Translate track covariance from local to global coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic).

Definition at line 219 of file TrackingPlane.h.

References Local5DToGlobal6DJacobian().

223  {
224  return ROOT::Math::Similarity(
225  Local5DToGlobal6DJacobian(hasMomentum, trackMomOrDir, planeDir), cov5d);
226  }
SMatrix65 Local5DToGlobal6DJacobian(bool hasMomentum, const Vector_t &trackMomOrDir) const
Compute the jacobian to translate track covariance from local to global coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic).
SMatrix65 recob::tracking::Plane::Local5DToGlobal6DJacobian ( bool  hasMomentum,
const Vector_t trackMomOrDir 
) const
inline

Compute the jacobian to translate track covariance from local to global coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic).

Definition at line 101 of file TrackingPlane.h.

Referenced by direction(), Local5DToGlobal6DCovariance(), and Local5DToGlobal6DJacobian().

103  {
104  return Local5DToGlobal6DJacobian(hasMomentum, trackMomOrDir, fPlaneDir, fTrigCache);
105  }
SMatrix65 Local5DToGlobal6DJacobian(bool hasMomentum, const Vector_t &trackMomOrDir) const
Compute the jacobian to translate track covariance from local to global coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic).
TrigCache fTrigCache
Cached trigonometric function values.
Vector_t fPlaneDir
Direction vector othogonal to the plane.
SMatrix65 recob::tracking::Plane::Local5DToGlobal6DJacobian ( bool  hasMomentum,
const Vector_t trackMomOrDir,
const Vector_t planeDir,
const TrigCache trigCache 
) const

Compute the jacobian to translate track covariance from local to global coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic).

Definition at line 71 of file TrackingPlane.cxx.

References recob::tracking::Plane::TrigCache::fCosA, recob::tracking::Plane::TrigCache::fCosB, recob::tracking::Plane::TrigCache::fSinA, and recob::tracking::Plane::TrigCache::fSinB.

75  {
76  bool trackAlongPlaneDir = trackMomOrDir.Dot(planeDir) > 0;
77  const double& sinalpha = trigCache.fSinA;
78  const double& cosalpha = trigCache.fCosA;
79  const double& sinbeta = trigCache.fSinB;
80  const double& cosbeta = trigCache.fCosB;
81  const double pu = trackMomOrDir.X() * cosalpha + trackMomOrDir.Y() * sinalpha * sinbeta -
82  trackMomOrDir.Z() * sinalpha * cosbeta;
83  const double pv = trackMomOrDir.Y() * cosbeta + trackMomOrDir.Z() * sinbeta;
84  const double pw = trackMomOrDir.X() * sinalpha - trackMomOrDir.Y() * cosalpha * sinbeta +
85  trackMomOrDir.Z() * cosalpha * cosbeta;
86  //local parameters 2,3,4
87  const double l2 = pu / pw;
88  const double l3 = pv / pw;
89  const double p2 = trackMomOrDir.X() * trackMomOrDir.X() +
90  trackMomOrDir.Y() * trackMomOrDir.Y() +
91  trackMomOrDir.Z() * trackMomOrDir.Z();
92  const double l4 = (hasMomentum ? 1. / sqrt(p2) : 1.);
93  const double den23 =
94  (trackAlongPlaneDir ? l4 * (l2 * l2 + l3 * l3 + 1.) * sqrt(l2 * l2 + l3 * l3 + 1.) :
95  -l4 * (l2 * l2 + l3 * l3 + 1.) * sqrt(l2 * l2 + l3 * l3 + 1.));
96  const double den4 = l4 * l4 * sqrt(l2 * l2 + l3 * l3 + 1.);
97  SMatrix65 j;
98  //
99  j(0, 0) = cosalpha;
100  j(0, 1) = 0.;
101  j(0, 2) = 0.;
102  j(0, 3) = 0.;
103  j(0, 4) = 0.;
104  //
105  j(1, 0) = sinalpha * sinbeta;
106  j(1, 1) = cosbeta;
107  j(1, 2) = 0.;
108  j(1, 3) = 0.;
109  j(1, 4) = 0.;
110  //
111  j(2, 0) = -sinalpha * cosbeta;
112  j(2, 1) = sinbeta;
113  j(2, 2) = 0.;
114  j(2, 3) = 0.;
115  j(2, 4) = 0.;
116  //
117  j(3, 0) = 0.;
118  j(3, 1) = 0.;
119  j(3, 2) = (cosalpha * (l3 * l3 + 1.) - sinalpha * l2) / den23;
120  j(3, 3) = -l3 * (l2 * cosalpha + sinalpha) / den23;
121  j(3, 4) = (hasMomentum ? -(l2 * cosalpha + sinalpha) / den4 : 0.);
122  //
123  j(4, 0) = 0.;
124  j(4, 1) = 0.;
125  j(4, 2) =
126  (cosalpha * sinbeta * l2 - cosbeta * l2 * l3 + sinalpha * sinbeta * (l3 * l3 + 1.)) / den23;
127  j(4, 3) = (sinbeta * l3 * (cosalpha - sinalpha * l2) + cosbeta * (l2 * l2 + 1.)) / den23;
128  j(4, 4) =
129  (hasMomentum ? (cosalpha * sinbeta - cosbeta * l3 - sinalpha * sinbeta * l2) / den4 : 0.);
130  //
131  j(5, 0) = 0.;
132  j(5, 1) = 0.;
133  j(5, 2) = -(cosalpha * cosbeta * l2 + cosbeta * sinalpha * l3 * l3 + cosbeta * sinalpha +
134  sinbeta * l2 * l3) /
135  den23;
136  j(5, 3) =
137  (-cosalpha * cosbeta * l3 + cosbeta * sinalpha * l2 * l3 + sinbeta * l2 * l2 + sinbeta) /
138  den23;
139  j(5, 4) =
140  (hasMomentum ? (-cosalpha * cosbeta + cosbeta * sinalpha * l2 - sinbeta * l3) / den4 : 0.);
141  //
142  return j;
143  }
ROOT::Math::SMatrix< Double32_t, 6, 5 > SMatrix65
static SMatrix65 recob::tracking::Plane::Local5DToGlobal6DJacobian ( bool  hasMomentum,
const Vector_t trackMomOrDir,
const Vector_t planeDir 
)
inlinestatic

Compute the jacobian to translate track covariance from local to global coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic).

Definition at line 187 of file TrackingPlane.h.

References Local5DToGlobal6DJacobian().

190  {
191  Plane p(Point_t(), planeDir);
192  return p.Local5DToGlobal6DJacobian(hasMomentum, trackMomOrDir);
193  }
Plane(const Point_t &planePos, const Vector_t &planeDir)
Constructor from reference position on the plane and direction orthogonal to the plane.
Definition: TrackingPlane.h:60
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...
Definition: TrackingTypes.h:27
static SMatrix65 recob::tracking::Plane::Local5DToGlobal6DJacobian ( bool  hasMomentum,
const SVector6 par6d,
const Vector_t planeDir 
)
inlinestatic

Compute the jacobian to translate track covariance from local to global coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic).

Definition at line 195 of file TrackingPlane.h.

References Local5DToGlobal6DJacobian().

198  {
199  Plane p(Point_t(), planeDir);
200  return p.Local5DToGlobal6DJacobian(hasMomentum, Vector_t(par6d[3], par6d[4], par6d[5]));
201  }
Plane(const Point_t &planePos, const Vector_t &planeDir)
Constructor from reference position on the plane and direction orthogonal to the plane.
Definition: TrackingPlane.h:60
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 ...
Definition: TrackingTypes.h:31
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...
Definition: TrackingTypes.h:27
SVector6 recob::tracking::Plane::Local5DToGlobal6DParameters ( const SVector5 par5d,
bool  trackAlongPlaneDir = true 
) const
inline

Function to convert parameters from local to global coordinates. Local coordinates are on the plane with origin at planePos and orthogonal to planeDir. trackAlongPlaneDir is as given by trackDir.Dot(planeDir)>0.

Definition at line 86 of file TrackingPlane.h.

Referenced by direction(), Local5DToGlobal6DParameters(), trkf::TrackState::setParameters(), and trkf::TrackState::TrackState().

88  {
90  par5d, fPlanePos, fPlaneDir, fTrigCache, trackAlongPlaneDir);
91  }
Point_t fPlanePos
Position of a point on the plane.
TrigCache fTrigCache
Cached trigonometric function values.
Vector_t fPlaneDir
Direction vector othogonal to the plane.
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...
Definition: TrackingPlane.h:86
SVector6 recob::tracking::Plane::Local5DToGlobal6DParameters ( const SVector5 par5d,
const Point_t planePos,
const Vector_t planeDir,
const TrigCache trigCache,
bool  trackAlongPlaneDir = true 
) const

Function to convert parameters from local to global coordinates. Local coordinates are on the plane with origin at planePos and orthogonal to planeDir. trackAlongPlaneDir is as given by trackDir.Dot(planeDir)>0.

Definition at line 21 of file TrackingPlane.cxx.

References recob::tracking::Plane::TrigCache::fCosA, recob::tracking::Plane::TrigCache::fCosB, recob::tracking::Plane::TrigCache::fSinA, and recob::tracking::Plane::TrigCache::fSinB.

26  {
27  const double& sinalpha = trigCache.fSinA;
28  const double& cosalpha = trigCache.fCosA;
29  const double& sinbeta = trigCache.fSinB;
30  const double& cosbeta = trigCache.fCosB;
31  const double denom =
32  (trackAlongPlaneDir ?
33  par5d[4] * std::sqrt(1. + par5d[2] * par5d[2] + par5d[3] * par5d[3]) :
34  -par5d[4] * std::sqrt(1. + par5d[2] * par5d[2] + par5d[3] * par5d[3]));
35  SVector6 par6d;
36  par6d[0] = planePos.X() + par5d[0] * cosalpha;
37  par6d[1] = planePos.Y() + par5d[0] * sinalpha * sinbeta + par5d[1] * cosbeta;
38  par6d[2] = planePos.Z() - par5d[0] * sinalpha * cosbeta + par5d[1] * sinbeta;
39  par6d[3] = (par5d[2] * cosalpha + 1. * sinalpha) / denom;
40  par6d[4] = (par5d[2] * sinalpha * sinbeta + par5d[3] * cosbeta - cosalpha * sinbeta) / denom;
41  par6d[5] = (-par5d[2] * sinalpha * cosbeta + par5d[3] * sinbeta + cosalpha * cosbeta) / denom;
42  return par6d;
43  }
STL namespace.
ROOT::Math::SVector< Double32_t, 6 > SVector6
static SVector6 recob::tracking::Plane::Local5DToGlobal6DParameters ( const SVector5 par5d,
const Point_t planePos,
const Vector_t planeDir,
bool  trackAlongPlaneDir = true 
)
inlinestatic

Function to convert parameters from local to global coordinates. Local coordinates are on the plane with origin at planePos and orthogonal to planeDir. trackAlongPlaneDir is as given by trackDir.Dot(planeDir)>0.

Definition at line 178 of file TrackingPlane.h.

References Local5DToGlobal6DParameters().

182  {
183  Plane p(planePos, planeDir);
184  return p.Local5DToGlobal6DParameters(par5d, trackAlongPlaneDir);
185  }
Plane(const Point_t &planePos, const Vector_t &planeDir)
Constructor from reference position on the plane and direction orthogonal to the plane.
Definition: TrackingPlane.h:60
double recob::tracking::Plane::sinAlpha ( ) const
inline

Return cached values of trigonometric function for angles defining the plane.

Definition at line 164 of file TrackingPlane.h.

References recob::tracking::Plane::TrigCache::fSinA, and fTrigCache.

Referenced by trkf::TrackStatePropagator::rotateToPlane().

164 { return fTrigCache.fSinA; }
TrigCache fTrigCache
Cached trigonometric function values.
double recob::tracking::Plane::sinBeta ( ) const
inline

Return cached values of trigonometric function for angles defining the plane.

Definition at line 166 of file TrackingPlane.h.

References recob::tracking::Plane::TrigCache::fSinB, and fTrigCache.

Referenced by trkf::TrackStatePropagator::rotateToPlane().

166 { return fTrigCache.fSinB; }
TrigCache fTrigCache
Cached trigonometric function values.

Member Data Documentation

Vector_t recob::tracking::Plane::fPlaneDir
private

Direction vector othogonal to the plane.

Definition at line 251 of file TrackingPlane.h.

Referenced by direction(), Global6DToLocal5DCovariance(), and Local5DToGlobal6DCovariance().

Point_t recob::tracking::Plane::fPlanePos
private

Position of a point on the plane.

Definition at line 250 of file TrackingPlane.h.

Referenced by direction(), and position().

TrigCache recob::tracking::Plane::fTrigCache
private

Cached trigonometric function values.

Definition at line 252 of file TrackingPlane.h.

Referenced by cosBeta(), direction(), Global6DToLocal5DCovariance(), sinAlpha(), and sinBeta().


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