]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/latex/classAliHLTTask.tex
New documenation
[u/mrichter/AliRoot.git] / HLT / PHOS / latex / classAliHLTTask.tex
1 \section{Ali\-HLTTask Class Reference}
2 \label{classAliHLTTask}\index{AliHLTTask@{AliHLTTask}}
3 {\tt \#include $<$Ali\-HLTTask.h$>$}
4
5 Inheritance diagram for Ali\-HLTTask::\begin{figure}[H]
6 \begin{center}
7 \leavevmode
8 \includegraphics[height=2cm]{classAliHLTTask}
9 \end{center}
10 \end{figure}
11
12
13 \subsection{Detailed Description}
14 A task collects all the information which is necessary to process a certain step in the HLT data processing chain.\begin{itemize}
15 \item the instance of the component the task object creates and deletes the component object\item the data buffer which receives the result of the component and provides the data to other tasks/components\item a list of all dependencies\item a list of consumers\item the task object holds an external pointer to the configuration object; {\bf Note:} the configuration object must exist through the existence of the task object!!!\end{itemize}
16
17
18 \begin{Desc}
19 \item[Note:]This class is only used for the {\bf HLT integration into Ali\-Root}{\rm (p.\,\pageref{group__alihlt__system})}. \end{Desc}
20
21
22
23
24 Definition at line 46 of file Ali\-HLTTask.h.\subsection*{Public Member Functions}
25 \begin{CompactItemize}
26 \item 
27 {\bf Ali\-HLTTask} ()
28 \item 
29 {\bf Ali\-HLTTask} ({\bf Ali\-HLTConfiguration} $\ast$p\-Conf)
30 \item 
31 {\bf Ali\-HLTTask} (const {\bf Ali\-HLTTask} \&)
32 \item 
33 {\bf Ali\-HLTTask} \& {\bf operator=} (const {\bf Ali\-HLTTask} \&)
34 \item 
35 virtual {\bf $\sim$Ali\-HLTTask} ()
36 \item 
37 int {\bf Init} ({\bf Ali\-HLTConfiguration} $\ast$p\-Conf, {\bf Ali\-HLTComponent\-Handler} $\ast$p\-CH)
38 \item 
39 int {\bf Deinit} ()
40 \item 
41 const char $\ast$ {\bf Get\-Name} () const 
42 \item 
43 {\bf Ali\-HLTConfiguration} $\ast$ {\bf Get\-Conf} () const 
44 \item 
45 {\bf Ali\-HLTComponent} $\ast$ {\bf Get\-Component} () const 
46 \item 
47 {\bf Ali\-HLTTask} $\ast$ {\bf Find\-Dependency} (const char $\ast$id)
48 \item 
49 int {\bf Set\-Dependency} ({\bf Ali\-HLTTask} $\ast$p\-Dep)
50 \item 
51 int {\bf Unset\-Dependency} ({\bf Ali\-HLTTask} $\ast$p\-Dep)
52 \item 
53 int {\bf Check\-Dependencies} ()
54 \item 
55 int {\bf Depends} ({\bf Ali\-HLTTask} $\ast$p\-Task)
56 \item 
57 {\bf Ali\-HLTTask} $\ast$ {\bf Find\-Target} (const char $\ast$id)
58 \item 
59 int {\bf Set\-Target} ({\bf Ali\-HLTTask} $\ast$p\-Dep)
60 \item 
61 int {\bf Unset\-Target} ({\bf Ali\-HLTTask} $\ast$p\-Target)
62 \item 
63 int {\bf Start\-Run} ()
64 \item 
65 int {\bf End\-Run} ()
66 \item 
67 int {\bf Process\-Task} (Int\_\-t event\-No)
68 \item 
69 int {\bf Get\-Nof\-Matching\-Data\-Blocks} (const {\bf Ali\-HLTTask} $\ast$p\-Consumer\-Task) const 
70 \item 
71 int {\bf Get\-Nof\-Matching\-Data\-Types} (const {\bf Ali\-HLTTask} $\ast$p\-Consumer\-Task) const 
72 \item 
73 int {\bf Subscribe} (const {\bf Ali\-HLTTask} $\ast$p\-Consumer\-Task, {\bf Ali\-HLTComponent\-Block\-Data} $\ast$array\-Block\-Desc, int i\-Array\-Size)
74 \item 
75 int {\bf Release} ({\bf Ali\-HLTComponent\-Block\-Data} $\ast$p\-Block\-Desc, const {\bf Ali\-HLTTask} $\ast$p\-Consumer\-Task)
76 \item 
77 void {\bf Print\-Status} ()
78 \item 
79 int {\bf Follow\-Dependency} (const char $\ast$id, TList $\ast$p\-Tgt\-List=NULL)
80 \item 
81 void {\bf Print\-Dependency\-Tree} (const char $\ast$id, int b\-Mode=0)
82 \item 
83 int {\bf Get\-Nof\-Sources} () const 
84 \end{CompactItemize}
85 \subsection*{Private Member Functions}
86 \begin{CompactItemize}
87 \item 
88 {\bf Class\-Def} ({\bf Ali\-HLTTask}, 1)
89 \end{CompactItemize}
90 \subsection*{Private Attributes}
91 \begin{CompactItemize}
92 \item 
93 {\bf Ali\-HLTConfiguration} $\ast$ {\bf fp\-Configuration}
94 \item 
95 {\bf Ali\-HLTComponent} $\ast$ {\bf fp\-Component}
96 \begin{CompactList}\small\item\em transient \item\end{CompactList}\item 
97 {\bf Ali\-HLTData\-Buffer} $\ast$ {\bf fp\-Data\-Buffer}
98 \begin{CompactList}\small\item\em transient \item\end{CompactList}\item 
99 TList {\bf f\-List\-Targets}
100 \begin{CompactList}\small\item\em transient \item\end{CompactList}\item 
101 TList {\bf f\-List\-Dependencies}
102 \item 
103 {\bf Ali\-HLTComponent\-Block\-Data} $\ast$ {\bf fp\-Block\-Data\-Array}
104 \item 
105 int {\bf f\-Block\-Data\-Array\-Size}
106 \begin{CompactList}\small\item\em transient \item\end{CompactList}\end{CompactItemize}
107
108
109 \subsection{Constructor \& Destructor Documentation}
110 \index{AliHLTTask@{Ali\-HLTTask}!AliHLTTask@{AliHLTTask}}
111 \index{AliHLTTask@{AliHLTTask}!AliHLTTask@{Ali\-HLTTask}}
112 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}Ali\-HLTTask::Ali\-HLTTask ()}\label{classAliHLTTask_a0}
113
114
115 standard constructor \index{AliHLTTask@{Ali\-HLTTask}!AliHLTTask@{AliHLTTask}}
116 \index{AliHLTTask@{AliHLTTask}!AliHLTTask@{Ali\-HLTTask}}
117 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}Ali\-HLTTask::Ali\-HLTTask ({\bf Ali\-HLTConfiguration} $\ast$ {\em p\-Conf})}\label{classAliHLTTask_a1}
118
119
120 constructor \begin{Desc}
121 \item[Parameters:]
122 \begin{description}
123 \item[{\em p\-Conf}]pointer to configuration descriptor \end{description}
124 \end{Desc}
125
126
127 Definition at line 436 of file Ali\-HLTConfiguration.cxx.
128
129 \footnotesize\begin{verbatim}437   :
130 438   fpConfiguration(pConf),
131 439   fpComponent(NULL),
132 440   fpDataBuffer(NULL),
133 441   fListTargets(),
134 442   fListDependencies(),
135 443   fpBlockDataArray(NULL),
136 444   fBlockDataArraySize(0)
137 445 {
138 446   // see header file for function documentation
139 447 }
140
141 \end{verbatim}\normalsize 
142
143
144 \index{AliHLTTask@{Ali\-HLTTask}!AliHLTTask@{AliHLTTask}}
145 \index{AliHLTTask@{AliHLTTask}!AliHLTTask@{Ali\-HLTTask}}
146 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}Ali\-HLTTask::Ali\-HLTTask (const {\bf Ali\-HLTTask} \&)}\label{classAliHLTTask_a2}
147
148
149 not a valid copy constructor, defined according to effective C++ style 
150
151 Definition at line 449 of file Ali\-HLTConfiguration.cxx.
152
153 References HLTFatal.
154
155 \footnotesize\begin{verbatim}450   :
156 451   TObject(),
157 452   AliHLTLogging(),
158 453   fpConfiguration(NULL),
159 454   fpComponent(NULL),
160 455   fpDataBuffer(NULL),
161 456   fListTargets(),
162 457   fListDependencies(),
163 458   fpBlockDataArray(NULL),
164 459   fBlockDataArraySize(0)
165 460 {
166 461   HLTFatal("copy constructor untested");
167 462 }
168
169 \end{verbatim}\normalsize 
170
171
172 \index{AliHLTTask@{Ali\-HLTTask}!~AliHLTTask@{$\sim$AliHLTTask}}
173 \index{~AliHLTTask@{$\sim$AliHLTTask}!AliHLTTask@{Ali\-HLTTask}}
174 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}Ali\-HLTTask::$\sim${\bf Ali\-HLTTask} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classAliHLTTask_a4}
175
176
177 destructor 
178
179 Definition at line 471 of file Ali\-HLTConfiguration.cxx.
180
181 References f\-List\-Dependencies, f\-List\-Targets, fp\-Block\-Data\-Array, fp\-Component, Unset\-Dependency(), and Unset\-Target().
182
183 \footnotesize\begin{verbatim}472 {
184 473   TObjLink* lnk=fListDependencies.FirstLink();
185 474 
186 475   while (lnk!=NULL) {
187 476     AliHLTTask* pTask=(AliHLTTask*)lnk->GetObject();
188 477     pTask->UnsetTarget(this);
189 478     lnk=lnk->Next();
190 479   }
191 480   lnk=fListTargets.FirstLink();
192 481 
193 482   while (lnk!=NULL) {
194 483     AliHLTTask* pTask=(AliHLTTask*)lnk->GetObject();
195 484     pTask->UnsetDependency(this);
196 485     lnk=lnk->Next();
197 486   }
198 487 
199 488   if (fpComponent) delete fpComponent;
200 489   fpComponent=NULL;
201 490   if (fpBlockDataArray) delete[] fpBlockDataArray;
202 491   fpBlockDataArray=NULL;
203 492 }
204 \end{verbatim}\normalsize 
205
206
207
208
209 \subsection{Member Function Documentation}
210 \index{AliHLTTask@{Ali\-HLTTask}!CheckDependencies@{CheckDependencies}}
211 \index{CheckDependencies@{CheckDependencies}!AliHLTTask@{Ali\-HLTTask}}
212 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Ali\-HLTTask::Check\-Dependencies ()}\label{classAliHLTTask_a13}
213
214
215 Return number of unresolved dependencies. Iterate through all the configurations the task depends on and check whether a corresponding task is available in the list. \begin{Desc}
216 \item[Returns:]number of unresolved dependencies \end{Desc}
217
218
219 Definition at line 666 of file Ali\-HLTConfiguration.cxx.
220
221 References Find\-Dependency(), fp\-Configuration, Ali\-HLTConfiguration::Get\-First\-Source(), Ali\-HLTConfiguration::Get\-Name(), and Ali\-HLTConfiguration::Get\-Next\-Source().
222
223 Referenced by Ali\-HLTSystem::Insert\-Task().
224
225 \footnotesize\begin{verbatim}667 {
226 668   // see header file for function documentation
227 669   int iResult=0;
228 670   AliHLTConfiguration* pSrc=fpConfiguration->GetFirstSource();
229 671   while (pSrc) {
230 672     if (FindDependency(pSrc->GetName())==NULL) {
231 673       //HLTDebug("dependency \"%s\" unresolved", pSrc->GetName());
232 674       iResult++;
233 675     }
234 676     pSrc=fpConfiguration->GetNextSource();
235 677   }
236 678   return iResult;
237 679 }
238 \end{verbatim}\normalsize 
239
240
241 \index{AliHLTTask@{Ali\-HLTTask}!ClassDef@{ClassDef}}
242 \index{ClassDef@{ClassDef}!AliHLTTask@{Ali\-HLTTask}}
243 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}Ali\-HLTTask::Class\-Def ({\bf Ali\-HLTTask}, 1)\hspace{0.3cm}{\tt  [private]}}\label{classAliHLTTask_d0}
244
245
246 \index{AliHLTTask@{Ali\-HLTTask}!Deinit@{Deinit}}
247 \index{Deinit@{Deinit}!AliHLTTask@{Ali\-HLTTask}}
248 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Ali\-HLTTask::Deinit ()}\label{classAliHLTTask_a6}
249
250
251 De-Initialize the task. Final cleanup after the run. The {\bf Ali\-HLTComponent::Deinit}{\rm (p.\,\pageref{classAliHLTComponent_a5})} method of the component is called. The analysis component is deleted. 
252
253 Definition at line 532 of file Ali\-HLTConfiguration.cxx.
254
255 References Ali\-HLTComponent::Deinit(), fp\-Component, Get\-Component(), Get\-Name(), and HLTWarning.
256
257 Referenced by Ali\-HLTSystem::Deinit\-Tasks().
258
259 \footnotesize\begin{verbatim}533 {
260 534   // see header file for function documentation
261 535   int iResult=0;
262 536   AliHLTComponent* pComponent=GetComponent();
263 537   fpComponent=NULL;
264 538   if (pComponent) {
265 539     //HLTDebug("delete component %s (%p)", pComponent->GetComponentID(), pComponent); 
266 540     pComponent->Deinit();
267 541     delete pComponent;
268 542   } else {
269 543     HLTWarning("task %s (%p) doesn't seem to be in initialized", GetName(), this);
270 544   }
271 545   return iResult;
272 546 }
273 \end{verbatim}\normalsize 
274
275
276 \index{AliHLTTask@{Ali\-HLTTask}!Depends@{Depends}}
277 \index{Depends@{Depends}!AliHLTTask@{Ali\-HLTTask}}
278 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Ali\-HLTTask::Depends ({\bf Ali\-HLTTask} $\ast$ {\em p\-Task})}\label{classAliHLTTask_a14}
279
280
281 Check whether the current task depends on the task p\-Task. \begin{Desc}
282 \item[Parameters:]
283 \begin{description}
284 \item[{\em p\-Task}]pointer to Task descriptor \end{description}
285 \end{Desc}
286 \begin{Desc}
287 \item[Returns:]1 the current task depends on p\-Task \par
288  0 no dependency \par
289  neg. error code if failed \end{Desc}
290
291
292 Definition at line 682 of file Ali\-HLTConfiguration.cxx.
293
294 References fp\-Configuration, Get\-Name(), and Ali\-HLTConfiguration::Get\-Source().
295
296 Referenced by Ali\-HLTSystem::Insert\-Task().
297
298 \footnotesize\begin{verbatim}683 {
299 684   // see header file for function documentation
300 685   int iResult=0;
301 686   if (pTask) {
302 687     if (fpConfiguration) {
303 688       iResult=fpConfiguration->GetSource(pTask->GetName())!=NULL;
304 689       if (iResult>0) {
305 690         //HLTDebug("task  \"%s\" depends on \"%s\"", GetName(), pTask->GetName());
306 691       } else {
307 692         //HLTDebug("task  \"%s\" independend of \"%s\"", GetName(), pTask->GetName());
308 693       }
309 694     } else {
310 695       iResult=-EFAULT;
311 696     }
312 697   } else {
313 698     iResult=-EINVAL;
314 699   }
315 700   return iResult;
316 701 }
317 \end{verbatim}\normalsize 
318
319
320 \index{AliHLTTask@{Ali\-HLTTask}!EndRun@{EndRun}}
321 \index{EndRun@{EndRun}!AliHLTTask@{Ali\-HLTTask}}
322 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Ali\-HLTTask::End\-Run ()}\label{classAliHLTTask_a19}
323
324
325 Clean-up the task after event processing. The method cleans up internal structures. 
326
327 Definition at line 812 of file Ali\-HLTConfiguration.cxx.
328
329 References f\-Block\-Data\-Array\-Size, fp\-Block\-Data\-Array, fp\-Data\-Buffer, Get\-Name(), and HLTWarning.
330
331 Referenced by Ali\-HLTSystem::Stop\-Tasks().
332
333 \footnotesize\begin{verbatim}813 {
334 814   // see header file for function documentation
335 815   int iResult=0;
336 816   if (fpBlockDataArray) {
337 817     fBlockDataArraySize=0;
338 818     delete [] fpBlockDataArray;
339 819     fpBlockDataArray=0;
340 820   } else {
341 821     HLTWarning("task %s (%p) doesn't seem to be in running mode", GetName(), this);
342 822   }
343 823   if (fpDataBuffer) {
344 824     AliHLTDataBuffer* pBuffer=fpDataBuffer;
345 825     fpDataBuffer=NULL;
346 826     delete pBuffer;
347 827   }
348 828   return iResult;
349 829 }
350 \end{verbatim}\normalsize 
351
352
353 \index{AliHLTTask@{Ali\-HLTTask}!FindDependency@{FindDependency}}
354 \index{FindDependency@{FindDependency}!AliHLTTask@{Ali\-HLTTask}}
355 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Ali\-HLTTask} $\ast$ Ali\-HLTTask::Find\-Dependency (const char $\ast$ {\em id})}\label{classAliHLTTask_a10}
356
357
358 Find a dependency with a certain {\em name id\/}. Searches in the list of dependencies for a task. \begin{Desc}
359 \item[Parameters:]
360 \begin{description}
361 \item[{\em id}]the id of the {\bf CONFIGURATION}\par
362  {\bf NOTE:} the id does NOT specify a COMPONENT \end{description}
363 \end{Desc}
364 \begin{Desc}
365 \item[Returns:]pointer to task \end{Desc}
366
367
368 Definition at line 568 of file Ali\-HLTConfiguration.cxx.
369
370 References f\-List\-Dependencies.
371
372 Referenced by Check\-Dependencies(), Print\-Status(), and Set\-Dependency().
373
374 \footnotesize\begin{verbatim}569 {
375 570   // see header file for function documentation
376 571   AliHLTTask* pTask=NULL;
377 572   if (id) {
378 573     pTask=(AliHLTTask*)fListDependencies.FindObject(id);
379 574   }
380 575   return pTask;
381 576 }
382 \end{verbatim}\normalsize 
383
384
385 \index{AliHLTTask@{Ali\-HLTTask}!FindTarget@{FindTarget}}
386 \index{FindTarget@{FindTarget}!AliHLTTask@{Ali\-HLTTask}}
387 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Ali\-HLTTask} $\ast$ Ali\-HLTTask::Find\-Target (const char $\ast$ {\em id})}\label{classAliHLTTask_a15}
388
389
390 Find a target with a certain id. Tasks which depend on the current task are referred to be {\em targets\/}. \begin{Desc}
391 \item[Parameters:]
392 \begin{description}
393 \item[{\em id}]configuration id to search for \end{description}
394 \end{Desc}
395 \begin{Desc}
396 \item[Returns:]pointer to task instance \end{Desc}
397
398
399 Definition at line 703 of file Ali\-HLTConfiguration.cxx.
400
401 References f\-List\-Targets.
402
403 Referenced by Set\-Target().
404
405 \footnotesize\begin{verbatim}704 {
406 705   // see header file for function documentation
407 706   AliHLTTask* pTask=NULL;
408 707   if (id) {
409 708     pTask=(AliHLTTask*)fListTargets.FindObject(id);
410 709   }
411 710   return pTask;
412 711 }
413 \end{verbatim}\normalsize 
414
415
416 \index{AliHLTTask@{Ali\-HLTTask}!FollowDependency@{FollowDependency}}
417 \index{FollowDependency@{FollowDependency}!AliHLTTask@{Ali\-HLTTask}}
418 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Ali\-HLTTask::Follow\-Dependency (const char $\ast$ {\em id}, TList $\ast$ {\em p\-Tgt\-List} = {\tt NULL})}\label{classAliHLTTask_a26}
419
420
421 Search task dependency list recursively to find a dependency. \begin{Desc}
422 \item[Parameters:]
423 \begin{description}
424 \item[{\em id}]id of the task to search for \item[{\em p\-Tgt\-List}](optional) target list to receive dependency tree \end{description}
425 \end{Desc}
426 \begin{Desc}
427 \item[Returns:]0 if not found, $>$0 found in the n-th level, dependency list in the target list \end{Desc}
428
429
430 Definition at line 578 of file Ali\-HLTConfiguration.cxx.
431
432 References f\-List\-Dependencies.
433
434 Referenced by Print\-Dependency\-Tree().
435
436 \footnotesize\begin{verbatim}579 {
437 580   // see header file for function documentation
438 581   int iResult=0;
439 582   if (id) {
440 583     AliHLTTask* pDep=NULL;
441 584     if ((pDep=(AliHLTTask*)fListDependencies.FindObject(id))!=NULL) {
442 585       if (pTgtList) pTgtList->Add(pDep);
443 586       iResult++;
444 587     } else {
445 588       TObjLink* lnk=fListDependencies.FirstLink();
446 589       while (lnk && iResult==0) {
447 590         pDep=(AliHLTTask*)lnk->GetObject();
448 591         if (pDep) {
449 592           if ((iResult=pDep->FollowDependency(id, pTgtList))>0) {
450 593             if (pTgtList) pTgtList->AddFirst(pDep);
451 594             iResult++;
452 595           }
453 596         } else {
454 597           iResult=-EFAULT;
455 598         }
456 599         lnk=lnk->Next();
457 600       }
458 601     }
459 602   } else {
460 603     iResult=-EINVAL;
461 604   }
462 605   return iResult;
463 606 }
464 \end{verbatim}\normalsize 
465
466
467 \index{AliHLTTask@{Ali\-HLTTask}!GetComponent@{GetComponent}}
468 \index{GetComponent@{GetComponent}!AliHLTTask@{Ali\-HLTTask}}
469 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Ali\-HLTComponent} $\ast$ Ali\-HLTTask::Get\-Component () const}\label{classAliHLTTask_a9}
470
471
472 Return pointer to component, which the task internally holds. {\bf Never delete this object!!!} \begin{Desc}
473 \item[Returns:]instance of the component \end{Desc}
474
475
476 Definition at line 562 of file Ali\-HLTConfiguration.cxx.
477
478 Referenced by Deinit(), Get\-Nof\-Matching\-Data\-Blocks(), Get\-Nof\-Matching\-Data\-Types(), Ali\-HLTSystem::Init\-Benchmarking(), Print\-Status(), Process\-Task(), Release(), Start\-Run(), and Subscribe().
479
480 \footnotesize\begin{verbatim}563 {
481 564   // see header file for function documentation
482 565   return fpComponent;
483 566 }
484 \end{verbatim}\normalsize 
485
486
487 \index{AliHLTTask@{Ali\-HLTTask}!GetConf@{GetConf}}
488 \index{GetConf@{GetConf}!AliHLTTask@{Ali\-HLTTask}}
489 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Ali\-HLTConfiguration} $\ast$ Ali\-HLTTask::Get\-Conf () const}\label{classAliHLTTask_a8}
490
491
492 Return pointer to configuration. The tasks holds internally the configuration object. \begin{Desc}
493 \item[Returns:]pointer to configuration \end{Desc}
494
495
496 Definition at line 556 of file Ali\-HLTConfiguration.cxx.
497
498 Referenced by Ali\-HLTSystem::Build\-Task\-List().
499
500 \footnotesize\begin{verbatim}557 {
501 558   // see header file for function documentation
502 559   return fpConfiguration;
503 560 }
504 \end{verbatim}\normalsize 
505
506
507 \index{AliHLTTask@{Ali\-HLTTask}!GetName@{GetName}}
508 \index{GetName@{GetName}!AliHLTTask@{Ali\-HLTTask}}
509 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}const char $\ast$ Ali\-HLTTask::Get\-Name () const}\label{classAliHLTTask_a7}
510
511
512 Get the name of the object. This is an overridden TObject function in order to return the configuration name instead of the class name. Enables use of TList standard functions. \begin{Desc}
513 \item[Returns:]name of the configuration \end{Desc}
514
515
516 Definition at line 548 of file Ali\-HLTConfiguration.cxx.
517
518 References fp\-Configuration, and Ali\-HLTConfiguration::Get\-Name().
519
520 Referenced by Ali\-HLTSystem::Build\-Task\-List(), Deinit(), Depends(), End\-Run(), Init(), Ali\-HLTSystem::Insert\-Task(), Print\-Dependency\-Tree(), Print\-Status(), Process\-Task(), Ali\-HLTSystem::Process\-Tasks(), Set\-Dependency(), Set\-Target(), and Start\-Run().
521
522 \footnotesize\begin{verbatim}549 {
523 550   // see header file for function documentation
524 551   if (fpConfiguration)
525 552     return fpConfiguration->GetName();
526 553   return TObject::GetName();
527 554 }
528 \end{verbatim}\normalsize 
529
530
531 \index{AliHLTTask@{Ali\-HLTTask}!GetNofMatchingDataBlocks@{GetNofMatchingDataBlocks}}
532 \index{GetNofMatchingDataBlocks@{GetNofMatchingDataBlocks}!AliHLTTask@{Ali\-HLTTask}}
533 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Ali\-HLTTask::Get\-Nof\-Matching\-Data\-Blocks (const {\bf Ali\-HLTTask} $\ast$ {\em p\-Consumer\-Task}) const}\label{classAliHLTTask_a21}
534
535
536 Determine the number of matching data block between the component and the data buffer of a consumer component. It checks which data types from the list of input data types of the consumer component can be provided by data blocks of the current component. \begin{Desc}
537 \item[Parameters:]
538 \begin{description}
539 \item[{\em p\-Consumer\-Task}]the task which subscribes to the data \end{description}
540 \end{Desc}
541 \begin{Desc}
542 \item[Returns:]number of matching data blocks \end{Desc}
543
544
545 Definition at line 959 of file Ali\-HLTConfiguration.cxx.
546
547 References Ali\-HLTData\-Buffer::Find\-Matching\-Data\-Blocks(), fp\-Data\-Buffer, Get\-Component(), and HLTFatal.
548
549 Referenced by Process\-Task().
550
551 \footnotesize\begin{verbatim}960 {
552 961   // see header file for function documentation
553 962   int iResult=0;
554 963   if (pConsumerTask) {
555 964     if (fpDataBuffer) {
556 965       iResult=fpDataBuffer->FindMatchingDataBlocks(pConsumerTask->GetComponent(), NULL);
557 966     } else {
558 967       HLTFatal("internal data buffer missing");
559 968       iResult=-EFAULT;
560 969     }
561 970   } else {
562 971     iResult=-EINVAL;
563 972   }
564 973   return iResult;
565 974 }
566 \end{verbatim}\normalsize 
567
568
569 \index{AliHLTTask@{Ali\-HLTTask}!GetNofMatchingDataTypes@{GetNofMatchingDataTypes}}
570 \index{GetNofMatchingDataTypes@{GetNofMatchingDataTypes}!AliHLTTask@{Ali\-HLTTask}}
571 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Ali\-HLTTask::Get\-Nof\-Matching\-Data\-Types (const {\bf Ali\-HLTTask} $\ast$ {\em p\-Consumer\-Task}) const}\label{classAliHLTTask_a22}
572
573
574 Determine the number of matching data types between the component and a consumer component. It checks which data types from the list of input data types of the consumer component can be provided by the current component. \begin{Desc}
575 \item[Parameters:]
576 \begin{description}
577 \item[{\em p\-Consumer\-Task}]the task which subscribes to the data \end{description}
578 \end{Desc}
579 \begin{Desc}
580 \item[Returns:]number of matching data types \end{Desc}
581
582
583 Definition at line 976 of file Ali\-HLTConfiguration.cxx.
584
585 References Ali\-HLTComponent::Find\-Matching\-Data\-Types(), Get\-Component(), HLTError, and HLTFatal.
586
587 Referenced by Start\-Run().
588
589 \footnotesize\begin{verbatim}977 {
590 978   // see header file for function documentation
591 979   int iResult=0;
592 980   if (pConsumerTask) {
593 981     AliHLTComponent* pComponent=GetComponent();
594 982     if (!pComponent) {
595 983       // init ?
596 984       HLTError("component not initialized");
597 985       iResult=-EFAULT;
598 986     }
599 987     if (pComponent) {
600 988       iResult=pComponent->FindMatchingDataTypes(pConsumerTask->GetComponent(), NULL);
601 989     } else {
602 990       HLTFatal("task initialization failed");
603 991       iResult=-EFAULT;
604 992     }
605 993   } else {
606 994     iResult=-EINVAL;
607 995   }
608 996   return iResult;
609 997 }
610 \end{verbatim}\normalsize 
611
612
613 \index{AliHLTTask@{Ali\-HLTTask}!GetNofSources@{GetNofSources}}
614 \index{GetNofSources@{GetNofSources}!AliHLTTask@{Ali\-HLTTask}}
615 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Ali\-HLTTask::Get\-Nof\-Sources () const\hspace{0.3cm}{\tt  [inline]}}\label{classAliHLTTask_a28}
616
617
618 Get number of source tasks. \begin{Desc}
619 \item[Returns:]number of source tasks \end{Desc}
620
621
622 Definition at line 269 of file Ali\-HLTTask.h.
623
624 References f\-List\-Dependencies.
625
626 \footnotesize\begin{verbatim}269 {return fListDependencies.GetSize();}
627 \end{verbatim}\normalsize 
628
629
630 \index{AliHLTTask@{Ali\-HLTTask}!Init@{Init}}
631 \index{Init@{Init}!AliHLTTask@{Ali\-HLTTask}}
632 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Ali\-HLTTask::Init ({\bf Ali\-HLTConfiguration} $\ast$ {\em p\-Conf}, {\bf Ali\-HLTComponent\-Handler} $\ast$ {\em p\-CH})}\label{classAliHLTTask_a5}
633
634
635 Initialize the task. The task is initialized with a configuration descriptor. It needs a component handler instance to create the analysis component. The component is created and initialized. \begin{Desc}
636 \item[Parameters:]
637 \begin{description}
638 \item[{\em p\-Conf}]pointer to configuration descriptor, can be NULL if it was already provided to the constructor \item[{\em p\-CH}]the HLT component handler \end{description}
639 \end{Desc}
640
641
642 Definition at line 494 of file Ali\-HLTConfiguration.cxx.
643
644 References Ali\-HLTComponent\-Handler::Create\-Component(), fp\-Component, fp\-Configuration, Ali\-HLTConfiguration::Get\-Arguments(), Ali\-HLTConfiguration::Get\-Component\-ID(), Ali\-HLTConfiguration::Get\-Name(), Get\-Name(), HLTError, and HLTWarning.
645
646 Referenced by Ali\-HLTSystem::Init\-Tasks().
647
648 \footnotesize\begin{verbatim}495 {
649 496   // see header file for function documentation
650 497   int iResult=0;
651 498   if (fpConfiguration!=NULL && pConf!=NULL && fpConfiguration!=pConf) {
652 499     HLTWarning("overriding existing reference to configuration object %p (%s) by %p",
653 500                fpConfiguration, GetName(), pConf);
654 501   }
655 502   if (pConf!=NULL) fpConfiguration=pConf;
656 503   if (fpConfiguration) {
657 504     if (pCH) {
658 505       int argc=0;
659 506       const char** argv=NULL;
660 507       if ((iResult=fpConfiguration->GetArguments(&argv))>=0) {
661 508         argc=iResult; // just to make it clear
662 509         // TODO: we have to think about the optional environment parameter,
663 510         // currently just set to NULL. 
664 511         iResult=pCH->CreateComponent(fpConfiguration->GetComponentID(), NULL, argc, argv, fpComponent);
665 512         if (fpComponent || iResult<=0) {
666 513           //HLTDebug("component %s (%p) created", fpComponent->GetComponentID(), fpComponent); 
667 514         } else {
668 515           HLTError("can not find component \"%s\" (%d)", fpConfiguration->GetComponentID(), iResult);
669 516         }
670 517       } else {
671 518         HLTError("can not get argument list for configuration %s (%s)", fpConfiguration->GetName(), fpConfiguration->GetComponentID());
672 519         iResult=-EINVAL;
673 520       }
674 521     } else {
675 522       HLTError("component handler instance needed for task initialization");
676 523       iResult=-EINVAL;
677 524     }
678 525   } else {
679 526     HLTError("configuration object instance needed for task initialization");
680 527     iResult=-EINVAL;
681 528   }
682 529   return iResult;
683 530 }
684 \end{verbatim}\normalsize 
685
686
687 \index{AliHLTTask@{Ali\-HLTTask}!operator=@{operator=}}
688 \index{operator=@{operator=}!AliHLTTask@{Ali\-HLTTask}}
689 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Ali\-HLTTask} \& Ali\-HLTTask::operator= (const {\bf Ali\-HLTTask} \&)}\label{classAliHLTTask_a3}
690
691
692 not a valid assignment op, but defined according to effective C++ style 
693
694 Definition at line 464 of file Ali\-HLTConfiguration.cxx.
695
696 References HLTFatal.
697
698 \footnotesize\begin{verbatim}465 { 
699 466   // see header file for function documentation
700 467   HLTFatal("assignment operator untested");
701 468   return *this;
702 469 }
703 \end{verbatim}\normalsize 
704
705
706 \index{AliHLTTask@{Ali\-HLTTask}!PrintDependencyTree@{PrintDependencyTree}}
707 \index{PrintDependencyTree@{PrintDependencyTree}!AliHLTTask@{Ali\-HLTTask}}
708 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Ali\-HLTTask::Print\-Dependency\-Tree (const char $\ast$ {\em id}, int {\em b\-Mode} = {\tt 0})}\label{classAliHLTTask_a27}
709
710
711 Print the tree for a certain dependency either from the task or configuration list. Each task posseses two \char`\"{}link lists\char`\"{}: The configurations are the origin of the task list. In case of an error during the built of the task list, the dependencies for the task list might be incomplete. In this case the configurations can give infomation on the error reason. \begin{Desc}
712 \item[Parameters:]
713 \begin{description}
714 \item[{\em id}]id of the dependency to search for \item[{\em b\-Mode}]0 (default) from task dependency list, \par
715  1 from configuration list \end{description}
716 \end{Desc}
717
718
719 Definition at line 608 of file Ali\-HLTConfiguration.cxx.
720
721 References Follow\-Dependency(), Ali\-HLTConfiguration::Follow\-Dependency(), fp\-Configuration, Get\-Name(), HLTLog\-Keyword, and HLTMessage.
722
723 Referenced by Ali\-HLTSystem::Build\-Task\-List().
724
725 \footnotesize\begin{verbatim}609 {
726 610   // see header file for function documentation
727 611   HLTLogKeyword("task dependencies");
728 612   int iResult=0;
729 613   TList tgtList;
730 614   if (bFromConfiguration) {
731 615     if (fpConfiguration)
732 616       iResult=fpConfiguration->FollowDependency(id, &tgtList);
733 617     else
734 618       iResult=-EFAULT;
735 619   } else
736 620     iResult=FollowDependency(id, &tgtList);
737 621   if (iResult>0) {
738 622     HLTMessage("     task \"%s\": dependency level %d ", GetName(), iResult);
739 623     TObjLink* lnk=tgtList.FirstLink();
740 624     int i=iResult;
741 625     char* pSpace = new char[iResult+1];
742 626     if (pSpace) {
743 627       memset(pSpace, 32, iResult);
744 628       pSpace[i]=0;
745 629       while (lnk) {
746 630         TObject* obj=lnk->GetObject();
747 631         HLTMessage("     %s^-- %s ", &pSpace[i--], obj->GetName());
748 632         lnk=lnk->Next();
749 633       }
750 634       delete [] pSpace;
751 635     } else {
752 636       iResult=-ENOMEM;
753 637     }
754 638   }
755 639 }
756 \end{verbatim}\normalsize 
757
758
759 \index{AliHLTTask@{Ali\-HLTTask}!PrintStatus@{PrintStatus}}
760 \index{PrintStatus@{PrintStatus}!AliHLTTask@{Ali\-HLTTask}}
761 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Ali\-HLTTask::Print\-Status ()}\label{classAliHLTTask_a25}
762
763
764 Print the status of the task with component, dependencies and targets. 
765
766 Definition at line 1033 of file Ali\-HLTConfiguration.cxx.
767
768 References Find\-Dependency(), f\-List\-Targets, fp\-Configuration, Get\-Component(), Ali\-HLTComponent::Get\-Component\-ID(), Ali\-HLTConfiguration::Get\-First\-Source(), Get\-Name(), Ali\-HLTConfiguration::Get\-Name(), Ali\-HLTConfiguration::Get\-Next\-Source(), HLTLog\-Keyword, and HLTMessage.
769
770 Referenced by Ali\-HLTSystem::Print\-Task\-List().
771
772 \footnotesize\begin{verbatim}1034 {
773 1035   // see header file for function documentation
774 1036   HLTLogKeyword("task properties");
775 1037   AliHLTComponent* pComponent=GetComponent();
776 1038   if (pComponent) {
777 1039     HLTMessage("     component: %s (%p)", pComponent->GetComponentID(), pComponent);
778 1040   } else {
779 1041     HLTMessage("     no component set!");
780 1042   }
781 1043   if (fpConfiguration) {
782 1044     AliHLTConfiguration* pSrc=fpConfiguration->GetFirstSource();
783 1045     while (pSrc) {
784 1046       const char* pQualifier="unresolved";
785 1047       if (FindDependency(pSrc->GetName()))
786 1048         pQualifier="resolved";
787 1049       HLTMessage("     source: %s (%s)", pSrc->GetName(), pQualifier);
788 1050       pSrc=fpConfiguration->GetNextSource();
789 1051     }
790 1052     TObjLink* lnk = fListTargets.FirstLink();
791 1053     while (lnk) {
792 1054       TObject *obj = lnk->GetObject();
793 1055       HLTMessage("     target: %s", obj->GetName());
794 1056       lnk = lnk->Next();
795 1057     }
796 1058   } else {
797 1059     HLTMessage("     task \"%s\" not initialized", GetName());
798 1060   }
799 1061 }
800 \end{verbatim}\normalsize 
801
802
803 \index{AliHLTTask@{Ali\-HLTTask}!ProcessTask@{ProcessTask}}
804 \index{ProcessTask@{ProcessTask}!AliHLTTask@{Ali\-HLTTask}}
805 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Ali\-HLTTask::Process\-Task (Int\_\-t {\em event\-No})}\label{classAliHLTTask_a20}
806
807
808 Process the task. If all dependencies are resolved the tasks subscribes to the data of all source tasks, builds the block descriptor and calls the {\bf Ali\-HLTComponent::Process\-Event}{\rm (p.\,\pageref{classAliHLTComponent_a6})} method of the component, after processing, the data blocks are released. \par
809  The {\bf Start\-Run}{\rm (p.\,\pageref{classAliHLTTask_a18})} method must be called before. 
810
811 Definition at line 831 of file Ali\-HLTConfiguration.cxx.
812
813 References Ali\-HLTUInt32\_\-t, Ali\-HLTUInt8\_\-t, Ali\-HLTComponent\-Event\-Data::f\-Block\-Cnt, f\-Block\-Data\-Array\-Size, Ali\-HLTComponent\-Event\-Data::f\-Event\-ID, Ali\-HLTComponent::Fill\-Event\-Data(), f\-List\-Dependencies, fp\-Block\-Data\-Array, fp\-Component, fp\-Data\-Buffer, Ali\-HLTComponent\-Block\-Data::f\-Size, Get\-Component(), Ali\-HLTComponent::Get\-Component\-ID(), Ali\-HLTComponent::Get\-Component\-Type(), Get\-Name(), Get\-Nof\-Matching\-Data\-Blocks(), Ali\-HLTComponent::Get\-Output\-Data\-Size(), Ali\-HLTData\-Buffer::Get\-Target\-Buffer(), HLTDebug, HLTError, HLTFatal, Ali\-HLTComponent::Process\-Event(), Release(), Ali\-HLTData\-Buffer::Reset(), Ali\-HLTData\-Buffer::Set\-Segments(), and Subscribe().
814
815 Referenced by Ali\-HLTSystem::Process\-Tasks().
816
817 \footnotesize\begin{verbatim}832 {
818 833   // see header file for function documentation
819 834   int iResult=0;
820 835   AliHLTComponent* pComponent=GetComponent();
821 836   if (pComponent && fpDataBuffer) {
822 837     HLTDebug("Processing task %s (%p) fpDataBuffer %p", GetName(), this, fpDataBuffer);
823 838     fpDataBuffer->Reset();
824 839     int iSourceDataBlock=0;
825 840     int iInputDataVolume=0;
826 841 
827 842     int iNofInputDataBlocks=0;
828 843     /* TODO: the assumption of only one output data type per component is the current constraint
829 844      * later it should be checked how many output blocks of the source component match the input
830 845      * data types of the consumer component (GetNofMatchingDataBlocks). If one assumes that a
831 846      * certain output block is always been produced, the initialization could be done in the
832 847      * StartRun. Otherwise the fpBlockDataArray has to be adapted each time.
833 848      */
834 849     iNofInputDataBlocks=fListDependencies.GetSize(); // one block per source
835 850     // is not been used since the allocation was done in StartRun, but check the size
836 851     if (iNofInputDataBlocks>fBlockDataArraySize) {
837 852       HLTError("block data array too small");
838 853     }
839 854 
840 855     AliHLTTask* pSrcTask=NULL;
841 856     TList subscribedTaskList;
842 857     TObjLink* lnk=fListDependencies.FirstLink();
843 858 
844 859     // subscribe to all source tasks
845 860     while (lnk && iResult>=0) {
846 861       pSrcTask=(AliHLTTask*)lnk->GetObject();
847 862       if (pSrcTask) {
848 863         int iMatchingDB=pSrcTask->GetNofMatchingDataBlocks(this);
849 864         if (iMatchingDB<=fBlockDataArraySize-iSourceDataBlock) {
850 865           if (fpBlockDataArray) {
851 866           if ((iResult=pSrcTask->Subscribe(this, &fpBlockDataArray[iSourceDataBlock],fBlockDataArraySize-iSourceDataBlock))>0) {
852 867             for (int i=0; i<iResult; i++) {
853 868               iInputDataVolume+=fpBlockDataArray[i+iSourceDataBlock].fSize;
854 869               // put the source task as many times into the list as it provides data blocks
855 870               // makes the bookkeeping for the data release easier
856 871               subscribedTaskList.Add(pSrcTask);
857 872             }
858 873             iSourceDataBlock+=iResult;
859 874             HLTDebug("Task %s (%p) successfully subscribed to %d data block(s) of task %s (%p)", GetName(), this, iResult, pSrcTask->GetName(), pSrcTask);
860 875             iResult=0;
861 876           } else {
862 877             HLTError("Task %s (%p): subscription to task %s (%p) failed with error %d", GetName(), this, pSrcTask->GetName(), pSrcTask, iResult);
863 878             iResult=-EFAULT;
864 879           }
865 880           } else {
866 881             HLTFatal("Task %s (%p): BlockData array not allocated", GetName(), this);
867 882             iResult=-EFAULT;
868 883           }
869 884         } else {
870 885           HLTFatal("Task %s (%p): too little space in data block array for subscription to task %s (%p)", GetName(), this, pSrcTask->GetName(), pSrcTask);
871 886           HLTDebug("#data types=%d, array size=%d, current index=%d", iMatchingDB, fBlockDataArraySize, iSourceDataBlock);
872 887           iResult=-EFAULT;
873 888         }
874 889       } else {
875 890         HLTFatal("fatal internal error in ROOT list handling");
876 891         iResult=-EFAULT;
877 892       }
878 893       lnk=lnk->Next();
879 894     }
880 895 
881 896     // process the event
882 897     if (iResult>=0) {
883 898       long unsigned int iConstBase=0;
884 899       double fInputMultiplier=0;
885 900       if (pComponent->GetComponentType()!=AliHLTComponent::kSink)
886 901         pComponent->GetOutputDataSize(iConstBase, fInputMultiplier);
887 902       int iOutputDataSize=int(fInputMultiplier*iInputDataVolume) + iConstBase;
888 903       //HLTDebug("task %s: reqired output size %d", GetName(), iOutputDataSize);
889 904       AliHLTUInt8_t* pTgtBuffer=NULL;
890 905       if (iOutputDataSize>0) pTgtBuffer=fpDataBuffer->GetTargetBuffer(iOutputDataSize);
891 906       //HLTDebug("provided raw buffer %p", pTgtBuffer);
892 907       AliHLTComponentEventData evtData;
893 908       AliHLTComponent::FillEventData(evtData);
894 909       evtData.fEventID=(AliHLTEventID_t)eventNo;
895 910       evtData.fBlockCnt=iSourceDataBlock;
896 911       AliHLTComponentTriggerData trigData;
897 912       AliHLTUInt32_t size=iOutputDataSize;
898 913       AliHLTUInt32_t outputBlockCnt=0;
899 914       AliHLTComponentBlockData* outputBlocks=NULL;
900 915       AliHLTComponentEventDoneData* edd;
901 916       if (pTgtBuffer!=NULL || iOutputDataSize==0) {
902 917         iResult=pComponent->ProcessEvent(evtData, fpBlockDataArray, trigData, pTgtBuffer, size, outputBlockCnt, outputBlocks, edd);
903 918         HLTDebug("task %s: component %s ProcessEvent finnished (%d): size=%d blocks=%d", GetName(), pComponent->GetComponentID(), iResult, size, outputBlockCnt);
904 919         if (iResult>=0 && pTgtBuffer) {
905 920           iResult=fpDataBuffer->SetSegments(pTgtBuffer, outputBlocks, outputBlockCnt);
906 921           delete [] outputBlocks; outputBlocks=NULL; outputBlockCnt=0;
907 922         }
908 923       } else {
909 924         HLTError("task %s: no target buffer available", GetName());
910 925         iResult=-EFAULT;
911 926       }
912 927     }
913 928 
914 929     // now release all buffers which we have subscribed to
915 930     iSourceDataBlock=0;
916 931     lnk=subscribedTaskList.FirstLink();
917 932     while (lnk) {
918 933       pSrcTask=(AliHLTTask*)lnk->GetObject();
919 934       if (pSrcTask) {
920 935         int iTempRes=0;
921 936         if ((iTempRes=pSrcTask->Release(&fpBlockDataArray[iSourceDataBlock], this))>=0) {
922 937           HLTDebug("Task %s (%p) successfully released task %s (%p)", GetName(), this, pSrcTask->GetName(), pSrcTask);
923 938         } else {
924 939           HLTError("Task %s (%p): realease of task %s (%p) failed with error %d", GetName(), this, pSrcTask->GetName(), pSrcTask, iTempRes);
925 940         }
926 941       } else {
927 942         HLTFatal("task %s (%p): internal error in ROOT list handling", GetName(), this);
928 943         if (iResult>=0) iResult=-EFAULT;
929 944       }
930 945       subscribedTaskList.Remove(lnk);
931 946       lnk=subscribedTaskList.FirstLink();
932 947       iSourceDataBlock++;
933 948     }
934 949     if (subscribedTaskList.GetSize()>0) {
935 950       HLTError("task %s (%p): could not release all data buffers", GetName(), this);
936 951     }
937 952   } else {
938 953     HLTError("task %s (%p): internal failure (not initialized component %p, data buffer %p)", GetName(), this, fpComponent, fpDataBuffer);
939 954     iResult=-EFAULT;
940 955   }
941 956   return iResult;
942 957 }
943 \end{verbatim}\normalsize 
944
945
946 \index{AliHLTTask@{Ali\-HLTTask}!Release@{Release}}
947 \index{Release@{Release}!AliHLTTask@{Ali\-HLTTask}}
948 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Ali\-HLTTask::Release ({\bf Ali\-HLTComponent\-Block\-Data} $\ast$ {\em p\-Block\-Desc}, const {\bf Ali\-HLTTask} $\ast$ {\em p\-Consumer\-Task})}\label{classAliHLTTask_a24}
949
950
951 Release a block descriptor. Notification from consumer task. \begin{Desc}
952 \item[Parameters:]
953 \begin{description}
954 \item[{\em p\-Block\-Desc}]descriptor of the data segment \item[{\em p\-Consumer\-Task}]the task which subscribed to the data \end{description}
955 \end{Desc}
956 \begin{Desc}
957 \item[Returns:]: $>$0 if success, negative error code if failed \end{Desc}
958
959
960 Definition at line 1016 of file Ali\-HLTConfiguration.cxx.
961
962 References fp\-Data\-Buffer, Get\-Component(), HLTFatal, and Ali\-HLTData\-Buffer::Release().
963
964 Referenced by Process\-Task().
965
966 \footnotesize\begin{verbatim}1017 {
967 1018   // see header file for function documentation
968 1019   int iResult=0;
969 1020   if (pConsumerTask && pBlockDesc) {
970 1021     if (fpDataBuffer) {
971 1022       iResult=fpDataBuffer->Release(pBlockDesc, pConsumerTask->GetComponent());
972 1023     } else {
973 1024       HLTFatal("internal data buffer missing");
974 1025       iResult=-EFAULT;
975 1026     }
976 1027   } else {
977 1028     iResult=-EINVAL;
978 1029   }
979 1030   return iResult;
980 1031 }
981 \end{verbatim}\normalsize 
982
983
984 \index{AliHLTTask@{Ali\-HLTTask}!SetDependency@{SetDependency}}
985 \index{SetDependency@{SetDependency}!AliHLTTask@{Ali\-HLTTask}}
986 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Ali\-HLTTask::Set\-Dependency ({\bf Ali\-HLTTask} $\ast$ {\em p\-Dep})}\label{classAliHLTTask_a11}
987
988
989 Add a dependency for the task. The task maintains a list of other tasks it depends on. \begin{Desc}
990 \item[Parameters:]
991 \begin{description}
992 \item[{\em p\-Dep}]pointer to a task descriptor \end{description}
993 \end{Desc}
994 \begin{Desc}
995 \item[Returns:]0 if suceeded, neg error code if failed \par
996  -EEXIST : the dependencie exists already \end{Desc}
997
998
999 Definition at line 641 of file Ali\-HLTConfiguration.cxx.
1000
1001 References Find\-Dependency(), f\-List\-Dependencies, and Get\-Name().
1002
1003 Referenced by Ali\-HLTSystem::Insert\-Task().
1004
1005 \footnotesize\begin{verbatim}642 {
1006 643   // see header file for function documentation
1007 644   int iResult=0;
1008 645   if (pDep) {
1009 646     if (FindDependency(pDep->GetName())==NULL) {
1010 647       fListDependencies.Add(pDep);
1011 648     } else {
1012 649       iResult=-EEXIST;
1013 650     }
1014 651   } else {
1015 652     iResult=-EINVAL;
1016 653   }
1017 654   return iResult;
1018 655 }
1019 \end{verbatim}\normalsize 
1020
1021
1022 \index{AliHLTTask@{Ali\-HLTTask}!SetTarget@{SetTarget}}
1023 \index{SetTarget@{SetTarget}!AliHLTTask@{Ali\-HLTTask}}
1024 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Ali\-HLTTask::Set\-Target ({\bf Ali\-HLTTask} $\ast$ {\em p\-Dep})}\label{classAliHLTTask_a16}
1025
1026
1027 Insert task into target list. The target list specifies all the tasks which depend on the current task. \begin{Desc}
1028 \item[Parameters:]
1029 \begin{description}
1030 \item[{\em p\-Dep}]pointer task object \end{description}
1031 \end{Desc}
1032 \begin{Desc}
1033 \item[Returns:]$>$=0 if succeeded, neg. error code if failed \end{Desc}
1034
1035
1036 Definition at line 713 of file Ali\-HLTConfiguration.cxx.
1037
1038 References Find\-Target(), f\-List\-Targets, and Get\-Name().
1039
1040 Referenced by Ali\-HLTSystem::Insert\-Task().
1041
1042 \footnotesize\begin{verbatim}714 {
1043 715   // see header file for function documentation
1044 716   int iResult=0;
1045 717   if (pTgt) {
1046 718     if (FindTarget(pTgt->GetName())==NULL) {
1047 719       fListTargets.Add(pTgt);
1048 720     } else {
1049 721       iResult=-EEXIST;
1050 722     }
1051 723   } else {
1052 724     iResult=-EINVAL;
1053 725   }
1054 726   return iResult;
1055 727 }
1056 \end{verbatim}\normalsize 
1057
1058
1059 \index{AliHLTTask@{Ali\-HLTTask}!StartRun@{StartRun}}
1060 \index{StartRun@{StartRun}!AliHLTTask@{Ali\-HLTTask}}
1061 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Ali\-HLTTask::Start\-Run ()}\label{classAliHLTTask_a18}
1062
1063
1064 Prepare the task for event processing. The method initializes the Data Buffer and calls the {\bf Ali\-HLTComponent::Init}{\rm (p.\,\pageref{classAliHLTComponent_a4})} method of the component.\par
1065  The {\bf Process\-Task}{\rm (p.\,\pageref{classAliHLTTask_a20})} method can be called an arbitrary number of times as soon as the task is in {\em running\/} mode. 
1066
1067 Definition at line 735 of file Ali\-HLTConfiguration.cxx.
1068
1069 References f\-Block\-Data\-Array\-Size, f\-List\-Dependencies, f\-List\-Targets, fp\-Block\-Data\-Array, fp\-Data\-Buffer, Get\-Component(), Get\-Name(), Get\-Nof\-Matching\-Data\-Types(), HLTDebug, HLTError, HLTFatal, HLTWarning, and Ali\-HLTData\-Buffer::Set\-Consumer().
1070
1071 Referenced by Ali\-HLTSystem::Start\-Tasks().
1072
1073 \footnotesize\begin{verbatim}736 {
1074 737   // see header file for function documentation
1075 738   int iResult=0;
1076 739   int iNofInputDataBlocks=0;
1077 740   AliHLTComponent* pComponent=GetComponent();
1078 741   if (pComponent) {
1079 742     // determine the number of input data blocks provided from the source tasks
1080 743     TObjLink* lnk=fListDependencies.FirstLink();
1081 744     while (lnk && iResult>=0) {
1082 745       AliHLTTask* pSrcTask=(AliHLTTask*)lnk->GetObject();
1083 746       if (pSrcTask) {
1084 747         if ((iResult=pSrcTask->GetNofMatchingDataTypes(this))>0) {
1085 748           iNofInputDataBlocks+=iResult;
1086 749         } else if (iResult==0) {
1087 750           HLTWarning("source task %s (%p) does not provide any matching data type for task %s (%p)", pSrcTask->GetName(), pSrcTask, GetName(), this);
1088 751         } else {
1089 752           HLTError("task %s (%p): error getting matching data types for source task %s (%p)", GetName(), this, pSrcTask->GetName(), pSrcTask);
1090 753           iResult=-EFAULT;
1091 754         }
1092 755       }
1093 756       lnk=lnk->Next();
1094 757     }
1095 758     if (iResult>=0) {
1096 759       if (fpBlockDataArray) {
1097 760         HLTWarning("block data array for task %s (%p) was not cleaned", GetName(), this);
1098 761         delete [] fpBlockDataArray;
1099 762         fpBlockDataArray=NULL;
1100 763         fBlockDataArraySize=0;
1101 764       }
1102 765 
1103 766       // component init
1104 767       // the initialization of the component is done by the ComponentHandler after creation
1105 768       // of the component.
1106 769       //iResult=Init( AliHLTComponentEnvironment* environ, void* environ_param, int argc, const char** argv );
1107 770 
1108 771       // allocate internal task variables for bookkeeping aso.
1109 772       // we allocate the BlockData array with at least one member
1110 773       if (iNofInputDataBlocks==0) iNofInputDataBlocks=1;
1111 774       fpBlockDataArray=new AliHLTComponentBlockData[iNofInputDataBlocks];
1112 775       if (fpBlockDataArray) {
1113 776         fBlockDataArraySize=iNofInputDataBlocks;
1114 777       } else {
1115 778         HLTError("memory allocation failed");
1116 779         iResult=-ENOMEM;
1117 780       }
1118 781 
1119 782       // allocate the data buffer, which controls the output buffer and subscriptions
1120 783       if (iResult>=0) {
1121 784         fpDataBuffer=new AliHLTDataBuffer;
1122 785         if (fpDataBuffer!=NULL) {
1123 786           HLTDebug("created data buffer %p for task %s (%p)", fpDataBuffer, GetName(), this);
1124 787           TObjLink* lnk=fListTargets.FirstLink();
1125 788           while (lnk && iResult>=0) {
1126 789             AliHLTTask* pTgtTask=(AliHLTTask*)lnk->GetObject();
1127 790             if (pTgtTask) {
1128 791               if ((iResult=fpDataBuffer->SetConsumer(pTgtTask->GetComponent()))>=0) {
1129 792               }
1130 793             } else {
1131 794               break;
1132 795               iResult=-EFAULT;
1133 796             }
1134 797             lnk=lnk->Next();
1135 798           }
1136 799         } else {
1137 800           HLTFatal("can not create data buffer object, memory allocation failed");
1138 801           iResult=-ENOMEM;
1139 802         }
1140 803       }
1141 804     }
1142 805   } else {
1143 806     HLTError("task %s (%p) does not have a component", GetName(), this);
1144 807     iResult=-EFAULT;
1145 808   }
1146 809   return iResult;
1147 810 }
1148 \end{verbatim}\normalsize 
1149
1150
1151 \index{AliHLTTask@{Ali\-HLTTask}!Subscribe@{Subscribe}}
1152 \index{Subscribe@{Subscribe}!AliHLTTask@{Ali\-HLTTask}}
1153 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Ali\-HLTTask::Subscribe (const {\bf Ali\-HLTTask} $\ast$ {\em p\-Consumer\-Task}, {\bf Ali\-HLTComponent\-Block\-Data} $\ast$ {\em array\-Block\-Desc}, int {\em i\-Array\-Size})}\label{classAliHLTTask_a23}
1154
1155
1156 Subscribe to the data of a source task. The function prepares the block descriptors for subsequent use with the {\bf Ali\-HLTComponent::Process\-Event}{\rm (p.\,\pageref{classAliHLTComponent_a6})} method, the method prepares all block descriptors which match the input data type of the consumer the function returns the number of blocks which would be prepared in case the target array is big enough. \begin{Desc}
1157 \item[Parameters:]
1158 \begin{description}
1159 \item[{\em p\-Consumer\-Task}]the task which subscribes to the data \item[{\em array\-Block\-Desc}]pointer to block descriptor to be filled \item[{\em i\-Array\-Size}]size of the block descriptor array \end{description}
1160 \end{Desc}
1161 \begin{Desc}
1162 \item[Returns:]number of matching data blocks, negative error code if failed \end{Desc}
1163
1164
1165 Definition at line 999 of file Ali\-HLTConfiguration.cxx.
1166
1167 References fp\-Data\-Buffer, Get\-Component(), HLTFatal, and Ali\-HLTData\-Buffer::Subscribe().
1168
1169 Referenced by Process\-Task().
1170
1171 \footnotesize\begin{verbatim}1000 {
1172 1001   // see header file for function documentation
1173 1002   int iResult=0;
1174 1003   if (pConsumerTask) {
1175 1004     if (fpDataBuffer) {
1176 1005       iResult=fpDataBuffer->Subscribe(pConsumerTask->GetComponent(), pBlockDesc, iArraySize);
1177 1006     } else {
1178 1007       HLTFatal("internal data buffer missing");
1179 1008       iResult=-EFAULT;
1180 1009     }
1181 1010   } else {
1182 1011     iResult=-EINVAL;
1183 1012   }
1184 1013   return iResult;
1185 1014 }
1186 \end{verbatim}\normalsize 
1187
1188
1189 \index{AliHLTTask@{Ali\-HLTTask}!UnsetDependency@{UnsetDependency}}
1190 \index{UnsetDependency@{UnsetDependency}!AliHLTTask@{Ali\-HLTTask}}
1191 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Ali\-HLTTask::Unset\-Dependency ({\bf Ali\-HLTTask} $\ast$ {\em p\-Dep})}\label{classAliHLTTask_a12}
1192
1193
1194 Clear a dependency. The ROOT TList touches the object which is in the list, even though it shouldn't care about. Thats why all lists have to be cleared before objects are deleted. 
1195
1196 Definition at line 657 of file Ali\-HLTConfiguration.cxx.
1197
1198 References f\-List\-Dependencies, fp\-Configuration, and Ali\-HLTConfiguration::Invalidate\-Sources().
1199
1200 Referenced by $\sim$Ali\-HLTTask().
1201
1202 \footnotesize\begin{verbatim}658 {
1203 659   fListDependencies.Remove(pDep);
1204 660   if (fpConfiguration) {
1205 661     fpConfiguration->InvalidateSources();
1206 662   }
1207 663   return 0;
1208 664 }
1209 \end{verbatim}\normalsize 
1210
1211
1212 \index{AliHLTTask@{Ali\-HLTTask}!UnsetTarget@{UnsetTarget}}
1213 \index{UnsetTarget@{UnsetTarget}!AliHLTTask@{Ali\-HLTTask}}
1214 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Ali\-HLTTask::Unset\-Target ({\bf Ali\-HLTTask} $\ast$ {\em p\-Target})}\label{classAliHLTTask_a17}
1215
1216
1217 Clear a target. The ROOT TList touches the object which is in the list, even though it shouldn't care about. Thats why all lists have to be cleared before objects are deleted. 
1218
1219 Definition at line 729 of file Ali\-HLTConfiguration.cxx.
1220
1221 References f\-List\-Targets.
1222
1223 Referenced by $\sim$Ali\-HLTTask().
1224
1225 \footnotesize\begin{verbatim}730 {
1226 731   fListTargets.Remove(pTarget);
1227 732   return 0;
1228 733 }
1229 \end{verbatim}\normalsize 
1230
1231
1232
1233
1234 \subsection{Member Data Documentation}
1235 \index{AliHLTTask@{Ali\-HLTTask}!fBlockDataArraySize@{fBlockDataArraySize}}
1236 \index{fBlockDataArraySize@{fBlockDataArraySize}!AliHLTTask@{Ali\-HLTTask}}
1237 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf Ali\-HLTTask::f\-Block\-Data\-Array\-Size}\hspace{0.3cm}{\tt  [private]}}\label{classAliHLTTask_r6}
1238
1239
1240 transient 
1241
1242 size of the block data array 
1243
1244 Definition at line 290 of file Ali\-HLTTask.h.
1245
1246 Referenced by End\-Run(), Process\-Task(), and Start\-Run().\index{AliHLTTask@{Ali\-HLTTask}!fListDependencies@{fListDependencies}}
1247 \index{fListDependencies@{fListDependencies}!AliHLTTask@{Ali\-HLTTask}}
1248 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}TList {\bf Ali\-HLTTask::f\-List\-Dependencies}\hspace{0.3cm}{\tt  [private]}}\label{classAliHLTTask_r4}
1249
1250
1251 the list of sources (tasks upon which the current one depends) 
1252
1253 Definition at line 281 of file Ali\-HLTTask.h.
1254
1255 Referenced by Find\-Dependency(), Follow\-Dependency(), Get\-Nof\-Sources(), Process\-Task(), Set\-Dependency(), Start\-Run(), Unset\-Dependency(), and $\sim$Ali\-HLTTask().\index{AliHLTTask@{Ali\-HLTTask}!fListTargets@{fListTargets}}
1256 \index{fListTargets@{fListTargets}!AliHLTTask@{Ali\-HLTTask}}
1257 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}TList {\bf Ali\-HLTTask::f\-List\-Targets}\hspace{0.3cm}{\tt  [private]}}\label{classAliHLTTask_r3}
1258
1259
1260 transient 
1261
1262 the list of targets (tasks which depend upon the current one) 
1263
1264 Definition at line 279 of file Ali\-HLTTask.h.
1265
1266 Referenced by Find\-Target(), Print\-Status(), Set\-Target(), Start\-Run(), Unset\-Target(), and $\sim$Ali\-HLTTask().\index{AliHLTTask@{Ali\-HLTTask}!fpBlockDataArray@{fpBlockDataArray}}
1267 \index{fpBlockDataArray@{fpBlockDataArray}!AliHLTTask@{Ali\-HLTTask}}
1268 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Ali\-HLTComponent\-Block\-Data}$\ast$ {\bf Ali\-HLTTask::fp\-Block\-Data\-Array}\hspace{0.3cm}{\tt  [private]}}\label{classAliHLTTask_r5}
1269
1270
1271 block data array to be passed as argument to the {\bf Ali\-HLTComponent::Process\-Event}{\rm (p.\,\pageref{classAliHLTComponent_a6})} method. Filled through subscription to source tasks ({\bf Subscribe}{\rm (p.\,\pageref{classAliHLTTask_a23})}). 
1272
1273 Definition at line 288 of file Ali\-HLTTask.h.
1274
1275 Referenced by End\-Run(), Process\-Task(), Start\-Run(), and $\sim$Ali\-HLTTask().\index{AliHLTTask@{Ali\-HLTTask}!fpComponent@{fpComponent}}
1276 \index{fpComponent@{fpComponent}!AliHLTTask@{Ali\-HLTTask}}
1277 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Ali\-HLTComponent}$\ast$ {\bf Ali\-HLTTask::fp\-Component}\hspace{0.3cm}{\tt  [private]}}\label{classAliHLTTask_r1}
1278
1279
1280 transient 
1281
1282 the component described by this task (created and deleted internally) 
1283
1284 Definition at line 275 of file Ali\-HLTTask.h.
1285
1286 Referenced by Deinit(), Init(), Process\-Task(), and $\sim$Ali\-HLTTask().\index{AliHLTTask@{Ali\-HLTTask}!fpConfiguration@{fpConfiguration}}
1287 \index{fpConfiguration@{fpConfiguration}!AliHLTTask@{Ali\-HLTTask}}
1288 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Ali\-HLTConfiguration}$\ast$ {\bf Ali\-HLTTask::fp\-Configuration}\hspace{0.3cm}{\tt  [private]}}\label{classAliHLTTask_r0}
1289
1290
1291 the configuration descriptor (external pointer) 
1292
1293 Definition at line 273 of file Ali\-HLTTask.h.
1294
1295 Referenced by Check\-Dependencies(), Depends(), Get\-Name(), Init(), Print\-Dependency\-Tree(), Print\-Status(), and Unset\-Dependency().\index{AliHLTTask@{Ali\-HLTTask}!fpDataBuffer@{fpDataBuffer}}
1296 \index{fpDataBuffer@{fpDataBuffer}!AliHLTTask@{Ali\-HLTTask}}
1297 \subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Ali\-HLTData\-Buffer}$\ast$ {\bf Ali\-HLTTask::fp\-Data\-Buffer}\hspace{0.3cm}{\tt  [private]}}\label{classAliHLTTask_r2}
1298
1299
1300 transient 
1301
1302 the data buffer for the component processing 
1303
1304 Definition at line 277 of file Ali\-HLTTask.h.
1305
1306 Referenced by End\-Run(), Get\-Nof\-Matching\-Data\-Blocks(), Process\-Task(), Release(), Start\-Run(), and Subscribe().
1307
1308 The documentation for this class was generated from the following files:\begin{CompactItemize}
1309 \item 
1310 /home/perthi/cern/aliroot/Ali\-Root\_\-head020507/HLT/BASE/{\bf Ali\-HLTTask.h}\item 
1311 /home/perthi/cern/aliroot/Ali\-Root\_\-head020507/HLT/BASE/{\bf Ali\-HLTConfiguration.cxx}\end{CompactItemize}