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