Helix.h
Go to the documentation of this file.
1 #ifndef GARCONTENT_HELIX_H
2 #define GARCONTENT_HELIX_H 1
3 
4 #include "Objects/CartesianVector.h"
5 
6 #include "Pandora/StatusCodes.h"
7 
8 namespace gar_content
9 {
10 
11  /**
12  * @brief Helix class
13  */
14  class Helix
15  {
16  public:
17  /**
18  * @brief Constructor using canonical (LEP-wise) parameterisation
19  *
20  * @param phi0 phi angle of momentum vector at the point of closest approach to IP in R-Phi plane
21  * @param d0 signed distance of closest approach in R-Phi plane
22  * @param x0 x coordinate of the point of closest approach to IP in R-Phi plane
23  * @param omega signed curvature
24  * @param tanLambda tangent of dip angle
25  * @param bField magnetic field (in Tesla)
26  */
27  Helix(const float phi0, const float d0, const float x0, const float omega, const float tanlambda, const float bField);
28 
29  /**
30  * @brief Constructor
31  *
32  * @param position position of the reference point
33  * @param momentum momentum vector at the reference point
34  * @param charge particle charge
35  * @param bField magnetic field (in Tesla)
36  */
37  Helix(const pandora::CartesianVector &position, const pandora::CartesianVector &momentum, const float charge, const float bField);
38 
39  /**
40  * @brief Get helix intersection point with a plane parallel to x axis. The plane is defined by two coordinates in the
41  * plane (z0,y0) and a normal vector (az,ay).
42  *
43  * @param z0 z coordinate in the specified plane
44  * @param y0 y coordinate in the specified plane
45  * @param az z component of vector normal to specified plane
46  * @param ay y component of vector normal to specified plane
47  * @param referencePoint the reference point of the helix
48  * @param intersectionPoint to receive the coordinates of the intersection point
49  */
50  pandora::StatusCode GetPointInZY(const float z0, const float y0, const float az, const float ay, const pandora::CartesianVector &referencePoint,
51  pandora::CartesianVector &intersectionPoint) const;
52 
53  /**
54  * @brief Get helix intersection point with a plane parallel to x axis. The plane is defined by two coordinates in the
55  * plane (z0,y0) and a normal vector (az,ay).
56  *
57  * @param z0 z coordinate in the specified plane
58  * @param y0 y coordinate in the specified plane
59  * @param az z component of vector normal to specified plane
60  * @param ay y component of vector normal to specified plane
61  * @param referencePoint the reference point of the helix
62  * @param intersectionPoint to receive the coordinates of the intersection point
63  * @param genericTime to receive the generic time (helix length, from reference point to intersection, divided by particle momentum)
64  */
65  pandora::StatusCode GetPointInZY(const float z0, const float y0, const float az, const float ay, const pandora::CartesianVector &referencePoint,
66  pandora::CartesianVector &intersectionPoint, float &genericTime) const;
67 
68  /**
69  * @brief Get helix intersection point with a plane perpendicular to x axis.
70  *
71  * @param xPlane the x coordinate for the specified plane
72  * @param referencePoint the reference point of the helix
73  * @param intersectionPoint to receive the coordinates of the intersection point
74  */
75  pandora::StatusCode GetPointInX(const float xPlane, const pandora::CartesianVector &referencePoint, pandora::CartesianVector &intersectionPoint) const;
76 
77  /**
78  * @brief Get helix intersection point with a plane perpendicular to x axis.
79  *
80  * @param xPlane the x coordinate for the specified plane
81  * @param referencePoint the reference point of the helix
82  * @param intersectionPoint to receive the coordinates of the intersection point
83  * @param genericTime to receive the generic time (helix length, from reference point to intersection, divided by particle momentum)
84  */
85  pandora::StatusCode GetPointInX(const float xPlane, const pandora::CartesianVector &referencePoint, pandora::CartesianVector &intersectionPoint,
86  float &genericTime) const;
87 
88  /**
89  * @brief Get coordinates of helix intersection with cylinder, aligned along z-axis
90  *
91  * @param radius the radius of the cylinder
92  * @param referencePoint the reference point of the helix
93  * @param intersectionPoint to receive the coordinates of the intersection point
94  */
95  pandora::StatusCode GetPointOnCircle(const float radius, const pandora::CartesianVector &referencePoint, pandora::CartesianVector &intersectionPoint) const;
96 
97  /**
98  * @brief Get coordinates of helix intersection with cylinder, aligned along z-axis
99  *
100  * @param radius the radius of the cylinder
101  * @param referencePoint the reference point of the helix
102  * @param intersectionPoint to receive the coordinates of the intersection point
103  * @param genericTime to receive the generic time (helix length, from reference point to intersection, divided by particle momentum)
104  */
105  pandora::StatusCode GetPointOnCircle(const float radius, const pandora::CartesianVector &referencePoint, pandora::CartesianVector &intersectionPoint,
106  float &genericTime) const;
107 
108  /**
109  * @brief Get distance of the closest approach of helix to an arbitrary point in space
110  *
111  * @param point coordinates of the specified point
112  * @param distance to receive a vector of distances from helix to point in the following projections:
113  * x component: distance in R-Phi plane
114  * y-component: distance along Z axis
115  * z-component: 3D distance magnitude
116  */
117  pandora::StatusCode GetDistanceToPoint(const pandora::CartesianVector &point, pandora::CartesianVector &distance) const;
118 
119  /**
120  * @brief Get distance of the closest approach of helix to an arbitrary point in space
121  *
122  * @param point coordinates of the specified point
123  * @param distance to receive a vector of distances from helix to point in the following projections:
124  * x component: distance in R-Phi plane
125  * y-component: distance along Z axis
126  * z-component: 3D distance magnitude
127  * @param genericTime to receive the generic time (helix length, from reference point to intersection, divided by particle momentum)
128  */
129  pandora::StatusCode GetDistanceToPoint(const pandora::CartesianVector &point, pandora::CartesianVector &distance, float &genericTime) const;
130 
131  /**
132  * @brief Get distance between two helices
133  *
134  * @param pHelix address of a second helix
135  * @param positionOfClosestApproach to receive position of the point of closest approach
136  * @param v0momentum to receive the v0 momentum
137  * @param helixDistance to receive the distance between the two helices
138  */
139  pandora::StatusCode GetDistanceToHelix(const Helix *const pHelix, pandora::CartesianVector &positionOfClosestApproach, pandora::CartesianVector &v0momentum,
140  float &helixDistance) const;
141 
142  /**
143  * @param Get extrapolated momentum at a specified position
144  *
145  * @param position the specified position
146  *
147  * @return the extrapolated momentum
148  */
149  pandora::CartesianVector GetExtrapolatedMomentum(const pandora::CartesianVector &position) const;
150 
151  /**
152  * @brief Get momentum of particle at the point of closest approach to IP
153  *
154  * @return the momentum of particle
155  */
156  const pandora::CartesianVector &GetMomentum() const;
157 
158  /**
159  * @brief Get reference point of track
160  *
161  * @return the reference point of track
162  */
163  const pandora::CartesianVector &GetReferencePoint() const;
164 
165  /**
166  * @brief Get phi angle of the momentum vector at the point of closest approach to IP
167  *
168  * @return the phi angle of the momentum vector
169  */
170  float GetPhi0() const;
171 
172  /**
173  * @brief Get x signed distance of closest approach to IP in the R-Phi plane
174  *
175  * @return the signed distance of closest approach
176  */
177  float GetD0() const;
178 
179  /**
180  * @brief Get x coordinate of the point of closest approach to IP in the R-Phi plane
181  *
182  * @return the x coordinate of the point of closest approach
183  */
184  float GetX0() const;
185 
186  /**
187  * @brief Get signed curvature of the track
188  *
189  * @return the signed curvature of the track
190  */
191  float GetOmega() const;
192 
193  /**
194  * @brief Get tangent of dip angle of the track
195  *
196  * @return the tangent of dip angle of the track
197  */
198  float GetTanLambda() const;
199 
200  /**
201  * @brief Get transverse momentum of the track
202  *
203  * @return the transverse momentum of the track
204  */
205  float GetPzy() const;
206 
207  /**
208  * @brief Get charge
209  *
210  * @return the charge
211  */
212  float GetCharge() const;
213 
214  /**
215  * @brief Get z coordinate of circumference
216  *
217  * @return the z coordinate of circumference
218  */
219  float GetZCentre() const;
220 
221  /**
222  * @brief Get y coordinate of circumference
223  *
224  * @return the y coordinate of circumference
225  */
226  float GetYCentre() const;
227 
228  /**
229  * @brief Get radius of circumference
230  *
231  * @return the radius of circumference
232  */
233  float GetRadius() const;
234 
235  private:
236  static const float FCT;
237  static const float TWO_PI;
238  static const float HALF_PI;
239 
240  pandora::CartesianVector m_referencePoint; ///< The coordinates of the reference point
241  pandora::CartesianVector m_momentum; ///< The momentum vector at reference point
242 
243  float m_phi0; ///< phi0 in canonical parameterization
244  float m_d0; ///< d0 in canonical parameterisation
245  float m_x0; ///< x0 in canonical parameterisation
246  float m_omega; ///< signed curvature in canonical parameterisation
247  float m_tanLambda; ///< tanLambda
248  float m_pzy; ///< The transverse momentum
249  float m_charge; ///< The particle charge
250  float m_zCentre; ///< The circle centre z coordinate
251  float m_yCentre; ///< The circle centre y coordinate
252  float m_radius; ///< The radius of circle in ZY plane
253  float m_phiRefPoint; ///< Phi w.r.t. (Z0, Y0) of circle at reference point
254  float m_phiAtPCA; ///< Phi w.r.t. (Z0, Y0) of circle at point of closest approach
255  float m_zAtPCA; ///< z coordinate at point of closest approach
256  float m_yAtPCA; ///< y coordinate at point of closest approach
257  float m_pzAtPCA; ///< Momentum z component at point of closest approach
258  float m_pyAtPCA; ///< Momentum y component at point of closest approach
259  float m_phiMomRefPoint; ///< Phi of Momentum vector at reference point
260  };
261 
262  //------------------------------------------------------------------------------------------------------------------------------------------
263 
264  inline pandora::StatusCode Helix::GetPointInZY(const float z0, const float y0, const float az, const float ay, const pandora::CartesianVector &referencePoint,
265  pandora::CartesianVector &intersectionPoint) const
266  {
267  float genericTime;
268  return this->GetPointInZY(z0, y0, az, ay, referencePoint, intersectionPoint, genericTime);
269  }
270 
271  //------------------------------------------------------------------------------------------------------------------------------------------
272 
273  inline pandora::StatusCode Helix::GetPointInX(const float xPlane, const pandora::CartesianVector &referencePoint, pandora::CartesianVector &intersectionPoint) const
274  {
275  float genericTime;
276  return this->GetPointInX(xPlane, referencePoint, intersectionPoint, genericTime);
277  }
278 
279  //------------------------------------------------------------------------------------------------------------------------------------------
280 
281  inline pandora::StatusCode Helix::GetPointOnCircle(const float radius, const pandora::CartesianVector &referencePoint, pandora::CartesianVector &intersectionPoint) const
282  {
283  float genericTime;
284  return this->GetPointOnCircle(radius, referencePoint, intersectionPoint, genericTime);
285  }
286 
287  //------------------------------------------------------------------------------------------------------------------------------------------
288 
289  inline pandora::StatusCode Helix::GetDistanceToPoint(const pandora::CartesianVector &point, pandora::CartesianVector &distance) const
290  {
291  float genericTime;
292  return this->GetDistanceToPoint(point, distance, genericTime);
293  }
294 
295  //------------------------------------------------------------------------------------------------------------------------------------------
296 
297  inline const pandora::CartesianVector &Helix::GetMomentum() const
298  {
299  return m_momentum;
300  }
301 
302  //------------------------------------------------------------------------------------------------------------------------------------------
303 
304  inline const pandora::CartesianVector &Helix::GetReferencePoint() const
305  {
306  return m_referencePoint;
307  }
308 
309  //------------------------------------------------------------------------------------------------------------------------------------------
310 
311  inline float Helix::GetPhi0() const
312  {
313  if (m_phi0 < 0.)
314  return m_phi0 + TWO_PI;
315 
316  return m_phi0;
317  }
318 
319  //------------------------------------------------------------------------------------------------------------------------------------------
320 
321  inline float Helix::GetD0() const
322  {
323  return m_d0;
324  }
325 
326  //------------------------------------------------------------------------------------------------------------------------------------------
327 
328  inline float Helix::GetX0() const
329  {
330  return m_x0;
331  }
332 
333  //------------------------------------------------------------------------------------------------------------------------------------------
334 
335  inline float Helix::GetOmega() const
336  {
337  return m_omega;
338  }
339 
340  //------------------------------------------------------------------------------------------------------------------------------------------
341 
342  inline float Helix::GetTanLambda() const
343  {
344  return m_tanLambda;
345  }
346 
347  //------------------------------------------------------------------------------------------------------------------------------------------
348 
349  inline float Helix::GetPzy() const
350  {
351  return m_pzy;
352  }
353 
354  //------------------------------------------------------------------------------------------------------------------------------------------
355 
356  inline float Helix::GetCharge() const
357  {
358  return m_charge;
359  }
360 
361  //------------------------------------------------------------------------------------------------------------------------------------------
362 
363  inline float Helix::GetZCentre() const
364  {
365  return m_zCentre;
366  }
367 
368  //------------------------------------------------------------------------------------------------------------------------------------------
369 
370  inline float Helix::GetYCentre() const
371  {
372  return m_yCentre;
373  }
374 
375  //------------------------------------------------------------------------------------------------------------------------------------------
376 
377  inline float Helix::GetRadius() const
378  {
379  return m_radius;
380  }
381 
382 } // namespace gar_content
383 
384 #endif // #ifndef GARCONTENT_HELIX_H
pandora::CartesianVector m_momentum
The momentum vector at reference point.
Definition: Helix.h:241
pandora::StatusCode GetPointInX(const float xPlane, const pandora::CartesianVector &referencePoint, pandora::CartesianVector &intersectionPoint) const
Get helix intersection point with a plane perpendicular to x axis.
Definition: Helix.h:273
float m_zCentre
The circle centre z coordinate.
Definition: Helix.h:250
float m_phiMomRefPoint
Phi of Momentum vector at reference point.
Definition: Helix.h:259
pandora::StatusCode GetDistanceToHelix(const Helix *const pHelix, pandora::CartesianVector &positionOfClosestApproach, pandora::CartesianVector &v0momentum, float &helixDistance) const
Get distance between two helices.
Definition: Helix.cc:341
float m_yCentre
The circle centre y coordinate.
Definition: Helix.h:251
float m_phi0
phi0 in canonical parameterization
Definition: Helix.h:243
float GetPzy() const
Get transverse momentum of the track.
Definition: Helix.h:349
float m_charge
The particle charge.
Definition: Helix.h:249
float GetPhi0() const
Get phi angle of the momentum vector at the point of closest approach to IP.
Definition: Helix.h:311
float m_radius
The radius of circle in ZY plane.
Definition: Helix.h:252
float m_pyAtPCA
Momentum y component at point of closest approach.
Definition: Helix.h:258
pandora::StatusCode GetPointOnCircle(const float radius, const pandora::CartesianVector &referencePoint, pandora::CartesianVector &intersectionPoint) const
Get coordinates of helix intersection with cylinder, aligned along z-axis.
Definition: Helix.h:281
float GetX0() const
Get x coordinate of the point of closest approach to IP in the R-Phi plane.
Definition: Helix.h:328
const pandora::CartesianVector & GetMomentum() const
Get momentum of particle at the point of closest approach to IP.
Definition: Helix.h:297
static const float TWO_PI
Definition: Helix.h:237
pandora::CartesianVector m_referencePoint
The coordinates of the reference point.
Definition: Helix.h:240
float GetRadius() const
Get radius of circumference.
Definition: Helix.h:377
float m_x0
x0 in canonical parameterisation
Definition: Helix.h:245
float GetOmega() const
Get signed curvature of the track.
Definition: Helix.h:335
const pandora::CartesianVector & GetReferencePoint() const
Get reference point of track.
Definition: Helix.h:304
float m_zAtPCA
z coordinate at point of closest approach
Definition: Helix.h:255
float GetTanLambda() const
Get tangent of dip angle of the track.
Definition: Helix.h:342
double distance(double x1, double y1, double z1, double x2, double y2, double z2)
float m_pzy
The transverse momentum.
Definition: Helix.h:248
float GetYCentre() const
Get y coordinate of circumference.
Definition: Helix.h:370
float m_pzAtPCA
Momentum z component at point of closest approach.
Definition: Helix.h:257
float GetCharge() const
Get charge.
Definition: Helix.h:356
pandora::CartesianVector GetExtrapolatedMomentum(const pandora::CartesianVector &position) const
Definition: Helix.cc:514
float m_omega
signed curvature in canonical parameterisation
Definition: Helix.h:246
static const float FCT
Definition: Helix.h:236
float GetZCentre() const
Get z coordinate of circumference.
Definition: Helix.h:363
float GetD0() const
Get x signed distance of closest approach to IP in the R-Phi plane.
Definition: Helix.h:321
pandora::StatusCode GetPointInZY(const float z0, const float y0, const float az, const float ay, const pandora::CartesianVector &referencePoint, pandora::CartesianVector &intersectionPoint) const
Get helix intersection point with a plane parallel to x axis. The plane is defined by two coordinates...
Definition: Helix.h:264
float m_tanLambda
tanLambda
Definition: Helix.h:247
float m_phiRefPoint
Phi w.r.t. (Z0, Y0) of circle at reference point.
Definition: Helix.h:253
float m_yAtPCA
y coordinate at point of closest approach
Definition: Helix.h:256
def momentum(x1, x2, x3, scale=1.)
static const float HALF_PI
Definition: Helix.h:238
float m_d0
d0 in canonical parameterisation
Definition: Helix.h:244
float m_phiAtPCA
Phi w.r.t. (Z0, Y0) of circle at point of closest approach.
Definition: Helix.h:254
pandora::StatusCode GetDistanceToPoint(const pandora::CartesianVector &point, pandora::CartesianVector &distance) const
Get distance of the closest approach of helix to an arbitrary point in space.
Definition: Helix.h:289
Helix(const float phi0, const float d0, const float x0, const float omega, const float tanlambda, const float bField)
Constructor using canonical (LEP-wise) parameterisation.
Definition: Helix.cc:16
Helix class.
Definition: Helix.h:14