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