\section{marlintpc\-:\-:Intersection\-Calculator Class Reference}
\label{classmarlintpc_1_1IntersectionCalculator}\index{marlintpc\-::\-Intersection\-Calculator@{marlintpc\-::\-Intersection\-Calculator}}


A helper class to calculate the intersections of.  




{\ttfamily \#include $<$Intersection\-Calculator.\-h$>$}

\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class {\bf No\-Intersection\-Exception}
\begin{DoxyCompactList}\small\item\em A nested exception which is thrown in case there is no intersection. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static std\-::pair$<$ double, double $>$ {\bf circle\-\_\-circle} (double R, double centre\-X, double centre\-Y, double r)
\begin{DoxyCompactList}\small\item\em Calculate the intersection of a circular pad row with a track circle. \end{DoxyCompactList}\item 
static std\-::pair$<$ std\-::pair\\*
$<$ double, double $>$, std\-::pair\\*
$<$ double, double $>$ $>$ {\bf circle\-\_\-straight\-Line\-\_\-xy} (double R, double inclination, double x\-Axis\-Intersect)
\begin{DoxyCompactList}\small\item\em Calculate the intersection of a circular pad row with a straight track parameterised in the direction parallel to the y axis (x = inclination$\ast$y + x\-Axis\-Intersect). \end{DoxyCompactList}\item 
static std\-::pair$<$ double, double $>$ {\bf circle\-\_\-straight\-Line} (double R, double x0, double y0, double track\-Phi)
\begin{DoxyCompactList}\small\item\em Calculate the intersection of a circular pad row with a straight track. \end{DoxyCompactList}\item 
static std\-::pair$<$ double, double $>$ {\bf circle\-\_\-straight\-Line\-\_\-phi} (double R, double inclination, double x\-Axis\-Intersect)
\begin{DoxyCompactList}\small\item\em Only kept for backwards compatibility. \end{DoxyCompactList}\item 
static std\-::pair$<$ double, double $>$ {\bf horizonal\-Line\-\_\-circle} (double Y, double centre\-X, double centre\-Y, double r)
\begin{DoxyCompactList}\small\item\em Calculate the intersection of a straight line (pad row) with a circle. \end{DoxyCompactList}\item 
static double {\bf horizontal\-Line\-\_\-straight\-Line} (double Y, double inclination, double x\-Axis\-Intersect)
\begin{DoxyCompactList}\small\item\em Calculate the intersection of a straight line (pad row) with a straight track parameterised in the direction perpendicular to the pad rows (x = inclination$\ast$y + x\-Axis\-Intersect). \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
A helper class to calculate the intersections of. 

\begin{DoxyItemize}
\item two circles \item a circle with a straigt line \item two straight lines\end{DoxyItemize}
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 {\ttfamily R} for circle and {\ttfamily 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.

\begin{DoxyAttention}{Attention}
The straight line is described by the inclination with respect to the y axis\-:\par
 $ x = y\cdot inclination + xAxisIntersect$\par
 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 \doxyref{circle\-\_\-straight\-Line(double R, double x0, double y0, double track\-Phi)}{p.}{classmarlintpc_1_1IntersectionCalculator_aa38c9c415a18aaf91a2568aabf99ba22} based on the track angle.
\end{DoxyAttention}
In case there is no intersection, an \doxyref{Intersection\-Calculator\-::\-No\-Intersection\-Exception}{p.}{classmarlintpc_1_1IntersectionCalculator_1_1NoIntersectionException} is thrown. 

\subsection{Member Function Documentation}
\index{marlintpc\-::\-Intersection\-Calculator@{marlintpc\-::\-Intersection\-Calculator}!circle\-\_\-circle@{circle\-\_\-circle}}
\index{circle\-\_\-circle@{circle\-\_\-circle}!marlintpc::IntersectionCalculator@{marlintpc\-::\-Intersection\-Calculator}}
\subsubsection[{circle\-\_\-circle}]{\setlength{\rightskip}{0pt plus 5cm}std\-::pair$<$ double, double $>$ marlintpc\-::\-Intersection\-Calculator\-::circle\-\_\-circle (
\begin{DoxyParamCaption}
\item[{double}]{R, }
\item[{double}]{centre\-X, }
\item[{double}]{centre\-Y, }
\item[{double}]{r}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}\label{classmarlintpc_1_1IntersectionCalculator_a3532803db801d7e52034d92890121c5e}


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


\begin{DoxyParams}{Parameters}
{\em R} & The radius of the pad row. \\
\hline
{\em centre\-X} & The x coordinate of the tracks helix centre. \\
\hline
{\em centre\-Y} & The y coordinate of the tracks helix centre. \\
\hline
{\em r} & The radius of the track helix.\\
\hline
\end{DoxyParams}
Return value\-: \begin{DoxyItemize}
\item 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. \end{DoxyItemize}


Referenced by marlintpc\-::\-Module\-Distortion\-Calculator\-::calculate\-Distance\-Row(), marlintpc\-::\-Track\-Fitter\-Simple\-Chi\-Square\-Pads\-::calculate\-Residuals(), and marlintpc\-::\-Geometric\-Mean\-Residuals\-Tuple\-Processor\-::process\-Event().

\index{marlintpc\-::\-Intersection\-Calculator@{marlintpc\-::\-Intersection\-Calculator}!circle\-\_\-straight\-Line@{circle\-\_\-straight\-Line}}
\index{circle\-\_\-straight\-Line@{circle\-\_\-straight\-Line}!marlintpc::IntersectionCalculator@{marlintpc\-::\-Intersection\-Calculator}}
\subsubsection[{circle\-\_\-straight\-Line}]{\setlength{\rightskip}{0pt plus 5cm}std\-::pair$<$ double, double $>$ marlintpc\-::\-Intersection\-Calculator\-::circle\-\_\-straight\-Line (
\begin{DoxyParamCaption}
\item[{double}]{R, }
\item[{double}]{x0, }
\item[{double}]{y0, }
\item[{double}]{track\-Phi}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}\label{classmarlintpc_1_1IntersectionCalculator_aa38c9c415a18aaf91a2568aabf99ba22}


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

Depending on the angle of the track either circle\-\_\-straight\-Line\-\_\-inx\-\_\-phi or circle\-\_\-straight\-Line\-\_\-iny\-\_\-phi is called.


\begin{DoxyParams}{Parameters}
{\em R} & The radius of the pad row. \\
\hline
{\em x0,y0} & A point on the track in local padplane coordinates \\
\hline
{\em phi} & The angle of the track in local padplane coordinates\\
\hline
\end{DoxyParams}
Return value\-: \begin{DoxyItemize}
\item 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. \end{DoxyItemize}


Referenced by marlintpc\-::\-Module\-Distortion\-Calculator\-::calculate\-Distance\-Row(), and marlintpc\-::\-Geometric\-Mean\-Residuals\-Tuple\-Processor\-::process\-Event().

\index{marlintpc\-::\-Intersection\-Calculator@{marlintpc\-::\-Intersection\-Calculator}!circle\-\_\-straight\-Line\-\_\-phi@{circle\-\_\-straight\-Line\-\_\-phi}}
\index{circle\-\_\-straight\-Line\-\_\-phi@{circle\-\_\-straight\-Line\-\_\-phi}!marlintpc::IntersectionCalculator@{marlintpc\-::\-Intersection\-Calculator}}
\subsubsection[{circle\-\_\-straight\-Line\-\_\-phi}]{\setlength{\rightskip}{0pt plus 5cm}std\-::pair$<$ double, double $>$ marlintpc\-::\-Intersection\-Calculator\-::circle\-\_\-straight\-Line\-\_\-phi (
\begin{DoxyParamCaption}
\item[{double}]{R, }
\item[{double}]{inclination, }
\item[{double}]{x\-Axis\-Intersect}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}\label{classmarlintpc_1_1IntersectionCalculator_a3a62f04b99688095acc9086eeee47253}


Only kept for backwards compatibility. 

Use circle\-\_\-straight\-Line instead! This function is now called circle\-\_\-straight\-Line\-\_\-inx\-\_\-phi as a private member function accessable through circle\-\_\-straight\-Line. 

Referenced by marlintpc\-::\-Track\-Fitter\-Simple\-Chi\-Square\-Pads\-::calculate\-Residuals().

\index{marlintpc\-::\-Intersection\-Calculator@{marlintpc\-::\-Intersection\-Calculator}!circle\-\_\-straight\-Line\-\_\-xy@{circle\-\_\-straight\-Line\-\_\-xy}}
\index{circle\-\_\-straight\-Line\-\_\-xy@{circle\-\_\-straight\-Line\-\_\-xy}!marlintpc::IntersectionCalculator@{marlintpc\-::\-Intersection\-Calculator}}
\subsubsection[{circle\-\_\-straight\-Line\-\_\-xy}]{\setlength{\rightskip}{0pt plus 5cm}std\-::pair$<$ std\-::pair$<$ double, double $>$, std\-::pair$<$ double, double $>$ $>$ marlintpc\-::\-Intersection\-Calculator\-::circle\-\_\-straight\-Line\-\_\-xy (
\begin{DoxyParamCaption}
\item[{double}]{R, }
\item[{double}]{inclination, }
\item[{double}]{x\-Axis\-Intersect}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}\label{classmarlintpc_1_1IntersectionCalculator_a2f822018dbedb559f784b66de9cc83b0}


Calculate the intersection of a circular pad row with a straight track parameterised in the direction parallel to the y axis (x = inclination$\ast$y + x\-Axis\-Intersect). 


\begin{DoxyParams}{Parameters}
{\em R} & The radius of the pad row. \\
\hline
{\em inclination} & Inclination of the track with respect to the y-\/axis \\
\hline
{\em x\-Axis\-Intersect} & Intersection point of the track with the x-\/axis\\
\hline
\end{DoxyParams}
Return value\-: \begin{DoxyItemize}
\item The two intersections, each as an (x,y) pair (=local coorinates, converted to cartesian, (r$\ast$cos(phi), r$\ast$sin(phi)) ) The first value has the smaller y coordinate. \end{DoxyItemize}
\index{marlintpc\-::\-Intersection\-Calculator@{marlintpc\-::\-Intersection\-Calculator}!horizonal\-Line\-\_\-circle@{horizonal\-Line\-\_\-circle}}
\index{horizonal\-Line\-\_\-circle@{horizonal\-Line\-\_\-circle}!marlintpc::IntersectionCalculator@{marlintpc\-::\-Intersection\-Calculator}}
\subsubsection[{horizonal\-Line\-\_\-circle}]{\setlength{\rightskip}{0pt plus 5cm}std\-::pair$<$ double, double $>$ marlintpc\-::\-Intersection\-Calculator\-::horizonal\-Line\-\_\-circle (
\begin{DoxyParamCaption}
\item[{double}]{Y, }
\item[{double}]{centre\-X, }
\item[{double}]{centre\-Y, }
\item[{double}]{r}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}\label{classmarlintpc_1_1IntersectionCalculator_a2bdca919e8f1668508f6034f56d6da07}


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


\begin{DoxyParams}{Parameters}
{\em Y} & The y coordinate the pad row. \\
\hline
{\em centre\-X} & The x coordinate of the tracks helix centre. \\
\hline
{\em centre\-Y} & The y coordinate of the tracks helix centre. \\
\hline
{\em r} & The radius of the track helix.\\
\hline
\end{DoxyParams}
Return value\-: \begin{DoxyItemize}
\item The two x coordinates where the circle intersects with the horizontal line \end{DoxyItemize}


Referenced by marlintpc\-::\-Module\-Distortion\-Calculator\-::calculate\-Distance\-Row(), and marlintpc\-::\-Track\-Fitter\-Simple\-Chi\-Square\-Pads\-::calculate\-Residuals().

\index{marlintpc\-::\-Intersection\-Calculator@{marlintpc\-::\-Intersection\-Calculator}!horizontal\-Line\-\_\-straight\-Line@{horizontal\-Line\-\_\-straight\-Line}}
\index{horizontal\-Line\-\_\-straight\-Line@{horizontal\-Line\-\_\-straight\-Line}!marlintpc::IntersectionCalculator@{marlintpc\-::\-Intersection\-Calculator}}
\subsubsection[{horizontal\-Line\-\_\-straight\-Line}]{\setlength{\rightskip}{0pt plus 5cm}double marlintpc\-::\-Intersection\-Calculator\-::horizontal\-Line\-\_\-straight\-Line (
\begin{DoxyParamCaption}
\item[{double}]{Y, }
\item[{double}]{inclination, }
\item[{double}]{x\-Axis\-Intersect}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}\label{classmarlintpc_1_1IntersectionCalculator_a802b75f32cceeac6635f9550985083dc}


Calculate the intersection of a straight line (pad row) with a straight track parameterised in the direction perpendicular to the pad rows (x = inclination$\ast$y + x\-Axis\-Intersect). 


\begin{DoxyParams}{Parameters}
{\em Y} & The y coordinate the pad row. \\
\hline
{\em inclination} & Inclination of the track with respect to the y-\/axis \\
\hline
{\em x\-Axis\-Intersect} & Intersection point of the track with the x-\/axis\\
\hline
\end{DoxyParams}
Return value\-: \begin{DoxyItemize}
\item The x coordinate of the intersection. \end{DoxyItemize}


Referenced by marlintpc\-::\-Module\-Distortion\-Calculator\-::calculate\-Distance\-Row().



The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
Intersection\-Calculator.\-h\item 
Intersection\-Calculator.\-cc\end{DoxyCompactItemize}
