SurfYZLine.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 ///
3 /// \file SurfYZLine.h
4 ///
5 /// \brief Line surface perpendicular to x-axis.
6 ///
7 /// \author H. Greenlee
8 ///
9 /// This class represents a line surface perpendicular to the global
10 /// x-axis, or equivalently, parallel to the yz-plane.
11 ///
12 /// The surface parameters and local coordinate system of this
13 /// surface are the same as SurfYZPlane.
14 ///
15 /// This surface is defined by four parameters, which are,
16 /// (x0, y0, z0) - Local origin in global coordinates.
17 /// phi - Rotation angle around x-axis.
18 ///
19 /// The local uvw coordinate system is related to the global xyz
20 /// coordinate system as follows.
21 ///
22 /// u = x-x0
23 /// v = (y-y0)*cos(phi) + (z-z0)*sin(phi)
24 /// w = -(y-y0)*sin(phi) + (z-z0)*cos(phi)
25 ///
26 /// or inversely,
27 ///
28 /// x = x0 + u
29 /// y = y0 + v*cos(phi) - w*sin(phi)
30 /// z = z0 + v*sin(phi) + w*cos(phi)
31 ///
32 /// Track parameters on this type of surface are:
33 ///
34 /// 1. r
35 /// 2. v
36 /// 3. phi
37 /// 4. eta
38 /// 5. 1/p (nonmagnetic) or q/p (magnetic)
39 ///
40 /// r = Signed impoact parameter. Absolute value of r is the perpendicular
41 /// distance of the track to the v-axis at the point of closest
42 /// approach to v-axis. Sign of r matches sign of L_v (v projection
43 /// of angular momentum).
44 /// v = V-coordinate of track at point of closest approach to v-axis.
45 /// phi = Direction of track in u-w plane (phi = arctan(w/u)).
46 /// eta = Pseudorapidity with respect to v-axis.
47 /// q/p or 1/p = Inverse momentum.
48 ///
49 /// In terms of these parameters, the point of closest approach to the
50 /// v-axis is
51 ///
52 /// u = -r sin(phi)
53 /// v = v
54 /// w = r cos(phi)
55 ///
56 /// The unit direction vector is
57 ///
58 /// du/ds = cos(phi) sech(eta)
59 /// dv/ds = tanh(eta)
60 /// dw/ds = sin(phi) sech(eta)
61 ///
62 /// Inversely:
63 ///
64 /// phi = atan(dw/du) = atan2(dw/ds, du/ds)
65 /// eta = atanh(dv/ds) = asinh(dv/duw)
66 /// r = w cos(phi) - u sin(phi)
67 ///
68 ///
69 ////////////////////////////////////////////////////////////////////////
70 
71 #ifndef SURFYZLINE_H
72 #define SURFYZLINE_H
73 
75 
76 namespace trkf {
77 
78  class SurfYZLine : public SurfLine
79  {
80  public:
81 
82  /// Default constructor.
83  SurfYZLine();
84 
85  /// Initializing constructor.
86  SurfYZLine(double x0, double y0, double z0, double phi);
87 
88  /// Destructor.
89  virtual ~SurfYZLine();
90 
91  // Accessors.
92  double x0() const {return fX0;} ///< X origin.
93  double y0() const {return fY0;} ///< Y origin.
94  double z0() const {return fZ0;} ///< Z origin.
95  double phi() const {return fPhi;} ///< Rotation angle about x-axis.
96 
97  /// Clone method.
98  virtual Surface* clone() const;
99 
100  /// Surface-specific tests of validity of track parameters.
101  virtual bool isTrackValid(const TrackVector& vec) const;
102 
103  /// Transform global to local coordinates.
104  virtual void toLocal(const double xyz[3], double uvw[3]) const;
105 
106  /// Transform local to global coordinates.
107  virtual void toGlobal(const double uvw[3], double xyz[3]) const;
108 
109  /// Calculate difference of two track parameter vectors.
110  virtual TrackVector getDiff(const TrackVector& vec1, const TrackVector& vec2) const;
111 
112  /// Get position of track.
113  virtual void getPosition(const TrackVector& vec, double xyz[3]) const;
114 
115  /// Get momentum vector of track.
116  virtual void getMomentum(const TrackVector& vec, double mom[3],
117  TrackDirection dir=UNKNOWN) const;
118 
119  /// Test whether two surfaces are parallel, within tolerance.
120  virtual bool isParallel(const Surface& surf) const;
121 
122  /// Find perpendicular distance to a parallel surface
123  virtual double distanceTo(const Surface& surf) const;
124 
125  /// Test two surfaces for equality, within tolerance.
126  virtual bool isEqual(const Surface& surf) const;
127 
128  /// Printout
129  virtual std::ostream& Print(std::ostream& out) const;
130 
131  private:
132 
133  // Static attributes.
134 
135  static double fPhiTolerance; ///< Phi tolerance for parallel.
136  static double fSepTolerance; ///< Separation tolerance for equal.
137 
138  // Attributes.
139 
140  double fX0; ///< X origin.
141  double fY0; ///< Y origin.
142  double fZ0; ///< Z origin.
143  double fPhi; ///< Rotation angle about x-axis.
144  };
145 }
146 
147 #endif
TrackDirection
Track direction enum.
Definition: Surface.h:56
virtual void toGlobal(const double uvw[3], double xyz[3]) const
Transform local to global coordinates.
Definition: SurfYZLine.cxx:93
virtual bool isEqual(const Surface &surf) const
Test two surfaces for equality, within tolerance.
Definition: SurfYZLine.cxx:270
string dir
virtual void toLocal(const double xyz[3], double uvw[3]) const
Transform global to local coordinates.
Definition: SurfYZLine.cxx:71
virtual bool isTrackValid(const TrackVector &vec) const
Surface-specific tests of validity of track parameters.
Definition: SurfYZLine.cxx:57
virtual void getMomentum(const TrackVector &vec, double mom[3], TrackDirection dir=UNKNOWN) const
Get momentum vector of track.
Definition: SurfYZLine.cxx:161
virtual bool isParallel(const Surface &surf) const
Test whether two surfaces are parallel, within tolerance.
Definition: SurfYZLine.cxx:208
double fX0
X origin.
Definition: SurfYZLine.h:140
virtual double distanceTo(const Surface &surf) const
Find perpendicular distance to a parallel surface.
Definition: SurfYZLine.cxx:237
virtual ~SurfYZLine()
Destructor.
Definition: SurfYZLine.cxx:47
static double fPhiTolerance
Phi tolerance for parallel.
Definition: SurfYZLine.h:135
virtual std::ostream & Print(std::ostream &out) const
Printout.
Definition: SurfYZLine.cxx:295
KVector< 5 >::type TrackVector
Track state vector, dimension 5.
double z0() const
Z origin.
Definition: SurfYZLine.h:94
static double fSepTolerance
Separation tolerance for equal.
Definition: SurfYZLine.h:136
double x0() const
X origin.
Definition: SurfYZLine.h:92
double fZ0
Z origin.
Definition: SurfYZLine.h:142
Base class for Kalman filter line surfaces.
double fY0
Y origin.
Definition: SurfYZLine.h:141
virtual TrackVector getDiff(const TrackVector &vec1, const TrackVector &vec2) const
Calculate difference of two track parameter vectors.
Definition: SurfYZLine.cxx:117
double phi() const
Rotation angle about x-axis.
Definition: SurfYZLine.h:95
double y0() const
Y origin.
Definition: SurfYZLine.h:93
double fPhi
Rotation angle about x-axis.
Definition: SurfYZLine.h:143
virtual Surface * clone() const
Clone method.
Definition: SurfYZLine.cxx:51
virtual void getPosition(const TrackVector &vec, double xyz[3]) const
Get position of track.
Definition: SurfYZLine.cxx:134
SurfYZLine()
Default constructor.
Definition: SurfYZLine.cxx:25