\section{D\-D\-Space\-Point\-Builder Class Reference}
\label{classDDSpacePointBuilder}\index{D\-D\-Space\-Point\-Builder@{D\-D\-Space\-Point\-Builder}}


================= F\-T\-D Space Point Builder =================  




{\ttfamily \#include $<$D\-D\-Space\-Point\-Builder.\-h$>$}

Inheritance diagram for D\-D\-Space\-Point\-Builder\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classDDSpacePointBuilder}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual Processor $\ast$ {\bfseries new\-Processor} ()\label{classDDSpacePointBuilder_a3514cb565938c00c71c45b939b85f851}

\item 
virtual void {\bf init} ()
\begin{DoxyCompactList}\small\item\em Called at the begin of the job before anything is read. \end{DoxyCompactList}\item 
virtual void {\bf process\-Run\-Header} (L\-C\-Run\-Header $\ast$run)\label{classDDSpacePointBuilder_a8743a97b538b0cd03cf2510d2f0970ca}

\begin{DoxyCompactList}\small\item\em Called for every run. \end{DoxyCompactList}\item 
virtual void {\bf process\-Event} (L\-C\-Event $\ast$evt)\label{classDDSpacePointBuilder_aae541c5da393f05ecf9f2213684a12a7}

\begin{DoxyCompactList}\small\item\em Called for every event -\/ the working horse. \end{DoxyCompactList}\item 
virtual void {\bfseries check} (L\-C\-Event $\ast$evt)\label{classDDSpacePointBuilder_a956876d67d15ae9336f74e22867446bd}

\item 
virtual void {\bf end} ()\label{classDDSpacePointBuilder_ad998fb7cac9cd47f4a3a125230654dcb}

\begin{DoxyCompactList}\small\item\em Called after data processing for clean up. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
Tracker\-Hit\-Impl $\ast$ {\bf create\-Space\-Point} (Tracker\-Hit\-Plane $\ast$a, Tracker\-Hit\-Plane $\ast$b, double strip\-Length)
\item 
std\-::vector$<$ int $>$ {\bf get\-Cell\-I\-D0s\-At\-Back} (int cell\-I\-D0)
\item 
std\-::vector$<$ int $>$ {\bfseries get\-Cell\-I\-D0s\-At\-Back\-Of\-F\-T\-D} (int cell\-I\-D0)\label{classDDSpacePointBuilder_aa1858693969cfb4ce56e9d46d063b39b}

\item 
std\-::vector$<$ int $>$ {\bfseries get\-Cell\-I\-D0s\-At\-Back\-Of\-S\-E\-T} (int cell\-I\-D0)\label{classDDSpacePointBuilder_ae6a906652dd6e4ec78d7a1af5274765e}

\item 
std\-::vector$<$ int $>$ {\bfseries get\-Cell\-I\-D0s\-At\-Back\-Of\-S\-I\-T} (int cell\-I\-D0)\label{classDDSpacePointBuilder_a241c2c0e466fce7ff420e5748af463fe}

\item 
std\-::string {\bf get\-Cell\-I\-D0\-Info} (int cell\-I\-D0)
\end{DoxyCompactItemize}
\subsection*{Static Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
static int {\bf calculate\-Xing\-Point} (double x1, double y1, float ex1, float ey1, double x2, double y2, float ex2, float ey2, double \&x, double \&y)
\begin{DoxyCompactList}\small\item\em Calculates the 2 dimensional crossing point of two lines. \end{DoxyCompactList}\item 
static int {\bf calculate\-Point\-Between\-Two\-Lines} (const C\-L\-H\-E\-P\-::\-Hep3\-Vector \&P1, const C\-L\-H\-E\-P\-::\-Hep3\-Vector \&V1, const C\-L\-H\-E\-P\-::\-Hep3\-Vector \&P2, const C\-L\-H\-E\-P\-::\-Hep3\-Vector \&V2, C\-L\-H\-E\-P\-::\-Hep3\-Vector \&point)
\begin{DoxyCompactList}\small\item\em Calculates a point between two lines in a way that it is equidistant from both lines and as close to them as possible. \end{DoxyCompactList}\item 
static int {\bf calculate\-Point\-Between\-Two\-Lines\-\_\-\-Using\-Vertex} (const C\-L\-H\-E\-P\-::\-Hep3\-Vector \&P\-A, const C\-L\-H\-E\-P\-::\-Hep3\-Vector \&P\-B, const C\-L\-H\-E\-P\-::\-Hep3\-Vector \&P\-C, const C\-L\-H\-E\-P\-::\-Hep3\-Vector \&P\-D, const C\-L\-H\-E\-P\-::\-Hep3\-Vector \&Vertex, C\-L\-H\-E\-P\-::\-Hep3\-Vector \&point)
\begin{DoxyCompactList}\small\item\em Calculates the intersection of a line L and line P\-A\-P\-B ( strip on the first sensor ). \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
std\-::string {\bf \-\_\-\-Tracker\-Hit\-Collection}\label{classDDSpacePointBuilder_a7eea2d74a53b27cdc74aae989d1963d7}

\begin{DoxyCompactList}\small\item\em Input collection name. \end{DoxyCompactList}\item 
std\-::string {\bf \-\_\-\-Tracker\-Hit\-Sim\-Hit\-Rel\-Collection}\label{classDDSpacePointBuilder_aa9fbb426764c8244eee730a2faaf1728}

\begin{DoxyCompactList}\small\item\em Input relation collection name. \end{DoxyCompactList}\item 
std\-::string {\bf \-\_\-\-Space\-Points\-Collection}\label{classDDSpacePointBuilder_ad8ba4b63ecfbc91238405d7a2420c852}

\begin{DoxyCompactList}\small\item\em Output collection name. \end{DoxyCompactList}\item 
std\-::string {\bf \-\_\-rel\-Col\-Name}\label{classDDSpacePointBuilder_a909187a9a551634c2b1fee8abf95d4d6}

\begin{DoxyCompactList}\small\item\em Output relations collection name. \end{DoxyCompactList}\item 
int {\bfseries \-\_\-n\-Run}\label{classDDSpacePointBuilder_a83475a8406ceb49f9fd43eaaa5b74fc0}

\item 
int {\bfseries \-\_\-n\-Evt}\label{classDDSpacePointBuilder_a44838f472ca318bf7d9d4893b8fa463b}

\item 
unsigned {\bfseries \-\_\-n\-Out\-Of\-Boundary}\label{classDDSpacePointBuilder_a94c3b7074e76b9b2e43b675756016f67}

\item 
unsigned {\bfseries \-\_\-n\-Strips\-Too\-Parallel}\label{classDDSpacePointBuilder_a58123ef07fc4508e20b73f533d458bd5}

\item 
unsigned {\bfseries \-\_\-n\-Planes\-Not\-Parallel}\label{classDDSpacePointBuilder_a0d7d9bf5f121c474da57c24a9ba20bec}

\item 
float {\bfseries \-\_\-nominal\-\_\-vertex\-\_\-x}\label{classDDSpacePointBuilder_ad28c24d8c95b843c422ecd8360166b4e}

\item 
float {\bfseries \-\_\-nominal\-\_\-vertex\-\_\-y}\label{classDDSpacePointBuilder_a7c83db9e2a4221420842928c72a55ce2}

\item 
float {\bfseries \-\_\-nominal\-\_\-vertex\-\_\-z}\label{classDDSpacePointBuilder_a85b5abcfa9eac69a74c5e992669eacf5}

\item 
C\-L\-H\-E\-P\-::\-Hep3\-Vector {\bfseries \-\_\-nominal\-\_\-vertex}\label{classDDSpacePointBuilder_a761cb9e2e59e5ea9807fc734afb6bcaf}

\item 
float {\bfseries \-\_\-striplength\-\_\-tolerance}\label{classDDSpacePointBuilder_a2f7eb24c6c767eb4243ff03c6099ba56}

\item 
double {\bfseries \-\_\-striplength}\label{classDDSpacePointBuilder_aefa062255ed3d47d1660780ac4cb3453}

\item 
std\-::string {\bfseries \-\_\-sub\-Det\-Name}\label{classDDSpacePointBuilder_a9e2cba7753402b91d71c89a920050a33}

\item 
const D\-D4hep\-::\-D\-D\-Rec\-::\-Surface\-Map $\ast$ {\bfseries surf\-Map}\label{classDDSpacePointBuilder_a1cd2c8fee630e2ce8eb93221b6014ce8}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
================= F\-T\-D Space Point Builder ================= 

Builds space points for pairs of silicon strip detectors. The digitisers create Tracker\-Hit\-Planars for the front and the back strips. In order to get a spacepoint (as is needed by track reconstruction) those strip measurements need to be combined into one space point.

This is done by this processor.

\subparagraph*{Input -\/ Prerequisites}

The Tracker\-Hit\-Planars as created by the Digitisers of F\-T\-D, S\-E\-T or S\-I\-T. This could of course be used for other detectors as well, but as information about the detector is acquired from gear, and as different detectors (at the moment) are stored differently in gear, used detectors have to be taken care of in the code.

\subparagraph*{Output}

A collection of Tracker\-Hits containing the constructed space points. The created hits will store the original strip hits in their raw\-Hits.


\begin{DoxyParams}{Parameters}
{\em Tracker\-Hit\-Collection} & The name of the input collection of Tracker\-Hits coming from strip detectors on the F\-T\-D, S\-I\-T or S\-E\-T \par
 (default name F\-T\-D\-Tracker\-Hits) \par
\\
\hline
{\em Space\-Points\-Collection} & The name of the output collection of the created spacepoints \par
 (default name F\-T\-D\-Space\-Points) \par
\\
\hline
{\em Tracker\-Hit\-Sim\-Hit\-Rel\-Collection} & The name of the input collection of the relations of the Tracker\-Hits to Sim\-Hits\par
 (default name F\-T\-D\-Tracker\-Hit\-Relations)\par
\\
\hline
{\em Sim\-Hit\-Space\-Point\-Rel\-Collection} & The name of the Space\-Point Sim\-Tracker\-Hit relation output collection \par
 (default name V\-T\-X\-Tracker\-Hit\-Relations) \par
\\
\hline
\end{DoxyParams}
\begin{DoxyAuthor}{Author}
Robin Glattauer H\-E\-P\-H\-Y, Vienna 
\end{DoxyAuthor}


\subsection{Member Function Documentation}
\index{D\-D\-Space\-Point\-Builder@{D\-D\-Space\-Point\-Builder}!calculate\-Point\-Between\-Two\-Lines@{calculate\-Point\-Between\-Two\-Lines}}
\index{calculate\-Point\-Between\-Two\-Lines@{calculate\-Point\-Between\-Two\-Lines}!DDSpacePointBuilder@{D\-D\-Space\-Point\-Builder}}
\subsubsection[{calculate\-Point\-Between\-Two\-Lines}]{\setlength{\rightskip}{0pt plus 5cm}int D\-D\-Space\-Point\-Builder\-::calculate\-Point\-Between\-Two\-Lines (
\begin{DoxyParamCaption}
\item[{const C\-L\-H\-E\-P\-::\-Hep3\-Vector \&}]{P1, }
\item[{const C\-L\-H\-E\-P\-::\-Hep3\-Vector \&}]{V1, }
\item[{const C\-L\-H\-E\-P\-::\-Hep3\-Vector \&}]{P2, }
\item[{const C\-L\-H\-E\-P\-::\-Hep3\-Vector \&}]{V2, }
\item[{C\-L\-H\-E\-P\-::\-Hep3\-Vector \&}]{point}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}, {\ttfamily [protected]}}\label{classDDSpacePointBuilder_a23b329f3cc260afdc606af43c33925ad}


Calculates a point between two lines in a way that it is equidistant from both lines and as close to them as possible. 

So when you calculate the distance between two lines, and you actually draw this distance as a short connecting line, the point in the middle of this line, is what this method finds. \begin{DoxyVerb}             /
            /
           /|___here!!!
          / |
---------/-------------- (line a)
        /
       /(line b)\end{DoxyVerb}
 (If this sketch looks terrible, you probably read this in doxygen and it still needs to be formatted in a way, that it still looks sensible in doxygen.)


\begin{DoxyParams}{Parameters}
{\em P1} & a point on the first line \\
\hline
{\em V1} & the direction vector of the first line\\
\hline
{\em point} & the reference to a point where the result will be stored \\
\hline
\end{DoxyParams}


References calculate\-Xing\-Point().

\index{D\-D\-Space\-Point\-Builder@{D\-D\-Space\-Point\-Builder}!calculate\-Point\-Between\-Two\-Lines\-\_\-\-Using\-Vertex@{calculate\-Point\-Between\-Two\-Lines\-\_\-\-Using\-Vertex}}
\index{calculate\-Point\-Between\-Two\-Lines\-\_\-\-Using\-Vertex@{calculate\-Point\-Between\-Two\-Lines\-\_\-\-Using\-Vertex}!DDSpacePointBuilder@{D\-D\-Space\-Point\-Builder}}
\subsubsection[{calculate\-Point\-Between\-Two\-Lines\-\_\-\-Using\-Vertex}]{\setlength{\rightskip}{0pt plus 5cm}int D\-D\-Space\-Point\-Builder\-::calculate\-Point\-Between\-Two\-Lines\-\_\-\-Using\-Vertex (
\begin{DoxyParamCaption}
\item[{const C\-L\-H\-E\-P\-::\-Hep3\-Vector \&}]{P\-A, }
\item[{const C\-L\-H\-E\-P\-::\-Hep3\-Vector \&}]{P\-B, }
\item[{const C\-L\-H\-E\-P\-::\-Hep3\-Vector \&}]{P\-C, }
\item[{const C\-L\-H\-E\-P\-::\-Hep3\-Vector \&}]{P\-D, }
\item[{const C\-L\-H\-E\-P\-::\-Hep3\-Vector \&}]{Vertex, }
\item[{C\-L\-H\-E\-P\-::\-Hep3\-Vector \&}]{point}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}, {\ttfamily [protected]}}\label{classDDSpacePointBuilder_a09d122c220825ab536c618f0f9b39fb0}


Calculates the intersection of a line L and line P\-A\-P\-B ( strip on the first sensor ). 

L is constrained to pass through the point \char`\"{}\-Vertex\char`\"{} and bisect both lines P\-A\-P\-B ( strip on the first sensor ) and P\-C\-P\-D ( strip on the second sensor ) 
\begin{DoxyParams}{Parameters}
{\em P\-A} & start of the first line \\
\hline
{\em P\-B} & end of the first line \\
\hline
{\em P\-C} & start of the second line \\
\hline
{\em P\-D} & end of the second line \\
\hline
{\em Vertex} & the position\\
\hline
{\em point} & the reference to a point where the result will be stored \\
\hline
\end{DoxyParams}


Referenced by create\-Space\-Point().

\index{D\-D\-Space\-Point\-Builder@{D\-D\-Space\-Point\-Builder}!calculate\-Xing\-Point@{calculate\-Xing\-Point}}
\index{calculate\-Xing\-Point@{calculate\-Xing\-Point}!DDSpacePointBuilder@{D\-D\-Space\-Point\-Builder}}
\subsubsection[{calculate\-Xing\-Point}]{\setlength{\rightskip}{0pt plus 5cm}int D\-D\-Space\-Point\-Builder\-::calculate\-Xing\-Point (
\begin{DoxyParamCaption}
\item[{double}]{x1, }
\item[{double}]{y1, }
\item[{float}]{ex1, }
\item[{float}]{ey1, }
\item[{double}]{x2, }
\item[{double}]{y2, }
\item[{float}]{ex2, }
\item[{float}]{ey2, }
\item[{double \&}]{x, }
\item[{double \&}]{y}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}, {\ttfamily [protected]}}\label{classDDSpacePointBuilder_ac1db9ef31d900ae585d24ebd16be06da}


Calculates the 2 dimensional crossing point of two lines. 

Each line is specified by a point (x,y) and a direction vector (ex,ey).

\begin{DoxyReturn}{Returns}
0, if the calculation has been successful, another number if there was a problem. 
\end{DoxyReturn}


Referenced by calculate\-Point\-Between\-Two\-Lines().

\index{D\-D\-Space\-Point\-Builder@{D\-D\-Space\-Point\-Builder}!create\-Space\-Point@{create\-Space\-Point}}
\index{create\-Space\-Point@{create\-Space\-Point}!DDSpacePointBuilder@{D\-D\-Space\-Point\-Builder}}
\subsubsection[{create\-Space\-Point}]{\setlength{\rightskip}{0pt plus 5cm}Tracker\-Hit\-Impl $\ast$ D\-D\-Space\-Point\-Builder\-::create\-Space\-Point (
\begin{DoxyParamCaption}
\item[{Tracker\-Hit\-Plane $\ast$}]{a, }
\item[{Tracker\-Hit\-Plane $\ast$}]{b, }
\item[{double}]{strip\-Length}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [protected]}}\label{classDDSpacePointBuilder_ad37abf1a6357af169fda581c8d30db9d}
\begin{DoxyReturn}{Returns}
a spacepoint (in the form of a Tracker\-Hit\-Impl$\ast$ ) created from two Tracker\-Hit\-Plane$\ast$ which stand for si-\/strips 
\end{DoxyReturn}


References calculate\-Point\-Between\-Two\-Lines\-\_\-\-Using\-Vertex().



Referenced by process\-Event().

\index{D\-D\-Space\-Point\-Builder@{D\-D\-Space\-Point\-Builder}!get\-Cell\-I\-D0\-Info@{get\-Cell\-I\-D0\-Info}}
\index{get\-Cell\-I\-D0\-Info@{get\-Cell\-I\-D0\-Info}!DDSpacePointBuilder@{D\-D\-Space\-Point\-Builder}}
\subsubsection[{get\-Cell\-I\-D0\-Info}]{\setlength{\rightskip}{0pt plus 5cm}std\-::string D\-D\-Space\-Point\-Builder\-::get\-Cell\-I\-D0\-Info (
\begin{DoxyParamCaption}
\item[{int}]{cell\-I\-D0}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [protected]}}\label{classDDSpacePointBuilder_a7ebbda198c75b7a18090930d0671e66e}
\begin{DoxyReturn}{Returns}
information about the contents of the passed Cell\-I\-D0 
\end{DoxyReturn}


Referenced by process\-Event().

\index{D\-D\-Space\-Point\-Builder@{D\-D\-Space\-Point\-Builder}!get\-Cell\-I\-D0s\-At\-Back@{get\-Cell\-I\-D0s\-At\-Back}}
\index{get\-Cell\-I\-D0s\-At\-Back@{get\-Cell\-I\-D0s\-At\-Back}!DDSpacePointBuilder@{D\-D\-Space\-Point\-Builder}}
\subsubsection[{get\-Cell\-I\-D0s\-At\-Back}]{\setlength{\rightskip}{0pt plus 5cm}std\-::vector$<$ int $>$ D\-D\-Space\-Point\-Builder\-::get\-Cell\-I\-D0s\-At\-Back (
\begin{DoxyParamCaption}
\item[{int}]{cell\-I\-D0}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [protected]}}\label{classDDSpacePointBuilder_aed0571011a3d8cdb4615c85197b85f57}
\begin{DoxyReturn}{Returns}
the Cell\-I\-D0s of the sensors that are back to back to a given front sensor. If the given sensor is in the back itself or has no corresponding sensor(s) on the back the vector will be empty.
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em cell\-I\-D0} & a Cell\-I\-D0 corresponding to a sensor \\
\hline
\end{DoxyParams}


Referenced by process\-Event().

\index{D\-D\-Space\-Point\-Builder@{D\-D\-Space\-Point\-Builder}!init@{init}}
\index{init@{init}!DDSpacePointBuilder@{D\-D\-Space\-Point\-Builder}}
\subsubsection[{init}]{\setlength{\rightskip}{0pt plus 5cm}void D\-D\-Space\-Point\-Builder\-::init (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classDDSpacePointBuilder_a595cc3c64562e3abd0323fb4e263d62e}


Called at the begin of the job before anything is read. 

Use to initialize the processor, e.\-g. book histograms. 

The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
D\-D\-Space\-Point\-Builder.\-h\item 
D\-D\-Space\-Point\-Builder.\-cc\end{DoxyCompactItemize}
