]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTDataTypes.h
299f4f189c7cb3a5478f2cb0862e47c0c990cefe
[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  */
37 #define ALIHLT_DATA_TYPES_VERSION 6
38
39 //////////////////////////////////////////////////////////////////////////
40 //
41 // HLT data origin variables.
42 //
43 // By converting from defines to variables, the origins can be used with
44 // the operator|
45 //
46 // AliHLTComponentDataType dt;
47 // dt = kAliHLTDataTypeDDLRaw | gkAliHLTDataOriginTPC;
48 //
49 //////////////////////////////////////////////////////////////////////////
50
51 /** field size of datat type origin 
52  * @ingroup alihlt_component_datatypes
53  */
54 const int kAliHLTComponentDataTypefOriginSize=4;
55
56
57 /** invalid data origin 
58  * @ingroup alihlt_component_datatypes
59  */
60 # define kAliHLTDataOriginVoid "\0\0\0"
61 /** old invalid data origin, kept for backward compatibility */
62 # define kAliHLTVoidDataOrigin "\0\0\0"
63
64 /** wildcard data type origin 
65  * @ingroup alihlt_component_datatypes
66  */
67 # define kAliHLTDataOriginAny "***"
68 /** old wildcard data type origin, kept for backward compatibility */
69 # define kAliHLTAnyDataOrigin "***"
70
71 /** Data origin HLT out 
72  * @ingroup alihlt_component_datatypes
73  */
74 extern const char kAliHLTDataOriginOut[kAliHLTComponentDataTypefOriginSize];
75
76 /** Data origin HLT/PubSub private internal 
77  * @ingroup alihlt_component_datatypes
78  */
79 extern const char kAliHLTDataOriginPrivate[kAliHLTComponentDataTypefOriginSize];
80
81 /** Data origin TPC 
82  * @ingroup alihlt_component_datatypes
83  */
84 extern const char kAliHLTDataOriginTPC[kAliHLTComponentDataTypefOriginSize];
85
86 /** Data origin PHOS 
87  * @ingroup alihlt_component_datatypes
88  */
89 extern const char kAliHLTDataOriginPHOS[kAliHLTComponentDataTypefOriginSize];
90
91 /** Data origin MUON 
92  * @ingroup alihlt_component_datatypes
93  */
94 extern const char kAliHLTDataOriginMUON[kAliHLTComponentDataTypefOriginSize];
95
96 /** Data origin TRD 
97  * @ingroup alihlt_component_datatypes
98  */
99 extern const char kAliHLTDataOriginTRD[kAliHLTComponentDataTypefOriginSize];
100
101 /** Data origin ITS 
102  * @ingroup alihlt_component_datatypes
103  */
104 extern const char kAliHLTDataOriginITS[kAliHLTComponentDataTypefOriginSize];
105
106 /** Data origin for examples 
107  * @ingroup alihlt_component_datatypes
108  */
109 extern const char kAliHLTDataOriginSample[kAliHLTComponentDataTypefOriginSize];
110
111 /** Data origin EMCAL 
112  * @ingroup alihlt_component_datatypes
113  */
114 extern const char kAliHLTDataOriginEMCAL[kAliHLTComponentDataTypefOriginSize];
115
116 //////////////////////////////////////////////////////////////////////////
117 //
118 // HLT common data type defines
119 //
120 //////////////////////////////////////////////////////////////////////////
121
122 /** field size of data type id 
123  * @ingroup alihlt_component_datatypes
124  */
125 const int kAliHLTComponentDataTypefIDsize=8;
126
127
128 /** invalid data type id 
129  * @ingroup alihlt_component_datatypes
130  */
131 # define kAliHLTVoidDataTypeID "\0\0\0\0\0\0\0"
132
133 /** special id for all data types: any + void
134  * @ingroup alihlt_component_datatypes
135  */
136 # define kAliHLTAllDataTypesID "ALLDATA"
137
138 /** special id for any valid data type id
139  * @ingroup alihlt_component_datatypes
140  */
141 # define kAliHLTAnyDataTypeID "*******"
142
143 /** DDL RAW data 
144  * @ingroup alihlt_component_datatypes
145  */
146 # define kAliHLTDDLRawDataTypeID   {'D','D','L','_','R','A','W',' '}
147
148 /** calibration data for file exchange subscriber 
149  * @ingroup alihlt_component_datatypes
150  */
151 # define kAliHLTFXSCalibDataTypeID {'F','X','S','_','C','A','L',' '}
152
153 /** start of run (SOR) event 
154  * @ref AliHLTRunDesc
155  * @ingroup alihlt_component_datatypes
156  */
157 # define kAliHLTSORDataTypeID      {'S','T','A','R','T','O','F','R'}
158
159 /** end of run (EOR) event 
160  * @ref AliHLTRunDesc
161  * @ingroup alihlt_component_datatypes
162  */
163 # define kAliHLTEORDataTypeID      {'E','N','D','O','F','R','U','N'}
164
165 /** DDL list event 
166  * @ref AliHLTEventDDL
167  * @ingroup alihlt_component_datatypes
168  */
169 # define kAliHLTDDLDataTypeID      {'D','D','L','L','I','S','T',' '}
170
171 /** EventType event 
172  * - empty payload, specification gives eventType
173  * @ingroup alihlt_component_datatypes
174  */
175 # define kAliHLTEventDataTypeID    {'E','V','E','N','T','T','Y','P'}
176
177 /** ComponentConfiguration event
178  * - payload contains the CDB path as string
179  * @ingroup alihlt_component_datatypes
180  */
181 # define kAliHLTComConfDataTypeID  {'C','O','M','_','C','O','N','F'}
182
183 /** DCS value update event
184  * - payload contains string of relevant detectors
185  * @ingroup alihlt_component_datatypes
186  */
187 # define kAliHLTUpdtDCSDataTypeID  {'U','P','D','T','_','D','C','S'}
188
189 /** ESD data block
190  * an AliESD object of varying origin
191  * The 'V0' at the end allows a versioning
192  * @ingroup alihlt_component_datatypes
193  */
194 # define kAliHLTESDObjectDataTypeID    {'A','L','I','E','S','D','V','0'}
195
196 /** ESD tree data block
197  * TTree with an AliESD object of varying origin
198  * @ingroup alihlt_component_datatypes
199  */
200 # define kAliHLTESDTreeDataTypeID      {'E','S','D','_','T','R','E','E'}
201
202 /** AliRoot TreeD
203  * - the digits tree of an AliRoot module
204  * @ingroup alihlt_component_datatypes
205  */
206 #define kAliHLTTreeDDataTypeID         {'A','L','I','T','R','E','E','D'}
207
208 /** AliRoot TreeR
209  * - the rec points tree of an AliRoot module
210  * @ingroup alihlt_component_datatypes
211  */
212 #define kAliHLTTreeRDataTypeID         {'A','L','I','T','R','E','E','D'}
213
214 /** HW Address selection data block
215  * - a selection list for 16 bit HW addresses
216  * - varying origin
217  * @ingroup alihlt_component_datatypes
218  */
219 # define kAliHLTHwAddr16DataTypeID     {'H','W','A','D','D','R','1','6'}
220
221 /** Event Statistics
222  * - event statistics for given detectors
223  * - varying origin
224  * @ingroup alihlt_component_datatypes
225  */
226 # define kAliHLTEventStatisticsDataTypeID     {'E','V','_','S','T','A','T','I'}
227
228 /** Event Summary
229  * - event summary
230  * - origin : kAliHLTDataOriginOut ( HLT )
231  * @ingroup alihlt_component_datatypes
232  */
233 # define kAliHLTEventSummaryDataTypeID        {'E','V','_','S','U','M','M','A'}
234
235 /** Run Statistics
236  * - run statistics for given detectors
237  * - varying origin
238  * @ingroup alihlt_component_datatypes
239  */
240 # define kAliHLTRunStatisticsDataTypeID       {'R','U','N','S','T','A','T','I'}
241
242 /** Run Summary
243  * - run summary
244  * - origin : kAliHLTDataOriginOut ( HLT )
245  * @ingroup alihlt_component_datatypes
246  */
247 # define kAliHLTRunSummaryDataTypeID          {'R','U','N','S','U','M','M','A'}
248
249 /** general ROOT TObject
250  * - a general TObject exported from the HLT analysis
251  * - varying origin
252  * @ingroup alihlt_component_datatypes
253  */
254 #define kAliHLTTObjectDataTypeID              {'R','O','O','T','T','O','B','J'}
255
256 /** ROOT TObjArray
257  * - a TObjArray exported from the HLT analysis
258  * - varying origin
259  * @ingroup alihlt_component_datatypes
260  */
261 #define kAliHLTTObjArrayDataTypeID            {'R','O','O','T','O','B','A','R'}
262
263 /** ROOT TTree
264  * - a TTree object exported from the HLT analysis
265  * - varying origin
266  * @ingroup alihlt_component_datatypes
267  */
268 #define kAliHLTTTreeDataTypeID                {'R','O','O','T','T','R','E','E'}
269
270 /** ROOT histogram
271  * - a histogram object exported from the HLT analysis
272  * - class derives from TH1 (directly or indirectly) and inherits all common functionality
273  * - varying origin
274  * @ingroup alihlt_component_datatypes
275  */
276 #define kAliHLTHistogramDataTypeID            {'R','O','O','T','H','I','S','T'}
277
278 /** ROOT TNtuple
279  * - a TNtupl object exported from the HLT analysis
280  * - varying origin
281  * @ingroup alihlt_component_datatypes
282  */
283 #define kAliHLTTNtupleDataTypeID              {'R','O','O','T','T','U','P','L'}
284
285 using namespace std;
286
287 extern "C" {
288   //////////////////////////////////////////////////////////////////////////
289   //
290   // Basic HLT data types
291   //
292   //////////////////////////////////////////////////////////////////////////
293
294   typedef unsigned char AliHLTUInt8_t;
295
296   typedef signed char AliHLTInt8_t;
297
298   typedef unsigned short AliHLTUInt16_t;
299
300   typedef signed short AliHLTInt16_t;
301
302   typedef unsigned int AliHLTUInt32_t;
303
304   typedef signed int AliHLTInt32_t;
305
306   typedef unsigned long long AliHLTUInt64_t;
307
308   typedef signed long long AliHLTInt64_t;
309
310   typedef float AliHLTFloat32_t;
311
312   typedef double AliHLTFloat64_t;
313
314   typedef AliHLTUInt64_t AliHLTEventID_t;
315
316   //////////////////////////////////////////////////////////////////////////
317   //
318   // HLT logging levels
319   //
320   //////////////////////////////////////////////////////////////////////////
321
322   /**
323    * Logging severities of the HLT
324    */
325   enum AliHLTComponentLogSeverity {
326     /** no logging */
327     kHLTLogNone      = 0,
328     /** benchmark messages */
329     kHLTLogBenchmark = 0x1,
330     /** debug messages */
331     kHLTLogDebug     = 0x2,
332     /** info messages */
333     kHLTLogInfo      = 0x4,
334     /** warning messages */
335     kHLTLogWarning   = 0x8,
336     /** error messages */
337     kHLTLogError     = 0x10,
338     /** fatal error messages */
339     kHLTLogFatal     = 0x20,
340     /** few important messages not to be filtered out.
341      * redirected to kHLTLogInfo in AliRoot
342      */
343     kHLTLogImportant = 0x40,
344     /** special value to enable all messages */
345     kHLTLogAll       = 0x7f,
346     /** the default logging filter */
347     kHLTLogDefault   = 0x79
348 };
349
350   //////////////////////////////////////////////////////////////////////////
351   //
352   // HLT data structures for data exchange and external interface
353   //
354   //////////////////////////////////////////////////////////////////////////
355
356   /**
357    * @struct AliHLTComponentEventData
358    * Event descriptor
359    */
360   struct AliHLTComponentEventData
361   {
362     AliHLTUInt32_t fStructSize;
363     AliHLTEventID_t fEventID;
364     AliHLTUInt32_t fEventCreation_s;
365     AliHLTUInt32_t fEventCreation_us;
366     AliHLTUInt32_t fBlockCnt;
367   };
368
369   /**
370    * @struct AliHLTComponentShmData
371    * Shared memory descriptor.
372    * Irrelevant for analysis components.
373    */
374   struct AliHLTComponentShmData
375   {
376     AliHLTUInt32_t fStructSize;
377     AliHLTUInt32_t fShmType;
378     AliHLTUInt64_t fShmID;
379   };
380
381   /**
382    * @defgroup alihlt_component_datatypes Common Component Data Types
383    * The analysis framework defines a number of common data types for
384    * usage in the detector modules, like e.g. ::kAliHLTAnyDataType
385    * and ::kAliHLTDataTypeDDLRaw. Those data types always have
386    * origin ::kAliHLTDataOriginAny. The correct detector origin can be
387    * set by using operator '|'
388    * <pre>
389    * AliHLTComponentDataType dt=kAliHLTDDLRawDataTypeID|kAliHLTDataOriginTPC
390    * </pre>
391    * @ingroup alihlt_component
392    */
393
394   /**
395    * @struct AliHLTComponentDataType
396    * Data type descriptor for data blocks transferred through the processing
397    * chain.
398    * @ingroup alihlt_component_datatypes
399    */
400   struct AliHLTComponentDataType
401   {
402     AliHLTUInt32_t fStructSize;
403     char fID[kAliHLTComponentDataTypefIDsize];                      //!
404     char fOrigin[kAliHLTComponentDataTypefOriginSize];              //!
405   };
406
407   /**
408    * @struct AliHLTComponentBlockData
409    * This is the decription of data blocks exchanged between components.
410    * \b IMPORTANT: The validity of fPtr and fOffset is different for input and
411    * output blocks:
412    * - input blocks: The \em fPtr member always points to the beginning of the data
413    *                 of size \em fSize. fOffset is ignored and should be in most
414    *                 case 0.
415    * - output blocks: The \em fPtr member is ignored by the framework. \em fOffset
416    *                  must specify the start of the data relative to the output
417    *                  buffer. The data block has size \em fSize.
418    */
419   struct AliHLTComponentBlockData
420   {
421     /* size and version of the struct */
422     AliHLTUInt32_t fStructSize;
423     /* shared memory key, ignored by processing components */
424     AliHLTComponentShmData fShmKey;
425     /* offset of output data relative to the output buffer */
426     AliHLTUInt32_t fOffset;
427     /* start of the data for input data blocks, fOffset to be ignored*/
428     void* fPtr;
429     /* size of the data block */
430     AliHLTUInt32_t fSize;
431     /* data type of the data block */
432     AliHLTComponentDataType fDataType;
433     /* data specification of the data block */
434     AliHLTUInt32_t fSpecification;
435   };
436
437   /**
438    * @struct AliHLTComponentEventDoneData
439    * 
440    */
441   struct AliHLTComponentEventDoneData
442   {
443     AliHLTUInt32_t fStructSize;
444     AliHLTUInt32_t fDataSize;
445     void* fData;
446   };
447
448   /**
449    * @struct AliHLTRunDesc
450    * Event descriptor.
451    * The struct is send with the SOR and EOR events.
452    */
453   struct AliHLTRunDesc
454   {
455     AliHLTUInt32_t fStructSize;
456     AliHLTUInt32_t fRunNo;
457     AliHLTUInt32_t fRunType;
458   };
459
460   //////////////////////////////////////////////////////////////////////////
461   //
462   // Trigger meta information
463   //
464   //////////////////////////////////////////////////////////////////////////
465
466   /** field size of fAttribute */
467   const int gkAliHLTBlockDAttributeCount = 8;
468
469   /** field size of fCommonHeader */
470    const int gkAliHLTCommonHeaderCount = 8;
471
472   /** size of the DDL list */
473   const int gkAliHLTDDLListSize = 30;
474
475   /** Number of Trigger Classes of CTP in CDH */
476   const int gkNCTPTriggerClasses = 50;
477
478   /**
479    * @struct AliHLTEventDDL
480    * DDL list event.
481    * The struct is send with the DDLLIST event.
482    * Used in the trigger structure for internal apperance of 
483    * the DLLs as well as for the HLT readout list send to DAQ 
484    * ( as DataType : kAliHLTDataTypeDDL )
485    */
486   struct AliHLTEventDDL
487   {
488     AliHLTUInt32_t fCount;
489     AliHLTUInt32_t fList[gkAliHLTDDLListSize];
490   };
491
492   /**
493    * @struct AliHLTEventTriggerData
494    */
495   struct AliHLTEventTriggerData
496   {
497     AliHLTUInt8_t  fAttributes[gkAliHLTBlockDAttributeCount]; 
498     AliHLTUInt64_t fHLTStatus; // Bit field 
499     AliHLTUInt32_t fCommonHeaderWordCnt;
500     AliHLTUInt32_t fCommonHeader[gkAliHLTCommonHeaderCount]; 
501     AliHLTEventDDL fReadoutList;
502   };
503
504   /**
505    * @struct AliHLTComponentTriggerData
506    * Trigger data
507    */
508   struct AliHLTComponentTriggerData
509   {
510     AliHLTUInt32_t fStructSize;
511     AliHLTUInt32_t fDataSize;
512     void* fData;
513   };
514
515   //////////////////////////////////////////////////////////////////////////
516   //
517   // HLT Event Type Specification
518   //
519   //////////////////////////////////////////////////////////////////////////
520
521   /** Unknown eventType specification */
522   const AliHLTUInt32_t gkAliEventTypeUnknown = ~(AliHLTUInt32_t)0;
523   /** SOR eventType specification */ 
524   const AliHLTUInt32_t gkAliEventTypeStartOfRun=1;
525   /** Data eventType specification */
526   const AliHLTUInt32_t gkAliEventTypeData=2;
527   /** EOR eventType specification */ 
528   const AliHLTUInt32_t gkAliEventTypeEndOfRun=4;
529   /** Corrupt eventType specification */
530   const AliHLTUInt32_t gkAliEventTypeCorruptID=8;
531   /** Calibration eventType specification */ 
532   const AliHLTUInt32_t gkAliEventTypeCalibration=16;
533   /** DataReplay eventType specification */
534   const AliHLTUInt32_t gkAliEventTypeDataReplay=32;
535   /** Configuration eventType specification */
536   const AliHLTUInt32_t gkAliEventTypeConfiguration=34;
537   /** Update DCS eventType specification */
538   const AliHLTUInt32_t gkAliEventTypeReadPreprocessor=35;
539   /** Tick eventType specification */ 
540   const AliHLTUInt32_t gkAliEventTypeTick=64;
541   /** Max eventType specification */ 
542   const AliHLTUInt32_t gkAliEventTypeMax=64;
543
544   //////////////////////////////////////////////////////////////////////////
545   //
546   // HLT defines and defaults
547   //
548   //////////////////////////////////////////////////////////////////////////
549
550   /** invalid event id 
551    * @ingroup alihlt_component_datatypes
552    */
553   const AliHLTEventID_t kAliHLTVoidEventID=~(AliHLTEventID_t)0;
554
555   /** invalid data specification 
556    * @ingroup alihlt_component_datatypes
557    */
558   const AliHLTUInt32_t kAliHLTVoidDataSpec = ~(AliHLTUInt32_t)0;
559
560   /** invalid shared memory type */
561   const AliHLTUInt32_t gkAliHLTComponentInvalidShmType = 0;
562
563   /** invalid shared memory id */
564   const AliHLTUInt64_t gkAliHLTComponentInvalidShmID = ~(AliHLTUInt64_t)0;
565
566   /** invalid data type 
567    * @ingroup alihlt_component_datatypes
568    */
569   const AliHLTComponentDataType kAliHLTVoidDataType = {
570     sizeof(AliHLTComponentDataType),
571     kAliHLTVoidDataTypeID,
572     kAliHLTDataOriginVoid
573   };
574
575   /** all data types, means any + void data type
576    * @ingroup alihlt_component_datatypes
577    */
578   const AliHLTComponentDataType kAliHLTAllDataTypes = {
579     sizeof(AliHLTComponentDataType),
580     kAliHLTAllDataTypesID,
581     kAliHLTDataOriginAny
582   };
583
584   // there is currently a problem with rootcint if the predefined ids
585   // (commented below) are used. rootcint does not find the id if they
586   // are char arrays defined with {} and individual chars. If strings
587   // are used it works fine
588   /** any data type 
589    * @ingroup alihlt_component_datatypes
590    */
591   const AliHLTComponentDataType kAliHLTAnyDataType = {
592     sizeof(AliHLTComponentDataType),
593     kAliHLTAnyDataTypeID,
594     kAliHLTDataOriginAny
595   };
596
597   /** multiple output data types 
598    * @ingroup alihlt_component_datatypes
599    */
600   extern const AliHLTComponentDataType kAliHLTMultipleDataType;
601
602   /** data to file exchange subscriber 
603    * @ingroup alihlt_component_datatypes
604    */
605   extern const AliHLTComponentDataType kAliHLTDataTypeFXSCalib;
606
607   /** DDL list data type 
608    * @ingroup alihlt_component_datatypes
609    */
610   extern const AliHLTComponentDataType kAliHLTDataTypeDDL;
611
612   /** SOR data type 
613    * @ingroup alihlt_component_datatypes
614    */
615   extern const AliHLTComponentDataType kAliHLTDataTypeSOR;
616
617   /** EOR data type 
618    * @ingroup alihlt_component_datatypes
619    */
620   extern const AliHLTComponentDataType kAliHLTDataTypeEOR;
621
622   /** Event type specification 
623    * @ingroup alihlt_component_datatypes
624    */
625   extern const AliHLTComponentDataType kAliHLTDataTypeEvent;
626
627   /** Configuration event data type 
628    * @ingroup alihlt_component_datatypes
629    */
630   extern const AliHLTComponentDataType kAliHLTDataTypeComConf;
631
632   /** DCS value update event 
633    * @ingroup alihlt_component_datatypes
634    */
635   extern const AliHLTComponentDataType kAliHLTDataTypeUpdtDCS;
636
637   /** RAW DDL data specification, origin is 'any', data publisher origin correctly 
638    * @ingroup alihlt_component_datatypes
639    */
640   extern const AliHLTComponentDataType kAliHLTDataTypeDDLRaw;
641
642   /** ESD object data specification, origin is 'any' 
643    * @ingroup alihlt_component_datatypes
644    */
645   extern const AliHLTComponentDataType kAliHLTDataTypeESDObject;
646
647   /** ESD Tree data specification, origin is 'any' 
648    
649    * @ingroup alihlt_component_datatypes
650    */
651   extern const AliHLTComponentDataType kAliHLTDataTypeESDTree;
652
653   /** AliRoot TreeD data specification, origin is 'any' 
654    * @ingroup alihlt_component_datatypes
655    */
656   extern const AliHLTComponentDataType kAliHLTDataTypeAliTreeD;
657
658   /** AliRoot TreeR data specification, origin is 'any' 
659    * @ingroup alihlt_component_datatypes
660    */
661   extern const AliHLTComponentDataType kAliHLTDataTypeAliTreeR;
662
663   /** 16 bit Hardware address selection data specification, origin is 'any' 
664    * @ingroup alihlt_component_datatypes
665    */
666   extern const AliHLTComponentDataType kAliHLTDataTypeHwAddr16;
667
668   /** Event statistics 
669    * @ingroup alihlt_component_datatypes
670    */
671   extern const AliHLTComponentDataType kAliHLTDataTypeEventStatistics;
672
673   /** Event summary 
674    * @ingroup alihlt_component_datatypes
675    */
676   extern const AliHLTComponentDataType kAliHLTDataTypeEventSummary;
677
678   /** Event statistics 
679    * @ingroup alihlt_component_datatypes
680    */
681   extern const AliHLTComponentDataType kAliHLTDataTypeRunStatistics;
682
683   /** Event summary 
684    * @ingroup alihlt_component_datatypes
685    */
686   extern const AliHLTComponentDataType kAliHLTDataTypeRunSummary;
687
688   //////////////////////////////////////////////////////////////////////////
689   //
690   // Data Types for Monitoring objects
691   //
692   //////////////////////////////////////////////////////////////////////////
693
694   /** general ROOT TObject 
695    * @ingroup alihlt_component_datatypes
696    */
697   extern const AliHLTComponentDataType kAliHLTDataTypeTObject;            // {ROOTTOBJ,"***"}
698                                                                                         
699   /** ROOT TObjArray 
700    * @ingroup alihlt_component_datatypes
701    */                                                                   
702   extern const AliHLTComponentDataType kAliHLTDataTypeTObjArray;          // {ROOTOBAR,"***"}
703                                                                                         
704   /** ROOT TTree 
705    * @ingroup alihlt_component_datatypes
706    */                                                                   
707   extern const AliHLTComponentDataType kAliHLTDataTypeTTree;              // {ROOTTREE,"***"}
708                                                                                         
709   /** ROOT TH1 (can be used for all histograms, they derive from TH1) 
710    * @ingroup alihlt_component_datatypes
711    */           
712   extern const AliHLTComponentDataType kAliHLTDataTypeHistogram;          // {ROOTHIST,"***"}
713                                                                                         
714   /** ROOT TNtuple 
715    * @ingroup alihlt_component_datatypes
716    */                                                                   
717   extern const AliHLTComponentDataType kAliHLTDataTypeTNtuple;            // {ROOTTUPL,"***"}
718
719   //////////////////////////////////////////////////////////////////////////
720   //
721   // FXS subscriber meta information
722   //
723   //////////////////////////////////////////////////////////////////////////
724
725   const int gkAliHLTFXSHeaderfOriginSize = 4;
726   const int gkAliHLTFXSHeaderfFileIDSize = 128;
727   const int gkAliHLTFXSHeaderfDDLNumberSize = 64;
728
729   /** Header in front of the data payload, in order to sent data to the FXS. */
730   struct AliHLTFXSHeader
731   {
732     AliHLTUInt32_t fHeaderVersion;
733     AliHLTUInt32_t fRunNumber;
734     char fOrigin[gkAliHLTFXSHeaderfOriginSize];
735     char fFileID[gkAliHLTFXSHeaderfFileIDSize];
736     char fDDLNumber[gkAliHLTFXSHeaderfDDLNumberSize];
737   };  
738
739   //////////////////////////////////////////////////////////////////////////
740   //
741   // Component running environment
742   //
743   //////////////////////////////////////////////////////////////////////////
744
745   /** logging function */
746   typedef int (*AliHLTfctLogging)( void* param, 
747                                    AliHLTComponentLogSeverity severity,
748                                    const char* origin,
749                                    const char* keyword,
750                                    const char* message);
751
752   /**
753    * @struct AliHLTComponentEnvironment
754    * Running environment for analysis components.
755    * The struct describes function callbacks for 
756    */
757   struct AliHLTComponentEnvironment
758   {
759     AliHLTUInt32_t fStructSize;
760     void* fParam;
761     void* (*fAllocMemoryFunc)( void* param, unsigned long size );
762 #if 0
763     // future addition already foreseen/envisioned
764     // IMPORTANT: don not just remove the defines as this breaks the binary
765     // compatibility
766     int (*fAllocShmMemoryFunc)( void* param, unsigned long size, AliHLTComponentBlockData* blockLocation );
767 #endif
768     int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd );
769     AliHLTfctLogging fLoggingFunc;
770   };
771 }
772
773 //////////////////////////////////////////////////////////////////////////
774 //
775 // Data type helper functions
776 //
777 //////////////////////////////////////////////////////////////////////////
778
779 /** exact comparison of HLT component data types
780  * @ingroup alihlt_component_datatypes
781  */
782 inline bool MatchExactly( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
783 {
784   for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ )
785     if ( dt1.fID[i] != dt2.fID[i] )
786       return false;
787   for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
788     if ( dt1.fOrigin[i] != dt2.fOrigin[i] )
789       return false;
790   return true;
791 }
792
793 /** Comparison operator for HLT component data types.
794  * The operator takes wildcards into account, i.e. the ::kAliHLTAnyDataType,
795  * ::kAliHLTAnyDataTypeID and ::kAliHLTDataOriginAny definitions.
796  * @ingroup alihlt_component_datatypes
797  */
798 inline bool operator==( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
799 {
800   if (MatchExactly(dt1, kAliHLTAllDataTypes)) return true;
801   if (MatchExactly(dt2, kAliHLTAllDataTypes)) return true;
802
803   bool any1=true, any2=true, void1=true, void2=true, match=true;
804   for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) {
805     any1&=(dt1.fOrigin[i]==kAliHLTDataOriginAny[i]);
806     any2&=(dt2.fOrigin[i]==kAliHLTDataOriginAny[i]);
807     void1&=(dt1.fOrigin[i]==kAliHLTDataOriginVoid[i]);
808     void2&=(dt2.fOrigin[i]==kAliHLTDataOriginVoid[i]);
809     match&=dt1.fOrigin[i]==dt2.fOrigin[i];
810     if (!(match || (any2 && !void1) || (any1 && !void2)))
811       return false;
812   }
813
814   any1=true, any2=true, match=true;
815   for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ ) {
816     any1&=(dt1.fID[i]==kAliHLTAnyDataTypeID[i]);
817     any2&=(dt2.fID[i]==kAliHLTAnyDataTypeID[i]);
818     void1&=(dt1.fID[i]==kAliHLTVoidDataTypeID[i]);
819     void2&=(dt2.fID[i]==kAliHLTVoidDataTypeID[i]);
820     match&=dt1.fID[i]==dt2.fID[i];
821     if (!(match || (any2 && !void1) || (any1 && !void2)))
822       return false;
823   }
824   return true;
825 }
826
827 /** Comparison operator for HLT component data types
828  * Invers of operator==
829  * @ingroup alihlt_component_datatypes
830  */
831 inline bool operator!=( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
832 {
833   return !(dt1==dt2);
834 }
835
836 /** merge operator for HLT component data types and origins
837  * @ingroup alihlt_component_datatypes
838  */
839 inline AliHLTComponentDataType operator|(const AliHLTComponentDataType srcdt, const char origin[kAliHLTComponentDataTypefOriginSize])
840 {
841   AliHLTComponentDataType dt=srcdt;
842   for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
843     dt.fOrigin[i]=origin[i];
844   return dt;
845 }
846
847 #endif