]>
Commit | Line | Data |
---|---|---|
30338a30 | 1 | //-*- Mode: C++ -*- |
030da833 | 2 | // $Id$ |
f23a6e1a | 3 | |
4 | #ifndef ALIHLTSYSTEM_H | |
5 | #define ALIHLTSYSTEM_H | |
c5123824 | 6 | //* This file is property of and copyright by the ALICE HLT Project * |
7 | //* ALICE Experiment at CERN, All rights reserved. * | |
8 | //* See cxx source for full Copyright notice * | |
f23a6e1a | 9 | |
030da833 | 10 | // @file AliHLTSystem.h |
11 | // @author Matthias Richter | |
12 | // @date 2007 | |
13 | // @brief Global HLT module management and AliRoot integration. | |
14 | // @note The class is used in Offline (AliRoot) context | |
15 | // | |
f23a6e1a | 16 | |
b22e91eb | 17 | /** |
18 | * @defgroup alihlt_system HLT integration into AliRoot | |
19 | * This section describes the HLT integration into AliRoot. | |
fb345ed7 | 20 | * |
21 | * @section alihlt_system_intro General Remarks | |
22 | * The HLT analysis is organized in components which can also be used | |
23 | * in off-line processing. Two different types of off-line applications | |
24 | * can be distinguished: | |
25 | * - AliRoot simulation (AliSimulation) | |
26 | * - AliRoot reconstruction (AliReconstruction) | |
27 | * | |
030da833 | 28 | * In either case an HLT chain described by means of AliHLTConfiguration |
29 | * builds the core of any HLT application. Special components exist, which | |
30 | * emulate the behavior of the components of the HLT on-line data | |
fb345ed7 | 31 | * transportation framework. Together with the analysis components, this |
32 | * allows the full emulation of the behavoir of HLT analysis chain off-line. | |
33 | * | |
34 | * More details how to setup up such a chain can be found: | |
35 | * - The examples page under @ref tut_hltsystem | |
36 | * | |
37 | * @section alihlt_system_simulation AliRoot simulation | |
38 | * HLT has a special role in the normal data flow of simulation and | |
39 | * reconstruction. Since the HLT reconstruction and analysis runs on-line | |
40 | * on the HLT farm, the raw data produced by HLT as a detector contains | |
41 | * already reconstructed events. Consequently, the HLT response has to be | |
42 | * simulated as well as the data of all other detectors. | |
43 | * | |
44 | * Since the detector data is needed, the HLT simulation is run at the | |
45 | * end of AliSimulation. | |
46 | * | |
47 | * As a matter of fact, HLT always reconstructs data, <em><b>HLT simulation | |
48 | * </b></em> means <em><b>HLT reconstruction embedded into AliRoot</b></em>. | |
49 | * | |
50 | * More Details an be found in the module: | |
51 | * - @ref alihlt_aliroot_simulation | |
52 | * | |
53 | * @section alihlt_system_reconstruction AliRoot reconstruction | |
54 | * | |
55 | * Like all other ALICE detectors, HLT utilizes the AliReconstruction interface | |
56 | * to implement a plugin for the AliRoot reconstruction. The reconstructor can be | |
57 | * used to | |
58 | * - run HLT analysis chains in the AliRoot reconstruction <br> | |
59 | * This option is mainly intended for the development and debugging cycle. HLT | |
60 | * chains can be defined by means of AliHLTConfiguration and can be run either | |
61 | * stand-alone or embedded into the AliReconstruction cycle. | |
62 | * - run the default analysis chains <br> | |
63 | * HLT modules can define default analysis chains to be run during AliRoot | |
64 | * reconstruction. | |
65 | * - handle the HLTOUT data<br> | |
66 | * The HLT output stream contains multiple data blocks produced by the various | |
67 | * components of the HLT chain. Each block might need different and even | |
68 | * detector specific processing, like e.g. the processing of ESD objects or the | |
69 | * handling of compressed data. | |
70 | * | |
71 | * More Details an be found in the module: | |
72 | * - @ref alihlt_aliroot_reconstruction | |
73 | * | |
b22e91eb | 74 | */ |
f23a6e1a | 75 | |
5ec8e281 | 76 | #include "AliHLTLogging.h" |
77 | #include <TList.h> | |
c043fa2c | 78 | #include <TString.h> |
f23a6e1a | 79 | |
5ec8e281 | 80 | class AliHLTComponentHandler; |
81 | class AliHLTConfiguration; | |
85465857 | 82 | class AliHLTConfigurationHandler; |
5ec8e281 | 83 | class AliHLTTask; |
c5123824 | 84 | class AliHLTOUT; |
f3c1d403 | 85 | class AliHLTOUTTask; |
19b5c321 | 86 | class AliHLTControlTask; |
242bb794 | 87 | class AliRunLoader; |
88 | class AliRawReader; | |
af885e0f | 89 | class AliESDEvent; |
90ebac25 | 90 | class TObjArray; |
91 | class TStopwatch; | |
f23a6e1a | 92 | |
bfccbf68 | 93 | /** |
94 | * @class AliHLTSystem | |
95 | * Main class for the HLT integration into AliRoot. | |
b22e91eb | 96 | * @note This class is only used for the @ref alihlt_system. |
97 | * | |
030da833 | 98 | * @section alihltsystem_overview Main functionality |
99 | * The class implements the main binding functionality to run HLT | |
100 | * embedded in AliRoot: | |
101 | * - creates handlers for HLT components (AliHLTComponentHandler) | |
102 | * and configurations (AliHLTConfigurationHandler). | |
103 | * - implements the creation of a task list from configurations | |
104 | * - runs the tasks of the task list | |
105 | * - implements the interface to AliHLTReconstructor and AliHLTSimulation | |
106 | * - manages the registered module agents (AliHLTModuleAgent) | |
107 | * | |
108 | * @section alihltsystem_functions Main functions | |
109 | * The following list gives the most important functions, see documentation | |
110 | * of functions for details. | |
111 | * - ScanOptions(const char*) initialize the system from arguments | |
112 | * - BuildTaskList(const char*) build task list for a reconstruction chain | |
113 | * - Run() processing loop for task list | |
114 | * - Reconstruct() interface to AliHLTReconstructor | |
115 | * - ProcessHLTOUT() process an HLTOUT colection | |
116 | * | |
117 | * @section alihltsystem_initialization Initialization | |
118 | * AliHLTSystem is initialized with a list of component libraries which determine | |
119 | * the actual functionality. See ScanOptions() for description of options. | |
120 | * | |
121 | * @section alihltsystem_usage Usage | |
122 | * The class AliHLTPluginBase handles the global instance of AliHLTSystem, | |
123 | * the instance is created and fetched like | |
124 | * <pre> | |
125 | * // setup the HLT system | |
126 | * AliHLTSystem* pHLT=AliHLTPluginBase::GetInstance(); | |
127 | * </pre> | |
128 | * | |
b22e91eb | 129 | * @ingroup alihlt_system |
bfccbf68 | 130 | */ |
5ec8e281 | 131 | class AliHLTSystem : public AliHLTLogging { |
132 | public: | |
bfccbf68 | 133 | /** default constructor */ |
19b5c321 | 134 | AliHLTSystem(AliHLTComponentLogSeverity loglevel=kHLTLogDefault, const char* name=""); |
bfccbf68 | 135 | /** destructor */ |
f23a6e1a | 136 | virtual ~AliHLTSystem(); |
137 | ||
bfccbf68 | 138 | /** |
a742f6f8 | 139 | * Build a task list |
030da833 | 140 | * This method is used to build the list of tasks from the configuration |
141 | * id of a single 'master' configuration. | |
142 | * | |
143 | * Configuration entries might depend upon other configurations. For each | |
144 | * configuration which has not yet been converted into an AliHLTTask, the | |
145 | * method will be called iteratively. Finally, after building all tasks | |
146 | * providing the input for the current one, the task is inserted to the | |
147 | * list of tasks with the InsertTask() method. | |
148 | * | |
149 | * The function can be called multiple times in order to add more than one | |
150 | * chain to the system. | |
151 | * | |
a742f6f8 | 152 | * @param pConf configuration name/id |
153 | */ | |
154 | int BuildTaskList(const char* pConf); | |
155 | ||
bfccbf68 | 156 | /** |
157 | * Clean the list of tasks and delete all the task objects. | |
3b35e87c | 158 | */ |
5ec8e281 | 159 | int CleanTaskList(); |
160 | ||
bfccbf68 | 161 | /** |
162 | * Insert a task to the task list. | |
163 | * The method first checks whether all dependencies are resolved (i.e. exist | |
70ed7d01 | 164 | * already in the task list). During this iteration the cross links between |
165 | * the tasks are set as well. If all dependencies are resolved, the task is | |
166 | * added at the end of the list. | |
bfccbf68 | 167 | * @param pTask pointer to task to add |
3b35e87c | 168 | */ |
5ec8e281 | 169 | int InsertTask(AliHLTTask* pTask); |
170 | ||
19b5c321 | 171 | /** |
172 | * Add HLTOUT task to the end of the task list. | |
173 | * If one of the specified chains has output, an AliHLTOUTTask is | |
174 | * added which controls the output. All other chains are removed from the | |
175 | * AliHLTOUTTask input. | |
176 | * @return 0 if no task has been added, 1 if task has been added | |
177 | */ | |
178 | int AddHLTOUTTask(const char* chains); | |
179 | ||
180 | AliHLTOUTTask* GetHLTOUTTask() const {return fpHLTOUTTask;} | |
f331e6c5 | 181 | AliHLTComponentHandler* GetComponentHandler() const {return fpComponentHandler;} |
182 | AliHLTConfigurationHandler* GetConfigurationHandler() const {return fpConfigurationHandler;} | |
19b5c321 | 183 | |
bfccbf68 | 184 | /** |
185 | * Find a task with an id. | |
186 | * @param id CONFIGURATION id (not a COMPONENT id!) | |
3b35e87c | 187 | */ |
5ec8e281 | 188 | AliHLTTask* FindTask(const char* id); |
189 | ||
bfccbf68 | 190 | /** |
191 | * Print the task list. | |
3b35e87c | 192 | */ |
5ec8e281 | 193 | void PrintTaskList(); |
194 | ||
53feaef5 | 195 | /** |
030da833 | 196 | * Run one or more events. |
197 | * Core of the processing loop. The method expects the task list to be | |
198 | * already created by a previous call to BuildTaskList(const char*) | |
199 | * | |
53feaef5 | 200 | * All tasks of the list will be subsequently processed for each event. |
dee38f1b | 201 | * The system can remain started if the \em bStop parameter is 0. In that |
202 | * case the system just waits for the next event. A specific call with | |
203 | * nofEvents==0 is needed to execute the stop sequence. | |
53feaef5 | 204 | * @param iNofEvents number of events |
dee38f1b | 205 | * @param bStop stop the chain after processing |
242bb794 | 206 | * @return number of reconstructed events, neg error code if failed |
53feaef5 | 207 | */ |
41017954 | 208 | int Run(Int_t iNofEvents, int bStop, AliHLTUInt64_t trgMask); |
209 | ||
210 | /** | |
211 | * Run the tasklist | |
212 | * Somehow the 64bit variable/default value did not work out on mac. | |
213 | * Re-introducing the original function, and forwarding it. | |
214 | */ | |
215 | int Run(Int_t iNofEvents=1, int bStop=1) | |
216 | {return Run(iNofEvents, bStop, 0);} | |
53feaef5 | 217 | |
9ce4bf4a | 218 | /** |
219 | * Init all tasks from the list. | |
220 | * The @ref AliHLTTask::Init method is called for each task, the components | |
221 | * will be created. | |
222 | * @return neg error code if failed | |
223 | */ | |
224 | int InitTasks(); | |
225 | ||
90ebac25 | 226 | /** |
227 | * Init the stopwatches for all tasks. | |
228 | * @param pStopwatches object array of stopwatches, for types | |
229 | * @see AliHLTComponent::AliHLTStopwatchType | |
230 | * @return neg error code if failed | |
231 | */ | |
232 | int InitBenchmarking(TObjArray* pStopwatches); | |
233 | ||
032c5e5e | 234 | /** |
235 | * Stop the stopwatches for all tasks. | |
236 | * @param pStopwatches object array of stopwatches, for types | |
237 | * @see AliHLTComponent::AliHLTStopwatchType | |
238 | * @return neg error code if failed | |
239 | */ | |
240 | int PauseBenchmarking(TObjArray* pStopwatches) const; | |
241 | ||
242 | /** | |
243 | * Continue the stopwatches for all tasks. | |
244 | * @param pStopwatches object array of stopwatches, for types | |
245 | * @see AliHLTComponent::AliHLTStopwatchType | |
246 | * @return neg error code if failed | |
247 | */ | |
248 | int ResumeBenchmarking(TObjArray* pStopwatches) const; | |
249 | ||
dee38f1b | 250 | /** |
251 | * Print benchmarking summary. | |
252 | * Optionak: clean up stop watches. | |
253 | * @param pStopwatches object array of stopwatches | |
254 | * @param bClean delete stop watches if 1 | |
255 | * @return neg error code if failed | |
256 | */ | |
032c5e5e | 257 | int PrintBenchmarking(TObjArray* pStopwatches, int bClean=0) const; |
dee38f1b | 258 | |
53feaef5 | 259 | /** |
260 | * Start task list. | |
70ed7d01 | 261 | * The @ref AliHLTTask::StartRun method is called for each task, the |
262 | * components will be prepared for event processing. | |
53feaef5 | 263 | * @return neg error code if failed |
264 | */ | |
265 | int StartTasks(); | |
266 | ||
267 | /** | |
268 | * Process task list. | |
269 | * The @ref AliHLTTask::ProcessTask method is called for each task. | |
270 | * @return neg error code if failed | |
271 | */ | |
c4ffab2c | 272 | int ProcessTasks(Int_t eventNo, AliHLTUInt64_t trgMask=0); |
53feaef5 | 273 | |
274 | /** | |
275 | * Stop task list. | |
276 | * The @ref AliHLTTask::EndRun method is called for each task, the components | |
277 | * will be cleaned after event processing. | |
278 | * @return neg error code if failed | |
5ec8e281 | 279 | */ |
53feaef5 | 280 | int StopTasks(); |
5ec8e281 | 281 | |
457ec821 | 282 | /** |
283 | * Send a control event trough the chain. | |
284 | * All data sources in the chain are switched to publish a control event like | |
285 | * SOR or EOR. The event is propagated in the same way as a normal event. | |
286 | * @param dt type of the event | |
287 | */ | |
288 | int SendControlEvent(AliHLTComponentDataType dt); | |
289 | ||
9ce4bf4a | 290 | /** |
291 | * De-init all tasks from the list. | |
292 | * The @ref AliHLTTask::Deinit method is called for each task, the components | |
293 | * will be deleted. | |
294 | * @return neg error code if failed | |
295 | */ | |
296 | int DeinitTasks(); | |
297 | ||
a472be38 | 298 | /** |
299 | * Cleanup all internal objects from HLTOUT processing. | |
300 | */ | |
301 | int CleanHLTOUT(); | |
302 | ||
9ce4bf4a | 303 | /** |
304 | * The memory allocation function for components. | |
030da833 | 305 | * This function is part of the running environment of the components, |
306 | * see AliHLTAnalysisEnvironment | |
9ce4bf4a | 307 | */ |
308 | static void* AllocMemory( void* param, unsigned long size ); | |
309 | ||
324ca3b4 | 310 | /** |
311 | * The allocation function for component EventDoneData. | |
030da833 | 312 | * This function is part of the running environment of the components, |
313 | * see AliHLTAnalysisEnvironment | |
324ca3b4 | 314 | */ |
315 | static int AllocEventDoneData( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd ); | |
316 | ||
242bb794 | 317 | /** |
dee38f1b | 318 | * AliRoot embedded reconstruction. |
319 | * Main entry point to execute the HLT reconstruction from AliRoot. Called | |
320 | * either by the AliHLTReconstructor plugin during AliRoot reconstruction | |
321 | * of raw data, or AliHLTSimulation during simulation of data. | |
322 | * | |
030da833 | 323 | * The two cases are distinguished by the availablility of the AliRunLoader |
dee38f1b | 324 | * and raw reader. |
030da833 | 325 | * - AliRoot simulation: AliRunLoader is available and is propagated to the |
dee38f1b | 326 | * module agents (AliHLTModuleAgent) to generate the corresponding |
327 | * configurations and chains, and to the AliHLTOfflineSource components. | |
030da833 | 328 | * raw reader might be available depending on whether raw data was |
329 | * simulated or not. | |
dee38f1b | 330 | * - AliRoot reconstruction: raw reader is available and is propagated to |
030da833 | 331 | * the agents and AliHLTOfflineSource components. AliRunLoader is always |
332 | * NULL. | |
dee38f1b | 333 | * |
334 | * The system remains started after the processing and just waits for the | |
335 | * next event. A specific call with nofEvents==0 is needed to execute the | |
336 | * stop sequence. | |
337 | * | |
030da833 | 338 | * The 'runLoader' and 'rawReader' parameters are propagated to all active |
242bb794 | 339 | * AliHLTOfflineDataSource's and the HLT chain is processed for the given |
340 | * number of events. If the rawReader is NULL, reconstruction is done on | |
341 | * simulated data, from real data if a RawReader is specified. | |
030da833 | 342 | * |
343 | * After setting up the system with the reconstruction parameters the | |
344 | * Run() method is called and carries out the processing of the chain. | |
345 | * | |
242bb794 | 346 | * @param nofEvents number of events |
030da833 | 347 | * @param runLoader the AliRoot RunLoader |
242bb794 | 348 | * @param rawReader the AliRoot RawReader |
349 | * @return number of reconstructed events, neg. error code if failed | |
350 | */ | |
351 | int Reconstruct(int nofEvents, AliRunLoader* runLoader, | |
352 | AliRawReader* rawReader=NULL); | |
353 | ||
354 | /** | |
355 | * Fill ESD for one event. | |
356 | * To be called by the AliHLTReconstructor plugin during the event loop | |
357 | * and FillESD method of the AliRoot reconstruction. | |
c5123824 | 358 | * |
359 | * The method is most likely deprecated as the scheme has been slightly | |
030da833 | 360 | * changed. The ESD is filled by the HLTOUT handlers implemented by the |
c5123824 | 361 | * HLT modules rather than by components within the reconstruction chain. |
362 | * Still, HLT reconstruction chains can be run during the AliRoot | |
363 | * reconstruction, data produced by such chains is automatically added | |
364 | * to the HLTOUT stream in order to be equivalent to the online HLT. | |
365 | * The HLTOUT is processed during AliReconstruction at the end of the | |
366 | * HLT event processing, literally during the FillESD method of the AliRoot | |
367 | * reconstruction interface. The HLT module must implement HLTOUT handlers | |
368 | * and provide those through the module agent. | |
369 | * | |
242bb794 | 370 | * @param eventNo current event no (Note: this event number is just a |
371 | * processing counter and is not related to the nature/ | |
372 | * origin of the event | |
373 | * @param runLoader the AliRoot runloader | |
af885e0f | 374 | * @param esd an AliESDEvent instance |
242bb794 | 375 | * @return neg. error code if failed |
376 | */ | |
af885e0f | 377 | int FillESD(int eventNo, AliRunLoader* runLoader, AliESDEvent* esd); |
242bb794 | 378 | |
c5123824 | 379 | /** |
380 | * Process the HLTOUT data. | |
030da833 | 381 | * The provided instance of AliHLTOUT provides the access to the data. |
382 | * AliHLTSystem queries all registered module agents (AliHLTModuleAgent) | |
383 | * for the ability to treat a specific data block. As the last step the | |
384 | * ESD object is filled. Please note that the provided ESD is the hltEsd | |
385 | * in case of AliReconstructor (switched in AliReconstruction). | |
c5123824 | 386 | */ |
387 | int ProcessHLTOUT(AliHLTOUT* pHLTOUT, AliESDEvent* esd); | |
388 | ||
0f1882a7 | 389 | /** |
390 | * Process all kChain-type data blocks of the HLTOUT data. | |
030da833 | 391 | * Handlers of type AliHLTModuleAgent::kChain are executed as the first |
392 | * step of the processing. The function is invoked from ProcessHLTOUT(), | |
393 | * eventual output of the chain is added to the HLTOUT collection. | |
0f1882a7 | 394 | */ |
395 | int ProcessHLTOUTkChain(AliHLTOUT* pHLTOUT); | |
396 | ||
242bb794 | 397 | /** |
398 | * Load component libraries. | |
399 | * @param libs string of blank separated library names | |
400 | * @return neg. error code if failed | |
401 | */ | |
402 | int LoadComponentLibraries(const char* libs); | |
403 | ||
85f0cede | 404 | /** |
405 | * Find a symbol in a dynamically loaded library. | |
406 | * @param library library | |
407 | * @param symbol the symbol to find | |
408 | * @return void pointer to function | |
409 | */ | |
f331e6c5 | 410 | AliHLTfctVoid FindDynamicSymbol(const char* library, const char* symbol); |
85f0cede | 411 | |
242bb794 | 412 | /** |
413 | * Prepare the HLT system for running. | |
414 | * - module agents are requested to register configurations | |
030da833 | 415 | * - task lists are built from the reconstruction chains of the modules |
c043fa2c | 416 | * |
dee38f1b | 417 | * @param rawReader instance of the raw reader or NULL |
030da833 | 418 | * @param runloader optional instance of the AliRunLoader |
242bb794 | 419 | * @return neg. error code if failed <br> |
420 | * -EBUSY system is in kRunning state <br> | |
421 | */ | |
dee38f1b | 422 | int Configure(AliRawReader* rawReader, AliRunLoader* runloader=NULL); |
242bb794 | 423 | |
dee38f1b | 424 | /** |
425 | * Old method kept for backward compatibilty. | |
426 | * | |
030da833 | 427 | * @param runloader optional instance of the AliRunLoader |
dee38f1b | 428 | * @return neg. error code if failed <br> |
429 | * -EBUSY system is in kRunning state <br> | |
430 | */ | |
431 | int Configure(AliRunLoader* runloader=NULL); | |
c043fa2c | 432 | |
433 | /** | |
b005ef92 | 434 | * Scan options and load component libraries. |
435 | * The options consist of blank separated tokens. Libraries can be just | |
030da833 | 436 | * specified by their name, and can be excluded by adding a '!'-mark in |
437 | * front. <br> | |
438 | * Further options | |
1ac82ce6 | 439 | * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting --> |
c043fa2c | 440 | * \li loglevel=<i>level</i> <br> |
441 | * logging level for this processing | |
dba03d72 | 442 | * \li frameworklog=<i>level</i> <br> |
443 | * logging level for framework classes | |
c043fa2c | 444 | * \li alilog=off |
445 | * disable redirection of log messages to AliLog class | |
446 | * \li config=<i>macro</i> | |
447 | * configuration macro | |
dee38f1b | 448 | * \li chains=<i>configuration</i> |
c043fa2c | 449 | * comma separated list of configurations to be run during local |
450 | * reconstruction | |
dba03d72 | 451 | * \li libmode=<i>static,dynamic(default)</i> |
452 | * libraries are persistent if loaded in mode <i>static</i>, i.e. they | |
453 | * can't be unloaded | |
c043fa2c | 454 | */ |
455 | int ScanOptions(const char* options); | |
456 | ||
242bb794 | 457 | /** |
458 | * Reset the HLT system. | |
459 | * Reset is not possible while the system is in running state. | |
460 | * @param bForce force the reset | |
461 | * @return neg. error code if failed <br> | |
462 | * -EBUSY system is in kRunning state <br> | |
463 | */ | |
464 | int Reset(int bForce=0); | |
465 | ||
466 | /** | |
467 | * Load the configurations specified by the module agents. | |
468 | * The runLoader is passed to the agent and allows configuration | |
469 | * selection. | |
030da833 | 470 | * - AliSimulation: runloader valid, raw reader might be valid |
471 | * - AliReconstruction: runloader always NULL, raw reader valid | |
472 | * | |
dee38f1b | 473 | * @param rawReader instance of the raw reader or NULL |
030da833 | 474 | * @param runloader optional instance of the AliRunLoader |
242bb794 | 475 | * @return neg. error code if failed |
476 | */ | |
dee38f1b | 477 | int LoadConfigurations(AliRawReader* rawReader, AliRunLoader* runloader=NULL); |
242bb794 | 478 | |
479 | /** | |
030da833 | 480 | * Get the reconstruction chains from all agents and build the task lists. |
481 | * AliHLTModuleAgent implementations can define reconstruction chains | |
482 | * depending on the availibility of AliRunLoader and AliRawReader parameters. | |
483 | * | |
dee38f1b | 484 | * @param rawReader instance of the raw reader or NULL |
030da833 | 485 | * @param runloader optional instance of the AliRunLoader |
242bb794 | 486 | * @return neg. error code if failed |
487 | */ | |
f3506ea2 | 488 | int BuildTaskListsFromReconstructionChains(AliRawReader* rawReader, |
489 | AliRunLoader* runloader=NULL); | |
242bb794 | 490 | |
6a8e0bb4 | 491 | enum AliHLTSystemState { |
242bb794 | 492 | kUninitialized = 0x0, |
493 | kLibrariesLoaded = 0x1, | |
494 | kConfigurationLoaded = 0x2, | |
495 | kTaskListCreated = 0x4, | |
496 | kReady = 0x7, | |
dee38f1b | 497 | kStarted = 0x8, |
498 | kRunning = 0x10, | |
242bb794 | 499 | kError = 0x1000 |
9253e11b | 500 | }; |
242bb794 | 501 | |
502 | /** | |
503 | * Check status of the system. | |
6a8e0bb4 | 504 | * @param flag AliHLTSystemState value to check for |
242bb794 | 505 | * @return 1 if set, 0 if not |
506 | */ | |
507 | int CheckStatus(int flag); | |
508 | ||
509 | /** | |
510 | * Get the current status. | |
6a8e0bb4 | 511 | * @return status flags of @ref AliHLTSystemState |
242bb794 | 512 | */ |
513 | int GetStatusFlags(); | |
514 | ||
e642a402 | 515 | /** |
516 | * Set logging level for framework classes. | |
517 | * This sets the local logging level of this instance and all subsequent | |
518 | * framework classes to \em level. | |
519 | * @param level local logging level for the framework classes | |
520 | */ | |
521 | void SetFrameworkLog(AliHLTComponentLogSeverity level); | |
522 | ||
97d2b87a | 523 | /** |
524 | * Customized logging function. | |
525 | * The name of the system and pointer is added at the beginning of each | |
526 | * message if name was set. | |
527 | */ | |
528 | int LoggingVarargs(AliHLTComponentLogSeverity severity, | |
529 | const char* originClass, const char* originFunc, | |
530 | const char* file, int line, ... ) const; | |
531 | ||
5ec8e281 | 532 | protected: |
5ec8e281 | 533 | |
534 | private: | |
c043fa2c | 535 | /** copy constructor prohibited */ |
536 | AliHLTSystem(const AliHLTSystem&); | |
537 | /** assignment operator prohibited */ | |
538 | AliHLTSystem& operator=(const AliHLTSystem&); | |
539 | ||
f331e6c5 | 540 | /** |
541 | * Build task list from a configuration object. | |
542 | * This method implements the configuration parsing and transformation into | |
543 | * a list of AliHLTTask objects. It has been made private in April 2007. | |
544 | * Use BuildTaskList(const char*) instead. | |
545 | * | |
546 | * @param pConf pointer to configuration to build the task list from | |
547 | */ | |
548 | int BuildTaskList(AliHLTConfiguration* pConf); | |
549 | ||
242bb794 | 550 | /** |
551 | * Set status flags. | |
552 | */ | |
553 | int SetStatusFlags(int flags); | |
554 | ||
555 | /** | |
556 | * clear status flags. | |
557 | */ | |
558 | int ClearStatusFlags(int flags); | |
559 | ||
f331e6c5 | 560 | /// Pointer to an instance of @ref AliHLTComponentHandler. |
561 | AliHLTComponentHandler* fpComponentHandler; //! transient | |
562 | ||
563 | /// Pointer to an instance of @ref AliHLTConfigurationHandler. | |
564 | AliHLTConfigurationHandler* fpConfigurationHandler; //! transient | |
5ec8e281 | 565 | |
242bb794 | 566 | /** list of tasks */ |
70ed7d01 | 567 | TList fTaskList; // see above |
f23a6e1a | 568 | |
fc455fba | 569 | /** the number of instances of AliHLTSystem */ |
570 | static int fgNofInstances; // see above | |
571 | ||
242bb794 | 572 | /** state of the object */ |
573 | int fState; // see above | |
574 | ||
dee38f1b | 575 | /** chains to be run during reconstruction */ |
576 | TString fChains; //!transient | |
577 | ||
6a8e0bb4 | 578 | /** array of stopwatches */ |
dee38f1b | 579 | TObjArray* fStopwatches; //!transient |
580 | ||
6a8e0bb4 | 581 | /** number of events processed in total */ |
dee38f1b | 582 | int fEventCount; //!transient |
583 | ||
6a8e0bb4 | 584 | /** number of events processed successfully */ |
dee38f1b | 585 | int fGoodEvents; //!transient |
c043fa2c | 586 | |
6a8e0bb4 | 587 | /** array of default libraries */ |
588 | static const char* fgkHLTDefaultLibs[]; //!transient | |
589 | ||
b005ef92 | 590 | /** active kChain handlers (AliHLTOUT::AliHLTOUTHandlerListEntryVector*) */ |
591 | void* fpChainHandlers; //!transient | |
592 | ||
593 | /** active kEsd handlers (AliHLTOUT::AliHLTOUTHandlerListEntryVector*) */ | |
594 | void* fpEsdHandlers; //!transient | |
595 | ||
596 | /** active kProprietary handlers (AliHLTOUT::AliHLTOUTHandlerListEntryVector*) */ | |
597 | void* fpProprietaryHandlers; //!transient | |
598 | ||
f3c1d403 | 599 | /** active HLTOUT task for the reconstruction */ |
600 | AliHLTOUTTask* fpHLTOUTTask; //!transient | |
601 | ||
19b5c321 | 602 | /** special task to publish the control events */ |
603 | AliHLTControlTask* fpControlTask; //!transient | |
604 | ||
605 | /** name of this system instance */ | |
606 | TString fName; //!transient | |
607 | ||
c4ffab2c | 608 | /// ECS parameter string |
609 | TString fECSParams; //!transient | |
610 | ||
611 | ClassDef(AliHLTSystem, 13); | |
f23a6e1a | 612 | }; |
f23a6e1a | 613 | |
c043fa2c | 614 | #endif |