LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
trkf::SurfPlane Class Referenceabstract

#include "SurfPlane.h"

Inheritance diagram for trkf::SurfPlane:
trkf::Surface trkf::SurfXYZPlane trkf::SurfYZPlane trkf::SurfWireX

Public Types

enum  TrackDirection { FORWARD, BACKWARD, UNKNOWN }
 Track direction enum. More...
 

Public Member Functions

 SurfPlane ()
 Default constructor. More...
 
virtual ~SurfPlane ()
 Destructor. More...
 
double PointingError (const TrackVector &vec, const TrackError &err) const
 Get pointing error of track. More...
 
void getStartingError (TrackError &err) const
 Get starting error matrix for Kalman filter. More...
 
virtual Surfaceclone () const =0
 Clone method. More...
 
virtual bool isTrackValid (const TrackVector &vec) const =0
 Surface-specific tests of validity of track parameters. More...
 
virtual void toLocal (const double xyz[3], double uvw[3]) const =0
 Transform global to local coordinates. More...
 
virtual void toGlobal (const double uvw[3], double xyz[3]) const =0
 Transform local to global coordinates. More...
 
virtual TrackVector getDiff (const TrackVector &vec1, const TrackVector &vec2) const
 Calculate difference of two track parameter vectors. More...
 
virtual void getPosition (const TrackVector &vec, double xyz[3]) const =0
 Get position of track. More...
 
virtual TrackDirection getDirection (const TrackVector &, TrackDirection dir=UNKNOWN) const
 Get direction of track (default UNKNOWN). More...
 
virtual void getMomentum (const TrackVector &vec, double mom[3], TrackDirection dir=UNKNOWN) const =0
 Get momentum vector of track. More...
 
virtual bool isParallel (const Surface &surf) const =0
 Test whether two surfaces are parallel, within tolerance. More...
 
virtual double distanceTo (const Surface &surf) const =0
 Find perpendicular forward distance to a parallel surface. More...
 
virtual bool isEqual (const Surface &surf) const =0
 Test two surfaces for equality, within tolerance. More...
 
virtual std::ostream & Print (std::ostream &out) const =0
 Printout. More...
 

Detailed Description

Definition at line 28 of file SurfPlane.h.

Member Enumeration Documentation

Track direction enum.

Enumerator
FORWARD 
BACKWARD 
UNKNOWN 

Definition at line 54 of file Surface.h.

Constructor & Destructor Documentation

trkf::SurfPlane::SurfPlane ( )

Default constructor.

Definition at line 17 of file SurfPlane.cxx.

17 {}
trkf::SurfPlane::~SurfPlane ( )
virtual

Destructor.

Definition at line 20 of file SurfPlane.cxx.

20 {}

Member Function Documentation

virtual Surface* trkf::Surface::clone ( ) const
pure virtualinherited

Clone method.

Implemented in trkf::SurfXYZPlane, trkf::SurfYZLine, and trkf::SurfYZPlane.

virtual double trkf::Surface::distanceTo ( const Surface surf) const
pure virtualinherited

Find perpendicular forward distance to a parallel surface.

Implemented in trkf::SurfXYZPlane, trkf::SurfYZLine, and trkf::SurfYZPlane.

Referenced by trkf::Surface::getDirection().

TrackVector trkf::Surface::getDiff ( const TrackVector vec1,
const TrackVector vec2 
) const
virtualinherited

Calculate difference of two track parameter vectors.

Calculate difference of two track parameter vectors. This method has a default implementation which is just the numeric difference. Surfaces that require a more sophisticated difference (e.g. phi-wrap difference) should override this method.

Reimplemented in trkf::SurfYZLine.

Definition at line 31 of file Surface.cxx.

32  {
33  return vec1 - vec2;
34  }
virtual TrackDirection trkf::Surface::getDirection ( const TrackVector ,
TrackDirection  dir = UNKNOWN 
) const
inlinevirtualinherited
virtual void trkf::Surface::getMomentum ( const TrackVector vec,
double  mom[3],
TrackDirection  dir = UNKNOWN 
) const
pure virtualinherited

Get momentum vector of track.

Implemented in trkf::SurfXYZPlane, trkf::SurfYZLine, and trkf::SurfYZPlane.

Referenced by trkf::Surface::getDirection().

virtual void trkf::Surface::getPosition ( const TrackVector vec,
double  xyz[3] 
) const
pure virtualinherited

Get position of track.

Implemented in trkf::SurfXYZPlane, trkf::SurfYZLine, and trkf::SurfYZPlane.

void trkf::SurfPlane::getStartingError ( TrackError err) const
virtual

Get starting error matrix for Kalman filter.

Get starting error matrix for Kalman filter.

Arguments:

err - Error matrix.

Implements trkf::Surface.

Definition at line 83 of file SurfPlane.cxx.

84  {
85  err.resize(5, false);
86  err.clear();
87  err(0, 0) = 1000.;
88  err(1, 1) = 1000.;
89  err(2, 2) = 0.25;
90  err(3, 3) = 0.25;
91  err(4, 4) = 10.;
92  }
virtual bool trkf::Surface::isEqual ( const Surface surf) const
pure virtualinherited

Test two surfaces for equality, within tolerance.

Implemented in trkf::SurfXYZPlane, trkf::SurfYZLine, and trkf::SurfYZPlane.

Referenced by trkf::Surface::getDirection().

virtual bool trkf::Surface::isParallel ( const Surface surf) const
pure virtualinherited

Test whether two surfaces are parallel, within tolerance.

Implemented in trkf::SurfXYZPlane, trkf::SurfYZLine, and trkf::SurfYZPlane.

Referenced by trkf::Surface::getDirection().

virtual bool trkf::Surface::isTrackValid ( const TrackVector vec) const
pure virtualinherited

Surface-specific tests of validity of track parameters.

Implemented in trkf::SurfXYZPlane, trkf::SurfYZLine, and trkf::SurfYZPlane.

double trkf::SurfPlane::PointingError ( const TrackVector vec,
const TrackError err 
) const
virtual

Get pointing error of track.

Get pointing error of track.

Arguments:

vec - Track parameters. err - Track error matrix.

Returns: Pointing error.

This method calculates the track pointing error based on the slope track paramers and errors (parameters 2 and 3).

Implements trkf::Surface.

Definition at line 34 of file SurfPlane.cxx.

References den.

35  {
36  // Get slope parameters and error matrix.
37 
38  double xp = vec(2);
39  double yp = vec(3);
40  double exx = err(2, 2);
41  double eyy = err(3, 3);
42  double exy = err(3, 2);
43 
44  // Calculate error matrix of pointing unit vector in some coordinate system.
45 
46  double den = 1. + xp * xp + yp * yp;
47  double den3 = den * den * den;
48 
49  double vxx = ((1. + yp * yp) * (1. + yp * yp) * exx + xp * xp * yp * yp * eyy -
50  2. * xp * yp * (1. + yp * yp) * exy) /
51  den3;
52  double vyy = (xp * xp * yp * yp * exx + (1. + xp * xp) * (1. + xp * xp) * eyy -
53  2. * xp * yp * (1. + xp * xp) * exy) /
54  den3;
55  double vzz = (xp * xp * exx + yp * yp * eyy + 2. * xp * yp * exy) / den3;
56 
57  double vxy = (-xp * yp * (1. + yp * yp) * exx - xp * yp * (1. + xp * xp) * eyy +
58  (1. + xp * xp + yp * yp + 2. * xp * xp * yp * yp) * exy) /
59  den3;
60  double vyz =
61  (xp * xp * yp * exx - yp * (1. + xp * xp) * eyy - xp * (1. + xp * xp - yp * yp) * exy) / den3;
62  double vxz =
63  (-xp * (1. + yp * yp) * exx + xp * yp * yp * eyy - yp * (1. - xp * xp + yp * yp) * exy) /
64  den3;
65 
66  // Calculate square root of the largest eigenvalue of error matrix.
67 
68  double ddd2 = vxx * vxx + vyy * vyy + vzz * vzz - 2. * vxx * vyy - 2. * vxx * vzz -
69  2. * vyy * vzz + 4. * vxy * vxy + 4. * vyz * vyz + 4. * vxz * vxz;
70  double ddd = sqrt(ddd2 > 0. ? ddd2 : 0.);
71  double lambda2 = 0.5 * (vxx + vyy + vzz + ddd);
72  double lambda = sqrt(lambda2 > 0. ? lambda2 : 0.);
73 
74  return lambda;
75  }
Float_t den
Definition: plot.C:35
virtual std::ostream& trkf::Surface::Print ( std::ostream &  out) const
pure virtualinherited
virtual void trkf::Surface::toGlobal ( const double  uvw[3],
double  xyz[3] 
) const
pure virtualinherited
virtual void trkf::Surface::toLocal ( const double  xyz[3],
double  uvw[3] 
) const
pure virtualinherited

Transform global to local coordinates.

Implemented in trkf::SurfXYZPlane, trkf::SurfYZLine, and trkf::SurfYZPlane.


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