Belle II Software  release-08-01-10
HelixSwimmer Class Reference

Utility for propagation of a particle along helix. More...

#include <HelixSwimmer.h>

Public Member Functions

 HelixSwimmer ()
 default constructor
 
void set (const ROOT::Math::XYZPoint &position, const ROOT::Math::XYZVector &momentum, double charge, double Bz)
 Sets the helix. More...
 
void setTransformation (const ROOT::Math::Transform3D &transform)
 Sets transformation from the frame in which helix is constructed (nominal frame) to module local frame. More...
 
void moveReferencePosition (double length)
 Moves reference position along helix by length. More...
 
ROOT::Math::XYZPoint getPosition (double length) const
 Returns particle position at given length. More...
 
ROOT::Math::XYZVector getDirection (double length) const
 Returns particle direction at given length. More...
 
double getDistanceToPlane (const ROOT::Math::XYZPoint &point, const ROOT::Math::XYZVector &normal) const
 Returns the distance along helix to the nearest intersection with the plane nearly parallel to z axis. More...
 

Private Member Functions

double shortestDistance (double cosAlpha, double phi) const
 Returns shortest distance. More...
 
double withinSingleTurn (double t) const
 Returns helix length within a single turn. More...
 

Private Attributes

double m_R = 0
 helix radius
 
double m_xc = 0
 helix axis position in x
 
double m_yc = 0
 helix axis position in y
 
double m_omega = 0
 angular speed [1/cm]
 
double m_kz = 0
 slope in z
 
double m_phi0 = 0
 phi of reference position
 
double m_z0 = 0
 z of reference position
 
double m_T0 = 0
 helix length of single turn
 
double & x0 = m_xc
 x of reference position for zero magnetic field
 
double & y0 = m_yc
 y of reference position for zero magnetic field
 
double & z0 = m_z0
 z of reference position for zero magnetic field
 
double & kx = m_R
 direction in x for zero magnetic field
 
double & ky = m_phi0
 direction in y for zero magnetic field
 
double & kz = m_kz
 direction in z for zero magnetic field
 
ROOT::Math::Transform3D m_transformInv
 transformation from nominal to local frame
 

Detailed Description

Utility for propagation of a particle along helix.

Helix representation here differs from the official one. Running parameter is the signed distance along helix measured from the reference position. Negative distance means propagating back in time.

Definition at line 30 of file HelixSwimmer.h.

Member Function Documentation

◆ getDirection()

XYZVector getDirection ( double  length) const

Returns particle direction at given length.

Parameters
lengthdistance along helix measured from the reference position
Returns
direction (in module local frame if transformation is set)

Definition at line 75 of file HelixSwimmer.cc.

76  {
77  if (m_omega != 0) {
78  double phi = m_phi0 + m_omega * length;
79  double k_T = m_omega * m_R;
80  XYZVector vec(-k_T * sin(phi), k_T * cos(phi), m_kz);
81  return m_transformInv * vec;
82  } else {
83  XYZVector vec(kx, ky, kz);
84  return m_transformInv * vec;
85  }
86  }
double m_phi0
phi of reference position
Definition: HelixSwimmer.h:105
double & kx
direction in x for zero magnetic field
Definition: HelixSwimmer.h:112
ROOT::Math::Transform3D m_transformInv
transformation from nominal to local frame
Definition: HelixSwimmer.h:116
double & ky
direction in y for zero magnetic field
Definition: HelixSwimmer.h:113
double & kz
direction in z for zero magnetic field
Definition: HelixSwimmer.h:114
double m_R
helix radius
Definition: HelixSwimmer.h:100
double m_omega
angular speed [1/cm]
Definition: HelixSwimmer.h:103
double m_kz
slope in z
Definition: HelixSwimmer.h:104

◆ getDistanceToPlane()

double getDistanceToPlane ( const ROOT::Math::XYZPoint &  point,
const ROOT::Math::XYZVector &  normal 
) const

Returns the distance along helix to the nearest intersection with the plane nearly parallel to z axis.

Parameters
pointpoint on the plane
normalplane normal
Returns
signed distance (NaN if cross-section doesn't exist)

Definition at line 88 of file HelixSwimmer.cc.

◆ getPosition()

XYZPoint getPosition ( double  length) const

Returns particle position at given length.

Parameters
lengthdistance along helix measured from the reference position
Returns
position (in module local frame if transformation is set)

Definition at line 63 of file HelixSwimmer.cc.

◆ moveReferencePosition()

void moveReferencePosition ( double  length)

Moves reference position along helix by length.

Parameters
lengthdistance along helix measured from current reference position

Definition at line 51 of file HelixSwimmer.cc.

◆ set()

void set ( const ROOT::Math::XYZPoint &  position,
const ROOT::Math::XYZVector &  momentum,
double  charge,
double  Bz 
)

Sets the helix.

Parameters
positionparticle position (= default reference position)
momentumparticle momentum
chargeparticle charge in units of elementary charge
Bzmagnetic field z-component (we assume other two are negligible)

Definition at line 26 of file HelixSwimmer.cc.

◆ setTransformation()

void setTransformation ( const ROOT::Math::Transform3D &  transform)
inline

Sets transformation from the frame in which helix is constructed (nominal frame) to module local frame.

Parameters
transformtransformation from local to nominal frame

Definition at line 53 of file HelixSwimmer.h.

53 {m_transformInv = transform.Inverse();}

◆ shortestDistance()

double shortestDistance ( double  cosAlpha,
double  phi 
) const
inlineprivate

Returns shortest distance.

Parameters
cosAlphacosine of alpha
phiphi of plane
Returns
signed shortest distance

Definition at line 121 of file HelixSwimmer.h.

◆ withinSingleTurn()

double withinSingleTurn ( double  t) const
inlineprivate

Returns helix length within a single turn.

Parameters
thelix length
Returns
helix length within single turn

Definition at line 132 of file HelixSwimmer.h.


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