3 #ifndef ALIHLTDATATYPES_H
4 #define ALIHLTDATATYPES_H
5 /* This file is property of and copyright by the ALICE HLT Project *
6 * ALICE Experiment at CERN, All rights reserved. *
7 * See cxx source for full Copyright notice */
9 /** @file AliHLTDataTypes.h
10 @author Matthias Richter, Timm Steinbeck, Jochen Thaeder
12 @brief Data type declaration for the HLT module.
15 //////////////////////////////////////////////////////////////////////////
17 // version no of HLT data types
19 //////////////////////////////////////////////////////////////////////////
21 /* Version Description
22 * 1 first version until June 07; implicite, not tagged
23 * 2 introduced June 07, enhanced/cleaned/arranged structure
24 * 3 2007-11-15 RAW DDL data type added; some inconsistencies fixed
25 * ('void' and 'any' origins); added signed HLT basic data types
26 * 2007-11-23 origin defines have become variables in conjunction
27 * to be used with the operator| (AliHLTComponentDataType)
28 * 2007-11-24 added trigger structs and ESD tree data type
29 * 4 Component configuration and DCS update events added
30 * gkAliHLTDDLListSize set from 29 to 30 according to new PubSub
32 * 5 Data types for Run and Event summary, and for monitoring added
33 * 6 Common data types for TreeD and TreeR defined
34 * kAliHLTAllDataTypes and kAliHLTDataOriginSample added
35 * kAliHLTDataOriginEMCAL added
36 * kAliHLTDataTypeRunType added
37 * 7 kAliHLTDataTypeComponentStatistics, kAliHLTDataTypeComponentTable,
38 * and AliHLTComponentStatistics have been added for optional
39 * component block statistics
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
45 * 9 added data types for arrays of AliHLTExternalTrackParam sets and
46 * TClonesArrays of AliExternalTrackParam objects.
47 * 10 Changes for information objects neededfor running with offline
48 * chains and analysis tasks.
49 * kAliHLTMCObjectDataType added
50 * kAliHLTDataOriginOffline added
51 * kAliHLTDataOriginHLT added
52 * 11 extended AliHLTComponentStatistics: one more member to store the
53 * cycle time between events per component.
54 * 12 added common data type id 'CLUSTERS'
55 * added data type 'ECSPARAM' for the full ECS parameter string to
58 #define ALIHLT_DATA_TYPES_VERSION 12
60 //////////////////////////////////////////////////////////////////////////
62 // HLT data origin variables.
64 // By converting from defines to variables, the origins can be used with
67 // AliHLTComponentDataType dt;
68 // dt = kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC;
70 //////////////////////////////////////////////////////////////////////////
72 /** field size of datat type origin
73 * @ingroup alihlt_component_datatypes
75 const int kAliHLTComponentDataTypefOriginSize=4;
78 /** invalid data origin
79 * @ingroup alihlt_component_datatypes
81 # define kAliHLTDataOriginVoid "\0\0\0"
82 /** old invalid data origin, kept for backward compatibility */
83 # define kAliHLTVoidDataOrigin "\0\0\0"
85 /** wildcard data type origin
86 * @ingroup alihlt_component_datatypes
88 # define kAliHLTDataOriginAny "***"
89 /** old wildcard data type origin, kept for backward compatibility */
90 # define kAliHLTAnyDataOrigin "***"
92 /** Data origin HLT out
93 * @ingroup alihlt_component_datatypes
95 extern const char kAliHLTDataOriginOut[kAliHLTComponentDataTypefOriginSize];
97 /** Data origin HLT, used for HLT specifc data
98 * in offline chains. This not a bug!
99 * @ingroup alihlt_component_datatypes
101 extern const char kAliHLTDataOriginHLT[kAliHLTComponentDataTypefOriginSize];
103 /** Data origin Offline
104 * @ingroup alihlt_component_datatypes
106 extern const char kAliHLTDataOriginOffline[kAliHLTComponentDataTypefOriginSize];
108 /** Data origin HLT/PubSub private internal
109 * @ingroup alihlt_component_datatypes
111 extern const char kAliHLTDataOriginPrivate[kAliHLTComponentDataTypefOriginSize];
114 * @ingroup alihlt_component_datatypes
116 extern const char kAliHLTDataOriginTPC[kAliHLTComponentDataTypefOriginSize];
119 * @ingroup alihlt_component_datatypes
121 extern const char kAliHLTDataOriginPHOS[kAliHLTComponentDataTypefOriginSize];
124 * @ingroup alihlt_component_datatypes
126 extern const char kAliHLTDataOriginFMD[kAliHLTComponentDataTypefOriginSize];
129 * @ingroup alihlt_component_datatypes
131 extern const char kAliHLTDataOriginMUON[kAliHLTComponentDataTypefOriginSize];
134 * @ingroup alihlt_component_datatypes
136 extern const char kAliHLTDataOriginTRD[kAliHLTComponentDataTypefOriginSize];
139 * @ingroup alihlt_component_datatypes
141 extern const char kAliHLTDataOriginITS[kAliHLTComponentDataTypefOriginSize];
143 /** Data origin ITS SPD
144 * @ingroup alihlt_component_datatypes
146 extern const char kAliHLTDataOriginITSSPD[kAliHLTComponentDataTypefOriginSize];
148 /** Data origin ITS SDD
149 * @ingroup alihlt_component_datatypes
151 extern const char kAliHLTDataOriginITSSDD[kAliHLTComponentDataTypefOriginSize];
153 /** Data origin ITS SSD
154 * @ingroup alihlt_component_datatypes
156 extern const char kAliHLTDataOriginITSSSD[kAliHLTComponentDataTypefOriginSize];
158 /** Data origin for examples
159 * @ingroup alihlt_component_datatypes
161 extern const char kAliHLTDataOriginSample[kAliHLTComponentDataTypefOriginSize];
163 /** Data origin EMCAL
164 * @ingroup alihlt_component_datatypes
166 extern const char kAliHLTDataOriginEMCAL[kAliHLTComponentDataTypefOriginSize];
168 //////////////////////////////////////////////////////////////////////////
170 // HLT common data type defines
172 //////////////////////////////////////////////////////////////////////////
174 /** field size of data type id
175 * @ingroup alihlt_component_datatypes
177 const int kAliHLTComponentDataTypefIDsize=8;
180 /** invalid data type id
181 * @ingroup alihlt_component_datatypes
183 # define kAliHLTVoidDataTypeID "\0\0\0\0\0\0\0"
185 /** special id for all data types: any + void
186 * @ingroup alihlt_component_datatypes
188 # define kAliHLTAllDataTypesID "ALLDATA"
190 /** special id for any valid data type id
191 * @ingroup alihlt_component_datatypes
193 # define kAliHLTAnyDataTypeID "*******"
196 * @ingroup alihlt_component_datatypes
198 # define kAliHLTDDLRawDataTypeID {'D','D','L','_','R','A','W',' '}
201 * Common data type for the output of cluster finders, the exact
202 * format depends on the origin (detector)
203 * @ingroup alihlt_component_datatypes
205 # define kAliHLTClustersDataTypeID {'C','L','U','S','T','E','R','S'}
207 /** calibration data for file exchange subscriber
208 * @ingroup alihlt_component_datatypes
210 # define kAliHLTFXSCalibDataTypeID {'F','X','S','_','C','A','L',' '}
212 /** start of run (SOR) event
214 * @ingroup alihlt_component_datatypes
216 # define kAliHLTSORDataTypeID {'S','T','A','R','T','O','F','R'}
218 /** end of run (EOR) event
220 * @ingroup alihlt_component_datatypes
222 # define kAliHLTEORDataTypeID {'E','N','D','O','F','R','U','N'}
224 /** run type data block
225 * string with run type as payload
226 * @ingroup alihlt_component_datatypes
228 # define kAliHLTRunTypeDataTypeID {'R','U','N','T','Y','P','E',' '}
231 * @ref AliHLTEventDDL
232 * @ingroup alihlt_component_datatypes
234 # define kAliHLTDDLDataTypeID {'D','D','L','L','I','S','T',' '}
237 * - empty payload, specification gives eventType
238 * @ingroup alihlt_component_datatypes
240 # define kAliHLTEventDataTypeID {'E','V','E','N','T','T','Y','P'}
242 /** ECS parameter event
243 * - sent during the SOR event by the framework
244 * - contains the full ECS parameter string
245 * @ingroup alihlt_component_datatypes
247 # define kAliHLTECSParamDataTypeID {'E','C','S','P','A','R','A','M'}
249 /** ComponentConfiguration event
250 * - payload contains the CDB path as string
251 * @ingroup alihlt_component_datatypes
253 # define kAliHLTComConfDataTypeID {'C','O','M','_','C','O','N','F'}
255 /** DCS value update event
256 * - payload contains string of relevant detectors
257 * @ingroup alihlt_component_datatypes
259 # define kAliHLTUpdtDCSDataTypeID {'U','P','D','T','_','D','C','S'}
262 * an AliMCEvent object of varying origin
263 * The 'V0' at the end allows a versioning
264 * @ingroup alihlt_component_datatypes
266 # define kAliHLTMCObjectDataTypeID {'A','L','I','M','C','_','V','0'}
269 * an AliESD object of varying origin
270 * The 'V0' at the end allows a versioning
271 * @ingroup alihlt_component_datatypes
273 # define kAliHLTESDObjectDataTypeID {'A','L','I','E','S','D','V','0'}
275 /** ESD tree data block
276 * TTree with an AliESD object of varying origin
277 * @ingroup alihlt_component_datatypes
279 # define kAliHLTESDTreeDataTypeID {'E','S','D','_','T','R','E','E'}
282 * - the digits tree of an AliRoot module
283 * @ingroup alihlt_component_datatypes
285 #define kAliHLTTreeDDataTypeID {'A','L','I','T','R','E','E','D'}
288 * - the rec points tree of an AliRoot module
289 * @ingroup alihlt_component_datatypes
291 #define kAliHLTTreeRDataTypeID {'A','L','I','T','R','E','E','R'}
293 /** HW Address selection data block
294 * - a selection list for 16 bit HW addresses
296 * @ingroup alihlt_component_datatypes
298 # define kAliHLTHwAddr16DataTypeID {'H','W','A','D','D','R','1','6'}
301 * - event statistics for given detectors
303 * @ingroup alihlt_component_datatypes
305 # define kAliHLTEventStatisticsDataTypeID {'E','V','_','S','T','A','T','I'}
309 * - origin : kAliHLTDataOriginOut ( HLT )
310 * @ingroup alihlt_component_datatypes
312 # define kAliHLTEventSummaryDataTypeID {'E','V','_','S','U','M','M','A'}
315 * - run statistics for given detectors
317 * @ingroup alihlt_component_datatypes
319 # define kAliHLTRunStatisticsDataTypeID {'R','U','N','S','T','A','T','I'}
323 * - origin : kAliHLTDataOriginOut ( HLT )
324 * @ingroup alihlt_component_datatypes
326 # define kAliHLTRunSummaryDataTypeID {'R','U','N','S','U','M','M','A'}
329 * - small block statistics info added to the data stream by
330 * the component base class
331 * - origin kAliHLTDataOriginPrivate
332 * @ingroup alihlt_component_datatypes
334 # define kAliHLTComponentStatisticsDataTypeID {'C','O','M','P','S','T','A','T'}
337 * - list of components in the chain to be percolated through the chain
338 * - each component adds it's chain id string and a generated 32bit id
339 * @ingroup alihlt_component_datatypes
341 # define kAliHLTComponentTableDataTypeID {'C','O','M','P','T','A','B','L'}
343 /** general ROOT TObject
344 * - a general TObject exported from the HLT analysis
346 * @ingroup alihlt_component_datatypes
348 #define kAliHLTTObjectDataTypeID {'R','O','O','T','T','O','B','J'}
351 * - a TObjArray exported from the HLT analysis
353 * @ingroup alihlt_component_datatypes
355 #define kAliHLTTObjArrayDataTypeID {'R','O','O','T','O','B','A','R'}
358 * - a TTree object exported from the HLT analysis
360 * @ingroup alihlt_component_datatypes
362 #define kAliHLTTTreeDataTypeID {'R','O','O','T','T','R','E','E'}
365 * - a histogram object exported from the HLT analysis
366 * - class derives from TH1 (directly or indirectly) and inherits all common functionality
368 * @ingroup alihlt_component_datatypes
370 #define kAliHLTHistogramDataTypeID {'R','O','O','T','H','I','S','T'}
373 * - a TNtupl object exported from the HLT analysis
375 * @ingroup alihlt_component_datatypes
377 #define kAliHLTTNtupleDataTypeID {'R','O','O','T','T','U','P','L'}
380 * - Struct for Tracks based on AliExternalTrackParam
382 * @ingroup alihlt_component_datatypes
384 #define kAliHLTTrackDataTypeID {'H','L','T','T','R','A','C','K'}
386 /** TClonesArray of AliExternalTrackParam
387 * @ingroup alihlt_component_datatypes
389 #define kAliHLTExternalTrackParamDataTypeID {'T','C','A','E','X','T','T','R'}
392 * - Struct for jets based on AliHLTJETJets
394 * @ingroup alihlt_component_datatypes
396 #define kAliHLTJetDataTypeID {'H','L','T','J','E','T','V','0'}
401 //////////////////////////////////////////////////////////////////////////
403 // Basic HLT data types
405 //////////////////////////////////////////////////////////////////////////
407 typedef unsigned char AliHLTUInt8_t;
409 typedef signed char AliHLTInt8_t;
411 typedef unsigned short AliHLTUInt16_t;
413 typedef signed short AliHLTInt16_t;
415 typedef unsigned int AliHLTUInt32_t;
417 typedef signed int AliHLTInt32_t;
419 typedef unsigned long long AliHLTUInt64_t;
421 typedef signed long long AliHLTInt64_t;
423 typedef float AliHLTFloat32_t;
425 typedef double AliHLTFloat64_t;
427 typedef AliHLTUInt64_t AliHLTEventID_t;
429 //////////////////////////////////////////////////////////////////////////
431 // HLT logging levels
433 //////////////////////////////////////////////////////////////////////////
436 * Logging severities of the HLT
438 enum AliHLTComponentLogSeverity {
441 /** benchmark messages */
442 kHLTLogBenchmark = 0x1,
443 /** debug messages */
447 /** warning messages */
448 kHLTLogWarning = 0x8,
449 /** error messages */
451 /** fatal error messages */
453 /** few important messages not to be filtered out.
454 * redirected to kHLTLogInfo in AliRoot
456 kHLTLogImportant = 0x40,
457 /** special value to enable all messages */
459 /** the default logging filter */
460 kHLTLogDefault = 0x79
463 //////////////////////////////////////////////////////////////////////////
465 // HLT data structures for data exchange and external interface
467 //////////////////////////////////////////////////////////////////////////
470 * @struct AliHLTComponentEventData
473 struct AliHLTComponentEventData
475 AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
476 AliHLTEventID_t fEventID; /// 64 bit event ID number.
477 AliHLTUInt32_t fEventCreation_s; /// Event creation time in seconds (Should be added to fEventCreation_us*1e6).
478 AliHLTUInt32_t fEventCreation_us; /// Fractional event creation time in micro seconds.
479 AliHLTUInt32_t fBlockCnt; /// The number of raw data blocks received by the component.
483 * @struct AliHLTComponentShmData
484 * Shared memory descriptor.
485 * Irrelevant for analysis components.
487 struct AliHLTComponentShmData
489 AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
490 AliHLTUInt32_t fShmType; /// The type code of the shared memory.
491 AliHLTUInt64_t fShmID; /// The shared memory identifier.
495 * @defgroup alihlt_component_datatypes Common Component Data Types
496 * The analysis framework defines a number of common data types for
497 * usage in the detector modules, like e.g. ::kAliHLTAnyDataType
498 * and ::kAliHLTDataTypeDDLRaw. Those data types always have
499 * origin ::kAliHLTDataOriginAny. The correct detector origin can be
500 * set by using operator '|'
502 * AliHLTComponentDataType dt=kAliHLTDDLRawDataTypeID|kAliHLTDataOriginTPC
504 * @ingroup alihlt_component
508 * @struct AliHLTComponentDataType
509 * Data type descriptor for data blocks transferred through the processing
511 * @ingroup alihlt_component_datatypes
513 struct AliHLTComponentDataType
515 AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
516 char fID[kAliHLTComponentDataTypefIDsize]; /// Data type identifier.
517 char fOrigin[kAliHLTComponentDataTypefOriginSize]; /// Subsystem or detector origin of the data.
521 * @struct AliHLTComponentBlockData
522 * This is the decription of data blocks exchanged between components.
523 * \b IMPORTANT: The validity of fPtr and fOffset is different for input and
525 * - input blocks: The \em fPtr member always points to the beginning of the data
526 * of size \em fSize. fOffset is ignored and should be in most
528 * - output blocks: The \em fPtr member is ignored by the framework. \em fOffset
529 * must specify the start of the data relative to the output
530 * buffer. The data block has size \em fSize.
532 struct AliHLTComponentBlockData
534 /** size and version of the struct */
535 AliHLTUInt32_t fStructSize;
536 /** shared memory key, ignored by processing components */
537 AliHLTComponentShmData fShmKey;
538 /** offset of output data relative to the output buffer */
539 AliHLTUInt32_t fOffset;
540 /** start of the data for input data blocks, fOffset to be ignored*/
542 /** size of the data block */
543 AliHLTUInt32_t fSize;
544 /** data type of the data block */
545 AliHLTComponentDataType fDataType;
546 /** data specification of the data block */
547 AliHLTUInt32_t fSpecification;
551 * @struct AliHLTComponentEventDoneData
554 struct AliHLTComponentEventDoneData
556 AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
557 AliHLTUInt32_t fDataSize; /// Size of the data section (following this data member) in bytes.
558 void* fData; /// Start of the data section.
562 * @struct AliHLTRunDesc
564 * The struct is sent with the SOR and EOR events.
567 * The name of the member fRunType is a bit misleading. This is not
568 * the ALICE Run Type given by the ECS to the sub-system. The member
569 * is an internal HLT run type and a combination of the HLT running
570 * mode and the beam type.
572 * Bit 0-2: beam type identifier
578 AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
579 AliHLTUInt32_t fRunNo; /// The run number for the current active run.
580 AliHLTUInt32_t fRunType; /// The HLT run type.
584 * @struct AliHLTComponentStatistics
585 * Small block size summary added by the AliHLTComponent base class
586 * if component statistics are enabled (--enable-compstat).
588 * fLevel is retrieved from incoming block statistics and incremented.
589 * Incoming block statistics are appended to the newly added one if
590 * --enable-compstat=full has been chosen.
593 * 2009-01-14 fComponentCycleTime added
595 struct AliHLTComponentStatistics
597 AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
598 AliHLTUInt32_t fLevel; /// Indicates from which processing stage this information is from.
599 AliHLTUInt32_t fId; /// Unique identifier for the chain based on CRC code.
600 AliHLTUInt32_t fTime; /// Real wall time used to process the data (micro seconds).
601 AliHLTUInt32_t fCTime; /// CPU time used to process the data (micro seconds).
602 AliHLTUInt32_t fInputBlockCount; /// Number of input data blocks.
603 AliHLTUInt32_t fTotalInputSize; /// Total size in bytes of input data.
604 AliHLTUInt32_t fOutputBlockCount; /// Number of output data blocks.
605 AliHLTUInt32_t fTotalOutputSize; /// Total size in bytes of output data.
606 AliHLTUInt32_t fComponentCycleTime; /// Real wall time indicating the start of the data processing (micro seconds).
610 * @struct AliHLTComponentTableEntry
611 * Structure to be send on SOR event through the chain. Each component
612 * adds its chain id and component arguments to the list.
613 * The 'length' of the structure is variable and depends on the length
614 * of the strings in the buffer at the end.
616 * ComponentTableEntries are identified by a 32bit Id generated by a CRC
617 * algorithm from the chain Id of the component. This is not a 100% unique
618 * id but with a high probability. This approach accounts for the fact
619 * that all components are separated processes.
621 struct AliHLTComponentTableEntry
623 /** Size of this structure in bytes. */
624 AliHLTUInt32_t fStructSize;
625 /** size of the array of parent ids */
626 AliHLTUInt16_t fNofParents;
627 /** size of the description string in the appended buffer */
628 AliHLTUInt8_t fSizeDescription;
629 /** the strings: chain id, component args, reserved */
630 AliHLTUInt8_t fBuffer[1];
633 //////////////////////////////////////////////////////////////////////////
635 // Trigger meta information
637 //////////////////////////////////////////////////////////////////////////
639 /** field size of fAttribute */
640 const int gkAliHLTBlockDAttributeCount = 8;
642 /** field size of fCommonHeader */
643 const int gkAliHLTCommonHeaderCount = 8;
645 /** size of the DDL list */
646 const int gkAliHLTDDLListSize = 30;
648 /** Number of Trigger Classes of CTP in CDH */
649 const int gkNCTPTriggerClasses = 50;
652 * @struct AliHLTEventDDL
654 * The struct is send with the DDLLIST event.
655 * Used in the trigger structure for internal apperance of
656 * the DLLs as well as for the HLT readout list send to DAQ
657 * ( as DataType : kAliHLTDataTypeDDL )
659 struct AliHLTEventDDL
661 AliHLTUInt32_t fCount; /// Indicates the number of words in fList.
662 AliHLTUInt32_t fList[gkAliHLTDDLListSize]; /// The list of DDL enable/disable bits.
666 * @struct AliHLTEventTriggerData
668 struct AliHLTEventTriggerData
670 AliHLTUInt8_t fAttributes[gkAliHLTBlockDAttributeCount]; /// List of data block attibutes.
671 AliHLTUInt64_t fHLTStatus; /// Bit field
672 AliHLTUInt32_t fCommonHeaderWordCnt; /// Number of words in fCommonHeader.
673 AliHLTUInt32_t fCommonHeader[gkAliHLTCommonHeaderCount]; /// The common header words.
674 AliHLTEventDDL fReadoutList; /// The readout list structure.
678 * @struct AliHLTComponentTriggerData
681 struct AliHLTComponentTriggerData
683 AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
684 AliHLTUInt32_t fDataSize; /// Size of the data section (following this data member) in bytes.
685 void* fData; /// Start of the data section.
688 //////////////////////////////////////////////////////////////////////////
690 // HLT Event Type Specification
692 //////////////////////////////////////////////////////////////////////////
694 /** Unknown eventType specification */
695 const AliHLTUInt32_t gkAliEventTypeUnknown = ~(AliHLTUInt32_t)0;
696 /** SOR eventType specification */
697 const AliHLTUInt32_t gkAliEventTypeStartOfRun=1;
698 /** Data eventType specification */
699 const AliHLTUInt32_t gkAliEventTypeData=2;
700 /** EOR eventType specification */
701 const AliHLTUInt32_t gkAliEventTypeEndOfRun=4;
702 /** Corrupt eventType specification */
703 const AliHLTUInt32_t gkAliEventTypeCorruptID=8;
704 /** Calibration eventType specification */
705 const AliHLTUInt32_t gkAliEventTypeCalibration=16;
706 /** DataReplay eventType specification */
707 const AliHLTUInt32_t gkAliEventTypeDataReplay=32;
708 /** Configuration eventType specification */
709 const AliHLTUInt32_t gkAliEventTypeConfiguration=34;
710 /** Update DCS eventType specification */
711 const AliHLTUInt32_t gkAliEventTypeReadPreprocessor=35;
712 /** Tick eventType specification */
713 const AliHLTUInt32_t gkAliEventTypeTick=64;
714 /** Max eventType specification */
715 const AliHLTUInt32_t gkAliEventTypeMax=64;
717 //////////////////////////////////////////////////////////////////////////
719 // HLT defines and defaults
721 //////////////////////////////////////////////////////////////////////////
724 * @ingroup alihlt_component_datatypes
726 const AliHLTEventID_t kAliHLTVoidEventID=~(AliHLTEventID_t)0;
728 /** invalid data specification
729 * @ingroup alihlt_component_datatypes
731 const AliHLTUInt32_t kAliHLTVoidDataSpec = ~(AliHLTUInt32_t)0;
734 * @ingroup alihlt_component_datatypes
736 const AliHLTUInt32_t kAliHLTVoidRunNo = ~(AliHLTUInt32_t)0;
739 * @ingroup alihlt_component_datatypes
741 const AliHLTUInt32_t kAliHLTVoidRunType = ~(AliHLTUInt32_t)0;
743 /** invalid run descriptor
744 * @ingroup alihlt_component_datatypes
746 const AliHLTRunDesc kAliHLTVoidRunDesc={sizeof(AliHLTRunDesc), kAliHLTVoidRunNo, kAliHLTVoidRunType};
748 /** invalid shared memory type */
749 const AliHLTUInt32_t gkAliHLTComponentInvalidShmType = 0;
751 /** invalid shared memory id */
752 const AliHLTUInt64_t gkAliHLTComponentInvalidShmID = ~(AliHLTUInt64_t)0;
754 /** invalid data type
755 * @ingroup alihlt_component_datatypes
757 const AliHLTComponentDataType kAliHLTVoidDataType = {
758 sizeof(AliHLTComponentDataType),
759 kAliHLTVoidDataTypeID,
760 kAliHLTDataOriginVoid
763 /** all data types, means any + void data type
764 * @ingroup alihlt_component_datatypes
766 const AliHLTComponentDataType kAliHLTAllDataTypes = {
767 sizeof(AliHLTComponentDataType),
768 kAliHLTAllDataTypesID,
772 // there is currently a problem with rootcint if the predefined ids
773 // (commented below) are used. rootcint does not find the id if they
774 // are char arrays defined with {} and individual chars. If strings
775 // are used it works fine
777 * @ingroup alihlt_component_datatypes
779 const AliHLTComponentDataType kAliHLTAnyDataType = {
780 sizeof(AliHLTComponentDataType),
781 kAliHLTAnyDataTypeID,
785 /** multiple output data types
786 * @ingroup alihlt_component_datatypes
788 extern const AliHLTComponentDataType kAliHLTMultipleDataType;
790 /** data to file exchange subscriber
791 * @ingroup alihlt_component_datatypes
793 extern const AliHLTComponentDataType kAliHLTDataTypeFXSCalib;
795 /** DDL list data type
796 * @ingroup alihlt_component_datatypes
798 extern const AliHLTComponentDataType kAliHLTDataTypeDDL;
801 * Common data type for the output of cluster finders, the exact
802 * format depends on the origin (detector)
803 * @ingroup alihlt_component_datatypes
805 extern const AliHLTComponentDataType kAliHLTDataTypeClusters;
808 * @ingroup alihlt_component_datatypes
810 extern const AliHLTComponentDataType kAliHLTDataTypeSOR;
813 * @ingroup alihlt_component_datatypes
815 extern const AliHLTComponentDataType kAliHLTDataTypeEOR;
817 /** Run type data block
818 * @ingroup alihlt_component_datatypes
820 extern const AliHLTComponentDataType kAliHLTDataTypeRunType;
822 /** Event type specification
823 * @ingroup alihlt_component_datatypes
825 extern const AliHLTComponentDataType kAliHLTDataTypeEvent;
827 /** ECS parameter event
828 * - sent during the SOR event by the framework
829 * - contains the full ECS parameter string
830 * @ingroup alihlt_component_datatypes
832 extern const AliHLTComponentDataType kAliHLTDataTypeECSParam; // {ECSPARAM:PRIV}
834 /** Configuration event data type
835 * @ingroup alihlt_component_datatypes
837 extern const AliHLTComponentDataType kAliHLTDataTypeComConf;
839 /** DCS value update event
840 * @ingroup alihlt_component_datatypes
842 extern const AliHLTComponentDataType kAliHLTDataTypeUpdtDCS;
844 /** RAW DDL data specification, origin is 'any', data publisher origin correctly
845 * @ingroup alihlt_component_datatypes
847 extern const AliHLTComponentDataType kAliHLTDataTypeDDLRaw;
849 /** AliMCEvent object data specification, origin is 'OFFL'
850 * @ingroup alihlt_component_datatypes
852 extern const AliHLTComponentDataType kAliHLTDataTypeMCObject;
854 /** ESD object data specification, origin is 'any'
855 * @ingroup alihlt_component_datatypes
857 extern const AliHLTComponentDataType kAliHLTDataTypeESDObject;
859 /** ESD Tree data specification, origin is 'any'
860 * @ingroup alihlt_component_datatypes
862 extern const AliHLTComponentDataType kAliHLTDataTypeESDTree;
864 /** AliRoot TreeD data specification, origin is 'any'
865 * @ingroup alihlt_component_datatypes
867 extern const AliHLTComponentDataType kAliHLTDataTypeAliTreeD;
869 /** AliRoot TreeR data specification, origin is 'any'
870 * @ingroup alihlt_component_datatypes
872 extern const AliHLTComponentDataType kAliHLTDataTypeAliTreeR;
874 /** 16 bit Hardware address selection data specification, origin is 'any'
875 * @ingroup alihlt_component_datatypes
877 extern const AliHLTComponentDataType kAliHLTDataTypeHwAddr16;
880 * @ingroup alihlt_component_datatypes
882 extern const AliHLTComponentDataType kAliHLTDataTypeEventStatistics;
885 * @ingroup alihlt_component_datatypes
887 extern const AliHLTComponentDataType kAliHLTDataTypeEventSummary;
890 * @ingroup alihlt_component_datatypes
892 extern const AliHLTComponentDataType kAliHLTDataTypeRunStatistics;
895 * @ingroup alihlt_component_datatypes
897 extern const AliHLTComponentDataType kAliHLTDataTypeRunSummary;
899 /** Component block statistics
900 * @ingroup alihlt_component_datatypes
902 extern const AliHLTComponentDataType kAliHLTDataTypeComponentStatistics;
905 * To be sent on SOR event, each component adds it's chain id string
906 * and a generated 32bit identifier to the table
907 * @ingroup alihlt_component_datatypes
909 extern const AliHLTComponentDataType kAliHLTDataTypeComponentTable;
911 //////////////////////////////////////////////////////////////////////////
913 // Data Types for Monitoring objects
915 //////////////////////////////////////////////////////////////////////////
917 /** general ROOT TObject
918 * @ingroup alihlt_component_datatypes
920 extern const AliHLTComponentDataType kAliHLTDataTypeTObject; // {ROOTTOBJ,"***"}
923 * @ingroup alihlt_component_datatypes
925 extern const AliHLTComponentDataType kAliHLTDataTypeTObjArray; // {ROOTOBAR,"***"}
928 * @ingroup alihlt_component_datatypes
930 extern const AliHLTComponentDataType kAliHLTDataTypeTTree; // {ROOTTREE,"***"}
932 /** ROOT TH1 (can be used for all histograms, they derive from TH1)
933 * @ingroup alihlt_component_datatypes
935 extern const AliHLTComponentDataType kAliHLTDataTypeHistogram; // {ROOTHIST,"***"}
938 * @ingroup alihlt_component_datatypes
940 extern const AliHLTComponentDataType kAliHLTDataTypeTNtuple; // {ROOTTUPL,"***"}
942 /** General track array for the barrel tracks based on AliExternalTrackParam
943 * Data format defined by AliHLTTracksData
945 * We follow the naming scheme of AliESDEvent where 'Tracks' denote the
946 * barrel tracks and detector tracks get names 'DETTracks'
947 * @ingroup alihlt_component_datatypes
949 extern const AliHLTComponentDataType kAliHLTDataTypeTrack; // {HLTTRACK,"***"}
951 /** TClonesArray of AliExternalTrackParam
952 * @ingroup alihlt_component_datatypes
954 extern const AliHLTComponentDataType kAliHLTDataTypeExternalTrackParam; // {TCAEXTTR,"***"}
956 /** Container containing jets (AliHLTJETJets)
957 * Containing TClonesArray of AliAODJets
958 * @ingroup alihlt_component_datatypes
960 extern const AliHLTComponentDataType kAliHLTDataTypeJet; // {HLTJETV0,"***"}
962 /** Container of ITS tracks
963 * @ingroup alihlt_component_datatypes
965 extern const AliHLTComponentDataType fgkITSTracksDataType;
967 //////////////////////////////////////////////////////////////////////////
969 // FXS subscriber meta information
971 //////////////////////////////////////////////////////////////////////////
973 const int gkAliHLTFXSHeaderfOriginSize = 4;
974 const int gkAliHLTFXSHeaderfFileIDSize = 128;
975 const int gkAliHLTFXSHeaderfDDLNumberSize = 64;
977 /** Header in front of the data payload, in order to sent data to the FXS. */
978 struct AliHLTFXSHeader
980 AliHLTUInt32_t fHeaderVersion; /// HLT software version number.
981 AliHLTUInt32_t fRunNumber; /// The current run number.
982 char fOrigin[gkAliHLTFXSHeaderfOriginSize]; /// The detector from which the FXS data is received.
983 char fFileID[gkAliHLTFXSHeaderfFileIDSize]; /// File identifier for the stored data.
984 char fDDLNumber[gkAliHLTFXSHeaderfDDLNumberSize]; /// The DDL bits.
987 //////////////////////////////////////////////////////////////////////////
989 // Component running environment
991 //////////////////////////////////////////////////////////////////////////
993 /** logging function */
994 typedef int (*AliHLTfctLogging)( void* param,
995 AliHLTComponentLogSeverity severity,
998 const char* message);
1001 * @struct AliHLTAnalysisEnvironment
1002 * Running environment for analysis components.
1003 * The struct describes function callbacks for actions to be
1004 * carried out by the calling framework, like memory allocation,
1005 * property callbecks, logging, etc.
1007 * @ingroup alihlt_wrapper_interface
1009 struct AliHLTAnalysisEnvironment
1011 /** size of the structure */
1012 AliHLTUInt32_t fStructSize;
1014 /** the component parameter given by the framework on creation */
1017 /** allocated memory */
1018 void* (*fAllocMemoryFunc)( void* param, unsigned long size );
1020 /** allocate an EventDoneData structure. */
1021 int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd );
1023 /** logging callback */
1024 AliHLTfctLogging fLoggingFunc;
1027 // I just keep this as a note pad. Has to be added to the end of the structure
1028 // future addition already foreseen/envisioned
1029 // IMPORTANT: don not just remove the defines as this breaks the binary
1031 int (*fAllocShmMemoryFunc)( void* param, unsigned long size, AliHLTComponentBlockData* blockLocation );
1035 * @struct AliHLTComponentEnvironment
1036 * This was the original definition of the running environment.
1037 * Due to a bug in the AliRootWrapperSubscriber/SimpleComponentWrapper,
1038 * this structure can not be used any longer but is kept for backward
1040 * @note The external interface provided by the libHLTbase is now kept
1041 * frozen but should not be used any more. Use the interface provided
1042 * by the libHLTinterface library.
1044 * @ingroup alihlt_wrapper_interface_deprecated
1046 struct AliHLTComponentEnvironment
1048 AliHLTUInt32_t fStructSize;
1050 void* (*fAllocMemoryFunc)( void* param, unsigned long size );
1051 int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd );
1052 AliHLTfctLogging fLoggingFunc;
1055 //////////////////////////////////////////////////////////////////////////
1057 // The external interface definition
1059 //////////////////////////////////////////////////////////////////////////
1062 * The component handle.
1063 * Used as indification in the outside world.
1064 * @ingroup alihlt_wrapper_interface
1066 typedef void* AliHLTComponentHandle;
1068 /** @ingroup alihlt_wrapper_interface */
1069 const AliHLTComponentHandle kEmptyHLTComponentHandle = 0;
1072 * Get a system call of the interface.
1073 * @param function signature
1074 * @return pointer to system call
1075 * @ingroup alihlt_wrapper_interface
1077 typedef void* (*AliHLTAnalysisFctGetInterfaceCall)(const char*);
1079 # define ALIHLTANALYSIS_INTERFACE_LIBRARY "libHLTinterface.so"
1080 # define ALIHLTANALYSIS_FCT_GETINTERFACECALL "AliHLTAnalysisGetInterfaceCall"
1082 /** @ingroup alihlt_wrapper_interface */
1083 typedef int (*AliHLTExtFctInitSystem)( unsigned long version, AliHLTAnalysisEnvironment* externalEnv, unsigned long runNo, const char* runType );
1085 /** @ingroup alihlt_wrapper_interface */
1086 typedef int (*AliHLTExtFctDeinitSystem)();
1088 /** @ingroup alihlt_wrapper_interface */
1089 typedef int (*AliHLTExtFctLoadLibrary)( const char* );
1091 /** @ingroup alihlt_wrapper_interface */
1092 typedef int (*AliHLTExtFctUnloadLibrary)( const char* );
1094 /** @ingroup alihlt_wrapper_interface */
1095 typedef int (*AliHLTExtFctCreateComponent)( const char*, void*, int, const char**, AliHLTComponentHandle*, const char* description );
1097 /** @ingroup alihlt_wrapper_interface */
1098 typedef int (*AliHLTExtFctDestroyComponent)( AliHLTComponentHandle );
1100 /** @ingroup alihlt_wrapper_interface */
1101 typedef int (*AliHLTExtFctProcessEvent)( AliHLTComponentHandle, const AliHLTComponentEventData*, const AliHLTComponentBlockData*,
1102 AliHLTComponentTriggerData*, AliHLTUInt8_t*,
1103 AliHLTUInt32_t*, AliHLTUInt32_t*,
1104 AliHLTComponentBlockData**,
1105 AliHLTComponentEventDoneData** );
1107 /** @ingroup alihlt_wrapper_interface */
1108 typedef int (*AliHLTExtFctGetOutputDataType)( AliHLTComponentHandle, AliHLTComponentDataType* );
1110 /** @ingroup alihlt_wrapper_interface */
1111 typedef int (*AliHLTExtFctGetOutputSize)( AliHLTComponentHandle, unsigned long*, double* );
1115 //////////////////////////////////////////////////////////////////////////
1117 // Data type helper functions
1119 //////////////////////////////////////////////////////////////////////////
1121 /** exact comparison of HLT component data types
1122 * @ingroup alihlt_component_datatypes
1124 inline bool MatchExactly( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1126 for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ )
1127 if ( dt1.fID[i] != dt2.fID[i] )
1129 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
1130 if ( dt1.fOrigin[i] != dt2.fOrigin[i] )
1135 /** Comparison operator for HLT component data types.
1136 * The operator takes wildcards into account, i.e. the ::kAliHLTAnyDataType,
1137 * ::kAliHLTAnyDataTypeID and ::kAliHLTDataOriginAny definitions.
1138 * @ingroup alihlt_component_datatypes
1140 inline bool operator==( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1142 if (MatchExactly(dt1, kAliHLTAllDataTypes)) return true;
1143 if (MatchExactly(dt2, kAliHLTAllDataTypes)) return true;
1145 bool any1=true, any2=true, void1=true, void2=true, match=true;
1146 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) {
1147 any1&=(dt1.fOrigin[i]==kAliHLTDataOriginAny[i]);
1148 any2&=(dt2.fOrigin[i]==kAliHLTDataOriginAny[i]);
1149 void1&=(dt1.fOrigin[i]==kAliHLTDataOriginVoid[i]);
1150 void2&=(dt2.fOrigin[i]==kAliHLTDataOriginVoid[i]);
1151 match&=dt1.fOrigin[i]==dt2.fOrigin[i];
1152 if (!(match || (any2 && !void1) || (any1 && !void2)))
1156 any1=true, any2=true, match=true;
1157 for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ ) {
1158 any1&=(dt1.fID[i]==kAliHLTAnyDataTypeID[i]);
1159 any2&=(dt2.fID[i]==kAliHLTAnyDataTypeID[i]);
1160 void1&=(dt1.fID[i]==kAliHLTVoidDataTypeID[i]);
1161 void2&=(dt2.fID[i]==kAliHLTVoidDataTypeID[i]);
1162 match&=dt1.fID[i]==dt2.fID[i];
1163 if (!(match || (any2 && !void1) || (any1 && !void2)))
1169 /** Comparison operator for HLT component data types
1170 * Invers of operator==
1171 * @ingroup alihlt_component_datatypes
1173 inline bool operator!=( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1178 /** merge operator for HLT component data types and origins
1179 * @ingroup alihlt_component_datatypes
1181 inline AliHLTComponentDataType operator|(const AliHLTComponentDataType srcdt, const char origin[kAliHLTComponentDataTypefOriginSize])
1183 AliHLTComponentDataType dt=srcdt;
1184 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
1185 dt.fOrigin[i]=origin[i];
1190 * Helper function to initialize a data type from an id char array and origin string.
1191 * @return data type structure initialized with the specified id and origin
1192 * @ingroup alihlt_component_datatypes
1194 inline AliHLTComponentDataType AliHLTComponentDataTypeInitializer(const char id[kAliHLTComponentDataTypefIDsize], const char* origin)
1196 AliHLTComponentDataType dt=kAliHLTVoidDataType;
1198 for (i = 0; i < kAliHLTComponentDataTypefIDsize; i++)
1200 for (i = 0; i < kAliHLTComponentDataTypefOriginSize && origin[i]!=0; i++ )
1201 dt.fOrigin[i]=origin[i];
1206 * Helper function to initialize a data type from a default data type and
1207 * an origin string. Basically it merges the specified origin into the data
1209 * @return data type structure initialized with the id from specified data type
1211 * @ingroup alihlt_component_datatypes
1213 inline AliHLTComponentDataType AliHLTComponentDataTypeInitializer(const AliHLTComponentDataType src, const char* origin)
1215 return AliHLTComponentDataTypeInitializer(src.fID, origin);