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