]>
Commit | Line | Data |
---|---|---|
f23a6e1a | 1 | // @(#) $Id$ |
2 | ||
3 | #ifndef ALIHLTDATATYPES_H | |
4 | #define ALIHLTDATATYPES_H | |
32db4144 | 5 | /* This file is property of and copyright by the ALICE HLT Project * |
6 | * ALICE Experiment at CERN, All rights reserved. * | |
f23a6e1a | 7 | * See cxx source for full Copyright notice */ |
8 | ||
b22e91eb | 9 | /** @file AliHLTDataTypes.h |
32db4144 | 10 | @author Matthias Richter, Timm Steinbeck, Jochen Thaeder |
b22e91eb | 11 | @date |
12 | @brief Data type declaration for the HLT module. | |
13 | */ | |
14 | ||
2cbdb37e | 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 | |
eda89fe6 | 24 | * 3 2007-11-15 RAW DDL data type added; some inconsistencies fixed |
25 | * ('void' and 'any' origins); added signed HLT basic data types | |
69347e0d | 26 | * 2007-11-23 origin defines have become variables in conjunction |
c704e290 | 27 | * to be used with the operator| (AliHLTComponentDataType) |
28 | * 2007-11-24 added trigger structs and ESD tree data type | |
b543e186 | 29 | * 4 Component configuration and DCS update events added |
2efb85be | 30 | * gkAliHLTDDLListSize set from 29 to 30 according to new PubSub |
31 | * specs | |
c736de25 | 32 | * 5 Data types for Run and Event summary, and for monitoring added |
1ac82ce6 | 33 | * 6 Common data types for TreeD and TreeR defined |
3dd8541e | 34 | * kAliHLTAllDataTypes added |
2cbdb37e | 35 | */ |
1ac82ce6 | 36 | #define ALIHLT_DATA_TYPES_VERSION 6 |
2cbdb37e | 37 | |
32db4144 | 38 | ////////////////////////////////////////////////////////////////////////// |
39 | // | |
69347e0d | 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; | |
32db4144 | 47 | // |
48 | ////////////////////////////////////////////////////////////////////////// | |
49 | ||
1ac82ce6 | 50 | /** field size of datat type origin |
51 | * @ingroup alihlt_component_datatypes | |
52 | */ | |
32db4144 | 53 | const int kAliHLTComponentDataTypefOriginSize=4; |
54 | ||
55 | ||
1ac82ce6 | 56 | /** invalid data origin |
57 | * @ingroup alihlt_component_datatypes | |
58 | */ | |
3f850585 | 59 | # define kAliHLTDataOriginVoid "\0\0\0" |
60 | /** old invalid data origin, kept for backward compatibility */ | |
32db4144 | 61 | # define kAliHLTVoidDataOrigin "\0\0\0" |
62 | ||
1ac82ce6 | 63 | /** wildcard data type origin |
64 | * @ingroup alihlt_component_datatypes | |
65 | */ | |
3f850585 | 66 | # define kAliHLTDataOriginAny "***" |
67 | /** old wildcard data type origin, kept for backward compatibility */ | |
32db4144 | 68 | # define kAliHLTAnyDataOrigin "***" |
69 | ||
1ac82ce6 | 70 | /** Data origin HLT out |
71 | * @ingroup alihlt_component_datatypes | |
72 | */ | |
69347e0d | 73 | extern const char kAliHLTDataOriginOut[kAliHLTComponentDataTypefOriginSize]; |
32db4144 | 74 | |
1ac82ce6 | 75 | /** Data origin HLT/PubSub private internal |
76 | * @ingroup alihlt_component_datatypes | |
77 | */ | |
69347e0d | 78 | extern const char kAliHLTDataOriginPrivate[kAliHLTComponentDataTypefOriginSize]; |
32db4144 | 79 | |
1ac82ce6 | 80 | /** Data origin TPC |
81 | * @ingroup alihlt_component_datatypes | |
82 | */ | |
69347e0d | 83 | extern const char kAliHLTDataOriginTPC[kAliHLTComponentDataTypefOriginSize]; |
32db4144 | 84 | |
1ac82ce6 | 85 | /** Data origin PHOS |
86 | * @ingroup alihlt_component_datatypes | |
87 | */ | |
69347e0d | 88 | extern const char kAliHLTDataOriginPHOS[kAliHLTComponentDataTypefOriginSize]; |
32db4144 | 89 | |
1ac82ce6 | 90 | /** Data origin MUON |
91 | * @ingroup alihlt_component_datatypes | |
92 | */ | |
69347e0d | 93 | extern const char kAliHLTDataOriginMUON[kAliHLTComponentDataTypefOriginSize]; |
32db4144 | 94 | |
1ac82ce6 | 95 | /** Data origin TRD |
96 | * @ingroup alihlt_component_datatypes | |
97 | */ | |
69347e0d | 98 | extern const char kAliHLTDataOriginTRD[kAliHLTComponentDataTypefOriginSize]; |
32db4144 | 99 | |
1ac82ce6 | 100 | /** Data origin ITS |
101 | * @ingroup alihlt_component_datatypes | |
102 | */ | |
69347e0d | 103 | extern const char kAliHLTDataOriginITS[kAliHLTComponentDataTypefOriginSize]; |
32db4144 | 104 | |
105 | ////////////////////////////////////////////////////////////////////////// | |
106 | // | |
107 | // HLT common data type defines | |
108 | // | |
109 | ////////////////////////////////////////////////////////////////////////// | |
110 | ||
1ac82ce6 | 111 | /** field size of data type id |
112 | * @ingroup alihlt_component_datatypes | |
113 | */ | |
32db4144 | 114 | const int kAliHLTComponentDataTypefIDsize=8; |
115 | ||
116 | ||
1ac82ce6 | 117 | /** invalid data type id |
118 | * @ingroup alihlt_component_datatypes | |
119 | */ | |
32db4144 | 120 | # define kAliHLTVoidDataTypeID "\0\0\0\0\0\0\0" |
121 | ||
3dd8541e | 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 | |
1ac82ce6 | 128 | * @ingroup alihlt_component_datatypes |
129 | */ | |
32db4144 | 130 | # define kAliHLTAnyDataTypeID "*******" |
131 | ||
1ac82ce6 | 132 | /** DDL RAW data |
133 | * @ingroup alihlt_component_datatypes | |
134 | */ | |
3f850585 | 135 | # define kAliHLTDDLRawDataTypeID {'D','D','L','_','R','A','W',' '} |
136 | ||
1ac82ce6 | 137 | /** calibration data for file exchange subscriber |
138 | * @ingroup alihlt_component_datatypes | |
139 | */ | |
32db4144 | 140 | # define kAliHLTFXSCalibDataTypeID {'F','X','S','_','C','A','L',' '} |
141 | ||
142 | /** start of run (SOR) event | |
2cbdb37e | 143 | * @ref AliHLTRunDesc |
1ac82ce6 | 144 | * @ingroup alihlt_component_datatypes |
32db4144 | 145 | */ |
146 | # define kAliHLTSORDataTypeID {'S','T','A','R','T','O','F','R'} | |
147 | ||
148 | /** end of run (EOR) event | |
2cbdb37e | 149 | * @ref AliHLTRunDesc |
1ac82ce6 | 150 | * @ingroup alihlt_component_datatypes |
32db4144 | 151 | */ |
152 | # define kAliHLTEORDataTypeID {'E','N','D','O','F','R','U','N'} | |
153 | ||
154 | /** DDL list event | |
155 | * @ref AliHLTEventDDL | |
1ac82ce6 | 156 | * @ingroup alihlt_component_datatypes |
32db4144 | 157 | */ |
158 | # define kAliHLTDDLDataTypeID {'D','D','L','L','I','S','T',' '} | |
159 | ||
9d9ffd37 | 160 | /** EventType event |
161 | * - empty payload, specification gives eventType | |
1ac82ce6 | 162 | * @ingroup alihlt_component_datatypes |
9d9ffd37 | 163 | */ |
164 | # define kAliHLTEventDataTypeID {'E','V','E','N','T','T','Y','P'} | |
165 | ||
853121af | 166 | /** ComponentConfiguration event |
b543e186 | 167 | * - payload contains the CDB path as string |
1ac82ce6 | 168 | * @ingroup alihlt_component_datatypes |
853121af | 169 | */ |
170 | # define kAliHLTComConfDataTypeID {'C','O','M','_','C','O','N','F'} | |
171 | ||
b543e186 | 172 | /** DCS value update event |
173 | * - payload contains string of relevant detectors | |
1ac82ce6 | 174 | * @ingroup alihlt_component_datatypes |
b543e186 | 175 | */ |
176 | # define kAliHLTUpdtDCSDataTypeID {'U','P','D','T','_','D','C','S'} | |
177 | ||
c704e290 | 178 | /** ESD data block |
179 | * an AliESD object of varying origin | |
853121af | 180 | * The 'V0' at the end allows a versioning |
1ac82ce6 | 181 | * @ingroup alihlt_component_datatypes |
c704e290 | 182 | */ |
a978c0d5 | 183 | # define kAliHLTESDObjectDataTypeID {'A','L','I','E','S','D','V','0'} |
c704e290 | 184 | |
a978c0d5 | 185 | /** ESD tree data block |
186 | * TTree with an AliESD object of varying origin | |
1ac82ce6 | 187 | * @ingroup alihlt_component_datatypes |
a978c0d5 | 188 | */ |
189 | # define kAliHLTESDTreeDataTypeID {'E','S','D','_','T','R','E','E'} | |
64defa03 | 190 | |
1ac82ce6 | 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 | ||
64defa03 | 203 | /** HW Address selection data block |
204 | * - a selection list for 16 bit HW addresses | |
205 | * - varying origin | |
1ac82ce6 | 206 | * @ingroup alihlt_component_datatypes |
64defa03 | 207 | */ |
208 | # define kAliHLTHwAddr16DataTypeID {'H','W','A','D','D','R','1','6'} | |
209 | ||
2ff24e4c | 210 | /** Event Statistics |
211 | * - event statistics for given detectors | |
212 | * - varying origin | |
1ac82ce6 | 213 | * @ingroup alihlt_component_datatypes |
2ff24e4c | 214 | */ |
215 | # define kAliHLTEventStatisticsDataTypeID {'E','V','_','S','T','A','T','I'} | |
216 | ||
217 | /** Event Summary | |
218 | * - event summary | |
219 | * - origin : kAliHLTDataOriginOut ( HLT ) | |
1ac82ce6 | 220 | * @ingroup alihlt_component_datatypes |
2ff24e4c | 221 | */ |
222 | # define kAliHLTEventSummaryDataTypeID {'E','V','_','S','U','M','M','A'} | |
223 | ||
224 | /** Run Statistics | |
225 | * - run statistics for given detectors | |
226 | * - varying origin | |
1ac82ce6 | 227 | * @ingroup alihlt_component_datatypes |
2ff24e4c | 228 | */ |
229 | # define kAliHLTRunStatisticsDataTypeID {'R','U','N','S','T','A','T','I'} | |
230 | ||
231 | /** Run Summary | |
232 | * - run summary | |
233 | * - origin : kAliHLTDataOriginOut ( HLT ) | |
1ac82ce6 | 234 | * @ingroup alihlt_component_datatypes |
2ff24e4c | 235 | */ |
236 | # define kAliHLTRunSummaryDataTypeID {'R','U','N','S','U','M','M','A'} | |
237 | ||
c736de25 | 238 | /** general ROOT TObject |
239 | * - a general TObject exported from the HLT analysis | |
240 | * - varying origin | |
1ac82ce6 | 241 | * @ingroup alihlt_component_datatypes |
c736de25 | 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 | |
1ac82ce6 | 248 | * @ingroup alihlt_component_datatypes |
c736de25 | 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 | |
1ac82ce6 | 255 | * @ingroup alihlt_component_datatypes |
c736de25 | 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 | |
1ac82ce6 | 263 | * @ingroup alihlt_component_datatypes |
c736de25 | 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 | |
1ac82ce6 | 270 | * @ingroup alihlt_component_datatypes |
c736de25 | 271 | */ |
272 | #define kAliHLTTNtupleDataTypeID {'R','O','O','T','T','U','P','L'} | |
273 | ||
1843b457 | 274 | using namespace std; |
f23a6e1a | 275 | |
276 | extern "C" { | |
32db4144 | 277 | ////////////////////////////////////////////////////////////////////////// |
278 | // | |
279 | // Basic HLT data types | |
280 | // | |
281 | ////////////////////////////////////////////////////////////////////////// | |
f23a6e1a | 282 | |
283 | typedef unsigned char AliHLTUInt8_t; | |
284 | ||
eda89fe6 | 285 | typedef signed char AliHLTInt8_t; |
286 | ||
71d7c760 | 287 | typedef unsigned short AliHLTUInt16_t; |
288 | ||
eda89fe6 | 289 | typedef signed short AliHLTInt16_t; |
290 | ||
f23a6e1a | 291 | typedef unsigned int AliHLTUInt32_t; |
292 | ||
eda89fe6 | 293 | typedef signed int AliHLTInt32_t; |
294 | ||
f23a6e1a | 295 | typedef unsigned long long AliHLTUInt64_t; |
296 | ||
eda89fe6 | 297 | typedef signed long long AliHLTInt64_t; |
298 | ||
299 | typedef float AliHLTFloat32_t; | |
300 | ||
301 | typedef double AliHLTFloat64_t; | |
302 | ||
f23a6e1a | 303 | typedef AliHLTUInt64_t AliHLTEventID_t; |
304 | ||
32db4144 | 305 | ////////////////////////////////////////////////////////////////////////// |
306 | // | |
307 | // HLT logging levels | |
308 | // | |
309 | ////////////////////////////////////////////////////////////////////////// | |
f23a6e1a | 310 | |
2efb85be | 311 | /** |
312 | * Logging severities of the HLT | |
313 | */ | |
314 | enum AliHLTComponentLogSeverity { | |
315 | /** no logging */ | |
32db4144 | 316 | kHLTLogNone = 0, |
2efb85be | 317 | /** benchmark messages */ |
32db4144 | 318 | kHLTLogBenchmark = 0x1, |
2efb85be | 319 | /** debug messages */ |
32db4144 | 320 | kHLTLogDebug = 0x2, |
2efb85be | 321 | /** info messages */ |
32db4144 | 322 | kHLTLogInfo = 0x4, |
2efb85be | 323 | /** warning messages */ |
32db4144 | 324 | kHLTLogWarning = 0x8, |
2efb85be | 325 | /** error messages */ |
32db4144 | 326 | kHLTLogError = 0x10, |
b2065764 | 327 | /** fatal error messages */ |
32db4144 | 328 | kHLTLogFatal = 0x20, |
b2065764 | 329 | /** few important messages not to be filtered out. |
330 | * redirected to kHLTLogInfo in AliRoot | |
331 | */ | |
332 | kHLTLogImportant = 0x40, | |
2efb85be | 333 | /** special value to enable all messages */ |
b2065764 | 334 | kHLTLogAll = 0x7f, |
2efb85be | 335 | /** the default logging filter */ |
7233bc62 | 336 | kHLTLogDefault = 0x79 |
32db4144 | 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 | */ | |
8ede8717 | 349 | struct AliHLTComponentEventData |
f23a6e1a | 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 | ||
32db4144 | 358 | /** |
359 | * @struct AliHLTComponentShmData | |
360 | * Shared memory descriptor. | |
361 | * Irrelevant for analysis components. | |
362 | */ | |
8ede8717 | 363 | struct AliHLTComponentShmData |
f23a6e1a | 364 | { |
365 | AliHLTUInt32_t fStructSize; | |
366 | AliHLTUInt32_t fShmType; | |
367 | AliHLTUInt64_t fShmID; | |
368 | }; | |
71d7c760 | 369 | |
1ac82ce6 | 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 | ||
32db4144 | 383 | /** |
384 | * @struct AliHLTComponentDataType | |
559631d5 | 385 | * Data type descriptor for data blocks transferred through the processing |
32db4144 | 386 | * chain. |
1ac82ce6 | 387 | * @ingroup alihlt_component_datatypes |
32db4144 | 388 | */ |
8ede8717 | 389 | struct AliHLTComponentDataType |
f23a6e1a | 390 | { |
391 | AliHLTUInt32_t fStructSize; | |
32db4144 | 392 | char fID[kAliHLTComponentDataTypefIDsize]; //! |
393 | char fOrigin[kAliHLTComponentDataTypefOriginSize]; //! | |
f23a6e1a | 394 | }; |
2d7ff710 | 395 | |
32db4144 | 396 | /** |
397 | * @struct AliHLTComponentBlockData | |
3294f81a | 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. | |
32db4144 | 407 | */ |
8ede8717 | 408 | struct AliHLTComponentBlockData |
f23a6e1a | 409 | { |
3294f81a | 410 | /* size and version of the struct */ |
f23a6e1a | 411 | AliHLTUInt32_t fStructSize; |
3294f81a | 412 | /* shared memory key, ignored by processing components */ |
8ede8717 | 413 | AliHLTComponentShmData fShmKey; |
3294f81a | 414 | /* offset of output data relative to the output buffer */ |
f23a6e1a | 415 | AliHLTUInt32_t fOffset; |
3294f81a | 416 | /* start of the data for input data blocks, fOffset to be ignored*/ |
f23a6e1a | 417 | void* fPtr; |
3294f81a | 418 | /* size of the data block */ |
f23a6e1a | 419 | AliHLTUInt32_t fSize; |
3294f81a | 420 | /* data type of the data block */ |
8ede8717 | 421 | AliHLTComponentDataType fDataType; |
3294f81a | 422 | /* data specification of the data block */ |
f23a6e1a | 423 | AliHLTUInt32_t fSpecification; |
424 | }; | |
425 | ||
32db4144 | 426 | /** |
427 | * @struct AliHLTComponentEventDoneData | |
428 | * | |
429 | */ | |
8ede8717 | 430 | struct AliHLTComponentEventDoneData |
f23a6e1a | 431 | { |
432 | AliHLTUInt32_t fStructSize; | |
433 | AliHLTUInt32_t fDataSize; | |
434 | void* fData; | |
435 | }; | |
436 | ||
32db4144 | 437 | /** |
2cbdb37e | 438 | * @struct AliHLTRunDesc |
32db4144 | 439 | * Event descriptor. |
440 | * The struct is send with the SOR and EOR events. | |
441 | */ | |
2cbdb37e | 442 | struct AliHLTRunDesc |
32db4144 | 443 | { |
444 | AliHLTUInt32_t fStructSize; | |
445 | AliHLTUInt32_t fRunNo; | |
446 | AliHLTUInt32_t fRunType; | |
447 | }; | |
448 | ||
8f81abf4 | 449 | ////////////////////////////////////////////////////////////////////////// |
450 | // | |
451 | // Trigger meta information | |
452 | // | |
453 | ////////////////////////////////////////////////////////////////////////// | |
454 | ||
455 | /** field size of fAttribute */ | |
2ff24e4c | 456 | const int gkAliHLTBlockDAttributeCount = 8; |
8f81abf4 | 457 | |
458 | /** field size of fCommonHeader */ | |
2ff24e4c | 459 | const int gkAliHLTCommonHeaderCount = 8; |
8f81abf4 | 460 | |
32db4144 | 461 | /** size of the DDL list */ |
2ff24e4c | 462 | const int gkAliHLTDDLListSize = 30; |
463 | ||
464 | /** Number of Trigger Classes of CTP in CDH */ | |
465 | const int gkNCTPTriggerClasses = 50; | |
32db4144 | 466 | |
467 | /** | |
468 | * @struct AliHLTEventDDL | |
469 | * DDL list event. | |
470 | * The struct is send with the DDLLIST event. | |
8f81abf4 | 471 | * Used in the trigger structure for internal apperance of |
472 | * the DLLs as well as for the HLT readout list send to DAQ | |
511b2509 | 473 | * ( as DataType : kAliHLTDataTypeDDL ) |
32db4144 | 474 | */ |
475 | struct AliHLTEventDDL | |
476 | { | |
477 | AliHLTUInt32_t fCount; | |
478 | AliHLTUInt32_t fList[gkAliHLTDDLListSize]; | |
479 | }; | |
480 | ||
8f81abf4 | 481 | /** |
482 | * @struct AliHLTEventTriggerData | |
8f81abf4 | 483 | */ |
484 | struct AliHLTEventTriggerData | |
485 | { | |
8f81abf4 | 486 | AliHLTUInt8_t fAttributes[gkAliHLTBlockDAttributeCount]; |
511b2509 | 487 | AliHLTUInt64_t fHLTStatus; // Bit field |
8f81abf4 | 488 | AliHLTUInt32_t fCommonHeaderWordCnt; |
489 | AliHLTUInt32_t fCommonHeader[gkAliHLTCommonHeaderCount]; | |
8f81abf4 | 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 | ||
9d9ffd37 | 504 | ////////////////////////////////////////////////////////////////////////// |
505 | // | |
506 | // HLT Event Type Specification | |
507 | // | |
508 | ////////////////////////////////////////////////////////////////////////// | |
509 | ||
510 | /** Unknown eventType specification */ | |
2ff24e4c | 511 | const AliHLTUInt32_t gkAliEventTypeUnknown = ~(AliHLTUInt32_t)0; |
9d9ffd37 | 512 | /** SOR eventType specification */ |
2ff24e4c | 513 | const AliHLTUInt32_t gkAliEventTypeStartOfRun=1; |
9d9ffd37 | 514 | /** Data eventType specification */ |
2ff24e4c | 515 | const AliHLTUInt32_t gkAliEventTypeData=2; |
9d9ffd37 | 516 | /** EOR eventType specification */ |
2ff24e4c | 517 | const AliHLTUInt32_t gkAliEventTypeEndOfRun=4; |
9d9ffd37 | 518 | /** Corrupt eventType specification */ |
2ff24e4c | 519 | const AliHLTUInt32_t gkAliEventTypeCorruptID=8; |
9d9ffd37 | 520 | /** Calibration eventType specification */ |
2ff24e4c | 521 | const AliHLTUInt32_t gkAliEventTypeCalibration=16; |
9d9ffd37 | 522 | /** DataReplay eventType specification */ |
2ff24e4c | 523 | const AliHLTUInt32_t gkAliEventTypeDataReplay=32; |
b543e186 | 524 | /** Configuration eventType specification */ |
2ff24e4c | 525 | const AliHLTUInt32_t gkAliEventTypeConfiguration=34; |
d6b69874 | 526 | /** Update DCS eventType specification */ |
2ff24e4c | 527 | const AliHLTUInt32_t gkAliEventTypeReadPreprocessor=35; |
9d9ffd37 | 528 | /** Tick eventType specification */ |
2ff24e4c | 529 | const AliHLTUInt32_t gkAliEventTypeTick=64; |
9d9ffd37 | 530 | /** Max eventType specification */ |
2ff24e4c | 531 | const AliHLTUInt32_t gkAliEventTypeMax=64; |
9d9ffd37 | 532 | |
32db4144 | 533 | ////////////////////////////////////////////////////////////////////////// |
534 | // | |
535 | // HLT defines and defaults | |
536 | // | |
537 | ////////////////////////////////////////////////////////////////////////// | |
538 | ||
1ac82ce6 | 539 | /** invalid event id |
540 | * @ingroup alihlt_component_datatypes | |
541 | */ | |
32db4144 | 542 | const AliHLTEventID_t kAliHLTVoidEventID=~(AliHLTEventID_t)0; |
543 | ||
1ac82ce6 | 544 | /** invalid data specification |
545 | * @ingroup alihlt_component_datatypes | |
546 | */ | |
32db4144 | 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 | ||
1ac82ce6 | 555 | /** invalid data type |
556 | * @ingroup alihlt_component_datatypes | |
557 | */ | |
32db4144 | 558 | const AliHLTComponentDataType kAliHLTVoidDataType = { |
559 | sizeof(AliHLTComponentDataType), | |
560 | kAliHLTVoidDataTypeID, | |
3f850585 | 561 | kAliHLTDataOriginVoid |
32db4144 | 562 | }; |
563 | ||
3dd8541e | 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 | ||
32db4144 | 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 | |
1ac82ce6 | 577 | /** any data type |
578 | * @ingroup alihlt_component_datatypes | |
579 | */ | |
32db4144 | 580 | const AliHLTComponentDataType kAliHLTAnyDataType = { |
581 | sizeof(AliHLTComponentDataType), | |
582 | kAliHLTAnyDataTypeID, | |
3f850585 | 583 | kAliHLTDataOriginAny |
32db4144 | 584 | }; |
585 | ||
1ac82ce6 | 586 | /** multiple output data types |
587 | * @ingroup alihlt_component_datatypes | |
588 | */ | |
de6593d0 | 589 | extern const AliHLTComponentDataType kAliHLTMultipleDataType; |
590 | ||
1ac82ce6 | 591 | /** data to file exchange subscriber |
592 | * @ingroup alihlt_component_datatypes | |
593 | */ | |
32db4144 | 594 | extern const AliHLTComponentDataType kAliHLTDataTypeFXSCalib; |
595 | ||
1ac82ce6 | 596 | /** DDL list data type |
597 | * @ingroup alihlt_component_datatypes | |
598 | */ | |
32db4144 | 599 | extern const AliHLTComponentDataType kAliHLTDataTypeDDL; |
600 | ||
1ac82ce6 | 601 | /** SOR data type |
602 | * @ingroup alihlt_component_datatypes | |
603 | */ | |
32db4144 | 604 | extern const AliHLTComponentDataType kAliHLTDataTypeSOR; |
605 | ||
1ac82ce6 | 606 | /** EOR data type |
607 | * @ingroup alihlt_component_datatypes | |
608 | */ | |
32db4144 | 609 | extern const AliHLTComponentDataType kAliHLTDataTypeEOR; |
5ec8e281 | 610 | |
1ac82ce6 | 611 | /** Event type specification |
612 | * @ingroup alihlt_component_datatypes | |
613 | */ | |
77405890 | 614 | extern const AliHLTComponentDataType kAliHLTDataTypeEvent; |
615 | ||
1ac82ce6 | 616 | /** Configuration event data type |
617 | * @ingroup alihlt_component_datatypes | |
618 | */ | |
853121af | 619 | extern const AliHLTComponentDataType kAliHLTDataTypeComConf; |
620 | ||
1ac82ce6 | 621 | /** DCS value update event |
622 | * @ingroup alihlt_component_datatypes | |
623 | */ | |
b543e186 | 624 | extern const AliHLTComponentDataType kAliHLTDataTypeUpdtDCS; |
625 | ||
1ac82ce6 | 626 | /** RAW DDL data specification, origin is 'any', data publisher origin correctly |
627 | * @ingroup alihlt_component_datatypes | |
628 | */ | |
3f850585 | 629 | extern const AliHLTComponentDataType kAliHLTDataTypeDDLRaw; |
630 | ||
1ac82ce6 | 631 | /** ESD object data specification, origin is 'any' |
632 | * @ingroup alihlt_component_datatypes | |
633 | */ | |
a978c0d5 | 634 | extern const AliHLTComponentDataType kAliHLTDataTypeESDObject; |
635 | ||
1ac82ce6 | 636 | /** ESD Tree data specification, origin is 'any' |
637 | ||
638 | * @ingroup alihlt_component_datatypes | |
639 | */ | |
c704e290 | 640 | extern const AliHLTComponentDataType kAliHLTDataTypeESDTree; |
641 | ||
1ac82ce6 | 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 | */ | |
64defa03 | 655 | extern const AliHLTComponentDataType kAliHLTDataTypeHwAddr16; |
656 | ||
1ac82ce6 | 657 | /** Event statistics |
658 | * @ingroup alihlt_component_datatypes | |
659 | */ | |
2ff24e4c | 660 | extern const AliHLTComponentDataType kAliHLTDataTypeEventStatistics; |
661 | ||
1ac82ce6 | 662 | /** Event summary |
663 | * @ingroup alihlt_component_datatypes | |
664 | */ | |
2ff24e4c | 665 | extern const AliHLTComponentDataType kAliHLTDataTypeEventSummary; |
666 | ||
1ac82ce6 | 667 | /** Event statistics |
668 | * @ingroup alihlt_component_datatypes | |
669 | */ | |
2ff24e4c | 670 | extern const AliHLTComponentDataType kAliHLTDataTypeRunStatistics; |
671 | ||
1ac82ce6 | 672 | /** Event summary |
673 | * @ingroup alihlt_component_datatypes | |
674 | */ | |
2ff24e4c | 675 | extern const AliHLTComponentDataType kAliHLTDataTypeRunSummary; |
676 | ||
c736de25 | 677 | ////////////////////////////////////////////////////////////////////////// |
678 | // | |
679 | // Data Types for Monitoring objects | |
680 | // | |
681 | ////////////////////////////////////////////////////////////////////////// | |
682 | ||
1ac82ce6 | 683 | /** general ROOT TObject |
684 | * @ingroup alihlt_component_datatypes | |
685 | */ | |
c736de25 | 686 | extern const AliHLTComponentDataType kAliHLTDataTypeTObject; // {ROOTTOBJ,"***"} |
687 | ||
1ac82ce6 | 688 | /** ROOT TObjArray |
689 | * @ingroup alihlt_component_datatypes | |
690 | */ | |
c736de25 | 691 | extern const AliHLTComponentDataType kAliHLTDataTypeTObjArray; // {ROOTOBAR,"***"} |
692 | ||
1ac82ce6 | 693 | /** ROOT TTree |
694 | * @ingroup alihlt_component_datatypes | |
695 | */ | |
c736de25 | 696 | extern const AliHLTComponentDataType kAliHLTDataTypeTTree; // {ROOTTREE,"***"} |
697 | ||
1ac82ce6 | 698 | /** ROOT TH1 (can be used for all histograms, they derive from TH1) |
699 | * @ingroup alihlt_component_datatypes | |
700 | */ | |
c736de25 | 701 | extern const AliHLTComponentDataType kAliHLTDataTypeHistogram; // {ROOTHIST,"***"} |
702 | ||
1ac82ce6 | 703 | /** ROOT TNtuple |
704 | * @ingroup alihlt_component_datatypes | |
705 | */ | |
c736de25 | 706 | extern const AliHLTComponentDataType kAliHLTDataTypeTNtuple; // {ROOTTUPL,"***"} |
707 | ||
32db4144 | 708 | ////////////////////////////////////////////////////////////////////////// |
709 | // | |
710 | // FXS subscriber meta information | |
711 | // | |
712 | ////////////////////////////////////////////////////////////////////////// | |
713 | ||
2ff24e4c | 714 | const int gkAliHLTFXSHeaderfOriginSize = 4; |
715 | const int gkAliHLTFXSHeaderfFileIDSize = 128; | |
716 | const int gkAliHLTFXSHeaderfDDLNumberSize = 64; | |
32db4144 | 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 | */ | |
f23a6e1a | 746 | struct AliHLTComponentEnvironment |
747 | { | |
748 | AliHLTUInt32_t fStructSize; | |
749 | void* fParam; | |
750 | void* (*fAllocMemoryFunc)( void* param, unsigned long size ); | |
751 | #if 0 | |
32db4144 | 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 ); | |
f23a6e1a | 756 | #endif |
8ede8717 | 757 | int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd ); |
5ec8e281 | 758 | AliHLTfctLogging fLoggingFunc; |
f23a6e1a | 759 | }; |
760 | } | |
761 | ||
32db4144 | 762 | ////////////////////////////////////////////////////////////////////////// |
763 | // | |
764 | // Data type helper functions | |
765 | // | |
766 | ////////////////////////////////////////////////////////////////////////// | |
767 | ||
3dd8541e | 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 | ||
1ac82ce6 | 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 | */ | |
8ede8717 | 787 | inline bool operator==( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 ) |
853121af | 788 | { |
3dd8541e | 789 | if (MatchExactly(dt1, kAliHLTAllDataTypes)) return true; |
790 | if (MatchExactly(dt2, kAliHLTAllDataTypes)) return true; | |
791 | ||
853121af | 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 | } | |
71d7c760 | 815 | |
1ac82ce6 | 816 | /** Comparison operator for HLT component data types |
297174de | 817 | * Invers of operator== |
1ac82ce6 | 818 | * @ingroup alihlt_component_datatypes |
819 | */ | |
8ede8717 | 820 | inline bool operator!=( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 ) |
853121af | 821 | { |
822 | return !(dt1==dt2); | |
823 | } | |
71d7c760 | 824 | |
1ac82ce6 | 825 | /** merge operator for HLT component data types and origins |
826 | * @ingroup alihlt_component_datatypes | |
827 | */ | |
69347e0d | 828 | inline AliHLTComponentDataType operator|(const AliHLTComponentDataType srcdt, const char origin[kAliHLTComponentDataTypefOriginSize]) |
853121af | 829 | { |
830 | AliHLTComponentDataType dt=srcdt; | |
831 | for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) | |
832 | dt.fOrigin[i]=origin[i]; | |
833 | return dt; | |
834 | } | |
32db4144 | 835 | |
f23a6e1a | 836 | #endif |