<!DOCTYPE HTML PUBLIC "-// IETF/DTD HTML 2.0// EN">
<html>
<!--                                             -->
<!-- Author: ROOT team (rootdev@hpsalo.cern.ch)  -->
<!--                                             -->
<!--   Date: Tue Apr  6 15:55:37 1999            -->
<!--                                             -->
<head>
<title>FullRecon - source file</title>
<link rev=made href="mailto:rootdev@root.cern.ch">
<meta name="rating" content="General">
<meta name="objecttype" content="Manual">
<meta name="keywords" content="software development, oo, object oriented, unix, x11, motif, windows nt, c++, html, rene brun, fons rademakers">
<meta name="description" content="ROOT - An Object Oriented Framework For Large Scale Data Analysis.">
</head>
<body BGCOLOR="#ffffff" LINK="#0000ff" VLINK="#551a8b" ALINK="#ff0000" TEXT="#000000">
<a name="TopOfPage"></a>
<pre>
#include "<a href="../FullRecon.h">FullRecon.h</a>"
#include "TCollection.h"
#include "TObjArray.h"
#include "<a href="../Event.h">Event.h</a>"
#include &lt;stdio.h&gt;
#include "<a href="../GetParameters.h">GetParameters.h</a>"
#include "<a href="../readRootFile.h">readRootFile.h</a>"


 ClassImp(FullRecon)
<a name="FullRecon:FullRecon"> </a>FullRecon::FullRecon(EventSource* eventSource,
	       char* parameterFileName,
	       char* outputFileName
	       ) {

<b>  // If running interactively in Root, may not have an output file</b>
  <a href=".././FullRecon.html#FullRecon:m_ofile">m_ofile</a> = 0;
  if (outputFileName)  <a href=".././FullRecon.html#FullRecon:m_ofile">m_ofile</a> =  fopen(outputFileName,"w");
  
   <a href=".././FullRecon.html#FullRecon:m_parfile">m_parfile</a> =  fopen(parameterFileName,"r");

   <a href="http://root.cern.ch/root/html/GetParameters.html">GetParameters</a>* gp = new <a href="http://root.cern.ch/root/html/GetParameters.html">GetParameters</a>(<a href=".././FullRecon.html#FullRecon:m_parfile">m_parfile</a>);

<b>   // create list of modules to run</b>

<b>   // add modules to list. They inherit from <a href="http://root.cern.ch/root/html/RecModule.html">RecModule</a> and must have </b>
<b>   // doit, cleanup and spew functions defined.</b>

    <a href=".././FullRecon.html#FullRecon:m_eventMarker">m_eventMarker</a> = new <a href="http://root.cern.ch/root/html/EventMarker.html">EventMarker</a>(0,0);
    <a href=".././FullRecon.html#FullRecon:m_ModuleList">m_ModuleList</a>.<a href="http://root.cern.ch/root/html/TObjArray.html#TObjArray:Add">Add</a>(<a href=".././FullRecon.html#FullRecon:m_eventMarker">m_eventMarker</a>);

    <a href=".././FullRecon.html#FullRecon:m_mcPartPrint">m_mcPartPrint</a> = new <a href="http://root.cern.ch/root/html/MCPartPrint.html">MCPartPrint</a>();
    <a href=".././FullRecon.html#FullRecon:m_ModuleList">m_ModuleList</a>.<a href="http://root.cern.ch/root/html/TObjArray.html#TObjArray:Add">Add</a>(<a href=".././FullRecon.html#FullRecon:m_mcPartPrint">m_mcPartPrint</a>); 

    <a href=".././FullRecon.html#FullRecon:m_trackRecSmear">m_trackRecSmear</a> = new <a href=".././TrackRecSmear.html">TrackRecSmear</a>(gp);
    <a href=".././FullRecon.html#FullRecon:m_ModuleList">m_ModuleList</a>.<a href="http://root.cern.ch/root/html/TObjArray.html#TObjArray:Add">Add</a>(<a href=".././FullRecon.html#FullRecon:m_trackRecSmear">m_trackRecSmear</a>); 

    <a href=".././FullRecon.html#FullRecon:m_ClusterSystem">m_ClusterSystem</a> = new <a href=".././ClusterSystem.html">ClusterSystem</a>(gp);
    <a href=".././FullRecon.html#FullRecon:m_ModuleList">m_ModuleList</a>.<a href="http://root.cern.ch/root/html/TObjArray.html#TObjArray:Add">Add</a>(<a href=".././FullRecon.html#FullRecon:m_ClusterSystem">m_ClusterSystem</a>);

    <a href=".././FullRecon.html#FullRecon:m_iter">m_iter</a> = new <a href="http://root.cern.ch/root/html/TObjArrayIter.html">TObjArrayIter</a>(&amp;<a href=".././FullRecon.html#FullRecon:m_ModuleList">m_ModuleList</a>);

    <a href=".././FullRecon.html#FullRecon:m_source">m_source</a> = eventSource;
    <a href=".././FullRecon.html#FullRecon:m_event">m_event</a> = 0;

};

<a name="FullRecon:~FullRecon"> </a><a href=".././FullRecon.html">FullRecon</a>::~<a href=".././FullRecon.html">FullRecon</a>() {

  <a href="../ListOfTypes.html#int">int</a> parfileStatus = fclose(<a href=".././FullRecon.html#FullRecon:m_parfile">m_parfile</a>);
  <a href="../ListOfTypes.html#int">int</a> ofileStatus;
  
  if (<a href=".././FullRecon.html#FullRecon:m_ofile">m_ofile</a>) ofileStatus = fclose(<a href=".././FullRecon.html#FullRecon:m_ofile">m_ofile</a>);

};

<a name="FullRecon:DoEventNewstyle"> </a><a href="../ListOfTypes.html#Int_t">Int_t</a> <a href=".././FullRecon.html#FullRecon:DoEventNewstyle">FullRecon::DoEventNewstyle</a>() {


<b>  // translate to Root event format</b>

<b>  // clean up previous event</b>
  if (<a href=".././FullRecon.html#FullRecon:m_event">m_event</a>) <a href=".././FullRecon.html#FullRecon:m_event">m_event</a>-&gt;Clear();

  <a href="../ListOfTypes.html#int">int</a> ierr = <a href=".././FullRecon.html#FullRecon:m_source">m_source</a>-&gt;<a href="http://root.cern.ch/root/html/EventSource.html#EventSource:getEvent">getEvent</a>(<a href=".././FullRecon.html#FullRecon:m_event">m_event</a>);
  if (!ierr) return ierr;
  <a href=".././FullRecon.html#FullRecon:m_event">m_event</a> = ((<a href="http://root.cern.ch/root/html/readRootFile.html">readRootFile</a>*)<a href=".././FullRecon.html#FullRecon:m_source">m_source</a>)-&gt;getEventPointer();;
  

  <a href="#FullRecon:Cleanup">Cleanup</a>();        // All modules get ready
  <a href="#FullRecon:Doit">Doit</a>(<a href=".././FullRecon.html#FullRecon:m_event">m_event</a>);      // All modules process
  <a href="#FullRecon:Spew">Spew</a>();           // All modules output
  
  
  return 1;
} 

<a name="FullRecon:FetchEvent"> </a><a href="../ListOfTypes.html#Int_t">Int_t</a> <a href=".././FullRecon.html#FullRecon:FetchEvent">FullRecon::FetchEvent</a>(<a href="http://root.cern.ch/root/html/Event.html">Event</a> *evt) {
  return <a href=".././FullRecon.html#FullRecon:m_source">m_source</a>-&gt;<a href="http://root.cern.ch/root/html/EventSource.html#EventSource:getEvent">getEvent</a>(evt);
}

<a name="FullRecon:Doit"> </a><a href="../ListOfTypes.html#void">void</a> <a href=".././FullRecon.html#FullRecon:Doit">FullRecon::Doit</a>(<a href="http://root.cern.ch/root/html/Event.html">Event</a> *event) {
  <a href=".././FullRecon.html#FullRecon:m_iter">m_iter</a>-&gt;<a href="http://root.cern.ch/root/html/TObjArrayIter.html#TObjArrayIter:Reset">Reset</a>();
  
  while (<a href=".././FullRecon.html#FullRecon:m_module">m_module</a> = (<a href="http://root.cern.ch/root/html/RecModule.html">RecModule</a>*) (*<a href=".././FullRecon.html#FullRecon:m_iter">m_iter</a>)()) {
    <a href=".././FullRecon.html#FullRecon:m_module">m_module</a>-&gt;<a href="http://root.cern.ch/root/html/RecModule.html#RecModule:doit">doit</a>(event);
  }
}



<a name="FullRecon:Spew"> </a><a href="../ListOfTypes.html#void">void</a>  <a href=".././FullRecon.html#FullRecon:Spew">FullRecon::Spew</a>() {
  if (<a href=".././FullRecon.html#FullRecon:m_ofile">m_ofile</a>) {
    <a href=".././FullRecon.html#FullRecon:m_iter">m_iter</a>-&gt;<a href="http://root.cern.ch/root/html/TObjArrayIter.html#TObjArrayIter:Reset">Reset</a>();

    while (<a href=".././FullRecon.html#FullRecon:m_module">m_module</a> = (<a href="http://root.cern.ch/root/html/RecModule.html">RecModule</a>*)(*<a href=".././FullRecon.html#FullRecon:m_iter">m_iter</a>)()) {
      <a href=".././FullRecon.html#FullRecon:m_module">m_module</a>-&gt;<a href="http://root.cern.ch/root/html/RecModule.html#RecModule:spew">spew</a>(<a href=".././FullRecon.html#FullRecon:m_ofile">m_ofile</a>);
    }
  }
}


<a name="FullRecon:Cleanup"> </a><a href="../ListOfTypes.html#void">void</a>  <a href=".././FullRecon.html#FullRecon:Cleanup">FullRecon::Cleanup</a>() {
  <a href=".././FullRecon.html#FullRecon:m_iter">m_iter</a>-&gt;<a href="http://root.cern.ch/root/html/TObjArrayIter.html#TObjArrayIter:Reset">Reset</a>();

  while (<a href=".././FullRecon.html#FullRecon:m_module">m_module</a> = (<a href="http://root.cern.ch/root/html/RecModule.html">RecModule</a>*) (*<a href=".././FullRecon.html#FullRecon:m_iter">m_iter</a>)()) {

    <a href=".././FullRecon.html#FullRecon:m_module">m_module</a>-&gt;<a href="http://root.cern.ch/root/html/RecModule.html#RecModule:cleanup">cleanup</a>();
  }
}
</pre>

<!--SIGNATURE-->
<br>
<address>
<hr>
<center>
<a href="http://root.cern.ch/root/Welcome.html">ROOT page</a> - <a href="../ClassIndex.html">Class index</a> - <a href="#TopOfPage">Top of the page</a><br>
</center>
<hr>This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to <a href="mailto:rootdev@root.cern.ch">ROOT support</a>, or contact <a href="mailto:rootdev@root.cern.ch">the developers</a> with any questions or problems regarding ROOT.
</address>
</body>
</html>
