Public Member Functions | List of all members
trkf::SurfPlane Class Reference

#include <SurfPlane.h>

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

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...
 
- Public Member Functions inherited from trkf::Surface
 Surface ()
 Default constructor. More...
 
virtual ~Surface ()
 Destructor. 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...
 

Additional Inherited Members

- Public Types inherited from trkf::Surface
enum  TrackDirection { FORWARD, BACKWARD, UNKNOWN }
 Track direction enum. More...
 

Detailed Description

Definition at line 28 of file SurfPlane.h.

Constructor & Destructor Documentation

trkf::SurfPlane::SurfPlane ( )

Default constructor.

Definition at line 17 of file SurfPlane.cxx.

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

Destructor.

Definition at line 21 of file SurfPlane.cxx.

22  {}

Member Function Documentation

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 80 of file SurfPlane.cxx.

80  {
81  err.resize(5, false);
82  err.clear();
83  err(0, 0) = 1000.;
84  err(1, 1) = 1000.;
85  err(2, 2) = 0.25;
86  err(3, 3) = 0.25;
87  err(4, 4) = 10.;
88  }
void err(const char *fmt,...)
Definition: message.cpp:226
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 36 of file SurfPlane.cxx.

37  {
38  // Get slope parameters and error matrix.
39 
40  double xp = vec(2);
41  double yp = vec(3);
42  double exx = err(2, 2);
43  double eyy = err(3, 3);
44  double exy = err(3, 2);
45 
46  // Calculate error matrix of pointing unit vector in some coordinate system.
47 
48  double den = 1. + xp*xp + yp*yp;
49  double den3 = den*den*den;
50 
51  double vxx = ( (1.+yp*yp)*(1.+yp*yp) * exx + xp*xp*yp*yp * eyy
52  - 2.*xp*yp*(1. + yp*yp) * exy ) / den3;
53  double vyy = ( xp*xp*yp*yp * exx + (1.+xp*xp)*(1.+xp*xp) * eyy
54  - 2.*xp*yp*(1. + xp*xp) * exy ) / 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 ) / den3;
59  double vyz = ( xp*xp*yp * exx - yp*(1. + xp*xp) * eyy - xp*(1. + xp*xp - yp*yp) * exy ) / den3;
60  double vxz = ( -xp*(1. + yp*yp) * exx + xp*yp*yp * eyy - yp*(1. - xp*xp + yp*yp) * exy ) / den3;
61 
62  // Calculate square root of the largest eigenvalue of error matrix.
63 
64  double ddd2 = vxx*vxx + vyy*vyy + vzz*vzz
65  - 2.*vxx*vyy - 2.*vxx*vzz - 2.*vyy*vzz
66  + 4.*vxy*vxy + 4.*vyz*vyz + 4.*vxz*vxz;
67  double ddd = sqrt(ddd2 > 0. ? ddd2 : 0.);
68  double lambda2 = 0.5 * ( vxx + vyy + vzz + ddd);
69  double lambda = sqrt(lambda2 > 0. ? lambda2 : 0.);
70 
71  return lambda;
72  }
void err(const char *fmt,...)
Definition: message.cpp:226

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