]>
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 |
703bcca6 | 34 | * kAliHLTAllDataTypes and kAliHLTDataOriginSample added |
d9dd3bc8 | 35 | * kAliHLTDataOriginEMCAL added |
45c0a780 | 36 | * kAliHLTDataTypeRunType added |
a0aeb701 | 37 | * 7 kAliHLTDataTypeComponentStatistics, kAliHLTDataTypeComponentTable, |
38 | * and AliHLTComponentStatistics have been added for optional | |
39 | * component block statistics | |
a3c9b745 | 40 | * 8 new wrapper interface has been introduced, old wrapper interface |
41 | * deprecated but kept for backward compatibility, the PubSub | |
42 | * interface is going to be compiled independently of AliHLT, new | |
43 | * interface provided by the libHLTinterface.so | |
44 | * AliHLTComponentEnvironment -> AliHLTAnalysisEnvironment | |
7398abba | 45 | * 9 added data types for arrays of AliHLTExternalTrackParam sets and |
46 | * TClonesArrays of AliExternalTrackParam objects. | |
2cbdb37e | 47 | */ |
7398abba | 48 | #define ALIHLT_DATA_TYPES_VERSION 9 |
2cbdb37e | 49 | |
32db4144 | 50 | ////////////////////////////////////////////////////////////////////////// |
51 | // | |
69347e0d | 52 | // HLT data origin variables. |
53 | // | |
54 | // By converting from defines to variables, the origins can be used with | |
55 | // the operator| | |
56 | // | |
57 | // AliHLTComponentDataType dt; | |
58 | // dt = kAliHLTDataTypeDDLRaw | gkAliHLTDataOriginTPC; | |
32db4144 | 59 | // |
60 | ////////////////////////////////////////////////////////////////////////// | |
61 | ||
1ac82ce6 | 62 | /** field size of datat type origin |
63 | * @ingroup alihlt_component_datatypes | |
64 | */ | |
32db4144 | 65 | const int kAliHLTComponentDataTypefOriginSize=4; |
66 | ||
67 | ||
1ac82ce6 | 68 | /** invalid data origin |
69 | * @ingroup alihlt_component_datatypes | |
70 | */ | |
3f850585 | 71 | # define kAliHLTDataOriginVoid "\0\0\0" |
72 | /** old invalid data origin, kept for backward compatibility */ | |
32db4144 | 73 | # define kAliHLTVoidDataOrigin "\0\0\0" |
74 | ||
1ac82ce6 | 75 | /** wildcard data type origin |
76 | * @ingroup alihlt_component_datatypes | |
77 | */ | |
3f850585 | 78 | # define kAliHLTDataOriginAny "***" |
79 | /** old wildcard data type origin, kept for backward compatibility */ | |
32db4144 | 80 | # define kAliHLTAnyDataOrigin "***" |
81 | ||
1ac82ce6 | 82 | /** Data origin HLT out |
83 | * @ingroup alihlt_component_datatypes | |
84 | */ | |
69347e0d | 85 | extern const char kAliHLTDataOriginOut[kAliHLTComponentDataTypefOriginSize]; |
32db4144 | 86 | |
1ac82ce6 | 87 | /** Data origin HLT/PubSub private internal |
88 | * @ingroup alihlt_component_datatypes | |
89 | */ | |
69347e0d | 90 | extern const char kAliHLTDataOriginPrivate[kAliHLTComponentDataTypefOriginSize]; |
32db4144 | 91 | |
1ac82ce6 | 92 | /** Data origin TPC |
93 | * @ingroup alihlt_component_datatypes | |
94 | */ | |
69347e0d | 95 | extern const char kAliHLTDataOriginTPC[kAliHLTComponentDataTypefOriginSize]; |
32db4144 | 96 | |
1ac82ce6 | 97 | /** Data origin PHOS |
98 | * @ingroup alihlt_component_datatypes | |
99 | */ | |
69347e0d | 100 | extern const char kAliHLTDataOriginPHOS[kAliHLTComponentDataTypefOriginSize]; |
32db4144 | 101 | |
629266d1 | 102 | /** Data origin FMD |
103 | * @ingroup alihlt_component_datatypes | |
104 | */ | |
105 | extern const char kAliHLTDataOriginFMD[kAliHLTComponentDataTypefOriginSize]; | |
106 | ||
1ac82ce6 | 107 | /** Data origin MUON |
108 | * @ingroup alihlt_component_datatypes | |
109 | */ | |
69347e0d | 110 | extern const char kAliHLTDataOriginMUON[kAliHLTComponentDataTypefOriginSize]; |
32db4144 | 111 | |
1ac82ce6 | 112 | /** Data origin TRD |
113 | * @ingroup alihlt_component_datatypes | |
114 | */ | |
69347e0d | 115 | extern const char kAliHLTDataOriginTRD[kAliHLTComponentDataTypefOriginSize]; |
32db4144 | 116 | |
1ac82ce6 | 117 | /** Data origin ITS |
118 | * @ingroup alihlt_component_datatypes | |
119 | */ | |
69347e0d | 120 | extern const char kAliHLTDataOriginITS[kAliHLTComponentDataTypefOriginSize]; |
32db4144 | 121 | |
859fbc05 | 122 | /** Data origin ITS SPD |
123 | * @ingroup alihlt_component_datatypes | |
124 | */ | |
125 | extern const char kAliHLTDataOriginITSSPD[kAliHLTComponentDataTypefOriginSize]; | |
126 | ||
127 | /** Data origin ITS SDD | |
128 | * @ingroup alihlt_component_datatypes | |
129 | */ | |
130 | extern const char kAliHLTDataOriginITSSDD[kAliHLTComponentDataTypefOriginSize]; | |
131 | ||
132 | /** Data origin ITS SSD | |
133 | * @ingroup alihlt_component_datatypes | |
134 | */ | |
135 | extern const char kAliHLTDataOriginITSSSD[kAliHLTComponentDataTypefOriginSize]; | |
136 | ||
703bcca6 | 137 | /** Data origin for examples |
138 | * @ingroup alihlt_component_datatypes | |
139 | */ | |
140 | extern const char kAliHLTDataOriginSample[kAliHLTComponentDataTypefOriginSize]; | |
141 | ||
d9dd3bc8 | 142 | /** Data origin EMCAL |
143 | * @ingroup alihlt_component_datatypes | |
144 | */ | |
145 | extern const char kAliHLTDataOriginEMCAL[kAliHLTComponentDataTypefOriginSize]; | |
146 | ||
32db4144 | 147 | ////////////////////////////////////////////////////////////////////////// |
148 | // | |
149 | // HLT common data type defines | |
150 | // | |
151 | ////////////////////////////////////////////////////////////////////////// | |
152 | ||
1ac82ce6 | 153 | /** field size of data type id |
154 | * @ingroup alihlt_component_datatypes | |
155 | */ | |
32db4144 | 156 | const int kAliHLTComponentDataTypefIDsize=8; |
157 | ||
158 | ||
1ac82ce6 | 159 | /** invalid data type id |
160 | * @ingroup alihlt_component_datatypes | |
161 | */ | |
32db4144 | 162 | # define kAliHLTVoidDataTypeID "\0\0\0\0\0\0\0" |
163 | ||
3dd8541e | 164 | /** special id for all data types: any + void |
165 | * @ingroup alihlt_component_datatypes | |
166 | */ | |
167 | # define kAliHLTAllDataTypesID "ALLDATA" | |
168 | ||
169 | /** special id for any valid data type id | |
1ac82ce6 | 170 | * @ingroup alihlt_component_datatypes |
171 | */ | |
32db4144 | 172 | # define kAliHLTAnyDataTypeID "*******" |
173 | ||
1ac82ce6 | 174 | /** DDL RAW data |
175 | * @ingroup alihlt_component_datatypes | |
176 | */ | |
3f850585 | 177 | # define kAliHLTDDLRawDataTypeID {'D','D','L','_','R','A','W',' '} |
178 | ||
1ac82ce6 | 179 | /** calibration data for file exchange subscriber |
180 | * @ingroup alihlt_component_datatypes | |
181 | */ | |
32db4144 | 182 | # define kAliHLTFXSCalibDataTypeID {'F','X','S','_','C','A','L',' '} |
183 | ||
184 | /** start of run (SOR) event | |
2cbdb37e | 185 | * @ref AliHLTRunDesc |
1ac82ce6 | 186 | * @ingroup alihlt_component_datatypes |
32db4144 | 187 | */ |
188 | # define kAliHLTSORDataTypeID {'S','T','A','R','T','O','F','R'} | |
189 | ||
190 | /** end of run (EOR) event | |
2cbdb37e | 191 | * @ref AliHLTRunDesc |
1ac82ce6 | 192 | * @ingroup alihlt_component_datatypes |
32db4144 | 193 | */ |
194 | # define kAliHLTEORDataTypeID {'E','N','D','O','F','R','U','N'} | |
195 | ||
45c0a780 | 196 | /** run type data block |
197 | * string with run type as payload | |
198 | * @ingroup alihlt_component_datatypes | |
199 | */ | |
200 | # define kAliHLTRunTypeDataTypeID {'R','U','N','T','Y','P','E',' '} | |
201 | ||
32db4144 | 202 | /** DDL list event |
203 | * @ref AliHLTEventDDL | |
1ac82ce6 | 204 | * @ingroup alihlt_component_datatypes |
32db4144 | 205 | */ |
206 | # define kAliHLTDDLDataTypeID {'D','D','L','L','I','S','T',' '} | |
207 | ||
9d9ffd37 | 208 | /** EventType event |
209 | * - empty payload, specification gives eventType | |
1ac82ce6 | 210 | * @ingroup alihlt_component_datatypes |
9d9ffd37 | 211 | */ |
212 | # define kAliHLTEventDataTypeID {'E','V','E','N','T','T','Y','P'} | |
213 | ||
853121af | 214 | /** ComponentConfiguration event |
b543e186 | 215 | * - payload contains the CDB path as string |
1ac82ce6 | 216 | * @ingroup alihlt_component_datatypes |
853121af | 217 | */ |
218 | # define kAliHLTComConfDataTypeID {'C','O','M','_','C','O','N','F'} | |
219 | ||
b543e186 | 220 | /** DCS value update event |
221 | * - payload contains string of relevant detectors | |
1ac82ce6 | 222 | * @ingroup alihlt_component_datatypes |
b543e186 | 223 | */ |
224 | # define kAliHLTUpdtDCSDataTypeID {'U','P','D','T','_','D','C','S'} | |
225 | ||
c704e290 | 226 | /** ESD data block |
227 | * an AliESD object of varying origin | |
853121af | 228 | * The 'V0' at the end allows a versioning |
1ac82ce6 | 229 | * @ingroup alihlt_component_datatypes |
c704e290 | 230 | */ |
a978c0d5 | 231 | # define kAliHLTESDObjectDataTypeID {'A','L','I','E','S','D','V','0'} |
c704e290 | 232 | |
a978c0d5 | 233 | /** ESD tree data block |
234 | * TTree with an AliESD object of varying origin | |
1ac82ce6 | 235 | * @ingroup alihlt_component_datatypes |
a978c0d5 | 236 | */ |
237 | # define kAliHLTESDTreeDataTypeID {'E','S','D','_','T','R','E','E'} | |
64defa03 | 238 | |
1ac82ce6 | 239 | /** AliRoot TreeD |
240 | * - the digits tree of an AliRoot module | |
241 | * @ingroup alihlt_component_datatypes | |
242 | */ | |
243 | #define kAliHLTTreeDDataTypeID {'A','L','I','T','R','E','E','D'} | |
244 | ||
245 | /** AliRoot TreeR | |
246 | * - the rec points tree of an AliRoot module | |
247 | * @ingroup alihlt_component_datatypes | |
248 | */ | |
ad2fa36b | 249 | #define kAliHLTTreeRDataTypeID {'A','L','I','T','R','E','E','R'} |
1ac82ce6 | 250 | |
64defa03 | 251 | /** HW Address selection data block |
252 | * - a selection list for 16 bit HW addresses | |
253 | * - varying origin | |
1ac82ce6 | 254 | * @ingroup alihlt_component_datatypes |
64defa03 | 255 | */ |
256 | # define kAliHLTHwAddr16DataTypeID {'H','W','A','D','D','R','1','6'} | |
257 | ||
2ff24e4c | 258 | /** Event Statistics |
259 | * - event statistics for given detectors | |
260 | * - varying origin | |
1ac82ce6 | 261 | * @ingroup alihlt_component_datatypes |
2ff24e4c | 262 | */ |
263 | # define kAliHLTEventStatisticsDataTypeID {'E','V','_','S','T','A','T','I'} | |
264 | ||
265 | /** Event Summary | |
266 | * - event summary | |
267 | * - origin : kAliHLTDataOriginOut ( HLT ) | |
1ac82ce6 | 268 | * @ingroup alihlt_component_datatypes |
2ff24e4c | 269 | */ |
270 | # define kAliHLTEventSummaryDataTypeID {'E','V','_','S','U','M','M','A'} | |
271 | ||
272 | /** Run Statistics | |
273 | * - run statistics for given detectors | |
274 | * - varying origin | |
1ac82ce6 | 275 | * @ingroup alihlt_component_datatypes |
2ff24e4c | 276 | */ |
277 | # define kAliHLTRunStatisticsDataTypeID {'R','U','N','S','T','A','T','I'} | |
278 | ||
279 | /** Run Summary | |
280 | * - run summary | |
281 | * - origin : kAliHLTDataOriginOut ( HLT ) | |
1ac82ce6 | 282 | * @ingroup alihlt_component_datatypes |
2ff24e4c | 283 | */ |
284 | # define kAliHLTRunSummaryDataTypeID {'R','U','N','S','U','M','M','A'} | |
285 | ||
a0aeb701 | 286 | /** Block Statistics |
287 | * - small block statistics info added to the data stream by | |
288 | * the component base class | |
289 | * - origin kAliHLTDataOriginPrivate | |
290 | * @ingroup alihlt_component_datatypes | |
291 | */ | |
292 | # define kAliHLTComponentStatisticsDataTypeID {'C','O','M','P','S','T','A','T'} | |
293 | ||
294 | /** Component table | |
295 | * - list of components in the chain to be percolated through the chain | |
296 | * - each component adds it's chain id string and a generated 32bit id | |
297 | * @ingroup alihlt_component_datatypes | |
298 | */ | |
299 | # define kAliHLTComponentTableDataTypeID {'C','O','M','P','T','A','B','L'} | |
300 | ||
c736de25 | 301 | /** general ROOT TObject |
302 | * - a general TObject exported from the HLT analysis | |
303 | * - varying origin | |
1ac82ce6 | 304 | * @ingroup alihlt_component_datatypes |
c736de25 | 305 | */ |
306 | #define kAliHLTTObjectDataTypeID {'R','O','O','T','T','O','B','J'} | |
307 | ||
308 | /** ROOT TObjArray | |
309 | * - a TObjArray exported from the HLT analysis | |
310 | * - varying origin | |
1ac82ce6 | 311 | * @ingroup alihlt_component_datatypes |
c736de25 | 312 | */ |
313 | #define kAliHLTTObjArrayDataTypeID {'R','O','O','T','O','B','A','R'} | |
314 | ||
315 | /** ROOT TTree | |
316 | * - a TTree object exported from the HLT analysis | |
317 | * - varying origin | |
1ac82ce6 | 318 | * @ingroup alihlt_component_datatypes |
c736de25 | 319 | */ |
320 | #define kAliHLTTTreeDataTypeID {'R','O','O','T','T','R','E','E'} | |
321 | ||
322 | /** ROOT histogram | |
323 | * - a histogram object exported from the HLT analysis | |
324 | * - class derives from TH1 (directly or indirectly) and inherits all common functionality | |
325 | * - varying origin | |
1ac82ce6 | 326 | * @ingroup alihlt_component_datatypes |
c736de25 | 327 | */ |
328 | #define kAliHLTHistogramDataTypeID {'R','O','O','T','H','I','S','T'} | |
329 | ||
330 | /** ROOT TNtuple | |
331 | * - a TNtupl object exported from the HLT analysis | |
332 | * - varying origin | |
1ac82ce6 | 333 | * @ingroup alihlt_component_datatypes |
c736de25 | 334 | */ |
335 | #define kAliHLTTNtupleDataTypeID {'R','O','O','T','T','U','P','L'} | |
336 | ||
7398abba | 337 | /** HLT Track |
338 | * - Struct for Tracks based on AliExternalTrackParam | |
339 | * - varying origin | |
340 | * @ingroup alihlt_component_datatypes | |
341 | */ | |
342 | #define kAliHLTTrackDataTypeID {'H','L','T','T','R','A','C','K'} | |
343 | ||
344 | /** TClonesArray of AliExternalTrackParam | |
345 | * @ingroup alihlt_component_datatypes | |
346 | */ | |
347 | #define kAliHLTExternalTrackParamDataTypeID {'T','C','A','E','X','T','T','R'} | |
348 | ||
1843b457 | 349 | using namespace std; |
f23a6e1a | 350 | |
351 | extern "C" { | |
32db4144 | 352 | ////////////////////////////////////////////////////////////////////////// |
353 | // | |
354 | // Basic HLT data types | |
355 | // | |
356 | ////////////////////////////////////////////////////////////////////////// | |
f23a6e1a | 357 | |
358 | typedef unsigned char AliHLTUInt8_t; | |
359 | ||
eda89fe6 | 360 | typedef signed char AliHLTInt8_t; |
361 | ||
71d7c760 | 362 | typedef unsigned short AliHLTUInt16_t; |
363 | ||
eda89fe6 | 364 | typedef signed short AliHLTInt16_t; |
365 | ||
f23a6e1a | 366 | typedef unsigned int AliHLTUInt32_t; |
367 | ||
eda89fe6 | 368 | typedef signed int AliHLTInt32_t; |
369 | ||
f23a6e1a | 370 | typedef unsigned long long AliHLTUInt64_t; |
371 | ||
eda89fe6 | 372 | typedef signed long long AliHLTInt64_t; |
373 | ||
374 | typedef float AliHLTFloat32_t; | |
375 | ||
376 | typedef double AliHLTFloat64_t; | |
377 | ||
f23a6e1a | 378 | typedef AliHLTUInt64_t AliHLTEventID_t; |
379 | ||
32db4144 | 380 | ////////////////////////////////////////////////////////////////////////// |
381 | // | |
382 | // HLT logging levels | |
383 | // | |
384 | ////////////////////////////////////////////////////////////////////////// | |
f23a6e1a | 385 | |
2efb85be | 386 | /** |
387 | * Logging severities of the HLT | |
388 | */ | |
389 | enum AliHLTComponentLogSeverity { | |
390 | /** no logging */ | |
32db4144 | 391 | kHLTLogNone = 0, |
2efb85be | 392 | /** benchmark messages */ |
32db4144 | 393 | kHLTLogBenchmark = 0x1, |
2efb85be | 394 | /** debug messages */ |
32db4144 | 395 | kHLTLogDebug = 0x2, |
2efb85be | 396 | /** info messages */ |
32db4144 | 397 | kHLTLogInfo = 0x4, |
2efb85be | 398 | /** warning messages */ |
32db4144 | 399 | kHLTLogWarning = 0x8, |
2efb85be | 400 | /** error messages */ |
32db4144 | 401 | kHLTLogError = 0x10, |
b2065764 | 402 | /** fatal error messages */ |
32db4144 | 403 | kHLTLogFatal = 0x20, |
b2065764 | 404 | /** few important messages not to be filtered out. |
405 | * redirected to kHLTLogInfo in AliRoot | |
406 | */ | |
407 | kHLTLogImportant = 0x40, | |
2efb85be | 408 | /** special value to enable all messages */ |
b2065764 | 409 | kHLTLogAll = 0x7f, |
2efb85be | 410 | /** the default logging filter */ |
7233bc62 | 411 | kHLTLogDefault = 0x79 |
a3c9b745 | 412 | }; |
32db4144 | 413 | |
414 | ////////////////////////////////////////////////////////////////////////// | |
415 | // | |
416 | // HLT data structures for data exchange and external interface | |
417 | // | |
418 | ////////////////////////////////////////////////////////////////////////// | |
419 | ||
420 | /** | |
421 | * @struct AliHLTComponentEventData | |
422 | * Event descriptor | |
423 | */ | |
8ede8717 | 424 | struct AliHLTComponentEventData |
f23a6e1a | 425 | { |
426 | AliHLTUInt32_t fStructSize; | |
427 | AliHLTEventID_t fEventID; | |
428 | AliHLTUInt32_t fEventCreation_s; | |
429 | AliHLTUInt32_t fEventCreation_us; | |
430 | AliHLTUInt32_t fBlockCnt; | |
431 | }; | |
432 | ||
32db4144 | 433 | /** |
434 | * @struct AliHLTComponentShmData | |
435 | * Shared memory descriptor. | |
436 | * Irrelevant for analysis components. | |
437 | */ | |
8ede8717 | 438 | struct AliHLTComponentShmData |
f23a6e1a | 439 | { |
440 | AliHLTUInt32_t fStructSize; | |
441 | AliHLTUInt32_t fShmType; | |
442 | AliHLTUInt64_t fShmID; | |
443 | }; | |
71d7c760 | 444 | |
1ac82ce6 | 445 | /** |
446 | * @defgroup alihlt_component_datatypes Common Component Data Types | |
447 | * The analysis framework defines a number of common data types for | |
448 | * usage in the detector modules, like e.g. ::kAliHLTAnyDataType | |
449 | * and ::kAliHLTDataTypeDDLRaw. Those data types always have | |
450 | * origin ::kAliHLTDataOriginAny. The correct detector origin can be | |
451 | * set by using operator '|' | |
452 | * <pre> | |
453 | * AliHLTComponentDataType dt=kAliHLTDDLRawDataTypeID|kAliHLTDataOriginTPC | |
454 | * </pre> | |
455 | * @ingroup alihlt_component | |
456 | */ | |
457 | ||
32db4144 | 458 | /** |
459 | * @struct AliHLTComponentDataType | |
559631d5 | 460 | * Data type descriptor for data blocks transferred through the processing |
32db4144 | 461 | * chain. |
1ac82ce6 | 462 | * @ingroup alihlt_component_datatypes |
32db4144 | 463 | */ |
8ede8717 | 464 | struct AliHLTComponentDataType |
f23a6e1a | 465 | { |
466 | AliHLTUInt32_t fStructSize; | |
32db4144 | 467 | char fID[kAliHLTComponentDataTypefIDsize]; //! |
468 | char fOrigin[kAliHLTComponentDataTypefOriginSize]; //! | |
f23a6e1a | 469 | }; |
2d7ff710 | 470 | |
32db4144 | 471 | /** |
472 | * @struct AliHLTComponentBlockData | |
3294f81a | 473 | * This is the decription of data blocks exchanged between components. |
474 | * \b IMPORTANT: The validity of fPtr and fOffset is different for input and | |
475 | * output blocks: | |
476 | * - input blocks: The \em fPtr member always points to the beginning of the data | |
477 | * of size \em fSize. fOffset is ignored and should be in most | |
478 | * case 0. | |
479 | * - output blocks: The \em fPtr member is ignored by the framework. \em fOffset | |
480 | * must specify the start of the data relative to the output | |
481 | * buffer. The data block has size \em fSize. | |
32db4144 | 482 | */ |
8ede8717 | 483 | struct AliHLTComponentBlockData |
f23a6e1a | 484 | { |
3294f81a | 485 | /* size and version of the struct */ |
f23a6e1a | 486 | AliHLTUInt32_t fStructSize; |
3294f81a | 487 | /* shared memory key, ignored by processing components */ |
8ede8717 | 488 | AliHLTComponentShmData fShmKey; |
3294f81a | 489 | /* offset of output data relative to the output buffer */ |
f23a6e1a | 490 | AliHLTUInt32_t fOffset; |
3294f81a | 491 | /* start of the data for input data blocks, fOffset to be ignored*/ |
f23a6e1a | 492 | void* fPtr; |
3294f81a | 493 | /* size of the data block */ |
f23a6e1a | 494 | AliHLTUInt32_t fSize; |
3294f81a | 495 | /* data type of the data block */ |
8ede8717 | 496 | AliHLTComponentDataType fDataType; |
3294f81a | 497 | /* data specification of the data block */ |
f23a6e1a | 498 | AliHLTUInt32_t fSpecification; |
499 | }; | |
500 | ||
32db4144 | 501 | /** |
502 | * @struct AliHLTComponentEventDoneData | |
503 | * | |
504 | */ | |
8ede8717 | 505 | struct AliHLTComponentEventDoneData |
f23a6e1a | 506 | { |
507 | AliHLTUInt32_t fStructSize; | |
508 | AliHLTUInt32_t fDataSize; | |
509 | void* fData; | |
510 | }; | |
511 | ||
32db4144 | 512 | /** |
2cbdb37e | 513 | * @struct AliHLTRunDesc |
32db4144 | 514 | * Event descriptor. |
45c0a780 | 515 | * The struct is sent with the SOR and EOR events. |
516 | * | |
517 | * @note | |
a3c9b745 | 518 | * The name of the member fRunType is a bit misleading. This is not |
519 | * the ALICE Run Type given by the ECS to the sub-system. The member | |
520 | * is an internal HLT run type and a combination of the HLT running | |
521 | * mode and the beam type. | |
522 | * <pre> | |
523 | * Bit 0-2: beam type identifier | |
524 | * Bit 3-31: HLT mode | |
525 | * </pre> | |
32db4144 | 526 | */ |
2cbdb37e | 527 | struct AliHLTRunDesc |
32db4144 | 528 | { |
529 | AliHLTUInt32_t fStructSize; | |
530 | AliHLTUInt32_t fRunNo; | |
531 | AliHLTUInt32_t fRunType; | |
532 | }; | |
533 | ||
a0aeb701 | 534 | /** |
535 | * @struct AliHLTComponentStatistics | |
536 | * Small block size summary added by the AliHLTComponent base class | |
537 | * if component statistics are enabled (--enable-compstat). | |
538 | * | |
539 | * fLevel is retrieved from incoming block statistics and incremented. | |
540 | * Incoming block statistics are appended to the newly added one if | |
541 | * --enable-compstat=full has been chosen. | |
542 | */ | |
543 | struct AliHLTComponentStatistics | |
544 | { | |
545 | AliHLTUInt32_t fStructSize; | |
546 | AliHLTUInt32_t fLevel; | |
547 | AliHLTUInt32_t fId; | |
548 | AliHLTUInt32_t fTime; | |
549 | AliHLTUInt32_t fCTime; | |
550 | AliHLTUInt32_t fInputBlockCount; | |
551 | AliHLTUInt32_t fTotalInputSize; | |
552 | AliHLTUInt32_t fOutputBlockCount; | |
553 | AliHLTUInt32_t fTotalOutputSize; | |
554 | }; | |
555 | ||
556 | /** | |
557 | * @struct AliHLTComponentTableEntry | |
558 | * Structure to be send on SOR event through the chain. Each component | |
559 | * adds its chain id and component arguments to the list. | |
560 | * The 'length' of the structure is variable and depends on the length | |
561 | * of the strings in the buffer at the end. | |
abb52c8f | 562 | * |
563 | * ComponentTableEntries are identified by a 32bit Id generated by a CRC | |
564 | * algorithm from the chain Id of the component. This is not a 100% unique | |
565 | * id but with a high probability. This approach accounts for the fact | |
566 | * that all components are separated processes. | |
a0aeb701 | 567 | */ |
568 | struct AliHLTComponentTableEntry | |
569 | { | |
570 | AliHLTUInt32_t fStructSize; | |
abb52c8f | 571 | /** size of the array of parent ids */ |
572 | AliHLTUInt16_t fNofParents; | |
573 | /** size of the description string in the appended buffer */ | |
574 | AliHLTUInt8_t fSizeDescription; | |
a0aeb701 | 575 | /** the strings: chain id, component args, reserved */ |
576 | AliHLTUInt8_t fBuffer[1]; | |
577 | }; | |
578 | ||
8f81abf4 | 579 | ////////////////////////////////////////////////////////////////////////// |
580 | // | |
581 | // Trigger meta information | |
582 | // | |
583 | ////////////////////////////////////////////////////////////////////////// | |
584 | ||
585 | /** field size of fAttribute */ | |
2ff24e4c | 586 | const int gkAliHLTBlockDAttributeCount = 8; |
8f81abf4 | 587 | |
588 | /** field size of fCommonHeader */ | |
a3c9b745 | 589 | const int gkAliHLTCommonHeaderCount = 8; |
8f81abf4 | 590 | |
32db4144 | 591 | /** size of the DDL list */ |
2ff24e4c | 592 | const int gkAliHLTDDLListSize = 30; |
593 | ||
594 | /** Number of Trigger Classes of CTP in CDH */ | |
595 | const int gkNCTPTriggerClasses = 50; | |
32db4144 | 596 | |
597 | /** | |
598 | * @struct AliHLTEventDDL | |
599 | * DDL list event. | |
600 | * The struct is send with the DDLLIST event. | |
8f81abf4 | 601 | * Used in the trigger structure for internal apperance of |
602 | * the DLLs as well as for the HLT readout list send to DAQ | |
511b2509 | 603 | * ( as DataType : kAliHLTDataTypeDDL ) |
32db4144 | 604 | */ |
605 | struct AliHLTEventDDL | |
606 | { | |
607 | AliHLTUInt32_t fCount; | |
608 | AliHLTUInt32_t fList[gkAliHLTDDLListSize]; | |
609 | }; | |
610 | ||
8f81abf4 | 611 | /** |
612 | * @struct AliHLTEventTriggerData | |
8f81abf4 | 613 | */ |
614 | struct AliHLTEventTriggerData | |
615 | { | |
8f81abf4 | 616 | AliHLTUInt8_t fAttributes[gkAliHLTBlockDAttributeCount]; |
511b2509 | 617 | AliHLTUInt64_t fHLTStatus; // Bit field |
8f81abf4 | 618 | AliHLTUInt32_t fCommonHeaderWordCnt; |
619 | AliHLTUInt32_t fCommonHeader[gkAliHLTCommonHeaderCount]; | |
8f81abf4 | 620 | AliHLTEventDDL fReadoutList; |
621 | }; | |
622 | ||
623 | /** | |
624 | * @struct AliHLTComponentTriggerData | |
625 | * Trigger data | |
626 | */ | |
627 | struct AliHLTComponentTriggerData | |
628 | { | |
629 | AliHLTUInt32_t fStructSize; | |
630 | AliHLTUInt32_t fDataSize; | |
631 | void* fData; | |
632 | }; | |
633 | ||
9d9ffd37 | 634 | ////////////////////////////////////////////////////////////////////////// |
635 | // | |
636 | // HLT Event Type Specification | |
637 | // | |
638 | ////////////////////////////////////////////////////////////////////////// | |
639 | ||
640 | /** Unknown eventType specification */ | |
2ff24e4c | 641 | const AliHLTUInt32_t gkAliEventTypeUnknown = ~(AliHLTUInt32_t)0; |
9d9ffd37 | 642 | /** SOR eventType specification */ |
2ff24e4c | 643 | const AliHLTUInt32_t gkAliEventTypeStartOfRun=1; |
9d9ffd37 | 644 | /** Data eventType specification */ |
2ff24e4c | 645 | const AliHLTUInt32_t gkAliEventTypeData=2; |
9d9ffd37 | 646 | /** EOR eventType specification */ |
2ff24e4c | 647 | const AliHLTUInt32_t gkAliEventTypeEndOfRun=4; |
9d9ffd37 | 648 | /** Corrupt eventType specification */ |
2ff24e4c | 649 | const AliHLTUInt32_t gkAliEventTypeCorruptID=8; |
9d9ffd37 | 650 | /** Calibration eventType specification */ |
2ff24e4c | 651 | const AliHLTUInt32_t gkAliEventTypeCalibration=16; |
9d9ffd37 | 652 | /** DataReplay eventType specification */ |
2ff24e4c | 653 | const AliHLTUInt32_t gkAliEventTypeDataReplay=32; |
b543e186 | 654 | /** Configuration eventType specification */ |
2ff24e4c | 655 | const AliHLTUInt32_t gkAliEventTypeConfiguration=34; |
d6b69874 | 656 | /** Update DCS eventType specification */ |
2ff24e4c | 657 | const AliHLTUInt32_t gkAliEventTypeReadPreprocessor=35; |
9d9ffd37 | 658 | /** Tick eventType specification */ |
2ff24e4c | 659 | const AliHLTUInt32_t gkAliEventTypeTick=64; |
9d9ffd37 | 660 | /** Max eventType specification */ |
2ff24e4c | 661 | const AliHLTUInt32_t gkAliEventTypeMax=64; |
9d9ffd37 | 662 | |
32db4144 | 663 | ////////////////////////////////////////////////////////////////////////// |
664 | // | |
665 | // HLT defines and defaults | |
666 | // | |
667 | ////////////////////////////////////////////////////////////////////////// | |
668 | ||
1ac82ce6 | 669 | /** invalid event id |
670 | * @ingroup alihlt_component_datatypes | |
671 | */ | |
32db4144 | 672 | const AliHLTEventID_t kAliHLTVoidEventID=~(AliHLTEventID_t)0; |
673 | ||
1ac82ce6 | 674 | /** invalid data specification |
675 | * @ingroup alihlt_component_datatypes | |
676 | */ | |
32db4144 | 677 | const AliHLTUInt32_t kAliHLTVoidDataSpec = ~(AliHLTUInt32_t)0; |
678 | ||
45c0a780 | 679 | /** invalid run no |
680 | * @ingroup alihlt_component_datatypes | |
681 | */ | |
682 | const AliHLTUInt32_t kAliHLTVoidRunNo = ~(AliHLTUInt32_t)0; | |
683 | ||
684 | /** invalid run type | |
685 | * @ingroup alihlt_component_datatypes | |
686 | */ | |
687 | const AliHLTUInt32_t kAliHLTVoidRunType = ~(AliHLTUInt32_t)0; | |
688 | ||
689 | /** invalid run descriptor | |
690 | * @ingroup alihlt_component_datatypes | |
691 | */ | |
692 | const AliHLTRunDesc kAliHLTVoidRunDesc={sizeof(AliHLTRunDesc), kAliHLTVoidRunNo, kAliHLTVoidRunType}; | |
693 | ||
32db4144 | 694 | /** invalid shared memory type */ |
695 | const AliHLTUInt32_t gkAliHLTComponentInvalidShmType = 0; | |
696 | ||
697 | /** invalid shared memory id */ | |
698 | const AliHLTUInt64_t gkAliHLTComponentInvalidShmID = ~(AliHLTUInt64_t)0; | |
699 | ||
1ac82ce6 | 700 | /** invalid data type |
701 | * @ingroup alihlt_component_datatypes | |
702 | */ | |
32db4144 | 703 | const AliHLTComponentDataType kAliHLTVoidDataType = { |
704 | sizeof(AliHLTComponentDataType), | |
705 | kAliHLTVoidDataTypeID, | |
3f850585 | 706 | kAliHLTDataOriginVoid |
32db4144 | 707 | }; |
708 | ||
3dd8541e | 709 | /** all data types, means any + void data type |
710 | * @ingroup alihlt_component_datatypes | |
711 | */ | |
712 | const AliHLTComponentDataType kAliHLTAllDataTypes = { | |
713 | sizeof(AliHLTComponentDataType), | |
714 | kAliHLTAllDataTypesID, | |
715 | kAliHLTDataOriginAny | |
716 | }; | |
717 | ||
32db4144 | 718 | // there is currently a problem with rootcint if the predefined ids |
719 | // (commented below) are used. rootcint does not find the id if they | |
720 | // are char arrays defined with {} and individual chars. If strings | |
721 | // are used it works fine | |
1ac82ce6 | 722 | /** any data type |
723 | * @ingroup alihlt_component_datatypes | |
724 | */ | |
32db4144 | 725 | const AliHLTComponentDataType kAliHLTAnyDataType = { |
726 | sizeof(AliHLTComponentDataType), | |
727 | kAliHLTAnyDataTypeID, | |
3f850585 | 728 | kAliHLTDataOriginAny |
32db4144 | 729 | }; |
730 | ||
1ac82ce6 | 731 | /** multiple output data types |
732 | * @ingroup alihlt_component_datatypes | |
733 | */ | |
de6593d0 | 734 | extern const AliHLTComponentDataType kAliHLTMultipleDataType; |
735 | ||
1ac82ce6 | 736 | /** data to file exchange subscriber |
737 | * @ingroup alihlt_component_datatypes | |
738 | */ | |
32db4144 | 739 | extern const AliHLTComponentDataType kAliHLTDataTypeFXSCalib; |
740 | ||
1ac82ce6 | 741 | /** DDL list data type |
742 | * @ingroup alihlt_component_datatypes | |
743 | */ | |
32db4144 | 744 | extern const AliHLTComponentDataType kAliHLTDataTypeDDL; |
745 | ||
1ac82ce6 | 746 | /** SOR data type |
747 | * @ingroup alihlt_component_datatypes | |
748 | */ | |
32db4144 | 749 | extern const AliHLTComponentDataType kAliHLTDataTypeSOR; |
750 | ||
1ac82ce6 | 751 | /** EOR data type |
752 | * @ingroup alihlt_component_datatypes | |
753 | */ | |
32db4144 | 754 | extern const AliHLTComponentDataType kAliHLTDataTypeEOR; |
5ec8e281 | 755 | |
45c0a780 | 756 | /** Run type data block |
757 | * @ingroup alihlt_component_datatypes | |
758 | */ | |
759 | extern const AliHLTComponentDataType kAliHLTDataTypeRunType; | |
760 | ||
1ac82ce6 | 761 | /** Event type specification |
762 | * @ingroup alihlt_component_datatypes | |
763 | */ | |
77405890 | 764 | extern const AliHLTComponentDataType kAliHLTDataTypeEvent; |
765 | ||
1ac82ce6 | 766 | /** Configuration event data type |
767 | * @ingroup alihlt_component_datatypes | |
768 | */ | |
853121af | 769 | extern const AliHLTComponentDataType kAliHLTDataTypeComConf; |
770 | ||
1ac82ce6 | 771 | /** DCS value update event |
772 | * @ingroup alihlt_component_datatypes | |
773 | */ | |
b543e186 | 774 | extern const AliHLTComponentDataType kAliHLTDataTypeUpdtDCS; |
775 | ||
1ac82ce6 | 776 | /** RAW DDL data specification, origin is 'any', data publisher origin correctly |
777 | * @ingroup alihlt_component_datatypes | |
778 | */ | |
3f850585 | 779 | extern const AliHLTComponentDataType kAliHLTDataTypeDDLRaw; |
780 | ||
1ac82ce6 | 781 | /** ESD object data specification, origin is 'any' |
782 | * @ingroup alihlt_component_datatypes | |
783 | */ | |
a978c0d5 | 784 | extern const AliHLTComponentDataType kAliHLTDataTypeESDObject; |
785 | ||
1ac82ce6 | 786 | /** ESD Tree data specification, origin is 'any' |
787 | ||
a3c9b745 | 788 | * @ingroup alihlt_component_datatypes |
789 | */ | |
c704e290 | 790 | extern const AliHLTComponentDataType kAliHLTDataTypeESDTree; |
791 | ||
1ac82ce6 | 792 | /** AliRoot TreeD data specification, origin is 'any' |
793 | * @ingroup alihlt_component_datatypes | |
794 | */ | |
795 | extern const AliHLTComponentDataType kAliHLTDataTypeAliTreeD; | |
796 | ||
797 | /** AliRoot TreeR data specification, origin is 'any' | |
798 | * @ingroup alihlt_component_datatypes | |
799 | */ | |
800 | extern const AliHLTComponentDataType kAliHLTDataTypeAliTreeR; | |
801 | ||
802 | /** 16 bit Hardware address selection data specification, origin is 'any' | |
803 | * @ingroup alihlt_component_datatypes | |
804 | */ | |
64defa03 | 805 | extern const AliHLTComponentDataType kAliHLTDataTypeHwAddr16; |
806 | ||
1ac82ce6 | 807 | /** Event statistics |
808 | * @ingroup alihlt_component_datatypes | |
809 | */ | |
2ff24e4c | 810 | extern const AliHLTComponentDataType kAliHLTDataTypeEventStatistics; |
811 | ||
1ac82ce6 | 812 | /** Event summary |
813 | * @ingroup alihlt_component_datatypes | |
814 | */ | |
2ff24e4c | 815 | extern const AliHLTComponentDataType kAliHLTDataTypeEventSummary; |
816 | ||
1ac82ce6 | 817 | /** Event statistics |
818 | * @ingroup alihlt_component_datatypes | |
819 | */ | |
2ff24e4c | 820 | extern const AliHLTComponentDataType kAliHLTDataTypeRunStatistics; |
821 | ||
1ac82ce6 | 822 | /** Event summary |
823 | * @ingroup alihlt_component_datatypes | |
824 | */ | |
2ff24e4c | 825 | extern const AliHLTComponentDataType kAliHLTDataTypeRunSummary; |
826 | ||
a0aeb701 | 827 | /** Component block statistics |
828 | * @ingroup alihlt_component_datatypes | |
829 | */ | |
830 | extern const AliHLTComponentDataType kAliHLTDataTypeComponentStatistics; | |
831 | ||
832 | /** Component table | |
833 | * To be sent on SOR event, each component adds it's chain id string | |
834 | * and a generated 32bit identifier to the table | |
835 | * @ingroup alihlt_component_datatypes | |
836 | */ | |
837 | extern const AliHLTComponentDataType kAliHLTDataTypeComponentTable; | |
838 | ||
c736de25 | 839 | ////////////////////////////////////////////////////////////////////////// |
840 | // | |
841 | // Data Types for Monitoring objects | |
842 | // | |
843 | ////////////////////////////////////////////////////////////////////////// | |
844 | ||
1ac82ce6 | 845 | /** general ROOT TObject |
846 | * @ingroup alihlt_component_datatypes | |
847 | */ | |
c736de25 | 848 | extern const AliHLTComponentDataType kAliHLTDataTypeTObject; // {ROOTTOBJ,"***"} |
849 | ||
1ac82ce6 | 850 | /** ROOT TObjArray |
851 | * @ingroup alihlt_component_datatypes | |
852 | */ | |
c736de25 | 853 | extern const AliHLTComponentDataType kAliHLTDataTypeTObjArray; // {ROOTOBAR,"***"} |
854 | ||
1ac82ce6 | 855 | /** ROOT TTree |
856 | * @ingroup alihlt_component_datatypes | |
857 | */ | |
c736de25 | 858 | extern const AliHLTComponentDataType kAliHLTDataTypeTTree; // {ROOTTREE,"***"} |
859 | ||
1ac82ce6 | 860 | /** ROOT TH1 (can be used for all histograms, they derive from TH1) |
861 | * @ingroup alihlt_component_datatypes | |
862 | */ | |
c736de25 | 863 | extern const AliHLTComponentDataType kAliHLTDataTypeHistogram; // {ROOTHIST,"***"} |
864 | ||
1ac82ce6 | 865 | /** ROOT TNtuple |
866 | * @ingroup alihlt_component_datatypes | |
867 | */ | |
c736de25 | 868 | extern const AliHLTComponentDataType kAliHLTDataTypeTNtuple; // {ROOTTUPL,"***"} |
869 | ||
7398abba | 870 | /** General track array for the barrel tracks based on AliExternalTrackParam |
871 | * Data format defined by AliHLTTracksData | |
872 | * | |
873 | * We follow the naming scheme of AliESDEvent where 'Tracks' denote the | |
874 | * barrel tracks and detector tracks get names 'DETTracks' | |
875 | * @ingroup alihlt_component_datatypes | |
876 | */ | |
877 | extern const AliHLTComponentDataType kAliHLTDataTypeTrack; // {HLTTRACK,"***"} | |
878 | ||
879 | /** TClonesArray of AliExternalTrackParam | |
880 | * @ingroup alihlt_component_datatypes | |
881 | */ | |
882 | extern const AliHLTComponentDataType kAliHLTDataTypeExternalTrackParam;// {TCAEXTTR,"***"} | |
883 | ||
32db4144 | 884 | ////////////////////////////////////////////////////////////////////////// |
885 | // | |
886 | // FXS subscriber meta information | |
887 | // | |
888 | ////////////////////////////////////////////////////////////////////////// | |
889 | ||
2ff24e4c | 890 | const int gkAliHLTFXSHeaderfOriginSize = 4; |
891 | const int gkAliHLTFXSHeaderfFileIDSize = 128; | |
892 | const int gkAliHLTFXSHeaderfDDLNumberSize = 64; | |
32db4144 | 893 | |
894 | /** Header in front of the data payload, in order to sent data to the FXS. */ | |
895 | struct AliHLTFXSHeader | |
896 | { | |
897 | AliHLTUInt32_t fHeaderVersion; | |
898 | AliHLTUInt32_t fRunNumber; | |
899 | char fOrigin[gkAliHLTFXSHeaderfOriginSize]; | |
900 | char fFileID[gkAliHLTFXSHeaderfFileIDSize]; | |
901 | char fDDLNumber[gkAliHLTFXSHeaderfDDLNumberSize]; | |
902 | }; | |
903 | ||
904 | ////////////////////////////////////////////////////////////////////////// | |
905 | // | |
906 | // Component running environment | |
907 | // | |
908 | ////////////////////////////////////////////////////////////////////////// | |
909 | ||
910 | /** logging function */ | |
911 | typedef int (*AliHLTfctLogging)( void* param, | |
912 | AliHLTComponentLogSeverity severity, | |
913 | const char* origin, | |
914 | const char* keyword, | |
915 | const char* message); | |
916 | ||
917 | /** | |
a3c9b745 | 918 | * @struct AliHLTAnalysisEnvironment |
32db4144 | 919 | * Running environment for analysis components. |
a3c9b745 | 920 | * The struct describes function callbacks for actions to be |
921 | * carried out by the calling framework, like memory allocation, | |
922 | * property callbecks, logging, etc. | |
923 | * | |
924 | * @ingroup alihlt_wrapper_interface | |
32db4144 | 925 | */ |
a3c9b745 | 926 | struct AliHLTAnalysisEnvironment |
f23a6e1a | 927 | { |
a3c9b745 | 928 | /** size of the structure */ |
f23a6e1a | 929 | AliHLTUInt32_t fStructSize; |
a3c9b745 | 930 | |
931 | /** the component parameter given by the framework on creation | |
932 | */ | |
f23a6e1a | 933 | void* fParam; |
a3c9b745 | 934 | |
935 | /** allocated memory | |
936 | */ | |
f23a6e1a | 937 | void* (*fAllocMemoryFunc)( void* param, unsigned long size ); |
a3c9b745 | 938 | |
939 | /** allocate an EventDoneData structure. | |
940 | */ | |
941 | int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd ); | |
942 | ||
943 | /** logging callback | |
944 | */ | |
945 | AliHLTfctLogging fLoggingFunc; | |
946 | }; | |
f23a6e1a | 947 | #if 0 |
a3c9b745 | 948 | // I just keep this as a note pad. Has to be added to the end of the structure |
949 | // future addition already foreseen/envisioned | |
950 | // IMPORTANT: don not just remove the defines as this breaks the binary | |
951 | // compatibility | |
952 | int (*fAllocShmMemoryFunc)( void* param, unsigned long size, AliHLTComponentBlockData* blockLocation ); | |
f23a6e1a | 953 | #endif |
a3c9b745 | 954 | |
955 | /** | |
956 | * @struct AliHLTComponentEnvironment | |
957 | * This was the original definition of the running environment. | |
958 | * Due to a bug in the AliRootWrapperSubscriber/SimpleComponentWrapper, | |
959 | * this structure can not be used any longer but is kept for backward | |
960 | * compatibility. | |
961 | * @note The external interface provided by the libHLTbase is now kept | |
962 | * frozen but should not be used any more. Use the interface provided | |
963 | * by the libHLTinterface library. | |
964 | * | |
965 | * @ingroup alihlt_wrapper_interface_deprecated | |
966 | */ | |
967 | struct AliHLTComponentEnvironment | |
968 | { | |
969 | AliHLTUInt32_t fStructSize; | |
970 | void* fParam; | |
971 | void* (*fAllocMemoryFunc)( void* param, unsigned long size ); | |
8ede8717 | 972 | int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd ); |
5ec8e281 | 973 | AliHLTfctLogging fLoggingFunc; |
f23a6e1a | 974 | }; |
a3c9b745 | 975 | |
976 | ////////////////////////////////////////////////////////////////////////// | |
977 | // | |
978 | // The external interface definition | |
979 | // | |
980 | ////////////////////////////////////////////////////////////////////////// | |
981 | ||
982 | /** | |
983 | * The component handle. | |
984 | * Used as indification in the outside world. | |
985 | * @ingroup alihlt_wrapper_interface | |
986 | */ | |
987 | typedef void* AliHLTComponentHandle; | |
988 | ||
989 | /** @ingroup alihlt_wrapper_interface */ | |
990 | const AliHLTComponentHandle kEmptyHLTComponentHandle = 0; | |
991 | ||
992 | /** | |
993 | * Get a system call of the interface. | |
994 | * @param function signature | |
995 | * @return pointer to system call | |
996 | * @ingroup alihlt_wrapper_interface | |
997 | */ | |
998 | typedef void* (*AliHLTAnalysisFctGetInterfaceCall)(const char*); | |
999 | ||
1000 | # define ALIHLTANALYSIS_INTERFACE_LIBRARY "libHLTinterface.so" | |
1001 | # define ALIHLTANALYSIS_FCT_GETINTERFACECALL "AliHLTAnalysisGetInterfaceCall" | |
1002 | ||
1003 | /** @ingroup alihlt_wrapper_interface */ | |
1004 | typedef int (*AliHLTExtFctInitSystem)( unsigned long version, AliHLTAnalysisEnvironment* externalEnv, unsigned long runNo, const char* runType ); | |
1005 | ||
1006 | /** @ingroup alihlt_wrapper_interface */ | |
1007 | typedef int (*AliHLTExtFctDeinitSystem)(); | |
1008 | ||
1009 | /** @ingroup alihlt_wrapper_interface */ | |
1010 | typedef int (*AliHLTExtFctLoadLibrary)( const char* ); | |
1011 | ||
1012 | /** @ingroup alihlt_wrapper_interface */ | |
1013 | typedef int (*AliHLTExtFctUnloadLibrary)( const char* ); | |
1014 | ||
1015 | /** @ingroup alihlt_wrapper_interface */ | |
1016 | typedef int (*AliHLTExtFctCreateComponent)( const char*, void*, int, const char**, AliHLTComponentHandle*, const char* description ); | |
1017 | ||
1018 | /** @ingroup alihlt_wrapper_interface */ | |
1019 | typedef int (*AliHLTExtFctDestroyComponent)( AliHLTComponentHandle ); | |
1020 | ||
1021 | /** @ingroup alihlt_wrapper_interface */ | |
1022 | typedef int (*AliHLTExtFctProcessEvent)( AliHLTComponentHandle, const AliHLTComponentEventData*, const AliHLTComponentBlockData*, | |
1023 | AliHLTComponentTriggerData*, AliHLTUInt8_t*, | |
1024 | AliHLTUInt32_t*, AliHLTUInt32_t*, | |
1025 | AliHLTComponentBlockData**, | |
1026 | AliHLTComponentEventDoneData** ); | |
1027 | ||
1028 | /** @ingroup alihlt_wrapper_interface */ | |
1029 | typedef int (*AliHLTExtFctGetOutputDataType)( AliHLTComponentHandle, AliHLTComponentDataType* ); | |
1030 | ||
1031 | /** @ingroup alihlt_wrapper_interface */ | |
1032 | typedef int (*AliHLTExtFctGetOutputSize)( AliHLTComponentHandle, unsigned long*, double* ); | |
1033 | ||
f23a6e1a | 1034 | } |
1035 | ||
32db4144 | 1036 | ////////////////////////////////////////////////////////////////////////// |
1037 | // | |
1038 | // Data type helper functions | |
1039 | // | |
1040 | ////////////////////////////////////////////////////////////////////////// | |
1041 | ||
3dd8541e | 1042 | /** exact comparison of HLT component data types |
1043 | * @ingroup alihlt_component_datatypes | |
1044 | */ | |
1045 | inline bool MatchExactly( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 ) | |
1046 | { | |
1047 | for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ ) | |
1048 | if ( dt1.fID[i] != dt2.fID[i] ) | |
1049 | return false; | |
1050 | for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) | |
1051 | if ( dt1.fOrigin[i] != dt2.fOrigin[i] ) | |
1052 | return false; | |
1053 | return true; | |
1054 | } | |
1055 | ||
1ac82ce6 | 1056 | /** Comparison operator for HLT component data types. |
1057 | * The operator takes wildcards into account, i.e. the ::kAliHLTAnyDataType, | |
1058 | * ::kAliHLTAnyDataTypeID and ::kAliHLTDataOriginAny definitions. | |
1059 | * @ingroup alihlt_component_datatypes | |
1060 | */ | |
8ede8717 | 1061 | inline bool operator==( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 ) |
853121af | 1062 | { |
3dd8541e | 1063 | if (MatchExactly(dt1, kAliHLTAllDataTypes)) return true; |
1064 | if (MatchExactly(dt2, kAliHLTAllDataTypes)) return true; | |
1065 | ||
853121af | 1066 | bool any1=true, any2=true, void1=true, void2=true, match=true; |
1067 | for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) { | |
1068 | any1&=(dt1.fOrigin[i]==kAliHLTDataOriginAny[i]); | |
1069 | any2&=(dt2.fOrigin[i]==kAliHLTDataOriginAny[i]); | |
1070 | void1&=(dt1.fOrigin[i]==kAliHLTDataOriginVoid[i]); | |
1071 | void2&=(dt2.fOrigin[i]==kAliHLTDataOriginVoid[i]); | |
1072 | match&=dt1.fOrigin[i]==dt2.fOrigin[i]; | |
1073 | if (!(match || (any2 && !void1) || (any1 && !void2))) | |
1074 | return false; | |
1075 | } | |
1076 | ||
1077 | any1=true, any2=true, match=true; | |
1078 | for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ ) { | |
1079 | any1&=(dt1.fID[i]==kAliHLTAnyDataTypeID[i]); | |
1080 | any2&=(dt2.fID[i]==kAliHLTAnyDataTypeID[i]); | |
1081 | void1&=(dt1.fID[i]==kAliHLTVoidDataTypeID[i]); | |
1082 | void2&=(dt2.fID[i]==kAliHLTVoidDataTypeID[i]); | |
1083 | match&=dt1.fID[i]==dt2.fID[i]; | |
1084 | if (!(match || (any2 && !void1) || (any1 && !void2))) | |
1085 | return false; | |
1086 | } | |
1087 | return true; | |
1088 | } | |
71d7c760 | 1089 | |
1ac82ce6 | 1090 | /** Comparison operator for HLT component data types |
297174de | 1091 | * Invers of operator== |
1ac82ce6 | 1092 | * @ingroup alihlt_component_datatypes |
1093 | */ | |
8ede8717 | 1094 | inline bool operator!=( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 ) |
853121af | 1095 | { |
1096 | return !(dt1==dt2); | |
1097 | } | |
71d7c760 | 1098 | |
1ac82ce6 | 1099 | /** merge operator for HLT component data types and origins |
1100 | * @ingroup alihlt_component_datatypes | |
1101 | */ | |
69347e0d | 1102 | inline AliHLTComponentDataType operator|(const AliHLTComponentDataType srcdt, const char origin[kAliHLTComponentDataTypefOriginSize]) |
853121af | 1103 | { |
1104 | AliHLTComponentDataType dt=srcdt; | |
1105 | for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) | |
1106 | dt.fOrigin[i]=origin[i]; | |
1107 | return dt; | |
1108 | } | |
32db4144 | 1109 | |
e5c0542d | 1110 | /** |
1111 | * Helper function to initialize a data type from an id char array and origin string. | |
1112 | * @return data type structure initialized with the specified id and origin | |
1113 | * @ingroup alihlt_component_datatypes | |
1114 | */ | |
1115 | inline AliHLTComponentDataType AliHLTComponentDataTypeInitializer(const char id[kAliHLTComponentDataTypefIDsize], const char* origin) | |
1116 | { | |
1117 | AliHLTComponentDataType dt=kAliHLTVoidDataType; | |
1118 | int i=0; | |
1119 | for (i = 0; i < kAliHLTComponentDataTypefIDsize; i++) | |
1120 | dt.fID[i]=id[i]; | |
1121 | for (i = 0; i < kAliHLTComponentDataTypefOriginSize && origin[i]!=0; i++ ) | |
1122 | dt.fOrigin[i]=origin[i]; | |
1123 | return dt; | |
1124 | } | |
1125 | ||
1126 | /** | |
1127 | * Helper function to initialize a data type from a default data type and | |
1128 | * an origin string. Basically it merges the specified origin into the data | |
1129 | * type. | |
1130 | * @return data type structure initialized with the id from specified data type | |
1131 | * and origin | |
1132 | * @ingroup alihlt_component_datatypes | |
1133 | */ | |
1134 | inline AliHLTComponentDataType AliHLTComponentDataTypeInitializer(const AliHLTComponentDataType src, const char* origin) | |
1135 | { | |
1136 | return AliHLTComponentDataTypeInitializer(src.fID, origin); | |
1137 | } | |
1138 | ||
f23a6e1a | 1139 | #endif |