]>
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 | |
2cbdb37e | 32 | */ |
853121af | 33 | #define ALIHLT_DATA_TYPES_VERSION 4 |
2cbdb37e | 34 | |
32db4144 | 35 | ////////////////////////////////////////////////////////////////////////// |
36 | // | |
69347e0d | 37 | // HLT data origin variables. |
38 | // | |
39 | // By converting from defines to variables, the origins can be used with | |
40 | // the operator| | |
41 | // | |
42 | // AliHLTComponentDataType dt; | |
43 | // dt = kAliHLTDataTypeDDLRaw | gkAliHLTDataOriginTPC; | |
32db4144 | 44 | // |
45 | ////////////////////////////////////////////////////////////////////////// | |
46 | ||
47 | /** field size of datat type origin */ | |
48 | const int kAliHLTComponentDataTypefOriginSize=4; | |
49 | ||
50 | ||
51 | /** invalid data origin */ | |
3f850585 | 52 | # define kAliHLTDataOriginVoid "\0\0\0" |
53 | /** old invalid data origin, kept for backward compatibility */ | |
32db4144 | 54 | # define kAliHLTVoidDataOrigin "\0\0\0" |
55 | ||
3f850585 | 56 | /** wildcard data type origin */ |
57 | # define kAliHLTDataOriginAny "***" | |
58 | /** old wildcard data type origin, kept for backward compatibility */ | |
32db4144 | 59 | # define kAliHLTAnyDataOrigin "***" |
60 | ||
61 | /** HLT out */ | |
69347e0d | 62 | extern const char kAliHLTDataOriginOut[kAliHLTComponentDataTypefOriginSize]; |
32db4144 | 63 | |
64 | /** HLT/PubSub private internal */ | |
69347e0d | 65 | extern const char kAliHLTDataOriginPrivate[kAliHLTComponentDataTypefOriginSize]; |
32db4144 | 66 | |
67 | /** TPC */ | |
69347e0d | 68 | extern const char kAliHLTDataOriginTPC[kAliHLTComponentDataTypefOriginSize]; |
32db4144 | 69 | |
70 | /** PHOS */ | |
69347e0d | 71 | extern const char kAliHLTDataOriginPHOS[kAliHLTComponentDataTypefOriginSize]; |
32db4144 | 72 | |
73 | /** MUON */ | |
69347e0d | 74 | extern const char kAliHLTDataOriginMUON[kAliHLTComponentDataTypefOriginSize]; |
32db4144 | 75 | |
76 | /** TRD */ | |
69347e0d | 77 | extern const char kAliHLTDataOriginTRD[kAliHLTComponentDataTypefOriginSize]; |
32db4144 | 78 | |
79 | /** ITS */ | |
69347e0d | 80 | extern const char kAliHLTDataOriginITS[kAliHLTComponentDataTypefOriginSize]; |
32db4144 | 81 | |
82 | ////////////////////////////////////////////////////////////////////////// | |
83 | // | |
84 | // HLT common data type defines | |
85 | // | |
86 | ////////////////////////////////////////////////////////////////////////// | |
87 | ||
88 | /** field size of data type id */ | |
89 | const int kAliHLTComponentDataTypefIDsize=8; | |
90 | ||
91 | ||
92 | /** invalid data type id */ | |
93 | # define kAliHLTVoidDataTypeID "\0\0\0\0\0\0\0" | |
94 | ||
95 | /** special id for any data type id */ | |
96 | # define kAliHLTAnyDataTypeID "*******" | |
97 | ||
3f850585 | 98 | /** DDL RAW data */ |
99 | # define kAliHLTDDLRawDataTypeID {'D','D','L','_','R','A','W',' '} | |
100 | ||
32db4144 | 101 | /** calibration data for file exchange subscriber */ |
102 | # define kAliHLTFXSCalibDataTypeID {'F','X','S','_','C','A','L',' '} | |
103 | ||
104 | /** start of run (SOR) event | |
2cbdb37e | 105 | * @ref AliHLTRunDesc |
32db4144 | 106 | */ |
107 | # define kAliHLTSORDataTypeID {'S','T','A','R','T','O','F','R'} | |
108 | ||
109 | /** end of run (EOR) event | |
2cbdb37e | 110 | * @ref AliHLTRunDesc |
32db4144 | 111 | */ |
112 | # define kAliHLTEORDataTypeID {'E','N','D','O','F','R','U','N'} | |
113 | ||
114 | /** DDL list event | |
115 | * @ref AliHLTEventDDL | |
116 | */ | |
117 | # define kAliHLTDDLDataTypeID {'D','D','L','L','I','S','T',' '} | |
118 | ||
9d9ffd37 | 119 | /** EventType event |
120 | * - empty payload, specification gives eventType | |
121 | */ | |
122 | # define kAliHLTEventDataTypeID {'E','V','E','N','T','T','Y','P'} | |
123 | ||
853121af | 124 | /** ComponentConfiguration event |
b543e186 | 125 | * - payload contains the CDB path as string |
853121af | 126 | */ |
127 | # define kAliHLTComConfDataTypeID {'C','O','M','_','C','O','N','F'} | |
128 | ||
b543e186 | 129 | /** DCS value update event |
130 | * - payload contains string of relevant detectors | |
131 | */ | |
132 | # define kAliHLTUpdtDCSDataTypeID {'U','P','D','T','_','D','C','S'} | |
133 | ||
c704e290 | 134 | /** ESD data block |
135 | * an AliESD object of varying origin | |
853121af | 136 | * The 'V0' at the end allows a versioning |
c704e290 | 137 | */ |
a978c0d5 | 138 | # define kAliHLTESDObjectDataTypeID {'A','L','I','E','S','D','V','0'} |
c704e290 | 139 | |
a978c0d5 | 140 | /** ESD tree data block |
141 | * TTree with an AliESD object of varying origin | |
142 | */ | |
143 | # define kAliHLTESDTreeDataTypeID {'E','S','D','_','T','R','E','E'} | |
64defa03 | 144 | |
145 | /** HW Address selection data block | |
146 | * - a selection list for 16 bit HW addresses | |
147 | * - varying origin | |
148 | */ | |
149 | # define kAliHLTHwAddr16DataTypeID {'H','W','A','D','D','R','1','6'} | |
150 | ||
2ff24e4c | 151 | /** Event Statistics |
152 | * - event statistics for given detectors | |
153 | * - varying origin | |
154 | */ | |
155 | # define kAliHLTEventStatisticsDataTypeID {'E','V','_','S','T','A','T','I'} | |
156 | ||
157 | /** Event Summary | |
158 | * - event summary | |
159 | * - origin : kAliHLTDataOriginOut ( HLT ) | |
160 | */ | |
161 | # define kAliHLTEventSummaryDataTypeID {'E','V','_','S','U','M','M','A'} | |
162 | ||
163 | /** Run Statistics | |
164 | * - run statistics for given detectors | |
165 | * - varying origin | |
166 | */ | |
167 | # define kAliHLTRunStatisticsDataTypeID {'R','U','N','S','T','A','T','I'} | |
168 | ||
169 | /** Run Summary | |
170 | * - run summary | |
171 | * - origin : kAliHLTDataOriginOut ( HLT ) | |
172 | */ | |
173 | # define kAliHLTRunSummaryDataTypeID {'R','U','N','S','U','M','M','A'} | |
174 | ||
1843b457 | 175 | using namespace std; |
f23a6e1a | 176 | |
177 | extern "C" { | |
32db4144 | 178 | ////////////////////////////////////////////////////////////////////////// |
179 | // | |
180 | // Basic HLT data types | |
181 | // | |
182 | ////////////////////////////////////////////////////////////////////////// | |
f23a6e1a | 183 | |
184 | typedef unsigned char AliHLTUInt8_t; | |
185 | ||
eda89fe6 | 186 | typedef signed char AliHLTInt8_t; |
187 | ||
71d7c760 | 188 | typedef unsigned short AliHLTUInt16_t; |
189 | ||
eda89fe6 | 190 | typedef signed short AliHLTInt16_t; |
191 | ||
f23a6e1a | 192 | typedef unsigned int AliHLTUInt32_t; |
193 | ||
eda89fe6 | 194 | typedef signed int AliHLTInt32_t; |
195 | ||
f23a6e1a | 196 | typedef unsigned long long AliHLTUInt64_t; |
197 | ||
eda89fe6 | 198 | typedef signed long long AliHLTInt64_t; |
199 | ||
200 | typedef float AliHLTFloat32_t; | |
201 | ||
202 | typedef double AliHLTFloat64_t; | |
203 | ||
f23a6e1a | 204 | typedef AliHLTUInt64_t AliHLTEventID_t; |
205 | ||
32db4144 | 206 | ////////////////////////////////////////////////////////////////////////// |
207 | // | |
208 | // HLT logging levels | |
209 | // | |
210 | ////////////////////////////////////////////////////////////////////////// | |
f23a6e1a | 211 | |
2efb85be | 212 | /** |
213 | * Logging severities of the HLT | |
214 | */ | |
215 | enum AliHLTComponentLogSeverity { | |
216 | /** no logging */ | |
32db4144 | 217 | kHLTLogNone = 0, |
2efb85be | 218 | /** benchmark messages */ |
32db4144 | 219 | kHLTLogBenchmark = 0x1, |
2efb85be | 220 | /** debug messages */ |
32db4144 | 221 | kHLTLogDebug = 0x2, |
2efb85be | 222 | /** info messages */ |
32db4144 | 223 | kHLTLogInfo = 0x4, |
2efb85be | 224 | /** warning messages */ |
32db4144 | 225 | kHLTLogWarning = 0x8, |
2efb85be | 226 | /** error messages */ |
32db4144 | 227 | kHLTLogError = 0x10, |
b2065764 | 228 | /** fatal error messages */ |
32db4144 | 229 | kHLTLogFatal = 0x20, |
b2065764 | 230 | /** few important messages not to be filtered out. |
231 | * redirected to kHLTLogInfo in AliRoot | |
232 | */ | |
233 | kHLTLogImportant = 0x40, | |
2efb85be | 234 | /** special value to enable all messages */ |
b2065764 | 235 | kHLTLogAll = 0x7f, |
2efb85be | 236 | /** the default logging filter */ |
b2065764 | 237 | kHLTLogDefault = 0x7d |
32db4144 | 238 | }; |
239 | ||
240 | ////////////////////////////////////////////////////////////////////////// | |
241 | // | |
242 | // HLT data structures for data exchange and external interface | |
243 | // | |
244 | ////////////////////////////////////////////////////////////////////////// | |
245 | ||
246 | /** | |
247 | * @struct AliHLTComponentEventData | |
248 | * Event descriptor | |
249 | */ | |
8ede8717 | 250 | struct AliHLTComponentEventData |
f23a6e1a | 251 | { |
252 | AliHLTUInt32_t fStructSize; | |
253 | AliHLTEventID_t fEventID; | |
254 | AliHLTUInt32_t fEventCreation_s; | |
255 | AliHLTUInt32_t fEventCreation_us; | |
256 | AliHLTUInt32_t fBlockCnt; | |
257 | }; | |
258 | ||
32db4144 | 259 | /** |
260 | * @struct AliHLTComponentShmData | |
261 | * Shared memory descriptor. | |
262 | * Irrelevant for analysis components. | |
263 | */ | |
8ede8717 | 264 | struct AliHLTComponentShmData |
f23a6e1a | 265 | { |
266 | AliHLTUInt32_t fStructSize; | |
267 | AliHLTUInt32_t fShmType; | |
268 | AliHLTUInt64_t fShmID; | |
269 | }; | |
71d7c760 | 270 | |
32db4144 | 271 | /** |
272 | * @struct AliHLTComponentDataType | |
559631d5 | 273 | * Data type descriptor for data blocks transferred through the processing |
32db4144 | 274 | * chain. |
275 | */ | |
8ede8717 | 276 | struct AliHLTComponentDataType |
f23a6e1a | 277 | { |
278 | AliHLTUInt32_t fStructSize; | |
32db4144 | 279 | char fID[kAliHLTComponentDataTypefIDsize]; //! |
280 | char fOrigin[kAliHLTComponentDataTypefOriginSize]; //! | |
f23a6e1a | 281 | }; |
2d7ff710 | 282 | |
32db4144 | 283 | /** |
284 | * @struct AliHLTComponentBlockData | |
3294f81a | 285 | * This is the decription of data blocks exchanged between components. |
286 | * \b IMPORTANT: The validity of fPtr and fOffset is different for input and | |
287 | * output blocks: | |
288 | * - input blocks: The \em fPtr member always points to the beginning of the data | |
289 | * of size \em fSize. fOffset is ignored and should be in most | |
290 | * case 0. | |
291 | * - output blocks: The \em fPtr member is ignored by the framework. \em fOffset | |
292 | * must specify the start of the data relative to the output | |
293 | * buffer. The data block has size \em fSize. | |
32db4144 | 294 | */ |
8ede8717 | 295 | struct AliHLTComponentBlockData |
f23a6e1a | 296 | { |
3294f81a | 297 | /* size and version of the struct */ |
f23a6e1a | 298 | AliHLTUInt32_t fStructSize; |
3294f81a | 299 | /* shared memory key, ignored by processing components */ |
8ede8717 | 300 | AliHLTComponentShmData fShmKey; |
3294f81a | 301 | /* offset of output data relative to the output buffer */ |
f23a6e1a | 302 | AliHLTUInt32_t fOffset; |
3294f81a | 303 | /* start of the data for input data blocks, fOffset to be ignored*/ |
f23a6e1a | 304 | void* fPtr; |
3294f81a | 305 | /* size of the data block */ |
f23a6e1a | 306 | AliHLTUInt32_t fSize; |
3294f81a | 307 | /* data type of the data block */ |
8ede8717 | 308 | AliHLTComponentDataType fDataType; |
3294f81a | 309 | /* data specification of the data block */ |
f23a6e1a | 310 | AliHLTUInt32_t fSpecification; |
311 | }; | |
312 | ||
32db4144 | 313 | /** |
314 | * @struct AliHLTComponentEventDoneData | |
315 | * | |
316 | */ | |
8ede8717 | 317 | struct AliHLTComponentEventDoneData |
f23a6e1a | 318 | { |
319 | AliHLTUInt32_t fStructSize; | |
320 | AliHLTUInt32_t fDataSize; | |
321 | void* fData; | |
322 | }; | |
323 | ||
32db4144 | 324 | /** |
2cbdb37e | 325 | * @struct AliHLTRunDesc |
32db4144 | 326 | * Event descriptor. |
327 | * The struct is send with the SOR and EOR events. | |
328 | */ | |
2cbdb37e | 329 | struct AliHLTRunDesc |
32db4144 | 330 | { |
331 | AliHLTUInt32_t fStructSize; | |
332 | AliHLTUInt32_t fRunNo; | |
333 | AliHLTUInt32_t fRunType; | |
334 | }; | |
335 | ||
8f81abf4 | 336 | ////////////////////////////////////////////////////////////////////////// |
337 | // | |
338 | // Trigger meta information | |
339 | // | |
340 | ////////////////////////////////////////////////////////////////////////// | |
341 | ||
342 | /** field size of fAttribute */ | |
2ff24e4c | 343 | const int gkAliHLTBlockDAttributeCount = 8; |
8f81abf4 | 344 | |
345 | /** field size of fCommonHeader */ | |
2ff24e4c | 346 | const int gkAliHLTCommonHeaderCount = 8; |
8f81abf4 | 347 | |
32db4144 | 348 | /** size of the DDL list */ |
2ff24e4c | 349 | const int gkAliHLTDDLListSize = 30; |
350 | ||
351 | /** Number of Trigger Classes of CTP in CDH */ | |
352 | const int gkNCTPTriggerClasses = 50; | |
32db4144 | 353 | |
354 | /** | |
355 | * @struct AliHLTEventDDL | |
356 | * DDL list event. | |
357 | * The struct is send with the DDLLIST event. | |
8f81abf4 | 358 | * Used in the trigger structure for internal apperance of |
359 | * the DLLs as well as for the HLT readout list send to DAQ | |
511b2509 | 360 | * ( as DataType : kAliHLTDataTypeDDL ) |
32db4144 | 361 | */ |
362 | struct AliHLTEventDDL | |
363 | { | |
364 | AliHLTUInt32_t fCount; | |
365 | AliHLTUInt32_t fList[gkAliHLTDDLListSize]; | |
366 | }; | |
367 | ||
8f81abf4 | 368 | /** |
369 | * @struct AliHLTEventTriggerData | |
8f81abf4 | 370 | */ |
371 | struct AliHLTEventTriggerData | |
372 | { | |
8f81abf4 | 373 | AliHLTUInt8_t fAttributes[gkAliHLTBlockDAttributeCount]; |
511b2509 | 374 | AliHLTUInt64_t fHLTStatus; // Bit field |
8f81abf4 | 375 | AliHLTUInt32_t fCommonHeaderWordCnt; |
376 | AliHLTUInt32_t fCommonHeader[gkAliHLTCommonHeaderCount]; | |
8f81abf4 | 377 | AliHLTEventDDL fReadoutList; |
378 | }; | |
379 | ||
380 | /** | |
381 | * @struct AliHLTComponentTriggerData | |
382 | * Trigger data | |
383 | */ | |
384 | struct AliHLTComponentTriggerData | |
385 | { | |
386 | AliHLTUInt32_t fStructSize; | |
387 | AliHLTUInt32_t fDataSize; | |
388 | void* fData; | |
389 | }; | |
390 | ||
9d9ffd37 | 391 | ////////////////////////////////////////////////////////////////////////// |
392 | // | |
393 | // HLT Event Type Specification | |
394 | // | |
395 | ////////////////////////////////////////////////////////////////////////// | |
396 | ||
397 | /** Unknown eventType specification */ | |
2ff24e4c | 398 | const AliHLTUInt32_t gkAliEventTypeUnknown = ~(AliHLTUInt32_t)0; |
9d9ffd37 | 399 | /** SOR eventType specification */ |
2ff24e4c | 400 | const AliHLTUInt32_t gkAliEventTypeStartOfRun=1; |
9d9ffd37 | 401 | /** Data eventType specification */ |
2ff24e4c | 402 | const AliHLTUInt32_t gkAliEventTypeData=2; |
9d9ffd37 | 403 | /** EOR eventType specification */ |
2ff24e4c | 404 | const AliHLTUInt32_t gkAliEventTypeEndOfRun=4; |
9d9ffd37 | 405 | /** Corrupt eventType specification */ |
2ff24e4c | 406 | const AliHLTUInt32_t gkAliEventTypeCorruptID=8; |
9d9ffd37 | 407 | /** Calibration eventType specification */ |
2ff24e4c | 408 | const AliHLTUInt32_t gkAliEventTypeCalibration=16; |
9d9ffd37 | 409 | /** DataReplay eventType specification */ |
2ff24e4c | 410 | const AliHLTUInt32_t gkAliEventTypeDataReplay=32; |
b543e186 | 411 | /** Configuration eventType specification */ |
2ff24e4c | 412 | const AliHLTUInt32_t gkAliEventTypeConfiguration=34; |
d6b69874 | 413 | /** Update DCS eventType specification */ |
2ff24e4c | 414 | const AliHLTUInt32_t gkAliEventTypeReadPreprocessor=35; |
9d9ffd37 | 415 | /** Tick eventType specification */ |
2ff24e4c | 416 | const AliHLTUInt32_t gkAliEventTypeTick=64; |
9d9ffd37 | 417 | /** Max eventType specification */ |
2ff24e4c | 418 | const AliHLTUInt32_t gkAliEventTypeMax=64; |
9d9ffd37 | 419 | |
32db4144 | 420 | ////////////////////////////////////////////////////////////////////////// |
421 | // | |
422 | // HLT defines and defaults | |
423 | // | |
424 | ////////////////////////////////////////////////////////////////////////// | |
425 | ||
426 | /** invalid event id */ | |
427 | const AliHLTEventID_t kAliHLTVoidEventID=~(AliHLTEventID_t)0; | |
428 | ||
429 | /** invalid data specification */ | |
430 | const AliHLTUInt32_t kAliHLTVoidDataSpec = ~(AliHLTUInt32_t)0; | |
431 | ||
432 | /** invalid shared memory type */ | |
433 | const AliHLTUInt32_t gkAliHLTComponentInvalidShmType = 0; | |
434 | ||
435 | /** invalid shared memory id */ | |
436 | const AliHLTUInt64_t gkAliHLTComponentInvalidShmID = ~(AliHLTUInt64_t)0; | |
437 | ||
438 | /** invalid data type */ | |
439 | const AliHLTComponentDataType kAliHLTVoidDataType = { | |
440 | sizeof(AliHLTComponentDataType), | |
441 | kAliHLTVoidDataTypeID, | |
3f850585 | 442 | kAliHLTDataOriginVoid |
32db4144 | 443 | }; |
444 | ||
445 | // there is currently a problem with rootcint if the predefined ids | |
446 | // (commented below) are used. rootcint does not find the id if they | |
447 | // are char arrays defined with {} and individual chars. If strings | |
448 | // are used it works fine | |
449 | /** any data type */ | |
450 | const AliHLTComponentDataType kAliHLTAnyDataType = { | |
451 | sizeof(AliHLTComponentDataType), | |
452 | kAliHLTAnyDataTypeID, | |
3f850585 | 453 | kAliHLTDataOriginAny |
32db4144 | 454 | }; |
455 | ||
de6593d0 | 456 | /** multiple output data types */ |
457 | extern const AliHLTComponentDataType kAliHLTMultipleDataType; | |
458 | ||
32db4144 | 459 | /** data to file exchange subscriber */ |
460 | extern const AliHLTComponentDataType kAliHLTDataTypeFXSCalib; | |
461 | ||
462 | /** DDL list data type */ | |
463 | extern const AliHLTComponentDataType kAliHLTDataTypeDDL; | |
464 | ||
465 | /** SOR data type */ | |
466 | extern const AliHLTComponentDataType kAliHLTDataTypeSOR; | |
467 | ||
468 | /** EOR data type */ | |
469 | extern const AliHLTComponentDataType kAliHLTDataTypeEOR; | |
5ec8e281 | 470 | |
77405890 | 471 | /** Event type specification */ |
472 | extern const AliHLTComponentDataType kAliHLTDataTypeEvent; | |
473 | ||
853121af | 474 | /** Configuration event data type */ |
475 | extern const AliHLTComponentDataType kAliHLTDataTypeComConf; | |
476 | ||
b543e186 | 477 | /** DCS value update event */ |
478 | extern const AliHLTComponentDataType kAliHLTDataTypeUpdtDCS; | |
479 | ||
c704e290 | 480 | /** RAW DDL data specification, origin is 'any', data publisher origin correctly */ |
3f850585 | 481 | extern const AliHLTComponentDataType kAliHLTDataTypeDDLRaw; |
482 | ||
a978c0d5 | 483 | /** ESD object data specification, origin is 'any' */ |
484 | extern const AliHLTComponentDataType kAliHLTDataTypeESDObject; | |
485 | ||
c704e290 | 486 | /** ESD Tree data specification, origin is 'any' */ |
487 | extern const AliHLTComponentDataType kAliHLTDataTypeESDTree; | |
488 | ||
64defa03 | 489 | /** 16 bit Hardware address selection data specification, origin is 'any' */ |
490 | extern const AliHLTComponentDataType kAliHLTDataTypeHwAddr16; | |
491 | ||
2ff24e4c | 492 | /** Event statistics */ |
493 | extern const AliHLTComponentDataType kAliHLTDataTypeEventStatistics; | |
494 | ||
495 | /** Event summary */ | |
496 | extern const AliHLTComponentDataType kAliHLTDataTypeEventSummary; | |
497 | ||
498 | /** Event statistics */ | |
499 | extern const AliHLTComponentDataType kAliHLTDataTypeRunStatistics; | |
500 | ||
501 | /** Event summary */ | |
502 | extern const AliHLTComponentDataType kAliHLTDataTypeRunSummary; | |
503 | ||
32db4144 | 504 | ////////////////////////////////////////////////////////////////////////// |
505 | // | |
506 | // FXS subscriber meta information | |
507 | // | |
508 | ////////////////////////////////////////////////////////////////////////// | |
509 | ||
2ff24e4c | 510 | const int gkAliHLTFXSHeaderfOriginSize = 4; |
511 | const int gkAliHLTFXSHeaderfFileIDSize = 128; | |
512 | const int gkAliHLTFXSHeaderfDDLNumberSize = 64; | |
32db4144 | 513 | |
514 | /** Header in front of the data payload, in order to sent data to the FXS. */ | |
515 | struct AliHLTFXSHeader | |
516 | { | |
517 | AliHLTUInt32_t fHeaderVersion; | |
518 | AliHLTUInt32_t fRunNumber; | |
519 | char fOrigin[gkAliHLTFXSHeaderfOriginSize]; | |
520 | char fFileID[gkAliHLTFXSHeaderfFileIDSize]; | |
521 | char fDDLNumber[gkAliHLTFXSHeaderfDDLNumberSize]; | |
522 | }; | |
523 | ||
524 | ////////////////////////////////////////////////////////////////////////// | |
525 | // | |
526 | // Component running environment | |
527 | // | |
528 | ////////////////////////////////////////////////////////////////////////// | |
529 | ||
530 | /** logging function */ | |
531 | typedef int (*AliHLTfctLogging)( void* param, | |
532 | AliHLTComponentLogSeverity severity, | |
533 | const char* origin, | |
534 | const char* keyword, | |
535 | const char* message); | |
536 | ||
537 | /** | |
538 | * @struct AliHLTComponentEnvironment | |
539 | * Running environment for analysis components. | |
540 | * The struct describes function callbacks for | |
541 | */ | |
f23a6e1a | 542 | struct AliHLTComponentEnvironment |
543 | { | |
544 | AliHLTUInt32_t fStructSize; | |
545 | void* fParam; | |
546 | void* (*fAllocMemoryFunc)( void* param, unsigned long size ); | |
547 | #if 0 | |
32db4144 | 548 | // future addition already foreseen/envisioned |
549 | // IMPORTANT: don not just remove the defines as this breaks the binary | |
550 | // compatibility | |
551 | int (*fAllocShmMemoryFunc)( void* param, unsigned long size, AliHLTComponentBlockData* blockLocation ); | |
f23a6e1a | 552 | #endif |
8ede8717 | 553 | int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd ); |
5ec8e281 | 554 | AliHLTfctLogging fLoggingFunc; |
f23a6e1a | 555 | }; |
556 | } | |
557 | ||
32db4144 | 558 | ////////////////////////////////////////////////////////////////////////// |
559 | // | |
560 | // Data type helper functions | |
561 | // | |
562 | ////////////////////////////////////////////////////////////////////////// | |
563 | ||
8ede8717 | 564 | inline bool operator==( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 ) |
853121af | 565 | { |
566 | bool any1=true, any2=true, void1=true, void2=true, match=true; | |
567 | for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) { | |
568 | any1&=(dt1.fOrigin[i]==kAliHLTDataOriginAny[i]); | |
569 | any2&=(dt2.fOrigin[i]==kAliHLTDataOriginAny[i]); | |
570 | void1&=(dt1.fOrigin[i]==kAliHLTDataOriginVoid[i]); | |
571 | void2&=(dt2.fOrigin[i]==kAliHLTDataOriginVoid[i]); | |
572 | match&=dt1.fOrigin[i]==dt2.fOrigin[i]; | |
573 | if (!(match || (any2 && !void1) || (any1 && !void2))) | |
574 | return false; | |
575 | } | |
576 | ||
577 | any1=true, any2=true, match=true; | |
578 | for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ ) { | |
579 | any1&=(dt1.fID[i]==kAliHLTAnyDataTypeID[i]); | |
580 | any2&=(dt2.fID[i]==kAliHLTAnyDataTypeID[i]); | |
581 | void1&=(dt1.fID[i]==kAliHLTVoidDataTypeID[i]); | |
582 | void2&=(dt2.fID[i]==kAliHLTVoidDataTypeID[i]); | |
583 | match&=dt1.fID[i]==dt2.fID[i]; | |
584 | if (!(match || (any2 && !void1) || (any1 && !void2))) | |
585 | return false; | |
586 | } | |
587 | return true; | |
588 | } | |
71d7c760 | 589 | |
8ede8717 | 590 | inline bool operator!=( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 ) |
853121af | 591 | { |
592 | return !(dt1==dt2); | |
593 | } | |
71d7c760 | 594 | |
732e8f50 | 595 | inline bool MatchExactly( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 ) |
596 | { | |
597 | for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ ) | |
598 | if ( dt1.fID[i] != dt2.fID[i] ) | |
599 | return false; | |
600 | for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) | |
601 | if ( dt1.fOrigin[i] != dt2.fOrigin[i] ) | |
602 | return false; | |
603 | return true; | |
604 | } | |
605 | ||
69347e0d | 606 | inline AliHLTComponentDataType operator|(const AliHLTComponentDataType srcdt, const char origin[kAliHLTComponentDataTypefOriginSize]) |
853121af | 607 | { |
608 | AliHLTComponentDataType dt=srcdt; | |
609 | for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) | |
610 | dt.fOrigin[i]=origin[i]; | |
611 | return dt; | |
612 | } | |
32db4144 | 613 | |
f23a6e1a | 614 | #endif |