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