MarlinTPC  1.2.0
Classes | Static Public Member Functions | List of all members
marlintpc::IntersectionCalculator Class Reference

A helper class to calculate the intersections of. More...

#include <IntersectionCalculator.h>

Classes

class  NoIntersectionException
 A nested exception which is thrown in case there is no intersection. More...
 

Static Public Member Functions

static std::pair< double, double > circle_circle (double R, double centreX, double centreY, double r)
 Calculate the intersection of a circular pad row with a track circle. More...
 
static std::pair< std::pair
< double, double >, std::pair
< double, double > > 
circle_straightLine_xy (double R, double inclination, double xAxisIntersect)
 Calculate the intersection of a circular pad row with a straight track parameterised in the direction parallel to the y axis (x = inclination*y + xAxisIntersect). More...
 
static std::pair< double, double > circle_straightLine (double R, double x0, double y0, double trackPhi)
 Calculate the intersection of a circular pad row with a straight track. More...
 
static std::pair< double, double > circle_straightLine_phi (double R, double inclination, double xAxisIntersect)
 Only kept for backwards compatibility. More...
 
static std::pair< double, double > horizonalLine_circle (double Y, double centreX, double centreY, double r)
 Calculate the intersection of a straight line (pad row) with a circle. More...
 
static double horizontalLine_straightLine (double Y, double inclination, double xAxisIntersect)
 Calculate the intersection of a straight line (pad row) with a straight track parameterised in the direction perpendicular to the pad rows (x = inclination*y + xAxisIntersect). More...
 

Detailed Description

A helper class to calculate the intersections of.

The idea is to calculate the intersection of a pad row with a track (straight or helix). The first part of the function name is the type of pad row (circle or horizontal line), the second part the type of track (circle or straight line). The pad plane is descibed by one local coordinate (radius R for circle and Y for rectangular pad rows, which is a horizontal line). The pad rows are concentric around the origin of the local pad coordinate system, so no further parameter is needed. The track circle is described by centre (x,y) and a radius.

Attention
The straight line is described by the inclination with respect to the y axis:
$ x = y\cdot inclination + xAxisIntersect$
This is done so tracks exactly perpendicular to the pad row can be described. Also for small inclinations with respect to the y axsis this is numerically more stable than $ y=mx+b$. For the large prototype the tracks are usually along the x axis so the parametrisation is done the other way. The decision which parametrisation is taken is done in circle_straightLine(double R, double x0, double y0, double trackPhi) based on the track angle.

In case there is no intersection, an IntersectionCalculator::NoIntersectionException is thrown.

Member Function Documentation

std::pair< double, double > marlintpc::IntersectionCalculator::circle_circle ( double  R,
double  centreX,
double  centreY,
double  r 
)
static

Calculate the intersection of a circular pad row with a track circle.

Parameters
RThe radius of the pad row.
centreXThe x coordinate of the tracks helix centre.
centreYThe y coordinate of the tracks helix centre.
rThe radius of the track helix.

Return value:

  • The two intersections, descibed by the two phi values on the pad row. As the local coordinates are polar, (R, phi1) and (R, phi2) are the intersection points in in local pad coordinates. The first argument of the pair is alwas the numerically smaller value.

Referenced by marlintpc::ModuleDistortionCalculator::calculateDistanceRow(), marlintpc::TrackFitterSimpleChiSquarePads::calculateResiduals(), and marlintpc::GeometricMeanResidualsTupleProcessor::processEvent().

std::pair< double, double > marlintpc::IntersectionCalculator::circle_straightLine ( double  R,
double  x0,
double  y0,
double  trackPhi 
)
static

Calculate the intersection of a circular pad row with a straight track.

Depending on the angle of the track either circle_straightLine_inx_phi or circle_straightLine_iny_phi is called.

Parameters
RThe radius of the pad row.
x0,y0A point on the track in local padplane coordinates
phiThe angle of the track in local padplane coordinates

Return value:

  • The two intersections, descibed by the two phi values on the pad row. The first argument of the pair is alwas the numerically smaller value.

Referenced by marlintpc::ModuleDistortionCalculator::calculateDistanceRow(), and marlintpc::GeometricMeanResidualsTupleProcessor::processEvent().

std::pair< double, double > marlintpc::IntersectionCalculator::circle_straightLine_phi ( double  R,
double  inclination,
double  xAxisIntersect 
)
static

Only kept for backwards compatibility.

Use circle_straightLine instead! This function is now called circle_straightLine_inx_phi as a private member function accessable through circle_straightLine.

Referenced by marlintpc::TrackFitterSimpleChiSquarePads::calculateResiduals().

std::pair< std::pair< double, double >, std::pair< double, double > > marlintpc::IntersectionCalculator::circle_straightLine_xy ( double  R,
double  inclination,
double  xAxisIntersect 
)
static

Calculate the intersection of a circular pad row with a straight track parameterised in the direction parallel to the y axis (x = inclination*y + xAxisIntersect).

Parameters
RThe radius of the pad row.
inclinationInclination of the track with respect to the y-axis
xAxisIntersectIntersection point of the track with the x-axis

Return value:

  • The two intersections, each as an (x,y) pair (=local coorinates, converted to cartesian, (r*cos(phi), r*sin(phi)) ) The first value has the smaller y coordinate.
std::pair< double, double > marlintpc::IntersectionCalculator::horizonalLine_circle ( double  Y,
double  centreX,
double  centreY,
double  r 
)
static

Calculate the intersection of a straight line (pad row) with a circle.

Parameters
YThe y coordinate the pad row.
centreXThe x coordinate of the tracks helix centre.
centreYThe y coordinate of the tracks helix centre.
rThe radius of the track helix.

Return value:

  • The two x coordinates where the circle intersects with the horizontal line

Referenced by marlintpc::ModuleDistortionCalculator::calculateDistanceRow(), and marlintpc::TrackFitterSimpleChiSquarePads::calculateResiduals().

double marlintpc::IntersectionCalculator::horizontalLine_straightLine ( double  Y,
double  inclination,
double  xAxisIntersect 
)
static

Calculate the intersection of a straight line (pad row) with a straight track parameterised in the direction perpendicular to the pad rows (x = inclination*y + xAxisIntersect).

Parameters
YThe y coordinate the pad row.
inclinationInclination of the track with respect to the y-axis
xAxisIntersectIntersection point of the track with the x-axis

Return value:

  • The x coordinate of the intersection.

Referenced by marlintpc::ModuleDistortionCalculator::calculateDistanceRow().


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