Helix.cc
Go to the documentation of this file.
1 #include "GArObjects/Helix.h"
2 
3 #include <cmath>
4 #include <iostream>
5 #include <limits>
6 
7 namespace gar_content
8 {
9 
10  const float Helix::FCT = 2.99792458E-4f;
11  const float Helix::TWO_PI = static_cast<float>(2. * std::acos(-1.0));
12  const float Helix::HALF_PI = static_cast<float>(0.5 * std::acos(-1.0));
13 
14  //------------------------------------------------------------------------------------------------------------------------------------------
15 
16  Helix::Helix(const float phi0, const float d0, const float x0, const float omega, const float tanLambda, const float bField)
17  : m_referencePoint(0.f, 0.f, 0.f),
18  m_momentum(0.f, 0.f, 0.f),
19  m_phi0(phi0),
20  m_d0(d0),
21  m_x0(x0),
22  m_omega(omega),
23  m_tanLambda(tanLambda)
24  {
25  if ((bField < std::numeric_limits<float>::epsilon()) || (std::fabs(omega) < std::numeric_limits<float>::epsilon()))
26  {
27  std::cout << "Helix, invalid parameter: bField " << bField << ", omega " << omega << std::endl;
28  throw pandora::StatusCodeException(pandora::STATUS_CODE_INVALID_PARAMETER);
29  }
30 
31  m_charge = omega / std::fabs(omega);
32  m_radius = 1.f / std::fabs(omega);
33  m_zAtPCA = -m_d0 * std::sin(m_phi0);
34  m_yAtPCA = m_d0 * std::cos(m_phi0);
36  m_pzy = FCT * bField * m_radius;
37  m_momentum.SetValues(m_pzy * std::cos(m_phi0), m_pzy * std::sin(m_phi0), m_tanLambda * m_pzy);
38  m_pzAtPCA = m_momentum.GetZ();
39  m_pyAtPCA = m_momentum.GetY();
40  m_phiMomRefPoint = std::atan2(m_pyAtPCA, m_pzAtPCA);
41  m_zCentre = m_referencePoint.GetZ() + m_radius * std::cos(m_phi0 - HALF_PI * m_charge);
42  m_yCentre = m_referencePoint.GetY() + m_radius * std::sin(m_phi0 - HALF_PI * m_charge);
43  m_phiAtPCA = std::atan2(-m_yCentre, -m_zCentre);
45  }
46 
47  //------------------------------------------------------------------------------------------------------------------------------------------
48 
49  Helix::Helix(const pandora::CartesianVector &position, const pandora::CartesianVector &momentum, const float charge, const float bField)
50  : m_referencePoint(position),
51  m_momentum(momentum),
52  m_charge(charge)
53  {
54  const double pz(momentum.GetZ()), py(momentum.GetY());
55  const double pzy(std::sqrt(pz * pz + py * py));
56 
57  if ((bField < std::numeric_limits<float>::epsilon()) || (std::fabs(pzy) < std::numeric_limits<float>::epsilon()))
58  {
59  std::cout << "Helix, invalid parameter: bField " << bField << ", pzy " << pzy << std::endl;
60  throw pandora::StatusCodeException(pandora::STATUS_CODE_INVALID_PARAMETER);
61  }
62 
63  const double radius(pzy / (FCT * bField));
64  m_pzy = static_cast<float>(pzy);
65  m_radius = static_cast<float>(radius);
66 
67  m_omega = charge / m_radius;
68  m_tanLambda = momentum.GetX() / m_pzy;
69  m_phiMomRefPoint = static_cast<float>(std::atan2(py, pz));
70 
71  const double z(position.GetZ()), y(position.GetY());
72  const double zCentre(z + radius * static_cast<double>(std::cos(m_phiMomRefPoint - HALF_PI * charge)));
73  const double yCentre(y + radius * static_cast<double>(std::sin(m_phiMomRefPoint - HALF_PI * charge)));
74  m_zCentre = static_cast<float>(zCentre);
75  m_yCentre = static_cast<float>(yCentre);
76 
77  double d0;
78  if (charge > 0)
79  {
80  d0 = static_cast<double>(charge) * radius - static_cast<double>(std::sqrt(zCentre * zCentre + yCentre * yCentre));
81  }
82  else
83  {
84  d0 = static_cast<double>(charge) * radius + static_cast<double>(std::sqrt(zCentre * zCentre + yCentre * yCentre));
85  }
86  m_d0 = static_cast<float>(d0);
87 
88  m_phiRefPoint = static_cast<float>(std::atan2(y - yCentre, z - zCentre));
89  m_phiAtPCA = static_cast<float>(std::atan2(-yCentre, -zCentre));
90  m_phi0 = -HALF_PI * charge + m_phiAtPCA;
91 
92  while (m_phi0 < 0.)
93  m_phi0 += TWO_PI;
94 
95  while (m_phi0 >= TWO_PI)
96  m_phi0 -= TWO_PI;
97 
98  m_zAtPCA = m_zCentre + m_radius * std::cos(m_phiAtPCA);
99  m_yAtPCA = m_yCentre + m_radius * std::sin(m_phiAtPCA);
100  m_pzAtPCA = m_pzy * std::cos(m_phi0);
101  m_pyAtPCA = m_pzy * std::sin(m_phi0);
102 
103  float deltaPhi = m_phiRefPoint - m_phiAtPCA;
104  float zCircles = (-position.GetX() * charge) / (TWO_PI * ((m_radius * m_tanLambda) - deltaPhi));
105 
106  int n1, n2;
107  if (zCircles >= std::numeric_limits<float>::epsilon())
108  {
109  n1 = static_cast<int>(zCircles);
110  n2 = n1 + 1;
111  }
112  else
113  {
114  n1 = static_cast<int>(zCircles) - 1;
115  n2 = n1 + 1;
116  }
117 
118  const int nCircles((std::fabs(n1 - zCircles) < std::fabs(n2 - zCircles) ? n1 : n2));
119  m_x0 = position.GetX() + m_radius * m_tanLambda * charge * (deltaPhi + TWO_PI * nCircles);
120  }
121 
122  //------------------------------------------------------------------------------------------------------------------------------------------
123 
124  pandora::StatusCode Helix::GetPointInZY(const float z0, const float y0, const float az, const float ay, const pandora::CartesianVector &referencePoint,
125  pandora::CartesianVector &intersectionPoint, float &genericTime) const
126  {
127  const float AA(std::sqrt(az * az + ay * ay));
128 
129  if (AA <= 0)
130  return pandora::STATUS_CODE_FAILURE;
131 
132  const float BB((az * (z0 - m_zCentre) + ay * (y0 - m_yCentre)) / AA);
133  const float CC(((z0 - m_zCentre) * (z0 - m_zCentre) + (y0 - m_yCentre) * (y0 - m_yCentre) - m_radius * m_radius) / AA);
134 
135  const float DET(BB * BB - CC);
136 
137  if (DET < 0)
138  return pandora::STATUS_CODE_NOT_FOUND;
139 
140  float tt1(-BB + std::sqrt(DET));
141  float tt2(-BB - std::sqrt(DET));
142 
143  const float zz1(z0 + tt1 * az);
144  const float yy1(y0 + tt1 * ay);
145  const float zz2(z0 + tt2 * az);
146  const float yy2(y0 + tt2 * ay);
147 
148  const float phi1(std::atan2(yy1 - m_yCentre, zz1 - m_zCentre));
149  const float phi2(std::atan2(yy2 - m_yCentre, zz2 - m_zCentre));
150  const float phi0(std::atan2(referencePoint.GetY() - m_yCentre, referencePoint.GetZ() - m_zCentre));
151 
152  float dphi1(phi1 - phi0);
153  float dphi2(phi2 - phi0);
154 
155  if (dphi1 < 0 && m_charge < 0)
156  {
157  dphi1 = dphi1 + TWO_PI;
158  }
159  else if (dphi1 > 0 && m_charge > 0)
160  {
161  dphi1 = dphi1 - TWO_PI;
162  }
163 
164  if (dphi2 < 0 && m_charge < 0)
165  {
166  dphi2 = dphi2 + TWO_PI;
167  }
168  else if (dphi2 > 0 && m_charge > 0)
169  {
170  dphi2 = dphi2 - TWO_PI;
171  }
172 
173  // Calculate generic time
174  tt1 = -m_charge * dphi1 * m_radius / m_pzy;
175  tt2 = -m_charge * dphi2 * m_radius / m_pzy;
176 
177  if ((tt1 < 0.) || (tt2 < 0.))
178  std::cout << "Helix:: GetPointInXY, warning - negative generic time, tt1 " << tt1 << ", tt2 " << tt2 << std::endl;
179 
180  if (tt1 < tt2)
181  {
182  genericTime = tt1;
183  intersectionPoint.SetValues(referencePoint.GetX() + genericTime * m_momentum.GetX(), yy1, zz1);
184  }
185  else
186  {
187  genericTime = tt2;
188  intersectionPoint.SetValues(referencePoint.GetX() + genericTime * m_momentum.GetX(), yy2, zz2);
189  }
190 
191  return pandora::STATUS_CODE_SUCCESS;
192  }
193 
194  //------------------------------------------------------------------------------------------------------------------------------------------
195 
196  pandora::StatusCode Helix::GetPointInX(const float xPlane, const pandora::CartesianVector &referencePoint, pandora::CartesianVector &intersectionPoint,
197  float &genericTime) const
198  {
199  if (std::fabs(m_momentum.GetX()) < std::numeric_limits<float>::epsilon())
200  return pandora::STATUS_CODE_NOT_FOUND;
201 
202  genericTime = (xPlane - referencePoint.GetX()) / m_momentum.GetX();
203 
204  const float phi0(std::atan2(referencePoint.GetY() - m_yCentre, referencePoint.GetZ() - m_zCentre));
205  const float phi(phi0 - m_charge * m_pzy * genericTime / m_radius);
206 
207  intersectionPoint.SetValues(xPlane, m_yCentre + m_radius * std::sin(phi), m_zCentre + m_radius * std::cos(phi));
208 
209  return pandora::STATUS_CODE_SUCCESS;
210  }
211 
212  //------------------------------------------------------------------------------------------------------------------------------------------
213 
214  pandora::StatusCode Helix::GetPointOnCircle(const float radius, const pandora::CartesianVector &referencePoint, pandora::CartesianVector &intersectionPoint,
215  float &genericTime) const
216  {
217  const float distCenterToIP(std::sqrt(m_zCentre * m_zCentre + m_yCentre * m_yCentre));
218 
219  if ( ((distCenterToIP + m_radius) < radius) || ((m_radius + radius) < distCenterToIP) )
220  return pandora::STATUS_CODE_NOT_FOUND;
221 
222  const float phiCentre(std::atan2(m_yCentre, m_zCentre));
223 
224  float phiStar(radius * radius + distCenterToIP * distCenterToIP - m_radius * m_radius);
225  phiStar = 0.5f * phiStar / std::max(1.e-20f, radius * distCenterToIP);
226 
227  if (phiStar > 1.f)
228  phiStar = 0.9999999f;
229 
230  if (phiStar < -1.f)
231  phiStar = -0.9999999f;
232 
233  phiStar = std::acos(phiStar);
234 
235  const float zz1(radius * std::cos(phiCentre + phiStar));
236  const float yy1(radius * std::sin(phiCentre + phiStar));
237 
238  const float zz2(radius * std::cos(phiCentre-phiStar));
239  const float yy2(radius * std::sin(phiCentre-phiStar));
240 
241  const float phi1(std::atan2(yy1 - m_yCentre, zz1 - m_zCentre));
242  const float phi2(std::atan2(yy2 - m_yCentre, zz2 - m_zCentre));
243  const float phi0(std::atan2(referencePoint.GetY() - m_yCentre, referencePoint.GetZ() - m_zCentre));
244 
245  float dphi1(phi1 - phi0);
246  float dphi2(phi2 - phi0);
247 
248  if (dphi1 < 0 && m_charge < 0)
249  {
250  dphi1 = dphi1 + TWO_PI;
251  }
252  else if (dphi1 > 0 && m_charge > 0)
253  {
254  dphi1 = dphi1 - TWO_PI;
255  }
256 
257  if (dphi2 < 0 && m_charge < 0)
258  {
259  dphi2 = dphi2 + TWO_PI;
260  }
261  else if (dphi2 > 0 && m_charge > 0)
262  {
263  dphi2 = dphi2 - TWO_PI;
264  }
265 
266  // Calculate generic time
267  const float tt1(-m_charge * dphi1 * m_radius / m_pzy);
268  const float tt2(-m_charge * dphi2 * m_radius / m_pzy);
269 
270  if ((tt1 < 0.) || (tt2 < 0.))
271  std::cout << "Helix:: GetPointOnCircle, warning - negative generic time, tt1 " << tt1 << ", tt2 " << tt2 << std::endl;
272 
273  // Previously returned both xx1, xx2, etc.
274  if (tt1 < tt2)
275  {
276  genericTime = tt1;
277  intersectionPoint.SetValues(referencePoint.GetX() + genericTime * m_momentum.GetX(), yy1, zz1);
278  }
279  else
280  {
281  genericTime = tt2;
282  intersectionPoint.SetValues(referencePoint.GetX() + genericTime * m_momentum.GetX(), yy2, zz2);
283  }
284 
285  return pandora::STATUS_CODE_SUCCESS;
286  }
287 
288  //------------------------------------------------------------------------------------------------------------------------------------------
289 
290  pandora::StatusCode Helix::GetDistanceToPoint(const pandora::CartesianVector &point, pandora::CartesianVector &distance, float &genericTime) const
291  {
292  const float phi(std::atan2(point.GetY() - m_yCentre, point.GetZ() - m_zCentre));
293  const float phi0(std::atan2(m_referencePoint.GetY() - m_yCentre, m_referencePoint.GetZ() - m_zCentre));
294 
295  int nCircles = 0;
296  if (std::fabs(m_tanLambda * m_radius) > 1.e-20)
297  {
298  const float zCircles((phi0 - phi - m_charge * (point.GetX() - m_referencePoint.GetX()) / (m_tanLambda * m_radius)) / TWO_PI);
299 
300  int n1, n2;
301  if (zCircles >= std::numeric_limits<float>::epsilon())
302  {
303  n1 = static_cast<int>(zCircles);
304  n2 = n1 + 1;
305  }
306  else
307  {
308  n1 = static_cast<int>(zCircles) - 1;
309  n2 = n1 + 1;
310  }
311 
312  nCircles = ((std::fabs(n1 - zCircles) < std::fabs(n2 - zCircles) ? n1 : n2));
313  }
314 
315  const float dPhi(TWO_PI * (static_cast<float>(nCircles)) + phi - phi0);
316  const float xOnHelix(m_referencePoint.GetX() - m_charge * m_radius * m_tanLambda * dPhi);
317 
318  const float distZ(std::fabs(m_zCentre - point.GetZ()));
319  const float distY(std::fabs(m_yCentre - point.GetY()));
320  const float distX(std::fabs(xOnHelix - point.GetX()));
321 
322  float distZY(std::sqrt(distZ * distZ + distY * distY));
323  distZY = std::fabs(distZY - m_radius);
324 
325  distance.SetValues(distX, distZY, std::sqrt(distZY * distZY + distZ * distZ));
326 
327  if (std::fabs(m_momentum.GetX()) > 0)
328  {
329  genericTime = (xOnHelix - m_referencePoint.GetX()) / m_momentum.GetX();
330  }
331  else
332  {
333  genericTime = m_charge * m_radius * dPhi / m_pzy;
334  }
335 
336  return pandora::STATUS_CODE_SUCCESS;
337  }
338 
339  //------------------------------------------------------------------------------------------------------------------------------------------
340 
341  pandora::StatusCode Helix::GetDistanceToHelix(const gar_content::Helix *const pHelix, pandora::CartesianVector &positionOfClosestApproach, pandora::CartesianVector &v0momentum,
342  float &helixDistance) const
343  {
344  if (this == pHelix)
345  return pandora::STATUS_CODE_INVALID_PARAMETER;
346 
347  const float z01(this->GetZCentre());
348  const float y01(this->GetYCentre());
349 
350  const float z02(pHelix->GetZCentre());
351  const float y02(pHelix->GetYCentre());
352 
353  const float rad1(this->GetRadius());
354  const float rad2(pHelix->GetRadius());
355 
356  const float distance(std::sqrt((z01-z02) * (z01-z02) + (y01-y02) * (y01-y02)));
357 
358  bool singlePoint(true);
359  float phi1(0.), phi2(0.);
360 
361  if (rad1 + rad2 < distance)
362  {
363  phi1 = std::atan2(y02 - y01, z02 - z01);
364  phi2 = std::atan2(y01 - y02, z01 - z02);
365  }
366  else if (distance + rad2 < rad1)
367  {
368  phi1 = std::atan2(y02 - y01, z02 - z01);
369  phi2 = phi1;
370  }
371  else if (distance + rad1 < rad2)
372  {
373  phi1 = std::atan2(y01 - y02, z01 - z02);
374  phi2 = phi1;
375  }
376  else
377  {
378  if ((std::fabs(distance) < std::numeric_limits<float>::epsilon()) || (std::fabs(rad2) < std::numeric_limits<float>::epsilon()))
379  return pandora::STATUS_CODE_FAILURE;
380 
381  singlePoint = false;
382  float cosAlpha = 0.5f * (distance * distance + rad2 * rad2 - rad1 * rad1) / (distance * rad2);
383  float alpha = std::acos(cosAlpha);
384  float phi0 = std::atan2(y01 - y02, z01 - z02);
385  phi1 = phi0 + alpha;
386  phi2 = phi0 - alpha;
387  }
388 
389  const pandora::CartesianVector &referencePoint1(m_referencePoint);
390  const pandora::CartesianVector &referencePoint2(pHelix->GetReferencePoint());
391 
392  pandora::CartesianVector position1(0.f, 0.f, 0.f), position2(0.f, 0.f, 0.f);
393 
394  if (singlePoint)
395  {
396  const float zSect1(z01 + rad1 * std::cos(phi1));
397  const float ySect1(y01 + rad1 * std::sin(phi1));
398  const float zSect2(z02 + rad2 * std::cos(phi2));
399  const float ySect2(y02 + rad2 * std::sin(phi2));
400  const float r1(std::sqrt(zSect1 * zSect1 + ySect1 * ySect1));
401  const float r2(std::sqrt(zSect2 * zSect2 + ySect2 * ySect2));
402 
403  PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, this->GetPointOnCircle(r1, referencePoint1, position1));
404  PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, pHelix->GetPointOnCircle(r2, referencePoint2, position2));
405  }
406  else
407  {
408  const float zSect1(z02 + rad2*std::cos(phi1));
409  const float ySect1(y02 + rad2*std::sin(phi1));
410  const float zSect2(z02 + rad2*std::cos(phi2));
411  const float ySect2(y02 + rad2*std::sin(phi2));
412 
413  const float phiI2(std::atan2(referencePoint2.GetY() - y02, referencePoint2.GetZ() - z02));
414  const float phiF21(std::atan2(ySect1 - y02, zSect1 - z02));
415  const float phiF22(std::atan2(ySect2 - y02, zSect2 - z02));
416  const float charge2(pHelix->GetCharge());
417 
418  float deltaPhi21(phiF21 - phiI2);
419  float deltaPhi22(phiF22 - phiI2);
420 
421  if (deltaPhi21 < 0 && charge2 < 0)
422  {
423  deltaPhi21 += TWO_PI;
424  }
425  else if (deltaPhi21 > 0 && charge2 > 0)
426  {
427  deltaPhi21 -= TWO_PI;
428  }
429 
430  if (deltaPhi22 < 0 && charge2 < 0)
431  {
432  deltaPhi22 += TWO_PI;
433  }
434  else if (deltaPhi22 > 0 && charge2 > 0)
435  {
436  deltaPhi22 -= TWO_PI;
437  }
438 
439  const float pzy2(pHelix->GetPzy());
440  const float genericTime21(-charge2 * deltaPhi21 * rad2 / pzy2);
441  const float genericTime22(-charge2 * deltaPhi22 * rad2 / pzy2);
442 
443  const float px2(pHelix->GetMomentum().GetX());
444  const float X21(referencePoint2.GetX() + genericTime21 * px2);
445  const float X22(referencePoint2.GetX() + genericTime22 * px2);
446 
447  const pandora::CartesianVector temp21(X21, ySect1, zSect1);
448  const pandora::CartesianVector temp22(X22, ySect2, zSect2);
449 
450  const float phiI1(std::atan2(referencePoint1.GetY() - y01, referencePoint1.GetZ() - z01));
451  const float phiF11(std::atan2(ySect1-y01,zSect1-z01));
452  const float phiF12(std::atan2(ySect2-y01,zSect2-z01));
453  const float charge1(m_charge);
454 
455  float deltaPhi11(phiF11 - phiI1);
456  float deltaPhi12(phiF12 - phiI1);
457 
458  if (deltaPhi11 < 0 && charge1 < 0)
459  {
460  deltaPhi11 += TWO_PI;
461  }
462  else if (deltaPhi11 > 0 && charge1 > 0)
463  {
464  deltaPhi11 -= TWO_PI;
465  }
466 
467  if (deltaPhi12 < 0 && charge1 < 0)
468  {
469  deltaPhi12 += TWO_PI;
470  }
471  else if (deltaPhi12 > 0 && charge1 > 0)
472  {
473  deltaPhi12 -= TWO_PI;
474  }
475 
476  const float pzy1(m_pzy);
477  const float genericTime11(-charge1 * deltaPhi11 * rad1 / pzy1);
478  const float genericTime12(-charge1 * deltaPhi12 * rad1 / pzy1);
479 
480  const float px1(m_momentum.GetX());
481  const float X11(referencePoint1.GetX() + genericTime11 * px1);
482  const float X12(referencePoint1.GetX() + genericTime12 * px1);
483 
484  const pandora::CartesianVector temp11(X11, ySect1, zSect1);
485  const pandora::CartesianVector temp12(X12, ySect2, zSect2);
486 
487  const float dist1((temp11 - temp21).GetMagnitudeSquared());
488  const float dist2((temp12 - temp22).GetMagnitudeSquared());
489 
490  if (dist1 < dist2)
491  {
492  position1 = temp11;
493  position2 = temp21;
494  }
495  else
496  {
497  position1 = temp12;
498  position2 = temp22;
499  }
500  }
501 
502  const pandora::CartesianVector momentum1(this->GetExtrapolatedMomentum(position1));
503  const pandora::CartesianVector momentum2(pHelix->GetExtrapolatedMomentum(position2));
504 
505  helixDistance = (position1 - position2).GetMagnitude();
506  positionOfClosestApproach = (position1 + position2) * 0.5;
507  v0momentum = momentum1 + momentum2;
508 
509  return pandora::STATUS_CODE_SUCCESS;
510  }
511 
512  //------------------------------------------------------------------------------------------------------------------------------------------
513 
514  pandora::CartesianVector Helix::GetExtrapolatedMomentum(const pandora::CartesianVector &position) const
515  {
516  float phi = std::atan2(position.GetY() - m_yCentre, position.GetZ() - m_zCentre);
517 
518  if (phi < 0.)
519  phi += TWO_PI;
520 
521  phi = phi - m_phiAtPCA + m_phi0;
522 
523  return pandora::CartesianVector(m_momentum.GetX(), m_pzy * std::sin(phi), m_pzy * std::cos(phi));
524  }
525 
526 } // namespace gar_content
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 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
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
const double e
float GetRadius() const
Get radius of circumference.
Definition: Helix.h:377
float m_x0
x0 in canonical parameterisation
Definition: Helix.h:245
const pandora::CartesianVector & GetReferencePoint() const
Get reference point of track.
Definition: Helix.h:304
double alpha
Definition: doAna.cpp:15
float m_zAtPCA
z coordinate at point of closest approach
Definition: Helix.h:255
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
static int max(int a, int b)
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
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
QTextStream & endl(QTextStream &s)
Helix class.
Definition: Helix.h:14