Description of this package's use of L\-C\-I\-O to store results of processors. \hypertarget{LCIO_Vertex}{}\subsection{Storage of Vertexing Result}\label{LCIO_Vertex}
The processors \hyperlink{classZVTOPZVKINProcessor}{Z\-V\-T\-O\-P\-Z\-V\-K\-I\-N\-Processor} and \hyperlink{classZVTOPZVRESProcessor}{Z\-V\-T\-O\-P\-Z\-V\-R\-E\-S\-Processor}

both store their results in the same way. They provide information on the decay vertices found, stored in a collection of L\-C\-I\-O Vertices and a collection of Reconstructed\-Particles, representing decaying particles that give rise to these vertices, as described in Frank Gaede’s \href{http://forum.linearcollider.org/index.php?t=tree&goto=548}{\tt Frank Gaede's forum post} \par
 In L\-C\-I\-O, Vertices and Reconstructed\-Particles, are connected as follows\-: 
\begin{DoxyItemize}
\item Each decay vertex found has a corresponding L\-C\-I\-O\-::\-Vertex. 
\item Each decay vertex found also has a corresponding L\-C\-I\-O\-Reconstructed\-Particle which respresents the decaying particle and holds kinematic information. 
\item This accompanying decaying Reconstructed\-Particle is accessed though Vertex\-::get\-Associated\-Particle() 
\item The descendant tracks which are produced by the particle are attached to the decaying Reconstructed\-Particle and accessed through Reconstructed\-Particle\-::get\-Particles() 
\item Each Reconstructed\-Particle points to its start and end vertex (if any) through Reconstructed\-Particle\-::get\-Start\-Vertex() and Reconstructed\-Particle\-::get\-End\-Vertex() 
\end{DoxyItemize}In essence we end up with three types of objects with links between them; Vertices, Decaying Reconstructed\-Particles, Stable Reconstructed\-Particles. \par
 Note that the information stored in the Reconstructed\-Particles created using Z\-V\-T\-O\-P information differs from the one of those created by the track reconstruction code. The get\-Start\-Vertex and get\-End\-Vertex methods permit building up a representation of a heavy flavour decay chain. In the current Z\-V\-T\-O\-P version, this is reconstructed as follows\-: vertices are sorted by increasing radius from the I\-P, the start vertex of the accompanying Reconstructed\-Particle is set to point to the previous vertex in the collection in this order. Note that this is only an approximation of the decay chain in an actual physics event, which may differ or be more complex (e.\-g. one decay vertex may give rise to two instable particles. If correctly reconstructed, their Reconstructed\-Particles would point to the same start vertex. Of the corresponding Z\-V\-T\-O\-P vertices, only the one closer to the I\-P will point to its correct start vertex, while the further one will point to the nearer one instead. \par
 As each R\-P points to its vertices, to store more than one vertexing result it is necessary to take a copy of the set of R\-Ps that are in each vertex. Each copy points to the original unique R\-P through Reconstructed\-Particle\-::get\-Particles()\mbox{[}0\mbox{]}. \par
 A master Reconstructed\-Particle object is created that points to all decaying and stable Reconstructed\-Particles in the decay chain though Reconstructed\-Particle\-::get\-Particles(). The Reconstructed\-Particle\-::get\-Start\-Vertex() is set to the first Vertex in the decay chain (usually the I\-P). This is the main object for accessing the decay chains as it allows one to iterate over all the Reconstructed\-Particles contained within. \par
 These objects are then stored in three collections\-: 
\begin{DoxyItemize}
\item Decay\-Chain\-R\-P\-Tracks\-Collection\-Name\-: default name\-: Z\-V$\ast$$\ast$$\ast$\-Decay\-Chain\-R\-P\-Tracks, stores decaying R\-Ps and copies of input R\-Ps for all decay chains.  
\item Vertex\-Collection\-: default name\-: Z\-V$\ast$$\ast$$\ast$\-Vertices, stores the Vertices for all decay chains.  
\item Decay\-Chain\-Collection\-Name\-: default name\-: Z\-V$\ast$$\ast$$\ast$\-Decay\-Chains, stores the master Reconstructed\-Particle Decay\-Chain\-Collection\-Name, in the same order as the Jets that were input to the algoithm in Jet\-R\-P\-Collection  
\end{DoxyItemize}\subparagraph*{Example}

If you wanted to print out the d0 of each L\-C\-I\-O\-::\-Track in each Vertex of a decay chain found for the second jet in the jet collection\-: 


\begin{DoxyCode}
\textcolor{comment}{//Get the decay chain master RP collection and get the second decay chain}
LCCollection* DecayChainRPCol = evt->getCollection( \_DecayChainRPColName );
ReconstructedParticle* DecayChainRP = \textcolor{keyword}{dynamic\_cast<}ReconstructedParticle*\textcolor{keyword}{>}(DecayChainRPCol->getElementAt(1)
\textcolor{comment}{//Make a list of vertices}
vector<lcio::Vertex*> LCIOVertices;
\textcolor{comment}{//Add the primary first}
LCIOVertices.push\_back(DecayChainRP->getStartVertex());
\textcolor{comment}{//Loop over RPs to find all the other vertices}
vector<ReconstructedParticle*> RPs = DecayChainRP->getParticles();
\textcolor{keywordflow}{for} (vector<ReconstructedParticle*>::const\_iterator iRP = RPs.begin();iRP < RPs.end();++iRP)
\{
         lcio::Vertex* MyVertex = (*iRP)->getStartVertex();
         \textcolor{keywordflow}{if}(MyVertex)
         \{
                 vector<lcio::Vertex*>::const\_iterator it = find(LCIOVertices.begin(),LCIOVertices.end(),
      MyVertex);
                 \textcolor{keywordflow}{if} (it == LCIOVertices.end())
                 \{
                         LCIOVertices.push\_back(MyVertex);
                 \}
         \}
\}
\textcolor{comment}{//Loop over the vertices}
\textcolor{keywordflow}{for} (\textcolor{keywordtype}{size\_t} i = 0; i < LCIOVertices.size(); ++i)
\{
        std::cout << \textcolor{stringliteral}{"Vertex "} << i << \textcolor{stringliteral}{"has d0's:"} << std::endl;
        
        \textcolor{comment}{//Get the Vertex RPs from the Vertices decaying RP}
        std::vector<ReconstuctedParticle*> VertexRPs = LCIOVertices[i]->getAssociatedParticle()->
      getParticles();
        \textcolor{keywordflow}{for} (\textcolor{keywordtype}{size\_t} j = 0; j < VertexRPs.size(); ++i)
        \{
                \textcolor{comment}{//Get the Track (remember the Vertex RP is a copy which points to the original)}
                std::cout << VertexRPs[j]->getParticles()[0]->getTracks()[0]->getD0() << \textcolor{stringliteral}{","};
        \}
        std::cout << std::endl;
\}
\end{DoxyCode}
 

\subparagraph*{Storage of track chi squareds }

If Output\-Track\-Chi2 is set to true the vertexing processors will output the chi squared each track contributes to its vertex. \par
 This is stored in a collection named\-: Track\-R\-P\-Collection\-Name+\char`\"{}\-Track\-Chi\-Squareds\char`\"{} ie. The name of the first collection appended with \char`\"{}\-Track\-Chi\-Squareds\char`\"{} \par
 The chi squareds are stored as a collection of L\-C\-Float\-Vecs in the same order as the tracks in Decay\-Chain\-R\-P\-Tracks\-Collection. Currently the L\-C\-Float\-Vec contains one value -\/ the chi squared in the start vertex, but the end vertex could be supported if needed as a second value.\hypertarget{LCIO_FT}{}\subsection{Storage of Flavour Tag Inputs and Flavour Tag Result}\label{LCIO_FT}
The lists of variables produced by the Flavour Tag and Inputs are stored in collections of L\-C\-Float\-Vecs, with one L\-C\-Float\-Vec per jet. Within the L\-C\-Float\-Vec, the names and order of the variables are stored in the parameter of the run header as a string vector stored under the name of the L\-C\-Float\-Vec collection. Note that the same L\-C\-Float\-Vec is used for the flavour tag inputs, the vertex charge and further additional variables. \subparagraph*{Example}

Get the secondary vertex probability for the second jet\-: 


\begin{DoxyCode}
\textcolor{comment}{//Get the variable names in the FlavourTagInputsCollection}
std::vector<std::string> VarNames;
(pRun->parameters()).getStringVals(\_FlavourTagInputsCollectionName,VarNames);
\textcolor{comment}{//Convert this to a convenient map}
std::map<std::string,unsigned int> IndexOf;
\textcolor{keywordflow}{for} (\textcolor{keywordtype}{size\_t} i = 0;i < VarNames.size();++i)
\{
        IndexOf[VarNames[i]] = i;
\}
\textcolor{comment}{//Get the inputs for the second jet}
lcio::LCCollection* pInputs=pEvent->getCollection( \_FlavourTagInputsCollectionName );
LCFloatVec* FTInputs = \textcolor{keyword}{dynamic\_cast<}lcio::LCFloatVec*\textcolor{keyword}{>}( pInputs->getElementAt(1) );
</pre>
Get the Secondary Probability by indexing the LCFloatVec
<pre>
\textcolor{keywordtype}{double} SecProb = (*FTInputs)[IndexOf[\textcolor{stringliteral}{"SecondaryVertexProbability"}]];
\end{DoxyCode}
 

{\itshape Ben Jeffery -\/ \href{mailto:b.jeffery1@physics.ox.ac.uk}{\tt b.\-jeffery1@physics.\-ox.\-ac.\-uk}} 