- added default CDB initialization to AliHLTComponent: CDB storage and
[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
2cbdb37e 35 */
1ac82ce6 36#define ALIHLT_DATA_TYPES_VERSION 6
2cbdb37e 37
32db4144 38//////////////////////////////////////////////////////////////////////////
39//
69347e0d 40// HLT data origin variables.
41//
42// By converting from defines to variables, the origins can be used with
43// the operator|
44//
45// AliHLTComponentDataType dt;
46// dt = kAliHLTDataTypeDDLRaw | gkAliHLTDataOriginTPC;
32db4144 47//
48//////////////////////////////////////////////////////////////////////////
49
1ac82ce6 50/** field size of datat type origin
51 * @ingroup alihlt_component_datatypes
52 */
32db4144 53const int kAliHLTComponentDataTypefOriginSize=4;
54
55
1ac82ce6 56/** invalid data origin
57 * @ingroup alihlt_component_datatypes
58 */
3f850585 59# define kAliHLTDataOriginVoid "\0\0\0"
60/** old invalid data origin, kept for backward compatibility */
32db4144 61# define kAliHLTVoidDataOrigin "\0\0\0"
62
1ac82ce6 63/** wildcard data type origin
64 * @ingroup alihlt_component_datatypes
65 */
3f850585 66# define kAliHLTDataOriginAny "***"
67/** old wildcard data type origin, kept for backward compatibility */
32db4144 68# define kAliHLTAnyDataOrigin "***"
69
1ac82ce6 70/** Data origin HLT out
71 * @ingroup alihlt_component_datatypes
72 */
69347e0d 73extern const char kAliHLTDataOriginOut[kAliHLTComponentDataTypefOriginSize];
32db4144 74
1ac82ce6 75/** Data origin HLT/PubSub private internal
76 * @ingroup alihlt_component_datatypes
77 */
69347e0d 78extern const char kAliHLTDataOriginPrivate[kAliHLTComponentDataTypefOriginSize];
32db4144 79
1ac82ce6 80/** Data origin TPC
81 * @ingroup alihlt_component_datatypes
82 */
69347e0d 83extern const char kAliHLTDataOriginTPC[kAliHLTComponentDataTypefOriginSize];
32db4144 84
1ac82ce6 85/** Data origin PHOS
86 * @ingroup alihlt_component_datatypes
87 */
69347e0d 88extern const char kAliHLTDataOriginPHOS[kAliHLTComponentDataTypefOriginSize];
32db4144 89
1ac82ce6 90/** Data origin MUON
91 * @ingroup alihlt_component_datatypes
92 */
69347e0d 93extern const char kAliHLTDataOriginMUON[kAliHLTComponentDataTypefOriginSize];
32db4144 94
1ac82ce6 95/** Data origin TRD
96 * @ingroup alihlt_component_datatypes
97 */
69347e0d 98extern const char kAliHLTDataOriginTRD[kAliHLTComponentDataTypefOriginSize];
32db4144 99
1ac82ce6 100/** Data origin ITS
101 * @ingroup alihlt_component_datatypes
102 */
69347e0d 103extern const char kAliHLTDataOriginITS[kAliHLTComponentDataTypefOriginSize];
32db4144 104
703bcca6 105/** Data origin for examples
106 * @ingroup alihlt_component_datatypes
107 */
108extern const char kAliHLTDataOriginSample[kAliHLTComponentDataTypefOriginSize];
109
32db4144 110//////////////////////////////////////////////////////////////////////////
111//
112// HLT common data type defines
113//
114//////////////////////////////////////////////////////////////////////////
115
1ac82ce6 116/** field size of data type id
117 * @ingroup alihlt_component_datatypes
118 */
32db4144 119const int kAliHLTComponentDataTypefIDsize=8;
120
121
1ac82ce6 122/** invalid data type id
123 * @ingroup alihlt_component_datatypes
124 */
32db4144 125# define kAliHLTVoidDataTypeID "\0\0\0\0\0\0\0"
126
3dd8541e 127/** special id for all data types: any + void
128 * @ingroup alihlt_component_datatypes
129 */
130# define kAliHLTAllDataTypesID "ALLDATA"
131
132/** special id for any valid data type id
1ac82ce6 133 * @ingroup alihlt_component_datatypes
134 */
32db4144 135# define kAliHLTAnyDataTypeID "*******"
136
1ac82ce6 137/** DDL RAW data
138 * @ingroup alihlt_component_datatypes
139 */
3f850585 140# define kAliHLTDDLRawDataTypeID {'D','D','L','_','R','A','W',' '}
141
1ac82ce6 142/** calibration data for file exchange subscriber
143 * @ingroup alihlt_component_datatypes
144 */
32db4144 145# define kAliHLTFXSCalibDataTypeID {'F','X','S','_','C','A','L',' '}
146
147/** start of run (SOR) event
2cbdb37e 148 * @ref AliHLTRunDesc
1ac82ce6 149 * @ingroup alihlt_component_datatypes
32db4144 150 */
151# define kAliHLTSORDataTypeID {'S','T','A','R','T','O','F','R'}
152
153/** end of run (EOR) event
2cbdb37e 154 * @ref AliHLTRunDesc
1ac82ce6 155 * @ingroup alihlt_component_datatypes
32db4144 156 */
157# define kAliHLTEORDataTypeID {'E','N','D','O','F','R','U','N'}
158
159/** DDL list event
160 * @ref AliHLTEventDDL
1ac82ce6 161 * @ingroup alihlt_component_datatypes
32db4144 162 */
163# define kAliHLTDDLDataTypeID {'D','D','L','L','I','S','T',' '}
164
9d9ffd37 165/** EventType event
166 * - empty payload, specification gives eventType
1ac82ce6 167 * @ingroup alihlt_component_datatypes
9d9ffd37 168 */
169# define kAliHLTEventDataTypeID {'E','V','E','N','T','T','Y','P'}
170
853121af 171/** ComponentConfiguration event
b543e186 172 * - payload contains the CDB path as string
1ac82ce6 173 * @ingroup alihlt_component_datatypes
853121af 174 */
175# define kAliHLTComConfDataTypeID {'C','O','M','_','C','O','N','F'}
176
b543e186 177/** DCS value update event
178 * - payload contains string of relevant detectors
1ac82ce6 179 * @ingroup alihlt_component_datatypes
b543e186 180 */
181# define kAliHLTUpdtDCSDataTypeID {'U','P','D','T','_','D','C','S'}
182
c704e290 183/** ESD data block
184 * an AliESD object of varying origin
853121af 185 * The 'V0' at the end allows a versioning
1ac82ce6 186 * @ingroup alihlt_component_datatypes
c704e290 187 */
a978c0d5 188# define kAliHLTESDObjectDataTypeID {'A','L','I','E','S','D','V','0'}
c704e290 189
a978c0d5 190/** ESD tree data block
191 * TTree with an AliESD object of varying origin
1ac82ce6 192 * @ingroup alihlt_component_datatypes
a978c0d5 193 */
194# define kAliHLTESDTreeDataTypeID {'E','S','D','_','T','R','E','E'}
64defa03 195
1ac82ce6 196/** AliRoot TreeD
197 * - the digits tree of an AliRoot module
198 * @ingroup alihlt_component_datatypes
199 */
200#define kAliHLTTreeDDataTypeID {'A','L','I','T','R','E','E','D'}
201
202/** AliRoot TreeR
203 * - the rec points tree of an AliRoot module
204 * @ingroup alihlt_component_datatypes
205 */
206#define kAliHLTTreeRDataTypeID {'A','L','I','T','R','E','E','D'}
207
64defa03 208/** HW Address selection data block
209 * - a selection list for 16 bit HW addresses
210 * - varying origin
1ac82ce6 211 * @ingroup alihlt_component_datatypes
64defa03 212 */
213# define kAliHLTHwAddr16DataTypeID {'H','W','A','D','D','R','1','6'}
214
2ff24e4c 215/** Event Statistics
216 * - event statistics for given detectors
217 * - varying origin
1ac82ce6 218 * @ingroup alihlt_component_datatypes
2ff24e4c 219 */
220# define kAliHLTEventStatisticsDataTypeID {'E','V','_','S','T','A','T','I'}
221
222/** Event Summary
223 * - event summary
224 * - origin : kAliHLTDataOriginOut ( HLT )
1ac82ce6 225 * @ingroup alihlt_component_datatypes
2ff24e4c 226 */
227# define kAliHLTEventSummaryDataTypeID {'E','V','_','S','U','M','M','A'}
228
229/** Run Statistics
230 * - run statistics for given detectors
231 * - varying origin
1ac82ce6 232 * @ingroup alihlt_component_datatypes
2ff24e4c 233 */
234# define kAliHLTRunStatisticsDataTypeID {'R','U','N','S','T','A','T','I'}
235
236/** Run Summary
237 * - run summary
238 * - origin : kAliHLTDataOriginOut ( HLT )
1ac82ce6 239 * @ingroup alihlt_component_datatypes
2ff24e4c 240 */
241# define kAliHLTRunSummaryDataTypeID {'R','U','N','S','U','M','M','A'}
242
c736de25 243/** general ROOT TObject
244 * - a general TObject exported from the HLT analysis
245 * - varying origin
1ac82ce6 246 * @ingroup alihlt_component_datatypes
c736de25 247 */
248#define kAliHLTTObjectDataTypeID {'R','O','O','T','T','O','B','J'}
249
250/** ROOT TObjArray
251 * - a TObjArray exported from the HLT analysis
252 * - varying origin
1ac82ce6 253 * @ingroup alihlt_component_datatypes
c736de25 254 */
255#define kAliHLTTObjArrayDataTypeID {'R','O','O','T','O','B','A','R'}
256
257/** ROOT TTree
258 * - a TTree object exported from the HLT analysis
259 * - varying origin
1ac82ce6 260 * @ingroup alihlt_component_datatypes
c736de25 261 */
262#define kAliHLTTTreeDataTypeID {'R','O','O','T','T','R','E','E'}
263
264/** ROOT histogram
265 * - a histogram object exported from the HLT analysis
266 * - class derives from TH1 (directly or indirectly) and inherits all common functionality
267 * - varying origin
1ac82ce6 268 * @ingroup alihlt_component_datatypes
c736de25 269 */
270#define kAliHLTHistogramDataTypeID {'R','O','O','T','H','I','S','T'}
271
272/** ROOT TNtuple
273 * - a TNtupl object exported from the HLT analysis
274 * - varying origin
1ac82ce6 275 * @ingroup alihlt_component_datatypes
c736de25 276 */
277#define kAliHLTTNtupleDataTypeID {'R','O','O','T','T','U','P','L'}
278
1843b457 279using namespace std;
f23a6e1a 280
281extern "C" {
32db4144 282 //////////////////////////////////////////////////////////////////////////
283 //
284 // Basic HLT data types
285 //
286 //////////////////////////////////////////////////////////////////////////
f23a6e1a 287
288 typedef unsigned char AliHLTUInt8_t;
289
eda89fe6 290 typedef signed char AliHLTInt8_t;
291
71d7c760 292 typedef unsigned short AliHLTUInt16_t;
293
eda89fe6 294 typedef signed short AliHLTInt16_t;
295
f23a6e1a 296 typedef unsigned int AliHLTUInt32_t;
297
eda89fe6 298 typedef signed int AliHLTInt32_t;
299
f23a6e1a 300 typedef unsigned long long AliHLTUInt64_t;
301
eda89fe6 302 typedef signed long long AliHLTInt64_t;
303
304 typedef float AliHLTFloat32_t;
305
306 typedef double AliHLTFloat64_t;
307
f23a6e1a 308 typedef AliHLTUInt64_t AliHLTEventID_t;
309
32db4144 310 //////////////////////////////////////////////////////////////////////////
311 //
312 // HLT logging levels
313 //
314 //////////////////////////////////////////////////////////////////////////
f23a6e1a 315
2efb85be 316 /**
317 * Logging severities of the HLT
318 */
319 enum AliHLTComponentLogSeverity {
320 /** no logging */
32db4144 321 kHLTLogNone = 0,
2efb85be 322 /** benchmark messages */
32db4144 323 kHLTLogBenchmark = 0x1,
2efb85be 324 /** debug messages */
32db4144 325 kHLTLogDebug = 0x2,
2efb85be 326 /** info messages */
32db4144 327 kHLTLogInfo = 0x4,
2efb85be 328 /** warning messages */
32db4144 329 kHLTLogWarning = 0x8,
2efb85be 330 /** error messages */
32db4144 331 kHLTLogError = 0x10,
b2065764 332 /** fatal error messages */
32db4144 333 kHLTLogFatal = 0x20,
b2065764 334 /** few important messages not to be filtered out.
335 * redirected to kHLTLogInfo in AliRoot
336 */
337 kHLTLogImportant = 0x40,
2efb85be 338 /** special value to enable all messages */
b2065764 339 kHLTLogAll = 0x7f,
2efb85be 340 /** the default logging filter */
7233bc62 341 kHLTLogDefault = 0x79
32db4144 342};
343
344 //////////////////////////////////////////////////////////////////////////
345 //
346 // HLT data structures for data exchange and external interface
347 //
348 //////////////////////////////////////////////////////////////////////////
349
350 /**
351 * @struct AliHLTComponentEventData
352 * Event descriptor
353 */
8ede8717 354 struct AliHLTComponentEventData
f23a6e1a 355 {
356 AliHLTUInt32_t fStructSize;
357 AliHLTEventID_t fEventID;
358 AliHLTUInt32_t fEventCreation_s;
359 AliHLTUInt32_t fEventCreation_us;
360 AliHLTUInt32_t fBlockCnt;
361 };
362
32db4144 363 /**
364 * @struct AliHLTComponentShmData
365 * Shared memory descriptor.
366 * Irrelevant for analysis components.
367 */
8ede8717 368 struct AliHLTComponentShmData
f23a6e1a 369 {
370 AliHLTUInt32_t fStructSize;
371 AliHLTUInt32_t fShmType;
372 AliHLTUInt64_t fShmID;
373 };
71d7c760 374
1ac82ce6 375 /**
376 * @defgroup alihlt_component_datatypes Common Component Data Types
377 * The analysis framework defines a number of common data types for
378 * usage in the detector modules, like e.g. ::kAliHLTAnyDataType
379 * and ::kAliHLTDataTypeDDLRaw. Those data types always have
380 * origin ::kAliHLTDataOriginAny. The correct detector origin can be
381 * set by using operator '|'
382 * <pre>
383 * AliHLTComponentDataType dt=kAliHLTDDLRawDataTypeID|kAliHLTDataOriginTPC
384 * </pre>
385 * @ingroup alihlt_component
386 */
387
32db4144 388 /**
389 * @struct AliHLTComponentDataType
559631d5 390 * Data type descriptor for data blocks transferred through the processing
32db4144 391 * chain.
1ac82ce6 392 * @ingroup alihlt_component_datatypes
32db4144 393 */
8ede8717 394 struct AliHLTComponentDataType
f23a6e1a 395 {
396 AliHLTUInt32_t fStructSize;
32db4144 397 char fID[kAliHLTComponentDataTypefIDsize]; //!
398 char fOrigin[kAliHLTComponentDataTypefOriginSize]; //!
f23a6e1a 399 };
2d7ff710 400
32db4144 401 /**
402 * @struct AliHLTComponentBlockData
3294f81a 403 * This is the decription of data blocks exchanged between components.
404 * \b IMPORTANT: The validity of fPtr and fOffset is different for input and
405 * output blocks:
406 * - input blocks: The \em fPtr member always points to the beginning of the data
407 * of size \em fSize. fOffset is ignored and should be in most
408 * case 0.
409 * - output blocks: The \em fPtr member is ignored by the framework. \em fOffset
410 * must specify the start of the data relative to the output
411 * buffer. The data block has size \em fSize.
32db4144 412 */
8ede8717 413 struct AliHLTComponentBlockData
f23a6e1a 414 {
3294f81a 415 /* size and version of the struct */
f23a6e1a 416 AliHLTUInt32_t fStructSize;
3294f81a 417 /* shared memory key, ignored by processing components */
8ede8717 418 AliHLTComponentShmData fShmKey;
3294f81a 419 /* offset of output data relative to the output buffer */
f23a6e1a 420 AliHLTUInt32_t fOffset;
3294f81a 421 /* start of the data for input data blocks, fOffset to be ignored*/
f23a6e1a 422 void* fPtr;
3294f81a 423 /* size of the data block */
f23a6e1a 424 AliHLTUInt32_t fSize;
3294f81a 425 /* data type of the data block */
8ede8717 426 AliHLTComponentDataType fDataType;
3294f81a 427 /* data specification of the data block */
f23a6e1a 428 AliHLTUInt32_t fSpecification;
429 };
430
32db4144 431 /**
432 * @struct AliHLTComponentEventDoneData
433 *
434 */
8ede8717 435 struct AliHLTComponentEventDoneData
f23a6e1a 436 {
437 AliHLTUInt32_t fStructSize;
438 AliHLTUInt32_t fDataSize;
439 void* fData;
440 };
441
32db4144 442 /**
2cbdb37e 443 * @struct AliHLTRunDesc
32db4144 444 * Event descriptor.
445 * The struct is send with the SOR and EOR events.
446 */
2cbdb37e 447 struct AliHLTRunDesc
32db4144 448 {
449 AliHLTUInt32_t fStructSize;
450 AliHLTUInt32_t fRunNo;
451 AliHLTUInt32_t fRunType;
452 };
453
8f81abf4 454 //////////////////////////////////////////////////////////////////////////
455 //
456 // Trigger meta information
457 //
458 //////////////////////////////////////////////////////////////////////////
459
460 /** field size of fAttribute */
2ff24e4c 461 const int gkAliHLTBlockDAttributeCount = 8;
8f81abf4 462
463 /** field size of fCommonHeader */
2ff24e4c 464 const int gkAliHLTCommonHeaderCount = 8;
8f81abf4 465
32db4144 466 /** size of the DDL list */
2ff24e4c 467 const int gkAliHLTDDLListSize = 30;
468
469 /** Number of Trigger Classes of CTP in CDH */
470 const int gkNCTPTriggerClasses = 50;
32db4144 471
472 /**
473 * @struct AliHLTEventDDL
474 * DDL list event.
475 * The struct is send with the DDLLIST event.
8f81abf4 476 * Used in the trigger structure for internal apperance of
477 * the DLLs as well as for the HLT readout list send to DAQ
511b2509 478 * ( as DataType : kAliHLTDataTypeDDL )
32db4144 479 */
480 struct AliHLTEventDDL
481 {
482 AliHLTUInt32_t fCount;
483 AliHLTUInt32_t fList[gkAliHLTDDLListSize];
484 };
485
8f81abf4 486 /**
487 * @struct AliHLTEventTriggerData
8f81abf4 488 */
489 struct AliHLTEventTriggerData
490 {
8f81abf4 491 AliHLTUInt8_t fAttributes[gkAliHLTBlockDAttributeCount];
511b2509 492 AliHLTUInt64_t fHLTStatus; // Bit field
8f81abf4 493 AliHLTUInt32_t fCommonHeaderWordCnt;
494 AliHLTUInt32_t fCommonHeader[gkAliHLTCommonHeaderCount];
8f81abf4 495 AliHLTEventDDL fReadoutList;
496 };
497
498 /**
499 * @struct AliHLTComponentTriggerData
500 * Trigger data
501 */
502 struct AliHLTComponentTriggerData
503 {
504 AliHLTUInt32_t fStructSize;
505 AliHLTUInt32_t fDataSize;
506 void* fData;
507 };
508
9d9ffd37 509 //////////////////////////////////////////////////////////////////////////
510 //
511 // HLT Event Type Specification
512 //
513 //////////////////////////////////////////////////////////////////////////
514
515 /** Unknown eventType specification */
2ff24e4c 516 const AliHLTUInt32_t gkAliEventTypeUnknown = ~(AliHLTUInt32_t)0;
9d9ffd37 517 /** SOR eventType specification */
2ff24e4c 518 const AliHLTUInt32_t gkAliEventTypeStartOfRun=1;
9d9ffd37 519 /** Data eventType specification */
2ff24e4c 520 const AliHLTUInt32_t gkAliEventTypeData=2;
9d9ffd37 521 /** EOR eventType specification */
2ff24e4c 522 const AliHLTUInt32_t gkAliEventTypeEndOfRun=4;
9d9ffd37 523 /** Corrupt eventType specification */
2ff24e4c 524 const AliHLTUInt32_t gkAliEventTypeCorruptID=8;
9d9ffd37 525 /** Calibration eventType specification */
2ff24e4c 526 const AliHLTUInt32_t gkAliEventTypeCalibration=16;
9d9ffd37 527 /** DataReplay eventType specification */
2ff24e4c 528 const AliHLTUInt32_t gkAliEventTypeDataReplay=32;
b543e186 529 /** Configuration eventType specification */
2ff24e4c 530 const AliHLTUInt32_t gkAliEventTypeConfiguration=34;
d6b69874 531 /** Update DCS eventType specification */
2ff24e4c 532 const AliHLTUInt32_t gkAliEventTypeReadPreprocessor=35;
9d9ffd37 533 /** Tick eventType specification */
2ff24e4c 534 const AliHLTUInt32_t gkAliEventTypeTick=64;
9d9ffd37 535 /** Max eventType specification */
2ff24e4c 536 const AliHLTUInt32_t gkAliEventTypeMax=64;
9d9ffd37 537
32db4144 538 //////////////////////////////////////////////////////////////////////////
539 //
540 // HLT defines and defaults
541 //
542 //////////////////////////////////////////////////////////////////////////
543
1ac82ce6 544 /** invalid event id
545 * @ingroup alihlt_component_datatypes
546 */
32db4144 547 const AliHLTEventID_t kAliHLTVoidEventID=~(AliHLTEventID_t)0;
548
1ac82ce6 549 /** invalid data specification
550 * @ingroup alihlt_component_datatypes
551 */
32db4144 552 const AliHLTUInt32_t kAliHLTVoidDataSpec = ~(AliHLTUInt32_t)0;
553
554 /** invalid shared memory type */
555 const AliHLTUInt32_t gkAliHLTComponentInvalidShmType = 0;
556
557 /** invalid shared memory id */
558 const AliHLTUInt64_t gkAliHLTComponentInvalidShmID = ~(AliHLTUInt64_t)0;
559
1ac82ce6 560 /** invalid data type
561 * @ingroup alihlt_component_datatypes
562 */
32db4144 563 const AliHLTComponentDataType kAliHLTVoidDataType = {
564 sizeof(AliHLTComponentDataType),
565 kAliHLTVoidDataTypeID,
3f850585 566 kAliHLTDataOriginVoid
32db4144 567 };
568
3dd8541e 569 /** all data types, means any + void data type
570 * @ingroup alihlt_component_datatypes
571 */
572 const AliHLTComponentDataType kAliHLTAllDataTypes = {
573 sizeof(AliHLTComponentDataType),
574 kAliHLTAllDataTypesID,
575 kAliHLTDataOriginAny
576 };
577
32db4144 578 // there is currently a problem with rootcint if the predefined ids
579 // (commented below) are used. rootcint does not find the id if they
580 // are char arrays defined with {} and individual chars. If strings
581 // are used it works fine
1ac82ce6 582 /** any data type
583 * @ingroup alihlt_component_datatypes
584 */
32db4144 585 const AliHLTComponentDataType kAliHLTAnyDataType = {
586 sizeof(AliHLTComponentDataType),
587 kAliHLTAnyDataTypeID,
3f850585 588 kAliHLTDataOriginAny
32db4144 589 };
590
1ac82ce6 591 /** multiple output data types
592 * @ingroup alihlt_component_datatypes
593 */
de6593d0 594 extern const AliHLTComponentDataType kAliHLTMultipleDataType;
595
1ac82ce6 596 /** data to file exchange subscriber
597 * @ingroup alihlt_component_datatypes
598 */
32db4144 599 extern const AliHLTComponentDataType kAliHLTDataTypeFXSCalib;
600
1ac82ce6 601 /** DDL list data type
602 * @ingroup alihlt_component_datatypes
603 */
32db4144 604 extern const AliHLTComponentDataType kAliHLTDataTypeDDL;
605
1ac82ce6 606 /** SOR data type
607 * @ingroup alihlt_component_datatypes
608 */
32db4144 609 extern const AliHLTComponentDataType kAliHLTDataTypeSOR;
610
1ac82ce6 611 /** EOR data type
612 * @ingroup alihlt_component_datatypes
613 */
32db4144 614 extern const AliHLTComponentDataType kAliHLTDataTypeEOR;
5ec8e281 615
1ac82ce6 616 /** Event type specification
617 * @ingroup alihlt_component_datatypes
618 */
77405890 619 extern const AliHLTComponentDataType kAliHLTDataTypeEvent;
620
1ac82ce6 621 /** Configuration event data type
622 * @ingroup alihlt_component_datatypes
623 */
853121af 624 extern const AliHLTComponentDataType kAliHLTDataTypeComConf;
625
1ac82ce6 626 /** DCS value update event
627 * @ingroup alihlt_component_datatypes
628 */
b543e186 629 extern const AliHLTComponentDataType kAliHLTDataTypeUpdtDCS;
630
1ac82ce6 631 /** RAW DDL data specification, origin is 'any', data publisher origin correctly
632 * @ingroup alihlt_component_datatypes
633 */
3f850585 634 extern const AliHLTComponentDataType kAliHLTDataTypeDDLRaw;
635
1ac82ce6 636 /** ESD object data specification, origin is 'any'
637 * @ingroup alihlt_component_datatypes
638 */
a978c0d5 639 extern const AliHLTComponentDataType kAliHLTDataTypeESDObject;
640
1ac82ce6 641 /** ESD Tree data specification, origin is 'any'
642
643 * @ingroup alihlt_component_datatypes
644 */
c704e290 645 extern const AliHLTComponentDataType kAliHLTDataTypeESDTree;
646
1ac82ce6 647 /** AliRoot TreeD data specification, origin is 'any'
648 * @ingroup alihlt_component_datatypes
649 */
650 extern const AliHLTComponentDataType kAliHLTDataTypeAliTreeD;
651
652 /** AliRoot TreeR data specification, origin is 'any'
653 * @ingroup alihlt_component_datatypes
654 */
655 extern const AliHLTComponentDataType kAliHLTDataTypeAliTreeR;
656
657 /** 16 bit Hardware address selection data specification, origin is 'any'
658 * @ingroup alihlt_component_datatypes
659 */
64defa03 660 extern const AliHLTComponentDataType kAliHLTDataTypeHwAddr16;
661
1ac82ce6 662 /** Event statistics
663 * @ingroup alihlt_component_datatypes
664 */
2ff24e4c 665 extern const AliHLTComponentDataType kAliHLTDataTypeEventStatistics;
666
1ac82ce6 667 /** Event summary
668 * @ingroup alihlt_component_datatypes
669 */
2ff24e4c 670 extern const AliHLTComponentDataType kAliHLTDataTypeEventSummary;
671
1ac82ce6 672 /** Event statistics
673 * @ingroup alihlt_component_datatypes
674 */
2ff24e4c 675 extern const AliHLTComponentDataType kAliHLTDataTypeRunStatistics;
676
1ac82ce6 677 /** Event summary
678 * @ingroup alihlt_component_datatypes
679 */
2ff24e4c 680 extern const AliHLTComponentDataType kAliHLTDataTypeRunSummary;
681
c736de25 682 //////////////////////////////////////////////////////////////////////////
683 //
684 // Data Types for Monitoring objects
685 //
686 //////////////////////////////////////////////////////////////////////////
687
1ac82ce6 688 /** general ROOT TObject
689 * @ingroup alihlt_component_datatypes
690 */
c736de25 691 extern const AliHLTComponentDataType kAliHLTDataTypeTObject; // {ROOTTOBJ,"***"}
692
1ac82ce6 693 /** ROOT TObjArray
694 * @ingroup alihlt_component_datatypes
695 */
c736de25 696 extern const AliHLTComponentDataType kAliHLTDataTypeTObjArray; // {ROOTOBAR,"***"}
697
1ac82ce6 698 /** ROOT TTree
699 * @ingroup alihlt_component_datatypes
700 */
c736de25 701 extern const AliHLTComponentDataType kAliHLTDataTypeTTree; // {ROOTTREE,"***"}
702
1ac82ce6 703 /** ROOT TH1 (can be used for all histograms, they derive from TH1)
704 * @ingroup alihlt_component_datatypes
705 */
c736de25 706 extern const AliHLTComponentDataType kAliHLTDataTypeHistogram; // {ROOTHIST,"***"}
707
1ac82ce6 708 /** ROOT TNtuple
709 * @ingroup alihlt_component_datatypes
710 */
c736de25 711 extern const AliHLTComponentDataType kAliHLTDataTypeTNtuple; // {ROOTTUPL,"***"}
712
32db4144 713 //////////////////////////////////////////////////////////////////////////
714 //
715 // FXS subscriber meta information
716 //
717 //////////////////////////////////////////////////////////////////////////
718
2ff24e4c 719 const int gkAliHLTFXSHeaderfOriginSize = 4;
720 const int gkAliHLTFXSHeaderfFileIDSize = 128;
721 const int gkAliHLTFXSHeaderfDDLNumberSize = 64;
32db4144 722
723 /** Header in front of the data payload, in order to sent data to the FXS. */
724 struct AliHLTFXSHeader
725 {
726 AliHLTUInt32_t fHeaderVersion;
727 AliHLTUInt32_t fRunNumber;
728 char fOrigin[gkAliHLTFXSHeaderfOriginSize];
729 char fFileID[gkAliHLTFXSHeaderfFileIDSize];
730 char fDDLNumber[gkAliHLTFXSHeaderfDDLNumberSize];
731 };
732
733 //////////////////////////////////////////////////////////////////////////
734 //
735 // Component running environment
736 //
737 //////////////////////////////////////////////////////////////////////////
738
739 /** logging function */
740 typedef int (*AliHLTfctLogging)( void* param,
741 AliHLTComponentLogSeverity severity,
742 const char* origin,
743 const char* keyword,
744 const char* message);
745
746 /**
747 * @struct AliHLTComponentEnvironment
748 * Running environment for analysis components.
749 * The struct describes function callbacks for
750 */
f23a6e1a 751 struct AliHLTComponentEnvironment
752 {
753 AliHLTUInt32_t fStructSize;
754 void* fParam;
755 void* (*fAllocMemoryFunc)( void* param, unsigned long size );
756#if 0
32db4144 757 // future addition already foreseen/envisioned
758 // IMPORTANT: don not just remove the defines as this breaks the binary
759 // compatibility
760 int (*fAllocShmMemoryFunc)( void* param, unsigned long size, AliHLTComponentBlockData* blockLocation );
f23a6e1a 761#endif
8ede8717 762 int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd );
5ec8e281 763 AliHLTfctLogging fLoggingFunc;
f23a6e1a 764 };
765}
766
32db4144 767//////////////////////////////////////////////////////////////////////////
768//
769// Data type helper functions
770//
771//////////////////////////////////////////////////////////////////////////
772
3dd8541e 773/** exact comparison of HLT component data types
774 * @ingroup alihlt_component_datatypes
775 */
776inline bool MatchExactly( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
777{
778 for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ )
779 if ( dt1.fID[i] != dt2.fID[i] )
780 return false;
781 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
782 if ( dt1.fOrigin[i] != dt2.fOrigin[i] )
783 return false;
784 return true;
785}
786
1ac82ce6 787/** Comparison operator for HLT component data types.
788 * The operator takes wildcards into account, i.e. the ::kAliHLTAnyDataType,
789 * ::kAliHLTAnyDataTypeID and ::kAliHLTDataOriginAny definitions.
790 * @ingroup alihlt_component_datatypes
791 */
8ede8717 792inline bool operator==( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
853121af 793{
3dd8541e 794 if (MatchExactly(dt1, kAliHLTAllDataTypes)) return true;
795 if (MatchExactly(dt2, kAliHLTAllDataTypes)) return true;
796
853121af 797 bool any1=true, any2=true, void1=true, void2=true, match=true;
798 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) {
799 any1&=(dt1.fOrigin[i]==kAliHLTDataOriginAny[i]);
800 any2&=(dt2.fOrigin[i]==kAliHLTDataOriginAny[i]);
801 void1&=(dt1.fOrigin[i]==kAliHLTDataOriginVoid[i]);
802 void2&=(dt2.fOrigin[i]==kAliHLTDataOriginVoid[i]);
803 match&=dt1.fOrigin[i]==dt2.fOrigin[i];
804 if (!(match || (any2 && !void1) || (any1 && !void2)))
805 return false;
806 }
807
808 any1=true, any2=true, match=true;
809 for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ ) {
810 any1&=(dt1.fID[i]==kAliHLTAnyDataTypeID[i]);
811 any2&=(dt2.fID[i]==kAliHLTAnyDataTypeID[i]);
812 void1&=(dt1.fID[i]==kAliHLTVoidDataTypeID[i]);
813 void2&=(dt2.fID[i]==kAliHLTVoidDataTypeID[i]);
814 match&=dt1.fID[i]==dt2.fID[i];
815 if (!(match || (any2 && !void1) || (any1 && !void2)))
816 return false;
817 }
818 return true;
819}
71d7c760 820
1ac82ce6 821/** Comparison operator for HLT component data types
297174de 822 * Invers of operator==
1ac82ce6 823 * @ingroup alihlt_component_datatypes
824 */
8ede8717 825inline bool operator!=( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
853121af 826{
827 return !(dt1==dt2);
828}
71d7c760 829
1ac82ce6 830/** merge operator for HLT component data types and origins
831 * @ingroup alihlt_component_datatypes
832 */
69347e0d 833inline AliHLTComponentDataType operator|(const AliHLTComponentDataType srcdt, const char origin[kAliHLTComponentDataTypefOriginSize])
853121af 834{
835 AliHLTComponentDataType dt=srcdt;
836 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
837 dt.fOrigin[i]=origin[i];
838 return dt;
839}
32db4144 840
f23a6e1a 841#endif