]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/html/AliHLTOfflineInterface_8cxx-source.html
75737fec3d66032411aec2e5b1bb5c579349d15f
[u/mrichter/AliRoot.git] / HLT / PHOS / html / AliHLTOfflineInterface_8cxx-source.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3 <title>AliHLTPHOS: /home/perthi/cern/aliroot/AliRoot_head020507/HLT/BASE/AliHLTOfflineInterface.cxx Source File</title>
4 <link href="doxygen.css" rel="stylesheet" type="text/css">
5 </head><body>
6 <!-- Generated by Doxygen 1.3.9.1 -->
7 <div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
8 <div class="nav">
9 <a class="el" href="dir_000000.html">BASE</a></div>
10 <h1>AliHLTOfflineInterface.cxx</h1><a href="AliHLTOfflineInterface_8cxx.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">// $Id$</span>
11 00002 
12 00003 <span class="comment">/**************************************************************************</span>
13 00004 <span class="comment"> * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *</span>
14 00005 <span class="comment"> *                                                                        *</span>
15 00006 <span class="comment"> * Authors: Matthias Richter &lt;Matthias.Richter@ift.uib.no&gt;                *</span>
16 00007 <span class="comment"> *          for The ALICE Off-line Project.                               *</span>
17 00008 <span class="comment"> *                                                                        *</span>
18 00009 <span class="comment"> * Permission to use, copy, modify and distribute this software and its   *</span>
19 00010 <span class="comment"> * documentation strictly for non-commercial purposes is hereby granted   *</span>
20 00011 <span class="comment"> * without fee, provided that the above copyright notice appears in all   *</span>
21 00012 <span class="comment"> * copies and that both the copyright notice and this permission notice   *</span>
22 00013 <span class="comment"> * appear in the supporting documentation. The authors make no claims     *</span>
23 00014 <span class="comment"> * about the suitability of this software for any purpose. It is          *</span>
24 00015 <span class="comment"> * provided "as is" without express or implied warranty.                  *</span>
25 00016 <span class="comment"> **************************************************************************/</span>
26 00017 
27 00024 <span class="preprocessor">#include "<a class="code" href="AliHLTOfflineInterface_8h.html">AliHLTOfflineInterface.h</a>"</span>
28 00025 <span class="preprocessor">#include "<a class="code" href="AliHLTLogging_8h.html">AliHLTLogging.h</a>"</span>
29 00026 
30 <a name="l00028"></a><a class="code" href="AliHLTOfflineInterface_8cxx.html#a0">00028</a> <a class="code" href="AliHLTPHOSRawAnalyzerPeakFinder_8cxx.html#a0">ClassImp</a>(<a class="code" href="classAliHLTOfflineInterface.html">AliHLTOfflineInterface</a>)
31 00029 
32 00030 <a class="code" href="classAliHLTOfflineInterface.html">AliHLTOfflineInterface</a>::<a class="code" href="classAliHLTOfflineInterface.html">AliHLTOfflineInterface</a>()
33 00031   :
34 00032   fpRunLoader(NULL),
35 00033   fpRawReader(NULL),
36 00034   fpESD(NULL)
37 00035 {
38 00036   <span class="comment">// see header file for class documentation</span>
39 00037   <span class="comment">// or</span>
40 00038   <span class="comment">// refer to README to build package</span>
41 00039   <span class="comment">// or</span>
42 00040   <span class="comment">// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt</span>
43 00041 }
44 00042 
45 <a name="l00043"></a><a class="code" href="classAliHLTOfflineInterface.html#v0">00043</a> TList AliHLTOfflineInterface::fgList;
46 <a name="l00044"></a><a class="code" href="classAliHLTOfflineInterface.html#v1">00044</a> TObjLink* <a class="code" href="classAliHLTOfflineInterface.html#v1">AliHLTOfflineInterface::fgCurrentLnk</a>=NULL;
47 <a name="l00045"></a><a class="code" href="classAliHLTOfflineInterface.html#v2">00045</a> AliRunLoader* <a class="code" href="classAliHLTOfflineInterface.html#v2">AliHLTOfflineInterface::fgpRunLoader</a>=NULL;
48 <a name="l00046"></a><a class="code" href="classAliHLTOfflineInterface.html#v3">00046</a> AliRawReader* <a class="code" href="classAliHLTOfflineInterface.html#v3">AliHLTOfflineInterface::fgpRawReader</a>=NULL;
49 00047 
50 <a name="l00048"></a><a class="code" href="classAliHLTOfflineInterface.html#a1">00048</a> <a class="code" href="classAliHLTOfflineInterface.html#a0">AliHLTOfflineInterface::AliHLTOfflineInterface</a>(AliRunLoader* pRunLoader, AliRawReader* pRawReader)
51 00049   :
52 00050   fpRunLoader(pRunLoader),
53 00051   fpRawReader(pRawReader),
54 00052   fpESD(NULL)
55 00053 {
56 00054 }
57 00055 
58 <a name="l00056"></a><a class="code" href="classAliHLTOfflineInterface.html#a2">00056</a> <a class="code" href="classAliHLTOfflineInterface.html#a0">AliHLTOfflineInterface::AliHLTOfflineInterface</a>(<span class="keyword">const</span> <a class="code" href="classAliHLTOfflineInterface.html">AliHLTOfflineInterface</a>&amp;)
59 00057   :
60 00058   TObject(),
61 00059   fpRunLoader(NULL),
62 00060   fpRawReader(NULL),
63 00061   fpESD(NULL)
64 00062 {
65 00063   <span class="comment">// see header file for class documentation</span>
66 00064   <span class="comment">//HLTFatal("copy constructor untested");</span>
67 00065 }
68 00066 
69 <a name="l00067"></a><a class="code" href="classAliHLTOfflineInterface.html#a3">00067</a> <a class="code" href="classAliHLTOfflineInterface.html">AliHLTOfflineInterface</a>&amp; <a class="code" href="classAliHLTOfflineInterface.html#a3">AliHLTOfflineInterface::operator=</a>(<span class="keyword">const</span> <a class="code" href="classAliHLTOfflineInterface.html">AliHLTOfflineInterface</a>&amp;)
70 00068 { 
71 00069   <span class="comment">// see header file for class documentation</span>
72 00070   <span class="comment">//HLTFatal("assignment operator untested");</span>
73 00071   <span class="keywordflow">return</span> *<span class="keyword">this</span>;
74 00072 }
75 00073 
76 <a name="l00074"></a><a class="code" href="classAliHLTOfflineInterface.html#a4">00074</a> <a class="code" href="classAliHLTOfflineInterface.html#a4">AliHLTOfflineInterface::~AliHLTOfflineInterface</a>()
77 00075 {
78 00076 }
79 00077 
80 <a name="l00078"></a><a class="code" href="classAliHLTOfflineInterface.html#a5">00078</a> AliRunLoader* <a class="code" href="classAliHLTOfflineInterface.html#a5">AliHLTOfflineInterface::GetRunLoader</a>()<span class="keyword"> const</span>
81 00079 <span class="keyword"></span>{
82 00080   <span class="keywordflow">return</span> <a class="code" href="classAliHLTOfflineInterface.html#r0">fpRunLoader</a>!=NULL?<a class="code" href="classAliHLTOfflineInterface.html#r0">fpRunLoader</a>:fgpRunLoader;
83 00081 }
84 00082 
85 <a name="l00083"></a><a class="code" href="classAliHLTOfflineInterface.html#a6">00083</a> AliRawReader* <a class="code" href="classAliHLTOfflineInterface.html#a6">AliHLTOfflineInterface::GetRawReader</a>()<span class="keyword"> const</span>
86 00084 <span class="keyword"></span>{
87 00085   <span class="keywordflow">return</span> <a class="code" href="classAliHLTOfflineInterface.html#r1">fpRawReader</a>!=NULL?<a class="code" href="classAliHLTOfflineInterface.html#r1">fpRawReader</a>:fgpRawReader;
88 00086 }
89 00087 
90 <a name="l00088"></a><a class="code" href="classAliHLTOfflineInterface.html#a7">00088</a> <span class="keywordtype">int</span> <a class="code" href="classAliHLTOfflineInterface.html#a7">AliHLTOfflineInterface::SetESD</a>(Int_t eventNo, AliESD* pESD)
91 00089 {
92 00090   <a class="code" href="classAliHLTOfflineInterface.html#r2">fpESD</a>=pESD;
93 00091   <span class="keywordflow">return</span> 0;
94 00092 }
95 00093 
96 <a name="l00094"></a><a class="code" href="classAliHLTOfflineInterface.html#a8">00094</a> AliESD* <a class="code" href="classAliHLTOfflineInterface.html#a8">AliHLTOfflineInterface::GetESD</a>()<span class="keyword"> const</span>
97 00095 <span class="keyword"></span>{
98 00096   <span class="keywordflow">return</span> fpESD;
99 00097 }
100 00098 
101 <a name="l00099"></a><a class="code" href="classAliHLTOfflineInterface.html#a9">00099</a> <span class="keywordtype">int</span> <a class="code" href="classAliHLTOfflineInterface.html#a9">AliHLTOfflineInterface::SetParams</a>(AliRunLoader* runLoader, AliRawReader* rawReader)
102 00100 {
103 00101   <span class="comment">// see header file for class documentation</span>
104 00102   <span class="keywordtype">int</span> iResult=0;
105 00103   <span class="keywordflow">if</span> (<a class="code" href="classAliHLTOfflineInterface.html#r0">fpRunLoader</a>!=NULL &amp;&amp; <a class="code" href="classAliHLTOfflineInterface.html#r0">fpRunLoader</a>!=runLoader) {
106 00104     <span class="comment">//HLTWarning("overriding previous instance of Run Loader %p with %p", fpRunLoader, runLoader);</span>
107 00105   }
108 00106   <a class="code" href="classAliHLTOfflineInterface.html#r0">fpRunLoader</a>=runLoader;
109 00107   <span class="keywordflow">if</span> (<a class="code" href="classAliHLTOfflineInterface.html#r1">fpRawReader</a>!=NULL &amp;&amp; <a class="code" href="classAliHLTOfflineInterface.html#r1">fpRawReader</a>!=rawReader) {
110 00108     <span class="comment">//HLTWarning("overriding previous instance of RawReader %p with %p", fpRawReader, rawReader);</span>
111 00109   }
112 00110   <a class="code" href="classAliHLTOfflineInterface.html#r1">fpRawReader</a>=rawReader;
113 00111   <span class="keywordflow">return</span> iResult;
114 00112 }
115 00113 
116 <a name="l00114"></a><a class="code" href="classAliHLTOfflineInterface.html#a10">00114</a> <span class="keywordtype">int</span> <a class="code" href="classAliHLTOfflineInterface.html#a10">AliHLTOfflineInterface::Reset</a>()
117 00115 {
118 00116   <span class="comment">// see header file for class documentation</span>
119 00117   <span class="keywordtype">int</span> iResult=0;
120 00118   <a class="code" href="classAliHLTOfflineInterface.html#r0">fpRunLoader</a>=NULL;
121 00119   <a class="code" href="classAliHLTOfflineInterface.html#r1">fpRawReader</a>=NULL;
122 00120   <a class="code" href="classAliHLTOfflineInterface.html#r2">fpESD</a>=NULL;
123 00121   <span class="keywordflow">return</span> iResult;
124 00122 }
125 00123 
126 <a name="l00124"></a><a class="code" href="classAliHLTOfflineInterface.html#e0">00124</a> <span class="keywordtype">int</span> <a class="code" href="classAliHLTOfflineInterface.html#e0">AliHLTOfflineInterface::SetParamsToComponents</a>(AliRunLoader* runLoader, AliRawReader* rawReader)
127 00125 {
128 00126   <span class="comment">// see header file for class documentation</span>
129 00127   <a class="code" href="classAliHLTLogging.html">AliHLTLogging</a> log;
130 00128   <span class="keywordtype">int</span> iResult=0;
131 00129   <span class="keywordtype">int</span> count=0;
132 00130   <a class="code" href="classAliHLTOfflineInterface.html#v2">fgpRunLoader</a>=runLoader;
133 00131   <a class="code" href="classAliHLTOfflineInterface.html#v3">fgpRawReader</a>=rawReader;
134 00132   <a class="code" href="classAliHLTOfflineInterface.html#v1">fgCurrentLnk</a>=<a class="code" href="classAliHLTOfflineInterface.html#v0">fgList</a>.FirstLink();
135 00133   <span class="keywordflow">while</span> (<a class="code" href="classAliHLTOfflineInterface.html#v1">fgCurrentLnk</a>!=NULL) {
136 00134     <a class="code" href="classAliHLTOfflineInterface.html">AliHLTOfflineInterface</a>* pComponent=reinterpret_cast&lt;AliHLTOfflineInterface*&gt;(<a class="code" href="classAliHLTOfflineInterface.html#v1">fgCurrentLnk</a>-&gt;GetObject());
137 00135     <span class="keywordtype">int</span> iLocal=0;
138 00136     <span class="keywordflow">if</span> (pComponent) iLocal=pComponent-&gt;<a class="code" href="classAliHLTOfflineInterface.html#a9">SetParams</a>(runLoader, rawReader);
139 00137     <span class="keywordflow">if</span> (iLocal&lt;0) {
140 00138       log.<a class="code" href="classAliHLTLogging.html#a8">LoggingVarargs</a>(<a class="code" href="AliHLTDataTypes_8h.html#a29a22">kHLTLogWarning</a>, <span class="stringliteral">"AliHLTOfflineInterface"</span>,<span class="stringliteral">"SetParamsToComponents"</span>, __FILE__, __LINE__,
141 00139                         <span class="stringliteral">"parameter initialization failed for component %p with result %d"</span>, pComponent, iLocal);
142 00140       <span class="keywordflow">if</span> (iResult&gt;=0) iResult=iLocal;
143 00141     }
144 00142     count++;
145 00143     <a class="code" href="classAliHLTOfflineInterface.html#v1">fgCurrentLnk</a>=<a class="code" href="classAliHLTOfflineInterface.html#v1">fgCurrentLnk</a>-&gt;Next();
146 00144   }
147 00145   <span class="keywordflow">if</span> (iResult&gt;=0) {
148 00146 <span class="comment">//       log.LoggingVarargs(kHLTLogInfo, "AliHLTOfflineInterface","SetParamsToComponents", __FILE__, __LINE__,</span>
149 00147 <span class="comment">//                      "parameters set to %d offline interface component(s)", count);</span>
150 00148   }
151 00149   <span class="keywordflow">return</span> iResult;
152 00150 }
153 00151 
154 <a name="l00152"></a><a class="code" href="classAliHLTOfflineInterface.html#e2">00152</a> <span class="keywordtype">int</span> <a class="code" href="classAliHLTOfflineInterface.html#e2">AliHLTOfflineInterface::ResetComponents</a>()
155 00153 {
156 00154   <span class="comment">// see header file for class documentation</span>
157 00155   <span class="keywordtype">int</span> iResult=0;
158 00156   <a class="code" href="classAliHLTOfflineInterface.html#v1">fgCurrentLnk</a>=<a class="code" href="classAliHLTOfflineInterface.html#v0">fgList</a>.FirstLink();
159 00157   <span class="keywordflow">while</span> (<a class="code" href="classAliHLTOfflineInterface.html#v1">fgCurrentLnk</a>!=NULL) {
160 00158     <a class="code" href="classAliHLTOfflineInterface.html">AliHLTOfflineInterface</a>* pComponent=reinterpret_cast&lt;AliHLTOfflineInterface*&gt;(<a class="code" href="classAliHLTOfflineInterface.html#v1">fgCurrentLnk</a>-&gt;GetObject());
161 00159     <span class="keywordtype">int</span> iLocal=0;
162 00160     <span class="keywordflow">if</span> (pComponent) iLocal=pComponent-&gt;<a class="code" href="classAliHLTOfflineInterface.html#a10">Reset</a>();
163 00161     <span class="keywordflow">if</span> (iLocal&lt;0) {
164 00162       <span class="keywordflow">if</span> (iResult&gt;=0) iResult=iLocal;
165 00163     }
166 00164     <a class="code" href="classAliHLTOfflineInterface.html#v1">fgCurrentLnk</a>=<a class="code" href="classAliHLTOfflineInterface.html#v1">fgCurrentLnk</a>-&gt;Next();
167 00165   }
168 00166   <span class="keywordflow">return</span> iResult;
169 00167 }
170 00168 
171 <a name="l00169"></a><a class="code" href="classAliHLTOfflineInterface.html#e1">00169</a> <span class="keywordtype">int</span> <a class="code" href="classAliHLTOfflineInterface.html#e1">AliHLTOfflineInterface::FillComponentESDs</a>(<span class="keywordtype">int</span> eventNo, AliRunLoader* runLoader, AliESD* esd)
172 00170 {
173 00171   <span class="comment">// see header file for class documentation</span>
174 00172   <span class="keywordtype">int</span> iResult=0;
175 00173   <a class="code" href="classAliHLTOfflineInterface.html#v1">fgCurrentLnk</a>=<a class="code" href="classAliHLTOfflineInterface.html#v0">fgList</a>.FirstLink();
176 00174   <span class="keywordflow">while</span> (<a class="code" href="classAliHLTOfflineInterface.html#v1">fgCurrentLnk</a>!=NULL) {
177 00175     <a class="code" href="classAliHLTOfflineInterface.html">AliHLTOfflineInterface</a>* pComponent=reinterpret_cast&lt;AliHLTOfflineInterface*&gt;(<a class="code" href="classAliHLTOfflineInterface.html#v1">fgCurrentLnk</a>-&gt;GetObject());
178 00176     <span class="keywordtype">int</span> iLocal=0;
179 00177     <span class="keywordflow">if</span> (pComponent) {
180 00178       pComponent-&gt;<a class="code" href="classAliHLTOfflineInterface.html#a7">SetESD</a>(eventNo, esd);
181 00179       <span class="keywordflow">if</span> (pComponent-&gt;<a class="code" href="classAliHLTOfflineInterface.html#a5">GetRunLoader</a>()!=runLoader) {
182 00180         <span class="comment">//HLTWarning("runLoader missmatch: component %p was reconstructed with runLoader %p, but got %p now", pComponent, pComponent-&gt;GetRunLoader(), runLoader);</span>
183 00181       }
184 00182       iLocal=pComponent-&gt;<a class="code" href="classAliHLTOfflineInterface.html#a11">FillESD</a>(eventNo, runLoader, esd);
185 00183     }
186 00184     <span class="keywordflow">if</span> (iLocal&lt;0) {
187 00185       <span class="keywordflow">if</span> (iResult&gt;=0) iResult=iLocal;
188 00186     }
189 00187     <a class="code" href="classAliHLTOfflineInterface.html#v1">fgCurrentLnk</a>=<a class="code" href="classAliHLTOfflineInterface.html#v1">fgCurrentLnk</a>-&gt;Next();
190 00188   }
191 00189   <span class="keywordflow">return</span> iResult;
192 00190 }
193 00191 
194 <a name="l00192"></a><a class="code" href="classAliHLTOfflineInterface.html#f0">00192</a> <span class="keywordtype">int</span> <a class="code" href="classAliHLTOfflineInterface.html#f0">AliHLTOfflineInterface::Register</a>(<a class="code" href="classAliHLTOfflineInterface.html">AliHLTOfflineInterface</a>* me)
195 00193 {
196 00194   <span class="comment">// see header file for function documentation</span>
197 00195   <span class="keywordtype">int</span> iResult=0;
198 00196   <span class="keywordflow">if</span> (<a class="code" href="classAliHLTOfflineInterface.html#v0">fgList</a>.FindObject(me-&gt;GetName())==NULL) {
199 00197     <a class="code" href="classAliHLTOfflineInterface.html#v0">fgList</a>.Add(me);
200 00198   } <span class="keywordflow">else</span> {
201 00199   }
202 00200   <span class="keywordflow">return</span> iResult;
203 00201 }
204 00202 
205 <a name="l00203"></a><a class="code" href="classAliHLTOfflineInterface.html#f1">00203</a> <span class="keywordtype">int</span> <a class="code" href="classAliHLTOfflineInterface.html#f1">AliHLTOfflineInterface::Unregister</a>(<a class="code" href="classAliHLTOfflineInterface.html">AliHLTOfflineInterface</a>* me)
206 00204 {
207 00205   <span class="comment">// see header file for function documentation</span>
208 00206   <span class="keywordtype">int</span> iResult=0;
209 00207   <span class="keywordflow">if</span> (<a class="code" href="classAliHLTOfflineInterface.html#v0">fgList</a>.FindObject(me)!=NULL) {
210 00208     <a class="code" href="classAliHLTOfflineInterface.html#v0">fgList</a>.Remove(me);
211 00209   } <span class="keywordflow">else</span> {
212 00210   }
213 00211   <span class="keywordflow">return</span> iResult;
214 00212 }
215 </pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri May 4 04:49:52 2007 for AliHLTPHOS by&nbsp;
216 <a href="http://www.doxygen.org/index.html">
217 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address>
218 </body>
219 </html>