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