SurfXYZPlane.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 ///
3 /// \file SurfXYZPlane.h
4 ///
5 /// \brief General planar surface.
6 ///
7 /// \author H. Greenlee
8 ///
9 /// This class represents an (almost) general planar surface. It is
10 /// intended to represent the measurement surface defined by a wire
11 /// and the drift velocity in the case of a magnetic LAr TPC with a
12 /// nonzero Lorentz angle.
13 ///
14 /// In contrast to a completely general planar surface, the rotation
15 /// part of the global to local coordinate transformation for this
16 /// surface is defined by two rotation angles (not three Euler
17 /// angles), which are the wire angle and the projected Lorentz angle.
18 /// What we calling the projected Lorentz angle is the dihedral angle
19 /// between the plane defined by the wire and the x-axis, and the
20 /// plane defined by the wire and the drift velocity, which can be
21 /// different for different views.
22 ///
23 /// In the case of a nonzero Lorentz angle, the drift velocity is not
24 /// perpendicular to a readout wire, so the drift velocity vector will
25 /// not coincide with a coordinate axis in the local coordinate
26 /// system. Nevertheless, the projected Lorentz angle provides
27 /// sufficient information to implement the prediction function for
28 /// this type of surface, provided the drift velocity perpendicular to
29 /// the readout planes (which is the same for every view) is available
30 /// externally.
31 ///
32 /// This surface is defined by five parameters, which are,
33 /// (x0, y0, z0) - Local origin.
34 /// phi - Rotation angle around x-axis (wire angle).
35 /// theta - Rotation angle around y'-axis (projected Lorentz angle).
36 ///
37 /// The local uvw coordinate system is related to the global xyz
38 /// coordinate system via an intermediate x'y'z' system as follows.
39 ///
40 /// x' = x-x0
41 /// y' = (y-y0)*cos(phi) + (z-z0)*sin(phi)
42 /// z' = -(y-y0)*sin(phi) + (z-z0)*cos(phi)
43 ///
44 /// u = x'*cos(theta) - z'*sin(theta)
45 /// v = y'
46 /// w = x'*sin(theta) + z'*cos(theta)
47 ///
48 /// u = (x-x0)*cos(theta) + (y-y0)*sin(theta)*sin(phi) - (z-z0)*sin(theta)*cos(phi)
49 /// v = (y-y0)*cos(phi) + (z-z0)*sin(phi)
50 /// w = (x-x0)*sin(theta) - (y-y0)*cos(theta)*sin(phi) + (z-z0)*cos(theta)*cos(phi)
51 ///
52 /// or inversely,
53 ///
54 /// x' = u*cos(theta) + w*sin(theta)
55 /// y' = v
56 /// z' = -u*sin(theta) + w*cos(theta)
57 ///
58 /// x = x0 + x'
59 /// y = y0 + y'*cos(phi) - z'*sin(phi)
60 /// z = z0 + y'*sin(phi) + z'*cos(phi)
61 ///
62 /// x = x0 + u*cos(theta) + w*sin(theta)
63 /// y = y0 + u*sin(theta)*sin(phi) + v*cos(phi) - w*cos(theta)*sin(phi)
64 /// z = z0 - u*sin(theta)*cos(phi) + v*sin(phi) + w*cos(theta)*cos(phi)
65 ///
66 /// Track parameters on this type of surface are as follows.
67 ///
68 /// 1. u
69 /// 2. v
70 /// 3. du/dw
71 /// 4. dv/dw
72 /// 5. 1/p (nonmagnetic) or q/p (magnetic)
73 ///
74 ////////////////////////////////////////////////////////////////////////
75 
76 #ifndef SURFXYZPLANE_H
77 #define SURFXYZPLANE_H
78 
80 
81 namespace trkf {
82 
83  class SurfXYZPlane : public SurfPlane
84  {
85  public:
86 
87  /// Default constructor.
88  SurfXYZPlane();
89 
90  /// Initializing constructor (angles).
91  SurfXYZPlane(double x0, double y0, double z0, double phi, double theta);
92 
93  /// Initializing constructor (normal vector).
94  SurfXYZPlane(double x0, double y0, double z0,
95  double nx, double ny, double nz);
96 
97  /// Destructor.
98  virtual ~SurfXYZPlane();
99 
100  // Accessors.
101  double x0() const {return fX0;} ///< X origin.
102  double y0() const {return fY0;} ///< Y origin.
103  double z0() const {return fZ0;} ///< Z origin.
104  double phi() const {return fPhi;} ///< Rot. angle about x-axis (wire angle).
105  double theta() const {return fTheta;} ///< Rot. angle about y'-axis (projected Lorentz angle).
106 
107  /// Clone method.
108  virtual Surface* clone() const;
109 
110  /// Surface-specific tests of validity of track parameters.
111  virtual bool isTrackValid(const TrackVector& vec) const;
112 
113  /// Transform global to local coordinates.
114  virtual void toLocal(const double xyz[3], double uvw[3]) const;
115 
116  /// Transform local to global coordinates.
117  virtual void toGlobal(const double uvw[3], double xyz[3]) const;
118 
119  /// Get position of track.
120  virtual void getPosition(const TrackVector& vec, double xyz[3]) const;
121 
122  /// Get momentum vector of track.
123  virtual void getMomentum(const TrackVector& vec, double mom[3],
124  TrackDirection dir=UNKNOWN) const;
125 
126  /// Test whether two surfaces are parallel, within tolerance.
127  virtual bool isParallel(const Surface& surf) const;
128 
129  /// Find perpendicular forward distance to a parallel surface
130  virtual double distanceTo(const Surface& surf) const;
131 
132  /// Test two surfaces for equality, within tolerance.
133  virtual bool isEqual(const Surface& surf) const;
134 
135  /// Printout
136  virtual std::ostream& Print(std::ostream& out) const;
137 
138  private:
139 
140  // Static attributes.
141 
142  static double fPhiTolerance; ///< Phi tolerance for parallel.
143  static double fThetaTolerance; ///< Theta tolerance for parallel.
144  static double fSepTolerance; ///< Separation tolerance for equal.
145 
146  // Attributes.
147 
148  double fX0; ///< X origin.
149  double fY0; ///< Y origin.
150  double fZ0; ///< Z origin.
151  double fPhi; ///< Rotation angle about x-axis (wire angle).
152  double fTheta; ///< Rotation angle about y'-axis (projected Lorentz angle).
153  };
154 }
155 
156 #endif
virtual void getPosition(const TrackVector &vec, double xyz[3]) const
Get position of track.
TrackDirection
Track direction enum.
Definition: Surface.h:56
virtual bool isEqual(const Surface &surf) const
Test two surfaces for equality, within tolerance.
double y0() const
Y origin.
Definition: SurfXYZPlane.h:102
virtual std::ostream & Print(std::ostream &out) const
Printout.
string dir
static double fPhiTolerance
Phi tolerance for parallel.
Definition: SurfXYZPlane.h:142
virtual bool isParallel(const Surface &surf) const
Test whether two surfaces are parallel, within tolerance.
static double fSepTolerance
Separation tolerance for equal.
Definition: SurfXYZPlane.h:144
virtual bool isTrackValid(const TrackVector &vec) const
Surface-specific tests of validity of track parameters.
virtual double distanceTo(const Surface &surf) const
Find perpendicular forward distance to a parallel surface.
double fX0
X origin.
Definition: SurfXYZPlane.h:148
double phi() const
Rot. angle about x-axis (wire angle).
Definition: SurfXYZPlane.h:104
double x0() const
X origin.
Definition: SurfXYZPlane.h:101
virtual void toLocal(const double xyz[3], double uvw[3]) const
Transform global to local coordinates.
SurfXYZPlane()
Default constructor.
KVector< 5 >::type TrackVector
Track state vector, dimension 5.
double theta() const
Rot. angle about y&#39;-axis (projected Lorentz angle).
Definition: SurfXYZPlane.h:105
virtual void toGlobal(const double uvw[3], double xyz[3]) const
Transform local to global coordinates.
double fY0
Y origin.
Definition: SurfXYZPlane.h:149
Base class for Kalman filter planar surfaces.
double fTheta
Rotation angle about y&#39;-axis (projected Lorentz angle).
Definition: SurfXYZPlane.h:152
static double fThetaTolerance
Theta tolerance for parallel.
Definition: SurfXYZPlane.h:143
double z0() const
Z origin.
Definition: SurfXYZPlane.h:103
virtual ~SurfXYZPlane()
Destructor.
double fPhi
Rotation angle about x-axis (wire angle).
Definition: SurfXYZPlane.h:151
virtual void getMomentum(const TrackVector &vec, double mom[3], TrackDirection dir=UNKNOWN) const
Get momentum vector of track.
virtual Surface * clone() const
Clone method.
double fZ0
Z origin.
Definition: SurfXYZPlane.h:150