]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTDataTypes.h
automatically added data sink components are now added directly to the internal insta...
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTDataTypes.h
1 // @(#) $Id$
2
3 #ifndef ALIHLTDATATYPES_H
4 #define ALIHLTDATATYPES_H
5 /* This file is property of and copyright by the ALICE HLT Project        * 
6  * ALICE Experiment at CERN, All rights reserved.                         *
7  * See cxx source for full Copyright notice                               */
8
9 /** @file   AliHLTDataTypes.h
10     @author Matthias Richter, Timm Steinbeck, Jochen Thaeder
11     @date   
12     @brief  Data type declaration for the HLT module.
13 */
14
15 //////////////////////////////////////////////////////////////////////////
16 //
17 // version no of HLT data types
18 //
19 //////////////////////////////////////////////////////////////////////////
20
21 /* Version   Description
22  *   1       first version until June 07; implicite, not tagged
23  *   2       introduced June 07, enhanced/cleaned/arranged structure
24  *   3       2007-11-15 RAW DDL data type added; some inconsistencies fixed
25  *           ('void' and 'any' origins); added signed HLT basic data types
26  *           2007-11-23 origin defines have become variables in conjunction
27  *           to be used with the operator| (AliHLTComponentDataType)
28  *           2007-11-24 added trigger structs and ESD tree data type
29  *   4       Component configuration and DCS update events added
30  *           gkAliHLTDDLListSize set from 29 to 30 according to new PubSub
31  *           specs
32  *   5       Data types for Run and Event summary, and for monitoring added
33  *   6       Common data types for TreeD and TreeR defined
34  *           kAliHLTAllDataTypes and kAliHLTDataOriginSample added
35  *           kAliHLTDataOriginEMCAL added
36  *           kAliHLTDataTypeRunType added
37  *   7       kAliHLTDataTypeComponentStatistics, kAliHLTDataTypeComponentTable,
38  *           and AliHLTComponentStatistics have been added for optional
39  *           component block statistics
40  *   8       new wrapper interface has been introduced, old wrapper interface
41  *           deprecated but kept for backward compatibility, the PubSub
42  *           interface is going to be compiled independently of AliHLT, new
43  *           interface provided by the libHLTinterface.so
44  *           AliHLTComponentEnvironment -> AliHLTAnalysisEnvironment
45  *   9       added data types for arrays of AliHLTExternalTrackParam sets and
46  *           TClonesArrays of AliExternalTrackParam objects.
47  *  10       Changes for information objects neededfor running with offline
48  *           chains and analysis tasks.
49  *           kAliHLTMCObjectDataType added
50  *           kAliHLTDataOriginOffline added
51  *           kAliHLTDataOriginHLT added
52  *  11       extended AliHLTComponentStatistics: one more member to store the
53  *           cycle time between events per component.
54  *  12       added common data type id 'CLUSTERS'
55  *           added data type 'ECSPARAM' for the full ECS parameter string to
56  *           be sebt during SOR
57  *           added kAliHLTDataTypeTrackMC (TRACK_MC) data type
58  *           added data types (note: interface version stays the same
59  *                 kAliHLTDataTypeDAQRDOUT (DAQRDOUT)
60  *                 kAliHLTDataTypeTriggerDecision (TRIG_DEC)
61  *                 kAliHLTDataTypeGlobalTrigger (GLOBTRIG)
62  *                 kAliHLTDataTypeStreamerInfo (ROOTSTRI)
63  *  13       Changed AliHLTEventDDL to now contain 31 words. The extra word is
64  *           for the EMCAL detector, which needs 46 DDLs after DCAL was added.
65  *  14       Adding new data block type for HLT global trigger counters.
66  *           Adding data block type for ESD content
67  *           Adding data block type for forwarded component table blocks
68  *           Adding new event type for software triggers.
69  *  15       Modifying data block types for trigger counter blocks.
70  */
71 #define ALIHLT_DATA_TYPES_VERSION 15
72
73 //////////////////////////////////////////////////////////////////////////
74 //
75 // HLT data origin variables.
76 //
77 // By converting from defines to variables, the origins can be used with
78 // the operator|
79 //
80 // AliHLTComponentDataType dt;
81 // dt = kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC;
82 //
83 //////////////////////////////////////////////////////////////////////////
84
85 /** field size of datat type origin 
86  * @ingroup alihlt_component_datatypes
87  */
88 const int kAliHLTComponentDataTypefOriginSize=4;
89
90
91 /** invalid data origin 
92  * @ingroup alihlt_component_datatypes
93  */
94 # define kAliHLTDataOriginVoid "\0\0\0"
95 /** old invalid data origin, kept for backward compatibility */
96 # define kAliHLTVoidDataOrigin "\0\0\0"
97
98 /** wildcard data type origin 
99  * @ingroup alihlt_component_datatypes
100  */
101 # define kAliHLTDataOriginAny "***"
102 /** old wildcard data type origin, kept for backward compatibility */
103 # define kAliHLTAnyDataOrigin "***"
104
105 /** Data origin HLT out 
106  * @ingroup alihlt_component_datatypes
107  */
108 extern const char kAliHLTDataOriginOut[kAliHLTComponentDataTypefOriginSize];
109
110 /** Data origin HLT, used for HLT specifc data 
111  *  in offline chains. This not a bug!
112  * @ingroup alihlt_component_datatypes
113  */
114 extern const char kAliHLTDataOriginHLT[kAliHLTComponentDataTypefOriginSize];
115
116 /** Data origin Offline 
117  * @ingroup alihlt_component_datatypes
118  */
119 extern const char kAliHLTDataOriginOffline[kAliHLTComponentDataTypefOriginSize];
120
121 /** Data origin HLT/PubSub private internal 
122  * @ingroup alihlt_component_datatypes
123  */
124 extern const char kAliHLTDataOriginPrivate[kAliHLTComponentDataTypefOriginSize];
125
126 /** Data origin TPC 
127  * @ingroup alihlt_component_datatypes
128  */
129 extern const char kAliHLTDataOriginTPC[kAliHLTComponentDataTypefOriginSize];
130
131 /** Data origin PHOS 
132  * @ingroup alihlt_component_datatypes
133  */
134 extern const char kAliHLTDataOriginPHOS[kAliHLTComponentDataTypefOriginSize];
135
136 /** Data origin FMD
137  * @ingroup alihlt_component_datatypes
138  */
139 extern const char kAliHLTDataOriginFMD[kAliHLTComponentDataTypefOriginSize];
140
141 /** Data origin MUON 
142  * @ingroup alihlt_component_datatypes
143  */
144 extern const char kAliHLTDataOriginMUON[kAliHLTComponentDataTypefOriginSize];
145
146 /** Data origin TRD 
147  * @ingroup alihlt_component_datatypes
148  */
149 extern const char kAliHLTDataOriginTRD[kAliHLTComponentDataTypefOriginSize];
150
151 /** Data origin ITS 
152  * @ingroup alihlt_component_datatypes
153  */
154 extern const char kAliHLTDataOriginITS[kAliHLTComponentDataTypefOriginSize];
155
156 /** Data origin ITSOut 
157  * @ingroup alihlt_component_datatypes
158  */
159 extern const char kAliHLTDataOriginITSOut[kAliHLTComponentDataTypefOriginSize];
160
161 /** Data origin ITS SPD
162  * @ingroup alihlt_component_datatypes
163  */
164 extern const char kAliHLTDataOriginITSSPD[kAliHLTComponentDataTypefOriginSize];
165
166 /** Data origin ITS SDD
167  * @ingroup alihlt_component_datatypes
168  */
169 extern const char kAliHLTDataOriginITSSDD[kAliHLTComponentDataTypefOriginSize];
170
171 /** Data origin ITS SSD
172  * @ingroup alihlt_component_datatypes
173  */
174 extern const char kAliHLTDataOriginITSSSD[kAliHLTComponentDataTypefOriginSize];
175
176 /** Data origin for examples 
177  * @ingroup alihlt_component_datatypes
178  */
179 extern const char kAliHLTDataOriginSample[kAliHLTComponentDataTypefOriginSize];
180
181 /** Data origin EMCAL 
182  * @ingroup alihlt_component_datatypes
183  */
184 extern const char kAliHLTDataOriginEMCAL[kAliHLTComponentDataTypefOriginSize];
185
186 /** Data origin TOF
187  * @ingroup alihlt_component_datatypes
188  */
189 extern const char kAliHLTDataOriginTOF[kAliHLTComponentDataTypefOriginSize];
190
191 /** Data origin HMPID
192  * @ingroup alihlt_component_datatypes
193  */
194 extern const char kAliHLTDataOriginHMPID[kAliHLTComponentDataTypefOriginSize];
195
196 /** Data origin CPV
197  * @ingroup alihlt_component_datatypes
198  */
199 extern const char kAliHLTDataOriginCPV[kAliHLTComponentDataTypefOriginSize];
200
201 /** Data origin PMD
202  * @ingroup alihlt_component_datatypes
203  */
204 extern const char kAliHLTDataOriginPMD[kAliHLTComponentDataTypefOriginSize];
205
206 /** Data origin T0
207  * @ingroup alihlt_component_datatypes
208  */
209 extern const char kAliHLTDataOriginT0[kAliHLTComponentDataTypefOriginSize];
210
211 /** Data origin VZERO
212  * @ingroup alihlt_component_datatypes
213  */
214 extern const char kAliHLTDataOriginVZERO[kAliHLTComponentDataTypefOriginSize];
215
216 /** Data origin ZDC
217  * @ingroup alihlt_component_datatypes
218  */
219 extern const char kAliHLTDataOriginZDC[kAliHLTComponentDataTypefOriginSize];
220
221 /** Data origin ACORDE
222  * @ingroup alihlt_component_datatypes
223  */
224
225 extern const char kAliHLTDataOriginACORDE[kAliHLTComponentDataTypefOriginSize];
226
227 /** Data origin TRG
228  * @ingroup alihlt_component_datatypes
229  */
230 extern const char kAliHLTDataOriginTRG[kAliHLTComponentDataTypefOriginSize];
231
232 //////////////////////////////////////////////////////////////////////////
233 //
234 // HLT common data type defines
235 //
236 //////////////////////////////////////////////////////////////////////////
237
238 /** field size of data type id 
239  * @ingroup alihlt_component_datatypes
240  */
241 const int kAliHLTComponentDataTypefIDsize=8;
242
243
244 /** invalid data type id 
245  * @ingroup alihlt_component_datatypes
246  */
247 # define kAliHLTVoidDataTypeID "\0\0\0\0\0\0\0"
248
249 /** special id for all data types: any + void
250  * @ingroup alihlt_component_datatypes
251  */
252 # define kAliHLTAllDataTypesID "ALLDATA"
253
254 /** special id for any valid data type id
255  * @ingroup alihlt_component_datatypes
256  */
257 # define kAliHLTAnyDataTypeID "*******"
258
259 /** DDL RAW data 
260  * @ingroup alihlt_component_datatypes
261  */
262 # define kAliHLTDDLRawDataTypeID   {'D','D','L','_','R','A','W',' '}
263
264 /** CLUSTERS data
265  * Common data type for the output of cluster finders, the exact
266  * format depends on the origin (detector)
267  * @ingroup alihlt_component_datatypes
268  */
269 # define kAliHLTClustersDataTypeID {'C','L','U','S','T','E','R','S'}
270
271 /** calibration data for file exchange subscriber 
272  * @ingroup alihlt_component_datatypes
273  */
274 # define kAliHLTFXSCalibDataTypeID {'F','X','S','_','C','A','L',' '}
275
276 /** start of run (SOR) event 
277  * @ref AliHLTRunDesc
278  * @ingroup alihlt_component_datatypes
279  */
280 # define kAliHLTSORDataTypeID      {'S','T','A','R','T','O','F','R'}
281
282 /** end of run (EOR) event 
283  * @ref AliHLTRunDesc
284  * @ingroup alihlt_component_datatypes
285  */
286 # define kAliHLTEORDataTypeID      {'E','N','D','O','F','R','U','N'}
287
288 /** run type data block
289  * string with run type as payload
290  * @ingroup alihlt_component_datatypes
291  */
292 # define kAliHLTRunTypeDataTypeID  {'R','U','N','T','Y','P','E',' '}
293
294 /** DDL list event 
295  * @ref AliHLTEventDDL
296  * @ingroup alihlt_component_datatypes
297  */
298 # define kAliHLTDDLDataTypeID      {'D','D','L','L','I','S','T',' '}
299
300 /** DAQ readout list 
301  * @ingroup alihlt_component_datatypes
302  */
303 # define kAliHLTDAQRDOUTDataTypeID "DAQRDOUT"
304
305 /** HLT readout list.
306  * @ingroup alihlt_component_datatypes
307  */
308 # define kAliHLTReadoutListDataTypeID {'H','L','T','R','D','L','S','T'}
309
310 /** EventType event 
311  * - empty payload, specification gives eventType
312  * @ingroup alihlt_component_datatypes
313  */
314 # define kAliHLTEventDataTypeID    {'E','V','E','N','T','T','Y','P'}
315
316 /** ECS parameter event 
317  * - sent during the SOR event by the framework
318  * - contains the full ECS parameter string
319  * @ingroup alihlt_component_datatypes
320  */
321 # define kAliHLTECSParamDataTypeID {'E','C','S','P','A','R','A','M'}
322
323 /** ComponentConfiguration event
324  * - payload contains the CDB path as string
325  * @ingroup alihlt_component_datatypes
326  */
327 # define kAliHLTComConfDataTypeID  {'C','O','M','_','C','O','N','F'}
328
329 /** DCS value update event
330  * - payload contains string of relevant detectors
331  * @ingroup alihlt_component_datatypes
332  */
333 # define kAliHLTUpdtDCSDataTypeID  {'U','P','D','T','_','D','C','S'}
334
335 /** MC data block
336  * an AliMCEvent object of varying origin
337  * The 'V0' at the end allows a versioning
338  * @ingroup alihlt_component_datatypes
339  */
340 # define kAliHLTMCObjectDataTypeID    {'A','L','I','M','C','_','V','0'}
341
342 /** ESDVertex data block
343  * an AliESDVertex object of varying origin
344  * The 'V0' at the end allows a versioning
345  * @ingroup alihlt_component_datatypes
346  */
347 # define kAliHLTESDVertexDataTypeID    {'E','S','D','V','T','X','V','0'}
348
349 /** KFVertex data block
350  * an AliKFVertex object of varying origin
351  * The 'V0' at the end allows a versioning
352  * @ingroup alihlt_component_datatypes
353  */
354 # define kAliHLTKFVertexDataTypeID    {'A','L','I','K','F','V','V','0'}
355
356
357 /** output of the GlobalVertexer data block
358  * The 'V0' at the end allows a versioning
359  * @ingroup alihlt_component_datatypes
360  */
361 # define kAliHLTDataTypeGlobalVertexerID    {'G','L','B','V','T','X','V','0'}
362
363 /** output of the PrimaryFinder data block
364  * The 'V0' at the end allows a versioning
365  * @ingroup alihlt_component_datatypes
366  */
367 # define kAliHLTDataTypePrimaryFinderID    {'P','R','I','V','T','X','V','0'}
368
369 /** output of the V0Finder data block
370  * The 'V0' at the end allows a versioning
371  * @ingroup alihlt_component_datatypes
372  */
373 # define kAliHLTDataTypeV0FinderID    {'V','0','S','V','T','X','V','0'}
374
375 /** ESD data block
376  * an AliESD object of varying origin
377  * The 'V0' at the end allows a versioning
378  * @ingroup alihlt_component_datatypes
379  */
380 # define kAliHLTESDObjectDataTypeID    {'A','L','I','E','S','D','V','0'}
381
382 /** ESD 
383  * data blocks designated for the ESD
384  * @ingroup alihlt_component_datatypes
385  */
386 # define kAliHLTESDContentDataTypeID   {'E','S','D','_','C','O','N','T'}
387
388 /** ESD tree data block
389  * TTree with an AliESD object of varying origin
390  * @ingroup alihlt_component_datatypes
391  */
392 # define kAliHLTESDTreeDataTypeID      {'E','S','D','_','T','R','E','E'}
393
394 /** AliRoot TreeD
395  * - the digits tree of an AliRoot module
396  * @ingroup alihlt_component_datatypes
397  */
398 #define kAliHLTTreeDDataTypeID         {'A','L','I','T','R','E','E','D'}
399
400 /** AliRoot TreeR
401  * - the rec points tree of an AliRoot module
402  * @ingroup alihlt_component_datatypes
403  */
404 #define kAliHLTTreeRDataTypeID         {'A','L','I','T','R','E','E','R'}
405
406 /** HW Address selection data block
407  * - a selection list for 16 bit HW addresses
408  * - varying origin
409  * @ingroup alihlt_component_datatypes
410  */
411 # define kAliHLTHwAddr16DataTypeID     {'H','W','A','D','D','R','1','6'}
412
413 /** Event Statistics
414  * - event statistics for given detectors
415  * - varying origin
416  * @ingroup alihlt_component_datatypes
417  */
418 # define kAliHLTEventStatisticsDataTypeID     {'E','V','_','S','T','A','T','I'}
419
420 /** Event Summary
421  * - event summary
422  * - origin : kAliHLTDataOriginOut ( HLT )
423  * @ingroup alihlt_component_datatypes
424  */
425 # define kAliHLTEventSummaryDataTypeID        {'E','V','_','S','U','M','M','A'}
426
427 /** Run Statistics
428  * - run statistics for given detectors
429  * - varying origin
430  * @ingroup alihlt_component_datatypes
431  */
432 # define kAliHLTRunStatisticsDataTypeID       {'R','U','N','S','T','A','T','I'}
433
434 /** Run Summary
435  * - run summary
436  * - origin : kAliHLTDataOriginOut ( HLT )
437  * @ingroup alihlt_component_datatypes
438  */
439 # define kAliHLTRunSummaryDataTypeID          {'R','U','N','S','U','M','M','A'}
440
441 /** Trigger decision
442  * - origin : kAliHLTDataOriginOut ( HLT )
443  * @ingroup alihlt_component_datatypes
444  */
445 # define kAliHLTTriggerDecisionDataTypeID     {'T','R','I','G','_','D','E','C'}
446
447 /** Global trigger decision
448  * - origin : kAliHLTDataOriginOut ( HLT )
449  * @ingroup alihlt_component_datatypes
450  */
451 # define kAliHLTGlobalTriggerDataTypeID       {'G','L','O','B','T','R','I','G'}
452
453 /** Block Statistics
454  * - small block statistics info added to the data stream by
455  *   the component base class
456  * - origin kAliHLTDataOriginPrivate
457  * @ingroup alihlt_component_datatypes
458  */
459 # define kAliHLTComponentStatisticsDataTypeID {'C','O','M','P','S','T','A','T'}
460
461 /** Component table
462  * - list of components in the chain to be percolated through the chain
463  * - each component adds it's chain id string and a generated 32bit id
464  * @ingroup alihlt_component_datatypes
465  */
466 # define kAliHLTComponentTableDataTypeID      {'C','O','M','P','T','A','B','L'}
467
468 /** Forwarded component table
469  * @ingroup alihlt_component_datatypes
470  */
471 # define kAliHLTComponentFwdTableDataTypeID   {'C','O','M','P','T','A','B','F'}
472
473 /** general ROOT TObject
474  * - a general TObject exported from the HLT analysis
475  * - varying origin
476  * @ingroup alihlt_component_datatypes
477  */
478 #define kAliHLTTObjectDataTypeID              {'R','O','O','T','T','O','B','J'}
479
480 /** ROOT streamer info
481  * - used for the transmission of streamer info for objects in the HLTOUT
482  * - origin kAliHLTDataOriginOut ( HLT )
483  * @ingroup alihlt_component_datatypes
484  */
485 #define kAliHLTStreamerInfoDataTypeID         {'R','O','O','T','S','T','R','I'}
486
487 /** ROOT TObjArray
488  * - a TObjArray exported from the HLT analysis
489  * - varying origin
490  * @ingroup alihlt_component_datatypes
491  */
492 #define kAliHLTTObjArrayDataTypeID            {'R','O','O','T','O','B','A','R'}
493
494 /** ROOT TTree
495  * - a TTree object exported from the HLT analysis
496  * - varying origin
497  * @ingroup alihlt_component_datatypes
498  */
499 #define kAliHLTTTreeDataTypeID                {'R','O','O','T','T','R','E','E'}
500
501 /** ROOT histogram
502  * - a histogram object exported from the HLT analysis
503  * - class derives from TH1 (directly or indirectly) and inherits all common functionality
504  * - varying origin
505  * @ingroup alihlt_component_datatypes
506  */
507 #define kAliHLTHistogramDataTypeID            {'R','O','O','T','H','I','S','T'}
508
509 /** ROOT TNtuple
510  * - a TNtupl object exported from the HLT analysis
511  * - varying origin
512  * @ingroup alihlt_component_datatypes
513  */
514 #define kAliHLTTNtupleDataTypeID              {'R','O','O','T','T','U','P','L'}
515
516 /** HLT Track
517  * - Struct for Tracks based on AliExternalTrackParam
518  * - varying origin
519  * @ingroup alihlt_component_datatypes
520  */
521 #define kAliHLTTrackDataTypeID                {'H','L','T','T','R','A','C','K'}
522
523 /** Track Monte Carlo information
524  * @ingroup alihlt_component_datatypes
525  */
526 #define kAliHLTTrackMCDataTypeID              {'T','R','A','C','K','_','M','C'}
527
528 /** TClonesArray of AliExternalTrackParam
529  * @ingroup alihlt_component_datatypes
530  */
531 #define kAliHLTExternalTrackParamDataTypeID   {'T','C','A','E','X','T','T','R'}
532
533 /** HLT Jet
534  * - Struct for jets based on AliHLTJETJets
535  * - varying origin
536  * @ingroup alihlt_component_datatypes
537  */
538 #define kAliHLTJetDataTypeID                  {'H','L','T','J','E','T','V','0'}
539
540 /** dEdx  data
541  * Common data type for the dEdx 
542  * format depends on the origin (detector)
543  * @ingroup alihlt_component_datatypes
544  */
545 # define kAliHLTdEdxDataTypeID {'D','E','D','X',' ',' ',' ',' '}
546
547 /** dNdPt  data
548  * Common data type for the dNdPt output object
549  * @ingroup alihlt_component_datatypes
550  */
551 # define kAliHLTdNdPtDataTypeID {'D','N','D','P','T',' ',' ',' '}
552
553 /** Global input trigger counters data block type.
554  * @ingroup alihlt_component_datatypes
555  */
556 # define kAliHLTInputTriggerCountersDataTypeID      {'I','N','T','R','G','C','N','T'}
557
558 /** Global output trigger counters data block type.
559  * @ingroup alihlt_component_datatypes
560  */
561 # define kAliHLTOutputTriggerCountersDataTypeID     {'O','T','T','R','G','C','N','T'}
562
563 using namespace std;
564
565 extern "C" {
566   //////////////////////////////////////////////////////////////////////////
567   //
568   // Basic HLT data types
569   //
570   //////////////////////////////////////////////////////////////////////////
571
572   typedef unsigned char AliHLTUInt8_t;
573
574   typedef signed char AliHLTInt8_t;
575
576   typedef unsigned short AliHLTUInt16_t;
577
578   typedef signed short AliHLTInt16_t;
579
580   typedef unsigned int AliHLTUInt32_t;
581
582   typedef signed int AliHLTInt32_t;
583
584   typedef unsigned long long AliHLTUInt64_t;
585
586   typedef signed long long AliHLTInt64_t;
587
588   typedef float AliHLTFloat32_t;
589
590   typedef double AliHLTFloat64_t;
591
592   typedef AliHLTUInt64_t AliHLTEventID_t;
593
594   //////////////////////////////////////////////////////////////////////////
595   //
596   // HLT logging levels
597   //
598   //////////////////////////////////////////////////////////////////////////
599
600   /**
601    * Logging severities of the HLT
602    */
603   enum AliHLTComponentLogSeverity {
604     /** no logging */
605     kHLTLogNone      = 0,
606     /** benchmark messages */
607     kHLTLogBenchmark = 0x1,
608     /** debug messages */
609     kHLTLogDebug     = 0x2,
610     /** info messages */
611     kHLTLogInfo      = 0x4,
612     /** warning messages */
613     kHLTLogWarning   = 0x8,
614     /** error messages */
615     kHLTLogError     = 0x10,
616     /** fatal error messages */
617     kHLTLogFatal     = 0x20,
618     /** few important messages not to be filtered out.
619      * redirected to kHLTLogInfo in AliRoot
620      */
621     kHLTLogImportant = 0x40,
622     /** special value to enable all messages */
623     kHLTLogAll       = 0x7f,
624     /** the default logging filter */
625     kHLTLogDefault   = 0x79
626   };
627
628   //////////////////////////////////////////////////////////////////////////
629   //
630   // HLT data structures for data exchange and external interface
631   //
632   //////////////////////////////////////////////////////////////////////////
633
634   /**
635    * @struct AliHLTComponentEventData
636    * Event descriptor
637    */
638   struct AliHLTComponentEventData
639   {
640     AliHLTUInt32_t fStructSize;        /// Size of this structure in bytes.
641     AliHLTEventID_t fEventID;          /// 64 bit event ID number.
642     AliHLTUInt32_t fEventCreation_s;   /// Event creation time in seconds (Should be added to fEventCreation_us*1e6).
643     AliHLTUInt32_t fEventCreation_us;  /// Fractional event creation time in micro seconds.
644     AliHLTUInt32_t fBlockCnt;          /// The number of raw data blocks received by the component.
645   };
646
647   /**
648    * @struct AliHLTComponentShmData
649    * Shared memory descriptor.
650    * Irrelevant for analysis components.
651    */
652   struct AliHLTComponentShmData
653   {
654     AliHLTUInt32_t fStructSize;  /// Size of this structure in bytes.
655     AliHLTUInt32_t fShmType;     /// The type code of the shared memory.
656     AliHLTUInt64_t fShmID;       /// The shared memory identifier.
657   };
658
659   /**
660    * @defgroup alihlt_component_datatypes Common Component Data Types
661    * The analysis framework defines a number of common data types for
662    * usage in the detector modules, like e.g. ::kAliHLTAnyDataType
663    * and ::kAliHLTDataTypeDDLRaw. Those data types always have
664    * origin ::kAliHLTDataOriginAny. The correct detector origin can be
665    * set by using operator '|'
666    * <pre>
667    * AliHLTComponentDataType dt=kAliHLTDDLRawDataTypeID|kAliHLTDataOriginTPC
668    * </pre>
669    * @ingroup alihlt_component
670    */
671
672   /**
673    * @struct AliHLTComponentDataType
674    * Data type descriptor for data blocks transferred through the processing
675    * chain.
676    * @ingroup alihlt_component_datatypes
677    */
678   struct AliHLTComponentDataType
679   {
680     AliHLTUInt32_t fStructSize;                            /// Size of this structure in bytes.
681     char fID[kAliHLTComponentDataTypefIDsize];             /// Data type identifier.
682     char fOrigin[kAliHLTComponentDataTypefOriginSize];     /// Subsystem or detector origin of the data.
683   };
684
685   /**
686    * @struct AliHLTComponentBlockData
687    * This is the decription of data blocks exchanged between components.
688    * \b IMPORTANT: The validity of fPtr and fOffset is different for input and
689    * output blocks:
690    * - input blocks: The \em fPtr member always points to the beginning of the data
691    *                 of size \em fSize. fOffset is ignored and should be in most
692    *                 case 0.
693    * - output blocks: The \em fPtr member is ignored by the framework. \em fOffset
694    *                  must specify the start of the data relative to the output
695    *                  buffer. The data block has size \em fSize.
696    */
697   struct AliHLTComponentBlockData
698   {
699     /** size and version of the struct */
700     AliHLTUInt32_t fStructSize;
701     /** shared memory key, ignored by processing components */
702     AliHLTComponentShmData fShmKey;
703     /** offset of output data relative to the output buffer */
704     AliHLTUInt32_t fOffset;
705     /** start of the data for input data blocks, fOffset to be ignored*/
706     void* fPtr;
707     /** size of the data block */
708     AliHLTUInt32_t fSize;
709     /** data type of the data block */
710     AliHLTComponentDataType fDataType;
711     /** data specification of the data block */
712     AliHLTUInt32_t fSpecification;
713   };
714
715   /**
716    * @struct AliHLTComponentEventDoneData
717    * 
718    */
719   struct AliHLTComponentEventDoneData
720   {
721     AliHLTUInt32_t fStructSize;   /// Size of this structure in bytes.
722     AliHLTUInt32_t fDataSize;     /// Size of the data section (following this data member) in bytes.
723     void* fData;                  /// Start of the data section.
724   };
725
726   /**
727    * @struct AliHLTRunDesc
728    * Event descriptor.
729    * The struct is sent with the SOR and EOR events.
730    *
731    * @note
732    * The name of the member fRunType is a bit misleading. This is not
733    * the ALICE Run Type given by the ECS to the sub-system. The member
734    * is an internal HLT run type and a combination of the HLT running
735    * mode and the beam type.
736    * <pre>
737    * Bit 0-2:   beam type identifier
738    * Bit 3-31:  HLT mode
739    * </pre>
740    */
741   struct AliHLTRunDesc
742   {
743     AliHLTUInt32_t fStructSize;   /// Size of this structure in bytes.
744     AliHLTUInt32_t fRunNo;        /// The run number for the current active run.
745     AliHLTUInt32_t fRunType;      /// The HLT run type.
746   };
747
748   /**
749    * @struct AliHLTComponentStatistics
750    * Small block size summary added by the AliHLTComponent base class
751    * if component statistics are enabled (--enable-compstat).
752    *
753    * fLevel is retrieved from incoming block statistics and incremented. 
754    * Incoming block statistics are appended to the newly added one if
755    * --enable-compstat=full has been chosen.
756    *
757    * ChangeLog:
758    *   2009-01-14 fComponentCycleTime added
759    */
760   struct AliHLTComponentStatistics
761   {
762     AliHLTUInt32_t fStructSize;           /// Size of this structure in bytes.
763     AliHLTUInt32_t fLevel;                /// Indicates from which processing stage this information is from.
764     AliHLTUInt32_t fId;                   /// Unique identifier for the chain based on CRC code.
765     AliHLTUInt32_t fTime;                 /// Real wall time used to process the data (micro seconds).
766     AliHLTUInt32_t fCTime;                /// CPU time used to process the data (micro seconds).
767     AliHLTUInt32_t fInputBlockCount;      /// Number of input data blocks.
768     AliHLTUInt32_t fTotalInputSize;       /// Total size in bytes of input data.
769     AliHLTUInt32_t fOutputBlockCount;     /// Number of output data blocks.
770     AliHLTUInt32_t fTotalOutputSize;      /// Total size in bytes of output data.
771     AliHLTUInt32_t fComponentCycleTime;   /// Real wall time indicating the start of the data processing (micro seconds).
772   };
773
774   /**
775    * @struct AliHLTComponentTableEntry
776    * Structure to be send on SOR event through the chain.
777    * The 'length' of the structure is variable and depends on the length
778    * of the buffer at the end.
779    *
780    * ComponentTableEntries are sent with data type @ref kAliHLTDataTypeComponentTable
781    * and are identified by a 32bit Id specification generated by a CRC
782    * algorithm from the chain Id of the component. This is not a 100% unique
783    * id but with a high probability. This approach accounts for the fact
784    * that all components are separated processes. 
785    *
786    * The buffer consists of an array of 32bit Ids containing the Ids of
787    * all direct parents taken from the specification of the data blocks.
788    * The number of parents is stored in fNofParents. Each component forwards the
789    * incoming component table entries with data type @ref kAliHLTDataTypeComponentFwdTable
790    * by that the direct parents can be identified.
791    *
792    * Following this array a description string contains the chain id, component args, and
793    * maybe more properties in the future. The current format is
794    * 'chain_id{component_id:component args}' e.g. TPC-CF_00_0{TPCClusterFinder32Bit:-deconvolute-time}
795    */
796   struct AliHLTComponentTableEntry
797   {
798     AliHLTUInt32_t fStructSize;           /// Size of this structure in bytes.
799     AliHLTUInt32_t fLevel;                /// Indicates from which processing stage this information is from.
800     AliHLTUInt16_t fNofParents;           /// size of the array of parent ids
801     AliHLTUInt8_t  fSizeDescription;      /// size of the description string in the appended buffer
802     AliHLTUInt8_t  fBuffer[1];            /// the strings: chain id, component args, reserved
803   };
804
805   //////////////////////////////////////////////////////////////////////////
806   //
807   // Trigger meta information
808   //
809   //////////////////////////////////////////////////////////////////////////
810
811   /** field size of fAttribute */
812   const int gkAliHLTBlockDAttributeCount = 8;
813
814   /** field size of fCommonHeader */
815   const int gkAliHLTCommonHeaderCount = 8;
816
817   /** size of the DDL list first version */
818   const int gkAliHLTDDLListSizeV0 = 30;
819
820   /** size of the DDL list after DCAL added to EMCAL */
821   const int gkAliHLTDDLListSizeV1 = 31;
822
823   /** size of the DDL list */
824   const int gkAliHLTDDLListSize = gkAliHLTDDLListSizeV1;
825
826   /** Number of Trigger Classes of CTP in CDH */
827   const int gkNCTPTriggerClasses = 50;
828
829   /**
830    * @struct AliHLTEventDDLV0
831    * First version of the DDL list event.
832    * The struct is send with the DDLLIST event.
833    * Used in the trigger structure for internal apperance of 
834    * the DLLs as well as for the HLT readout list send to DAQ 
835    * ( as DataType : kAliHLTDataTypeDDL )
836    */
837   struct AliHLTEventDDLV0
838   {
839     AliHLTUInt32_t fCount;                       /// Indicates the number of words in fList.
840     AliHLTUInt32_t fList[gkAliHLTDDLListSizeV0];   /// The list of DDL enable/disable bits.
841   };
842
843   /**
844    * @struct AliHLTEventDDLV1
845    * DDL list event structure with extra word for DCAL bits.
846    */
847   struct AliHLTEventDDLV1
848   {
849     AliHLTUInt32_t fCount;                       /// Indicates the number of words in fList.
850     AliHLTUInt32_t fList[gkAliHLTDDLListSizeV1];   /// The list of DDL enable/disable bits.
851   };
852   
853   /**
854    * @typedef AliHLTEventDDL
855    * Current used default version of the AliHLTEventDDL structure.
856    */
857   typedef AliHLTEventDDLV1 AliHLTEventDDL;
858
859   /**
860    * @struct AliHLTEventTriggerData
861    */
862   struct AliHLTEventTriggerData
863   {
864     AliHLTUInt8_t  fAttributes[gkAliHLTBlockDAttributeCount];  /// List of data block attibutes.
865     AliHLTUInt64_t fHLTStatus; /// Bit field 
866     AliHLTUInt32_t fCommonHeaderWordCnt;  /// Number of words in fCommonHeader.
867     AliHLTUInt32_t fCommonHeader[gkAliHLTCommonHeaderCount];  /// The common header words.
868     union
869     {
870       AliHLTEventDDL fReadoutList;   /// The default readout list structure.
871       AliHLTEventDDLV0 fReadoutListV0;   /// Access to the old version of the readout list structure.
872       AliHLTEventDDLV1 fReadoutListV1;   /// Access to the readout list structure with DCAL included.
873     };
874   };
875
876   /**
877    * @struct AliHLTComponentTriggerData
878    * Trigger data
879    */
880   struct AliHLTComponentTriggerData
881   {
882     AliHLTUInt32_t fStructSize;  /// Size of this structure in bytes.
883     AliHLTUInt32_t fDataSize;    /// Size of the data section (following this data member) in bytes.
884     void* fData;                 /// Start of the data section.
885   };
886
887   //////////////////////////////////////////////////////////////////////////
888   //
889   // HLT Event Type Specification
890   //
891   //////////////////////////////////////////////////////////////////////////
892
893   /** Unknown eventType specification */
894   const AliHLTUInt32_t gkAliEventTypeUnknown = ~(AliHLTUInt32_t)0;
895   /** SOR eventType specification */ 
896   const AliHLTUInt32_t gkAliEventTypeStartOfRun=1;
897   /** Data eventType specification */
898   const AliHLTUInt32_t gkAliEventTypeData=2;
899   /** EOR eventType specification */ 
900   const AliHLTUInt32_t gkAliEventTypeEndOfRun=4;
901   /** Corrupt eventType specification */
902   const AliHLTUInt32_t gkAliEventTypeCorruptID=8;
903   /** Calibration eventType specification */ 
904   const AliHLTUInt32_t gkAliEventTypeCalibration=16;
905   /** Software eventType specification */ 
906   const AliHLTUInt32_t gkAliEventTypeSoftware=24;
907   /** DataReplay eventType specification */
908   const AliHLTUInt32_t gkAliEventTypeDataReplay=32;
909   /** Configuration eventType specification */
910   const AliHLTUInt32_t gkAliEventTypeConfiguration=34;
911   /** Update DCS eventType specification */
912   const AliHLTUInt32_t gkAliEventTypeReadPreprocessor=35;
913   /** Tick eventType specification */ 
914   const AliHLTUInt32_t gkAliEventTypeTick=64;
915   /** Max eventType specification */ 
916   const AliHLTUInt32_t gkAliEventTypeMax=64;
917
918   //////////////////////////////////////////////////////////////////////////
919   //
920   // HLT defines and defaults
921   //
922   //////////////////////////////////////////////////////////////////////////
923
924   /** invalid event id 
925    * @ingroup alihlt_component_datatypes
926    */
927   const AliHLTEventID_t kAliHLTVoidEventID=~(AliHLTEventID_t)0;
928
929   /** invalid data specification 
930    * @ingroup alihlt_component_datatypes
931    */
932   const AliHLTUInt32_t kAliHLTVoidDataSpec = ~(AliHLTUInt32_t)0;
933
934   /** invalid run no
935    * @ingroup alihlt_component_datatypes
936    */
937   const AliHLTUInt32_t kAliHLTVoidRunNo = ~(AliHLTUInt32_t)0;
938
939   /** invalid run type
940    * @ingroup alihlt_component_datatypes
941    */
942   const AliHLTUInt32_t kAliHLTVoidRunType = ~(AliHLTUInt32_t)0;
943
944   /** invalid run descriptor
945    * @ingroup alihlt_component_datatypes
946    */
947   const AliHLTRunDesc kAliHLTVoidRunDesc={sizeof(AliHLTRunDesc), kAliHLTVoidRunNo, kAliHLTVoidRunType};
948
949   /** invalid shared memory type */
950   const AliHLTUInt32_t gkAliHLTComponentInvalidShmType = 0;
951
952   /** invalid shared memory id */
953   const AliHLTUInt64_t gkAliHLTComponentInvalidShmID = ~(AliHLTUInt64_t)0;
954
955   /** invalid data type 
956    * @ingroup alihlt_component_datatypes
957    */
958   const AliHLTComponentDataType kAliHLTVoidDataType = {
959     sizeof(AliHLTComponentDataType),
960     kAliHLTVoidDataTypeID,
961     kAliHLTDataOriginVoid
962   };
963
964   /** all data types, means any + void data type
965    * @ingroup alihlt_component_datatypes
966    */
967   const AliHLTComponentDataType kAliHLTAllDataTypes = {
968     sizeof(AliHLTComponentDataType),
969     kAliHLTAllDataTypesID,
970     kAliHLTDataOriginAny
971   };
972
973   // there is currently a problem with rootcint if the predefined ids
974   // (commented below) are used. rootcint does not find the id if they
975   // are char arrays defined with {} and individual chars. If strings
976   // are used it works fine
977   /** any data type 
978    * @ingroup alihlt_component_datatypes
979    */
980   const AliHLTComponentDataType kAliHLTAnyDataType = {
981     sizeof(AliHLTComponentDataType),
982     kAliHLTAnyDataTypeID,
983     kAliHLTDataOriginAny
984   };
985
986   /** multiple output data types 
987    * @ingroup alihlt_component_datatypes
988    */
989   extern const AliHLTComponentDataType kAliHLTMultipleDataType;
990
991   /** data to file exchange subscriber 
992    * @ingroup alihlt_component_datatypes
993    */
994   extern const AliHLTComponentDataType kAliHLTDataTypeFXSCalib;
995
996   /** DDL list data type 
997    * @ingroup alihlt_component_datatypes
998    */
999   extern const AliHLTComponentDataType kAliHLTDataTypeDDL;
1000
1001   /** DAQ readout list 
1002    * @ingroup alihlt_component_datatypes
1003    */
1004   extern const AliHLTComponentDataType kAliHLTDataTypeDAQRDOUT;
1005
1006   /** CLUSTERS data
1007    * Common data type for the output of cluster finders, the exact
1008    * format depends on the origin (detector)
1009    * @ingroup alihlt_component_datatypes
1010    */
1011   extern const AliHLTComponentDataType kAliHLTDataTypeClusters;
1012
1013   /** SOR data type 
1014    * @ingroup alihlt_component_datatypes
1015    */
1016   extern const AliHLTComponentDataType kAliHLTDataTypeSOR;
1017
1018   /** EOR data type 
1019    * @ingroup alihlt_component_datatypes
1020    */
1021   extern const AliHLTComponentDataType kAliHLTDataTypeEOR;
1022
1023   /** Run type data block 
1024    * @ingroup alihlt_component_datatypes
1025    */
1026   extern const AliHLTComponentDataType kAliHLTDataTypeRunType;
1027
1028   /** Event type specification 
1029    * @ingroup alihlt_component_datatypes
1030    */
1031   extern const AliHLTComponentDataType kAliHLTDataTypeEvent;
1032
1033   /** ECS parameter event 
1034    * - sent during the SOR event by the framework
1035    * - contains the full ECS parameter string
1036    * @ingroup alihlt_component_datatypes
1037    */
1038   extern const AliHLTComponentDataType kAliHLTDataTypeECSParam; // {ECSPARAM:PRIV}
1039
1040   /** Configuration event data type 
1041    * @ingroup alihlt_component_datatypes
1042    */
1043   extern const AliHLTComponentDataType kAliHLTDataTypeComConf;
1044
1045   /** DCS value update event 
1046    * @ingroup alihlt_component_datatypes
1047    */
1048   extern const AliHLTComponentDataType kAliHLTDataTypeUpdtDCS;
1049
1050   /** RAW DDL data specification, origin is 'any', data publisher origin correctly 
1051    * @ingroup alihlt_component_datatypes
1052    */
1053   extern const AliHLTComponentDataType kAliHLTDataTypeDDLRaw;
1054
1055   /** AliMCEvent object data specification, origin is 'OFFL' 
1056    * @ingroup alihlt_component_datatypes
1057    */
1058   extern const AliHLTComponentDataType kAliHLTDataTypeMCObject;
1059
1060   /** ESD vertex object data specification, origin is 'any' 
1061    * @ingroup alihlt_component_datatypes
1062    */
1063   extern const AliHLTComponentDataType kAliHLTDataTypeESDVertex;
1064
1065    /** KF vertex object data specification, origin is 'any'
1066    * @ingroup alihlt_component_datatypes
1067    */
1068   extern const AliHLTComponentDataType kAliHLTDataTypeKFVertex;
1069
1070   /** global vertexer data specification, origin is 'any'
1071    * @ingroup alihlt_component_datatypes
1072    */
1073   extern const AliHLTComponentDataType kAliHLTDataTypeGlobalVertexer;
1074
1075   /** primary finder data specification, origin is 'any'
1076    * @ingroup alihlt_component_datatypes
1077    */
1078   extern const AliHLTComponentDataType kAliHLTDataTypePrimaryFinder;
1079
1080   /** primary finder data specification, origin is 'any'
1081    * @ingroup alihlt_component_datatypes
1082    */
1083   extern const AliHLTComponentDataType kAliHLTDataTypeV0Finder;
1084
1085   /** ESD object data specification, origin is 'any' 
1086    * @ingroup alihlt_component_datatypes
1087    */
1088   extern const AliHLTComponentDataType kAliHLTDataTypeESDObject;
1089
1090   /** ESD content data specification, origin is 'any' 
1091    * @ingroup alihlt_component_datatypes
1092    */
1093   extern const AliHLTComponentDataType kAliHLTDataTypeESDContent;
1094
1095   /** ESD Tree data specification, origin is 'any' 
1096    * @ingroup alihlt_component_datatypes
1097    */
1098   extern const AliHLTComponentDataType kAliHLTDataTypeESDTree;
1099
1100   /** AliRoot TreeD data specification, origin is 'any' 
1101    * @ingroup alihlt_component_datatypes
1102    */
1103   extern const AliHLTComponentDataType kAliHLTDataTypeAliTreeD;
1104
1105   /** AliRoot TreeR data specification, origin is 'any' 
1106    * @ingroup alihlt_component_datatypes
1107    */
1108   extern const AliHLTComponentDataType kAliHLTDataTypeAliTreeR;
1109
1110   /** 16 bit Hardware address selection data specification, origin is 'any' 
1111    * @ingroup alihlt_component_datatypes
1112    */
1113   extern const AliHLTComponentDataType kAliHLTDataTypeHwAddr16;
1114
1115   /** Event statistics 
1116    * @ingroup alihlt_component_datatypes
1117    */
1118   extern const AliHLTComponentDataType kAliHLTDataTypeEventStatistics;
1119
1120   /** Event summary 
1121    * @ingroup alihlt_component_datatypes
1122    */
1123   extern const AliHLTComponentDataType kAliHLTDataTypeEventSummary;
1124
1125   /** Event statistics 
1126    * @ingroup alihlt_component_datatypes
1127    */
1128   extern const AliHLTComponentDataType kAliHLTDataTypeRunStatistics;
1129
1130   /** Run summary 
1131    * @ingroup alihlt_component_datatypes
1132    */
1133   extern const AliHLTComponentDataType kAliHLTDataTypeRunSummary;
1134
1135   /** Trigger decision
1136    * - origin : kAliHLTDataOriginOut ( HLT )
1137    * @ingroup alihlt_component_datatypes
1138    */
1139   extern const AliHLTComponentDataType kAliHLTDataTypeTriggerDecision;   // {TRIG_DEC:HLT }
1140
1141   /** Trigger decision
1142    * - origin : kAliHLTDataOriginOut ( HLT )
1143    * @ingroup alihlt_component_datatypes
1144    */
1145   extern const AliHLTComponentDataType kAliHLTDataTypeReadoutList;   // {HLTRDLST:HLT }
1146
1147   /** Global trigger decision
1148    * - origin : kAliHLTDataOriginOut ( HLT )
1149    * @ingroup alihlt_component_datatypes
1150    */
1151   extern const AliHLTComponentDataType kAliHLTDataTypeGlobalTrigger;     // {GLOBTRIG:HLT }
1152
1153   /** Component block statistics
1154    * @ingroup alihlt_component_datatypes
1155    */
1156   extern const AliHLTComponentDataType kAliHLTDataTypeComponentStatistics;
1157
1158   /** Component table
1159    * To be sent on SOR event, each component adds it's chain id string
1160    * and a generated 32bit identifier to the table
1161    * @ingroup alihlt_component_datatypes
1162    */
1163   extern const AliHLTComponentDataType kAliHLTDataTypeComponentTable;
1164
1165   /** Forwarded component table
1166    * To be sent on SOR event, each component forwards blocks of type
1167    * @ref kAliHLTDataTypeComponentTable was kAliHLTDataTypeComponentFwdTable
1168    * after adding the parent ids to its own table struct.
1169    * @ingroup alihlt_component_datatypes
1170    */
1171   extern const AliHLTComponentDataType kAliHLTDataTypeComponentFwdTable;
1172
1173   //////////////////////////////////////////////////////////////////////////
1174   //
1175   // Data Types for Monitoring objects
1176   //
1177   //////////////////////////////////////////////////////////////////////////
1178
1179   /** general ROOT TObject 
1180    * @ingroup alihlt_component_datatypes
1181    */
1182   extern const AliHLTComponentDataType kAliHLTDataTypeTObject;            // {ROOTTOBJ,"***"}
1183
1184   /** ROOT streamer info
1185    * @ingroup alihlt_component_datatypes
1186    */
1187   extern const AliHLTComponentDataType kAliHLTDataTypeStreamerInfo;       // {ROOTSTRI,HLT }
1188                                                                                         
1189   /** ROOT TObjArray 
1190    * @ingroup alihlt_component_datatypes
1191    */                                                                   
1192   extern const AliHLTComponentDataType kAliHLTDataTypeTObjArray;          // {ROOTOBAR,"***"}
1193                                                                                         
1194   /** ROOT TTree 
1195    * @ingroup alihlt_component_datatypes
1196    */                                                                   
1197   extern const AliHLTComponentDataType kAliHLTDataTypeTTree;              // {ROOTTREE,"***"}
1198                                                                                         
1199   /** ROOT TH1 (can be used for all histograms, they derive from TH1) 
1200    * @ingroup alihlt_component_datatypes
1201    */           
1202   extern const AliHLTComponentDataType kAliHLTDataTypeHistogram;          // {ROOTHIST,"***"}
1203                                                                                         
1204   /** ROOT TNtuple 
1205    * @ingroup alihlt_component_datatypes
1206    */                                                                   
1207   extern const AliHLTComponentDataType kAliHLTDataTypeTNtuple;            // {ROOTTUPL,"***"}
1208
1209   /** Global input trigger counters.
1210    * - origin : kAliHLTDataOriginOut ( HLT )
1211    * @ingroup alihlt_component_datatypes
1212    */
1213   extern const AliHLTComponentDataType kAliHLTDataTypeInputTriggerCounters;     // {INTRGCNT:HLT }
1214
1215   /** Global output trigger counters.
1216    * - origin : kAliHLTDataOriginOut ( HLT )
1217    * @ingroup alihlt_component_datatypes
1218    */
1219   extern const AliHLTComponentDataType kAliHLTDataTypeOutputTriggerCounters;     // {OTTRGCNT:HLT }
1220
1221   /** General track array for the barrel tracks based on AliExternalTrackParam
1222    * Data format defined by AliHLTTracksData
1223    *
1224    * We follow the naming scheme of AliESDEvent where 'Tracks' denote the
1225    * barrel tracks and detector tracks get names 'DETTracks'
1226    * @ingroup alihlt_component_datatypes
1227    */   
1228   extern const AliHLTComponentDataType kAliHLTDataTypeTrack;              // {HLTTRACK,"***"}
1229
1230   /** Track Monte Carlo information
1231    */
1232   extern const AliHLTComponentDataType kAliHLTDataTypeTrackMC;            // {TRACK_MC,"***"}
1233
1234   /** TClonesArray of AliExternalTrackParam
1235    * @ingroup alihlt_component_datatypes
1236    */   
1237   extern const AliHLTComponentDataType kAliHLTDataTypeExternalTrackParam; // {TCAEXTTR,"***"}
1238
1239   /** Container containing jets (AliHLTJETJets)
1240    * Containing TClonesArray of AliAODJets 
1241    * @ingroup alihlt_component_datatypes
1242    */   
1243   extern const AliHLTComponentDataType kAliHLTDataTypeJet;                // {HLTJETV0,"***"}
1244   
1245   /** Container of ITS tracks
1246    * @ingroup alihlt_component_datatypes
1247    */   
1248   extern const AliHLTComponentDataType fgkITSTracksDataType;
1249
1250   /** Container of calorimeter clusters
1251    * @ingroup alihlt_component_datatypes
1252    */   
1253   extern const AliHLTComponentDataType kAliHLTDataTypeCaloCluster; 
1254
1255   /** Container of dEdx
1256    * @ingroup alihlt_component_datatypes
1257    */
1258   extern const AliHLTComponentDataType kAliHLTDataTypedEdx;
1259
1260   /** Container of dNdPt
1261    * @ingroup alihlt_component_datatypes
1262    */
1263   extern const AliHLTComponentDataType kAliHLTDataTypedNdPt;
1264
1265   //////////////////////////////////////////////////////////////////////////
1266   //
1267   // FXS subscriber meta information
1268   //
1269   //////////////////////////////////////////////////////////////////////////
1270
1271   const int gkAliHLTFXSHeaderfOriginSize = 4;
1272   const int gkAliHLTFXSHeaderfFileIDSize = 128;
1273   const int gkAliHLTFXSHeaderfDDLNumberSize = 64;
1274
1275   /** Header in front of the data payload, in order to sent data to the FXS. */
1276   struct AliHLTFXSHeader
1277   {
1278     AliHLTUInt32_t fHeaderVersion;   /// HLT software version number.
1279     AliHLTUInt32_t fRunNumber;       /// The current run number.
1280     char fOrigin[gkAliHLTFXSHeaderfOriginSize];   /// The detector from which the FXS data is received.
1281     char fFileID[gkAliHLTFXSHeaderfFileIDSize];   /// File identifier for the stored data.
1282     char fDDLNumber[gkAliHLTFXSHeaderfDDLNumberSize];  /// The DDL bits.
1283   };  
1284
1285   //////////////////////////////////////////////////////////////////////////
1286   //
1287   // Component running environment
1288   //
1289   //////////////////////////////////////////////////////////////////////////
1290
1291   /** definition of a void fct pointer */
1292   typedef void (*AliHLTfctVoid)();
1293
1294   /** logging function */
1295   typedef int (*AliHLTfctLogging)( void* param, 
1296                                    AliHLTComponentLogSeverity severity,
1297                                    const char* origin,
1298                                    const char* keyword,
1299                                    const char* message);
1300
1301   /**
1302    * @struct AliHLTAnalysisEnvironment
1303    * Running environment for analysis components.
1304    * The struct describes function callbacks for actions to be
1305    * carried out by the calling framework, like memory allocation,
1306    * property callbecks, logging, etc.
1307    *
1308    * @ingroup alihlt_wrapper_interface
1309    */
1310   struct AliHLTAnalysisEnvironment
1311   {
1312     /** size of the structure */
1313     AliHLTUInt32_t fStructSize;
1314
1315     /** the component parameter given by the framework on creation */
1316     void* fParam;
1317
1318     /** allocated memory */
1319     void* (*fAllocMemoryFunc)( void* param, unsigned long size );
1320
1321     /** allocate an EventDoneData structure. */
1322     int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd );
1323
1324     /** logging callback */
1325     AliHLTfctLogging fLoggingFunc;
1326   };
1327 #if 0
1328   // I just keep this as a note pad. Has to be added to the end of the structure
1329   // future addition already foreseen/envisioned
1330   // IMPORTANT: don not just remove the defines as this breaks the binary
1331   // compatibility
1332   int (*fAllocShmMemoryFunc)( void* param, unsigned long size, AliHLTComponentBlockData* blockLocation );
1333 #endif
1334
1335   /**
1336    * @struct AliHLTComponentEnvironment
1337    * This was the original definition of the running environment.
1338    * Due to a bug in the AliRootWrapperSubscriber/SimpleComponentWrapper,
1339    * this structure can not be used any longer but is kept for backward
1340    * compatibility. 
1341    * @note The external interface provided by the libHLTbase is now kept
1342    * frozen but should not be used any more. Use the interface provided
1343    * by the libHLTinterface library.
1344    *
1345    * @ingroup alihlt_wrapper_interface_deprecated
1346    */
1347   struct AliHLTComponentEnvironment
1348   {
1349     AliHLTUInt32_t fStructSize;
1350     void* fParam;
1351     void* (*fAllocMemoryFunc)( void* param, unsigned long size );
1352     int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd );
1353     AliHLTfctLogging fLoggingFunc;
1354   };
1355
1356   //////////////////////////////////////////////////////////////////////////
1357   //
1358   // The external interface definition
1359   //
1360   //////////////////////////////////////////////////////////////////////////
1361
1362   /**
1363    * The component handle.
1364    * Used as indification in the outside world.
1365    * @ingroup alihlt_wrapper_interface
1366    */
1367   typedef void* AliHLTComponentHandle;
1368
1369   /** @ingroup alihlt_wrapper_interface */
1370   const AliHLTComponentHandle kEmptyHLTComponentHandle = 0;
1371
1372   /**
1373    * Get a system call of the interface.
1374    * @param function signature
1375    * @return pointer to system call
1376    * @ingroup alihlt_wrapper_interface
1377    */
1378   typedef void* (*AliHLTAnalysisFctGetInterfaceCall)(const char*);
1379
1380 # define ALIHLTANALYSIS_INTERFACE_LIBRARY  "libHLTinterface.so"
1381 # define ALIHLTANALYSIS_FCT_GETINTERFACECALL  "AliHLTAnalysisGetInterfaceCall"
1382
1383   /** @ingroup alihlt_wrapper_interface */
1384   typedef int (*AliHLTExtFctInitSystem)( unsigned long version, AliHLTAnalysisEnvironment* externalEnv, unsigned long runNo, const char* runType );
1385
1386   /** @ingroup alihlt_wrapper_interface */
1387   typedef int (*AliHLTExtFctDeinitSystem)();
1388
1389   /** @ingroup alihlt_wrapper_interface */
1390   typedef int (*AliHLTExtFctLoadLibrary)( const char* );
1391
1392   /** @ingroup alihlt_wrapper_interface */
1393   typedef int (*AliHLTExtFctUnloadLibrary)( const char* );
1394
1395   /** @ingroup alihlt_wrapper_interface */
1396   typedef int (*AliHLTExtFctCreateComponent)( const char*, void*, int, const char**, AliHLTComponentHandle*, const char* description );
1397
1398   /** @ingroup alihlt_wrapper_interface */
1399   typedef int (*AliHLTExtFctDestroyComponent)( AliHLTComponentHandle );
1400
1401   /** @ingroup alihlt_wrapper_interface */
1402   typedef int (*AliHLTExtFctProcessEvent)( AliHLTComponentHandle, const AliHLTComponentEventData*, const AliHLTComponentBlockData*, 
1403                                            AliHLTComponentTriggerData*, AliHLTUInt8_t*,
1404                                            AliHLTUInt32_t*, AliHLTUInt32_t*, 
1405                                            AliHLTComponentBlockData**,
1406                                            AliHLTComponentEventDoneData** );
1407
1408   /** @ingroup alihlt_wrapper_interface */
1409   typedef int (*AliHLTExtFctGetOutputDataType)( AliHLTComponentHandle, AliHLTComponentDataType* );
1410
1411   /** @ingroup alihlt_wrapper_interface */
1412   typedef int (*AliHLTExtFctGetOutputSize)( AliHLTComponentHandle, unsigned long*, double* );
1413
1414 }
1415
1416 //////////////////////////////////////////////////////////////////////////
1417 //
1418 // Data type helper functions
1419 //
1420 //////////////////////////////////////////////////////////////////////////
1421
1422 /** exact comparison of HLT component data types
1423  * @ingroup alihlt_component_datatypes
1424  */
1425 inline bool MatchExactly( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1426 {
1427   for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ )
1428     if ( dt1.fID[i] != dt2.fID[i] )
1429       return false;
1430   for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
1431     if ( dt1.fOrigin[i] != dt2.fOrigin[i] )
1432       return false;
1433   return true;
1434 }
1435
1436 /** Comparison operator for HLT component data types.
1437  * The operator takes wildcards into account, i.e. the ::kAliHLTAnyDataType,
1438  * ::kAliHLTAnyDataTypeID and ::kAliHLTDataOriginAny definitions.
1439  * @ingroup alihlt_component_datatypes
1440  */
1441 inline bool operator==( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1442 {
1443   if (MatchExactly(dt1, kAliHLTAllDataTypes)) return true;
1444   if (MatchExactly(dt2, kAliHLTAllDataTypes)) return true;
1445
1446   bool any1=true, any2=true, void1=true, void2=true, match=true;
1447   for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) {
1448     any1&=(dt1.fOrigin[i]==kAliHLTDataOriginAny[i]);
1449     any2&=(dt2.fOrigin[i]==kAliHLTDataOriginAny[i]);
1450     void1&=(dt1.fOrigin[i]==kAliHLTDataOriginVoid[i]);
1451     void2&=(dt2.fOrigin[i]==kAliHLTDataOriginVoid[i]);
1452     match&=dt1.fOrigin[i]==dt2.fOrigin[i];
1453     if (!(match || (any2 && !void1) || (any1 && !void2)))
1454       return false;
1455   }
1456
1457   any1=true, any2=true, match=true;
1458   for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ ) {
1459     any1&=(dt1.fID[i]==kAliHLTAnyDataTypeID[i]);
1460     any2&=(dt2.fID[i]==kAliHLTAnyDataTypeID[i]);
1461     void1&=(dt1.fID[i]==kAliHLTVoidDataTypeID[i]);
1462     void2&=(dt2.fID[i]==kAliHLTVoidDataTypeID[i]);
1463     match&=dt1.fID[i]==dt2.fID[i];
1464     if (!(match || (any2 && !void1) || (any1 && !void2)))
1465       return false;
1466   }
1467   return true;
1468 }
1469
1470 /** Comparison operator for HLT component data types
1471  * Invers of operator==
1472  * @ingroup alihlt_component_datatypes
1473  */
1474 inline bool operator!=( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1475 {
1476   return !(dt1==dt2);
1477 }
1478
1479 /** merge operator for HLT component data types and origins
1480  * @ingroup alihlt_component_datatypes
1481  */
1482 inline AliHLTComponentDataType operator|(const AliHLTComponentDataType srcdt, const char origin[kAliHLTComponentDataTypefOriginSize])
1483 {
1484   AliHLTComponentDataType dt=srcdt;
1485   for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
1486     dt.fOrigin[i]=origin[i];
1487   return dt;
1488 }
1489
1490 /**
1491  * Helper function to initialize a data type from an id char array and origin string.
1492  * @return data type structure initialized with the specified id and origin
1493  * @ingroup alihlt_component_datatypes
1494  */
1495 inline AliHLTComponentDataType AliHLTComponentDataTypeInitializer(const char id[kAliHLTComponentDataTypefIDsize], const char* origin)
1496 {
1497   AliHLTComponentDataType dt=kAliHLTVoidDataType;
1498   int i=0;
1499   for (i = 0; i < kAliHLTComponentDataTypefIDsize && id[i]!=0; i++)
1500     dt.fID[i]=id[i];
1501   for (i = 0; i < kAliHLTComponentDataTypefOriginSize && origin[i]!=0; i++ )
1502     dt.fOrigin[i]=origin[i];
1503   return dt;
1504 }
1505
1506 /**
1507  * Helper function to initialize a data type from a default data type and
1508  * an origin string. Basically it merges the specified origin into the data
1509  * type.
1510  * @return data type structure initialized with the id from specified data type
1511  *         and origin
1512  * @ingroup alihlt_component_datatypes
1513  */
1514 inline AliHLTComponentDataType AliHLTComponentDataTypeInitializer(const AliHLTComponentDataType src, const char* origin)
1515 {
1516   return AliHLTComponentDataTypeInitializer(src.fID, origin);
1517 }
1518
1519 #endif