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.
48 #define ALIHLT_DATA_TYPES_VERSION 9
50 //////////////////////////////////////////////////////////////////////////
52 // HLT data origin variables.
54 // By converting from defines to variables, the origins can be used with
57 // AliHLTComponentDataType dt;
58 // dt = kAliHLTDataTypeDDLRaw | gkAliHLTDataOriginTPC;
60 //////////////////////////////////////////////////////////////////////////
62 /** field size of datat type origin
63 * @ingroup alihlt_component_datatypes
65 const int kAliHLTComponentDataTypefOriginSize=4;
68 /** invalid data origin
69 * @ingroup alihlt_component_datatypes
71 # define kAliHLTDataOriginVoid "\0\0\0"
72 /** old invalid data origin, kept for backward compatibility */
73 # define kAliHLTVoidDataOrigin "\0\0\0"
75 /** wildcard data type origin
76 * @ingroup alihlt_component_datatypes
78 # define kAliHLTDataOriginAny "***"
79 /** old wildcard data type origin, kept for backward compatibility */
80 # define kAliHLTAnyDataOrigin "***"
82 /** Data origin HLT out
83 * @ingroup alihlt_component_datatypes
85 extern const char kAliHLTDataOriginOut[kAliHLTComponentDataTypefOriginSize];
87 /** Data origin HLT/PubSub private internal
88 * @ingroup alihlt_component_datatypes
90 extern const char kAliHLTDataOriginPrivate[kAliHLTComponentDataTypefOriginSize];
93 * @ingroup alihlt_component_datatypes
95 extern const char kAliHLTDataOriginTPC[kAliHLTComponentDataTypefOriginSize];
98 * @ingroup alihlt_component_datatypes
100 extern const char kAliHLTDataOriginPHOS[kAliHLTComponentDataTypefOriginSize];
103 * @ingroup alihlt_component_datatypes
105 extern const char kAliHLTDataOriginFMD[kAliHLTComponentDataTypefOriginSize];
108 * @ingroup alihlt_component_datatypes
110 extern const char kAliHLTDataOriginMUON[kAliHLTComponentDataTypefOriginSize];
113 * @ingroup alihlt_component_datatypes
115 extern const char kAliHLTDataOriginTRD[kAliHLTComponentDataTypefOriginSize];
118 * @ingroup alihlt_component_datatypes
120 extern const char kAliHLTDataOriginITS[kAliHLTComponentDataTypefOriginSize];
122 /** Data origin ITS SPD
123 * @ingroup alihlt_component_datatypes
125 extern const char kAliHLTDataOriginITSSPD[kAliHLTComponentDataTypefOriginSize];
127 /** Data origin ITS SDD
128 * @ingroup alihlt_component_datatypes
130 extern const char kAliHLTDataOriginITSSDD[kAliHLTComponentDataTypefOriginSize];
132 /** Data origin ITS SSD
133 * @ingroup alihlt_component_datatypes
135 extern const char kAliHLTDataOriginITSSSD[kAliHLTComponentDataTypefOriginSize];
137 /** Data origin for examples
138 * @ingroup alihlt_component_datatypes
140 extern const char kAliHLTDataOriginSample[kAliHLTComponentDataTypefOriginSize];
142 /** Data origin EMCAL
143 * @ingroup alihlt_component_datatypes
145 extern const char kAliHLTDataOriginEMCAL[kAliHLTComponentDataTypefOriginSize];
147 //////////////////////////////////////////////////////////////////////////
149 // HLT common data type defines
151 //////////////////////////////////////////////////////////////////////////
153 /** field size of data type id
154 * @ingroup alihlt_component_datatypes
156 const int kAliHLTComponentDataTypefIDsize=8;
159 /** invalid data type id
160 * @ingroup alihlt_component_datatypes
162 # define kAliHLTVoidDataTypeID "\0\0\0\0\0\0\0"
164 /** special id for all data types: any + void
165 * @ingroup alihlt_component_datatypes
167 # define kAliHLTAllDataTypesID "ALLDATA"
169 /** special id for any valid data type id
170 * @ingroup alihlt_component_datatypes
172 # define kAliHLTAnyDataTypeID "*******"
175 * @ingroup alihlt_component_datatypes
177 # define kAliHLTDDLRawDataTypeID {'D','D','L','_','R','A','W',' '}
179 /** calibration data for file exchange subscriber
180 * @ingroup alihlt_component_datatypes
182 # define kAliHLTFXSCalibDataTypeID {'F','X','S','_','C','A','L',' '}
184 /** start of run (SOR) event
186 * @ingroup alihlt_component_datatypes
188 # define kAliHLTSORDataTypeID {'S','T','A','R','T','O','F','R'}
190 /** end of run (EOR) event
192 * @ingroup alihlt_component_datatypes
194 # define kAliHLTEORDataTypeID {'E','N','D','O','F','R','U','N'}
196 /** run type data block
197 * string with run type as payload
198 * @ingroup alihlt_component_datatypes
200 # define kAliHLTRunTypeDataTypeID {'R','U','N','T','Y','P','E',' '}
203 * @ref AliHLTEventDDL
204 * @ingroup alihlt_component_datatypes
206 # define kAliHLTDDLDataTypeID {'D','D','L','L','I','S','T',' '}
209 * - empty payload, specification gives eventType
210 * @ingroup alihlt_component_datatypes
212 # define kAliHLTEventDataTypeID {'E','V','E','N','T','T','Y','P'}
214 /** ComponentConfiguration event
215 * - payload contains the CDB path as string
216 * @ingroup alihlt_component_datatypes
218 # define kAliHLTComConfDataTypeID {'C','O','M','_','C','O','N','F'}
220 /** DCS value update event
221 * - payload contains string of relevant detectors
222 * @ingroup alihlt_component_datatypes
224 # define kAliHLTUpdtDCSDataTypeID {'U','P','D','T','_','D','C','S'}
227 * an AliESD object of varying origin
228 * The 'V0' at the end allows a versioning
229 * @ingroup alihlt_component_datatypes
231 # define kAliHLTESDObjectDataTypeID {'A','L','I','E','S','D','V','0'}
233 /** ESD tree data block
234 * TTree with an AliESD object of varying origin
235 * @ingroup alihlt_component_datatypes
237 # define kAliHLTESDTreeDataTypeID {'E','S','D','_','T','R','E','E'}
240 * - the digits tree of an AliRoot module
241 * @ingroup alihlt_component_datatypes
243 #define kAliHLTTreeDDataTypeID {'A','L','I','T','R','E','E','D'}
246 * - the rec points tree of an AliRoot module
247 * @ingroup alihlt_component_datatypes
249 #define kAliHLTTreeRDataTypeID {'A','L','I','T','R','E','E','R'}
251 /** HW Address selection data block
252 * - a selection list for 16 bit HW addresses
254 * @ingroup alihlt_component_datatypes
256 # define kAliHLTHwAddr16DataTypeID {'H','W','A','D','D','R','1','6'}
259 * - event statistics for given detectors
261 * @ingroup alihlt_component_datatypes
263 # define kAliHLTEventStatisticsDataTypeID {'E','V','_','S','T','A','T','I'}
267 * - origin : kAliHLTDataOriginOut ( HLT )
268 * @ingroup alihlt_component_datatypes
270 # define kAliHLTEventSummaryDataTypeID {'E','V','_','S','U','M','M','A'}
273 * - run statistics for given detectors
275 * @ingroup alihlt_component_datatypes
277 # define kAliHLTRunStatisticsDataTypeID {'R','U','N','S','T','A','T','I'}
281 * - origin : kAliHLTDataOriginOut ( HLT )
282 * @ingroup alihlt_component_datatypes
284 # define kAliHLTRunSummaryDataTypeID {'R','U','N','S','U','M','M','A'}
287 * - small block statistics info added to the data stream by
288 * the component base class
289 * - origin kAliHLTDataOriginPrivate
290 * @ingroup alihlt_component_datatypes
292 # define kAliHLTComponentStatisticsDataTypeID {'C','O','M','P','S','T','A','T'}
295 * - list of components in the chain to be percolated through the chain
296 * - each component adds it's chain id string and a generated 32bit id
297 * @ingroup alihlt_component_datatypes
299 # define kAliHLTComponentTableDataTypeID {'C','O','M','P','T','A','B','L'}
301 /** general ROOT TObject
302 * - a general TObject exported from the HLT analysis
304 * @ingroup alihlt_component_datatypes
306 #define kAliHLTTObjectDataTypeID {'R','O','O','T','T','O','B','J'}
309 * - a TObjArray exported from the HLT analysis
311 * @ingroup alihlt_component_datatypes
313 #define kAliHLTTObjArrayDataTypeID {'R','O','O','T','O','B','A','R'}
316 * - a TTree object exported from the HLT analysis
318 * @ingroup alihlt_component_datatypes
320 #define kAliHLTTTreeDataTypeID {'R','O','O','T','T','R','E','E'}
323 * - a histogram object exported from the HLT analysis
324 * - class derives from TH1 (directly or indirectly) and inherits all common functionality
326 * @ingroup alihlt_component_datatypes
328 #define kAliHLTHistogramDataTypeID {'R','O','O','T','H','I','S','T'}
331 * - a TNtupl object exported from the HLT analysis
333 * @ingroup alihlt_component_datatypes
335 #define kAliHLTTNtupleDataTypeID {'R','O','O','T','T','U','P','L'}
338 * - Struct for Tracks based on AliExternalTrackParam
340 * @ingroup alihlt_component_datatypes
342 #define kAliHLTTrackDataTypeID {'H','L','T','T','R','A','C','K'}
344 /** TClonesArray of AliExternalTrackParam
345 * @ingroup alihlt_component_datatypes
347 #define kAliHLTExternalTrackParamDataTypeID {'T','C','A','E','X','T','T','R'}
352 //////////////////////////////////////////////////////////////////////////
354 // Basic HLT data types
356 //////////////////////////////////////////////////////////////////////////
358 typedef unsigned char AliHLTUInt8_t;
360 typedef signed char AliHLTInt8_t;
362 typedef unsigned short AliHLTUInt16_t;
364 typedef signed short AliHLTInt16_t;
366 typedef unsigned int AliHLTUInt32_t;
368 typedef signed int AliHLTInt32_t;
370 typedef unsigned long long AliHLTUInt64_t;
372 typedef signed long long AliHLTInt64_t;
374 typedef float AliHLTFloat32_t;
376 typedef double AliHLTFloat64_t;
378 typedef AliHLTUInt64_t AliHLTEventID_t;
380 //////////////////////////////////////////////////////////////////////////
382 // HLT logging levels
384 //////////////////////////////////////////////////////////////////////////
387 * Logging severities of the HLT
389 enum AliHLTComponentLogSeverity {
392 /** benchmark messages */
393 kHLTLogBenchmark = 0x1,
394 /** debug messages */
398 /** warning messages */
399 kHLTLogWarning = 0x8,
400 /** error messages */
402 /** fatal error messages */
404 /** few important messages not to be filtered out.
405 * redirected to kHLTLogInfo in AliRoot
407 kHLTLogImportant = 0x40,
408 /** special value to enable all messages */
410 /** the default logging filter */
411 kHLTLogDefault = 0x79
414 //////////////////////////////////////////////////////////////////////////
416 // HLT data structures for data exchange and external interface
418 //////////////////////////////////////////////////////////////////////////
421 * @struct AliHLTComponentEventData
424 struct AliHLTComponentEventData
426 AliHLTUInt32_t fStructSize;
427 AliHLTEventID_t fEventID;
428 AliHLTUInt32_t fEventCreation_s;
429 AliHLTUInt32_t fEventCreation_us;
430 AliHLTUInt32_t fBlockCnt;
434 * @struct AliHLTComponentShmData
435 * Shared memory descriptor.
436 * Irrelevant for analysis components.
438 struct AliHLTComponentShmData
440 AliHLTUInt32_t fStructSize;
441 AliHLTUInt32_t fShmType;
442 AliHLTUInt64_t fShmID;
446 * @defgroup alihlt_component_datatypes Common Component Data Types
447 * The analysis framework defines a number of common data types for
448 * usage in the detector modules, like e.g. ::kAliHLTAnyDataType
449 * and ::kAliHLTDataTypeDDLRaw. Those data types always have
450 * origin ::kAliHLTDataOriginAny. The correct detector origin can be
451 * set by using operator '|'
453 * AliHLTComponentDataType dt=kAliHLTDDLRawDataTypeID|kAliHLTDataOriginTPC
455 * @ingroup alihlt_component
459 * @struct AliHLTComponentDataType
460 * Data type descriptor for data blocks transferred through the processing
462 * @ingroup alihlt_component_datatypes
464 struct AliHLTComponentDataType
466 AliHLTUInt32_t fStructSize;
467 char fID[kAliHLTComponentDataTypefIDsize]; //!
468 char fOrigin[kAliHLTComponentDataTypefOriginSize]; //!
472 * @struct AliHLTComponentBlockData
473 * This is the decription of data blocks exchanged between components.
474 * \b IMPORTANT: The validity of fPtr and fOffset is different for input and
476 * - input blocks: The \em fPtr member always points to the beginning of the data
477 * of size \em fSize. fOffset is ignored and should be in most
479 * - output blocks: The \em fPtr member is ignored by the framework. \em fOffset
480 * must specify the start of the data relative to the output
481 * buffer. The data block has size \em fSize.
483 struct AliHLTComponentBlockData
485 /* size and version of the struct */
486 AliHLTUInt32_t fStructSize;
487 /* shared memory key, ignored by processing components */
488 AliHLTComponentShmData fShmKey;
489 /* offset of output data relative to the output buffer */
490 AliHLTUInt32_t fOffset;
491 /* start of the data for input data blocks, fOffset to be ignored*/
493 /* size of the data block */
494 AliHLTUInt32_t fSize;
495 /* data type of the data block */
496 AliHLTComponentDataType fDataType;
497 /* data specification of the data block */
498 AliHLTUInt32_t fSpecification;
502 * @struct AliHLTComponentEventDoneData
505 struct AliHLTComponentEventDoneData
507 AliHLTUInt32_t fStructSize;
508 AliHLTUInt32_t fDataSize;
513 * @struct AliHLTRunDesc
515 * The struct is sent with the SOR and EOR events.
518 * The name of the member fRunType is a bit misleading. This is not
519 * the ALICE Run Type given by the ECS to the sub-system. The member
520 * is an internal HLT run type and a combination of the HLT running
521 * mode and the beam type.
523 * Bit 0-2: beam type identifier
529 AliHLTUInt32_t fStructSize;
530 AliHLTUInt32_t fRunNo;
531 AliHLTUInt32_t fRunType;
535 * @struct AliHLTComponentStatistics
536 * Small block size summary added by the AliHLTComponent base class
537 * if component statistics are enabled (--enable-compstat).
539 * fLevel is retrieved from incoming block statistics and incremented.
540 * Incoming block statistics are appended to the newly added one if
541 * --enable-compstat=full has been chosen.
543 struct AliHLTComponentStatistics
545 AliHLTUInt32_t fStructSize;
546 AliHLTUInt32_t fLevel;
548 AliHLTUInt32_t fTime;
549 AliHLTUInt32_t fCTime;
550 AliHLTUInt32_t fInputBlockCount;
551 AliHLTUInt32_t fTotalInputSize;
552 AliHLTUInt32_t fOutputBlockCount;
553 AliHLTUInt32_t fTotalOutputSize;
557 * @struct AliHLTComponentTableEntry
558 * Structure to be send on SOR event through the chain. Each component
559 * adds its chain id and component arguments to the list.
560 * The 'length' of the structure is variable and depends on the length
561 * of the strings in the buffer at the end.
563 * ComponentTableEntries are identified by a 32bit Id generated by a CRC
564 * algorithm from the chain Id of the component. This is not a 100% unique
565 * id but with a high probability. This approach accounts for the fact
566 * that all components are separated processes.
568 struct AliHLTComponentTableEntry
570 AliHLTUInt32_t fStructSize;
571 /** size of the array of parent ids */
572 AliHLTUInt16_t fNofParents;
573 /** size of the description string in the appended buffer */
574 AliHLTUInt8_t fSizeDescription;
575 /** the strings: chain id, component args, reserved */
576 AliHLTUInt8_t fBuffer[1];
579 //////////////////////////////////////////////////////////////////////////
581 // Trigger meta information
583 //////////////////////////////////////////////////////////////////////////
585 /** field size of fAttribute */
586 const int gkAliHLTBlockDAttributeCount = 8;
588 /** field size of fCommonHeader */
589 const int gkAliHLTCommonHeaderCount = 8;
591 /** size of the DDL list */
592 const int gkAliHLTDDLListSize = 30;
594 /** Number of Trigger Classes of CTP in CDH */
595 const int gkNCTPTriggerClasses = 50;
598 * @struct AliHLTEventDDL
600 * The struct is send with the DDLLIST event.
601 * Used in the trigger structure for internal apperance of
602 * the DLLs as well as for the HLT readout list send to DAQ
603 * ( as DataType : kAliHLTDataTypeDDL )
605 struct AliHLTEventDDL
607 AliHLTUInt32_t fCount;
608 AliHLTUInt32_t fList[gkAliHLTDDLListSize];
612 * @struct AliHLTEventTriggerData
614 struct AliHLTEventTriggerData
616 AliHLTUInt8_t fAttributes[gkAliHLTBlockDAttributeCount];
617 AliHLTUInt64_t fHLTStatus; // Bit field
618 AliHLTUInt32_t fCommonHeaderWordCnt;
619 AliHLTUInt32_t fCommonHeader[gkAliHLTCommonHeaderCount];
620 AliHLTEventDDL fReadoutList;
624 * @struct AliHLTComponentTriggerData
627 struct AliHLTComponentTriggerData
629 AliHLTUInt32_t fStructSize;
630 AliHLTUInt32_t fDataSize;
634 //////////////////////////////////////////////////////////////////////////
636 // HLT Event Type Specification
638 //////////////////////////////////////////////////////////////////////////
640 /** Unknown eventType specification */
641 const AliHLTUInt32_t gkAliEventTypeUnknown = ~(AliHLTUInt32_t)0;
642 /** SOR eventType specification */
643 const AliHLTUInt32_t gkAliEventTypeStartOfRun=1;
644 /** Data eventType specification */
645 const AliHLTUInt32_t gkAliEventTypeData=2;
646 /** EOR eventType specification */
647 const AliHLTUInt32_t gkAliEventTypeEndOfRun=4;
648 /** Corrupt eventType specification */
649 const AliHLTUInt32_t gkAliEventTypeCorruptID=8;
650 /** Calibration eventType specification */
651 const AliHLTUInt32_t gkAliEventTypeCalibration=16;
652 /** DataReplay eventType specification */
653 const AliHLTUInt32_t gkAliEventTypeDataReplay=32;
654 /** Configuration eventType specification */
655 const AliHLTUInt32_t gkAliEventTypeConfiguration=34;
656 /** Update DCS eventType specification */
657 const AliHLTUInt32_t gkAliEventTypeReadPreprocessor=35;
658 /** Tick eventType specification */
659 const AliHLTUInt32_t gkAliEventTypeTick=64;
660 /** Max eventType specification */
661 const AliHLTUInt32_t gkAliEventTypeMax=64;
663 //////////////////////////////////////////////////////////////////////////
665 // HLT defines and defaults
667 //////////////////////////////////////////////////////////////////////////
670 * @ingroup alihlt_component_datatypes
672 const AliHLTEventID_t kAliHLTVoidEventID=~(AliHLTEventID_t)0;
674 /** invalid data specification
675 * @ingroup alihlt_component_datatypes
677 const AliHLTUInt32_t kAliHLTVoidDataSpec = ~(AliHLTUInt32_t)0;
680 * @ingroup alihlt_component_datatypes
682 const AliHLTUInt32_t kAliHLTVoidRunNo = ~(AliHLTUInt32_t)0;
685 * @ingroup alihlt_component_datatypes
687 const AliHLTUInt32_t kAliHLTVoidRunType = ~(AliHLTUInt32_t)0;
689 /** invalid run descriptor
690 * @ingroup alihlt_component_datatypes
692 const AliHLTRunDesc kAliHLTVoidRunDesc={sizeof(AliHLTRunDesc), kAliHLTVoidRunNo, kAliHLTVoidRunType};
694 /** invalid shared memory type */
695 const AliHLTUInt32_t gkAliHLTComponentInvalidShmType = 0;
697 /** invalid shared memory id */
698 const AliHLTUInt64_t gkAliHLTComponentInvalidShmID = ~(AliHLTUInt64_t)0;
700 /** invalid data type
701 * @ingroup alihlt_component_datatypes
703 const AliHLTComponentDataType kAliHLTVoidDataType = {
704 sizeof(AliHLTComponentDataType),
705 kAliHLTVoidDataTypeID,
706 kAliHLTDataOriginVoid
709 /** all data types, means any + void data type
710 * @ingroup alihlt_component_datatypes
712 const AliHLTComponentDataType kAliHLTAllDataTypes = {
713 sizeof(AliHLTComponentDataType),
714 kAliHLTAllDataTypesID,
718 // there is currently a problem with rootcint if the predefined ids
719 // (commented below) are used. rootcint does not find the id if they
720 // are char arrays defined with {} and individual chars. If strings
721 // are used it works fine
723 * @ingroup alihlt_component_datatypes
725 const AliHLTComponentDataType kAliHLTAnyDataType = {
726 sizeof(AliHLTComponentDataType),
727 kAliHLTAnyDataTypeID,
731 /** multiple output data types
732 * @ingroup alihlt_component_datatypes
734 extern const AliHLTComponentDataType kAliHLTMultipleDataType;
736 /** data to file exchange subscriber
737 * @ingroup alihlt_component_datatypes
739 extern const AliHLTComponentDataType kAliHLTDataTypeFXSCalib;
741 /** DDL list data type
742 * @ingroup alihlt_component_datatypes
744 extern const AliHLTComponentDataType kAliHLTDataTypeDDL;
747 * @ingroup alihlt_component_datatypes
749 extern const AliHLTComponentDataType kAliHLTDataTypeSOR;
752 * @ingroup alihlt_component_datatypes
754 extern const AliHLTComponentDataType kAliHLTDataTypeEOR;
756 /** Run type data block
757 * @ingroup alihlt_component_datatypes
759 extern const AliHLTComponentDataType kAliHLTDataTypeRunType;
761 /** Event type specification
762 * @ingroup alihlt_component_datatypes
764 extern const AliHLTComponentDataType kAliHLTDataTypeEvent;
766 /** Configuration event data type
767 * @ingroup alihlt_component_datatypes
769 extern const AliHLTComponentDataType kAliHLTDataTypeComConf;
771 /** DCS value update event
772 * @ingroup alihlt_component_datatypes
774 extern const AliHLTComponentDataType kAliHLTDataTypeUpdtDCS;
776 /** RAW DDL data specification, origin is 'any', data publisher origin correctly
777 * @ingroup alihlt_component_datatypes
779 extern const AliHLTComponentDataType kAliHLTDataTypeDDLRaw;
781 /** ESD object data specification, origin is 'any'
782 * @ingroup alihlt_component_datatypes
784 extern const AliHLTComponentDataType kAliHLTDataTypeESDObject;
786 /** ESD Tree data specification, origin is 'any'
788 * @ingroup alihlt_component_datatypes
790 extern const AliHLTComponentDataType kAliHLTDataTypeESDTree;
792 /** AliRoot TreeD data specification, origin is 'any'
793 * @ingroup alihlt_component_datatypes
795 extern const AliHLTComponentDataType kAliHLTDataTypeAliTreeD;
797 /** AliRoot TreeR data specification, origin is 'any'
798 * @ingroup alihlt_component_datatypes
800 extern const AliHLTComponentDataType kAliHLTDataTypeAliTreeR;
802 /** 16 bit Hardware address selection data specification, origin is 'any'
803 * @ingroup alihlt_component_datatypes
805 extern const AliHLTComponentDataType kAliHLTDataTypeHwAddr16;
808 * @ingroup alihlt_component_datatypes
810 extern const AliHLTComponentDataType kAliHLTDataTypeEventStatistics;
813 * @ingroup alihlt_component_datatypes
815 extern const AliHLTComponentDataType kAliHLTDataTypeEventSummary;
818 * @ingroup alihlt_component_datatypes
820 extern const AliHLTComponentDataType kAliHLTDataTypeRunStatistics;
823 * @ingroup alihlt_component_datatypes
825 extern const AliHLTComponentDataType kAliHLTDataTypeRunSummary;
827 /** Component block statistics
828 * @ingroup alihlt_component_datatypes
830 extern const AliHLTComponentDataType kAliHLTDataTypeComponentStatistics;
833 * To be sent on SOR event, each component adds it's chain id string
834 * and a generated 32bit identifier to the table
835 * @ingroup alihlt_component_datatypes
837 extern const AliHLTComponentDataType kAliHLTDataTypeComponentTable;
839 //////////////////////////////////////////////////////////////////////////
841 // Data Types for Monitoring objects
843 //////////////////////////////////////////////////////////////////////////
845 /** general ROOT TObject
846 * @ingroup alihlt_component_datatypes
848 extern const AliHLTComponentDataType kAliHLTDataTypeTObject; // {ROOTTOBJ,"***"}
851 * @ingroup alihlt_component_datatypes
853 extern const AliHLTComponentDataType kAliHLTDataTypeTObjArray; // {ROOTOBAR,"***"}
856 * @ingroup alihlt_component_datatypes
858 extern const AliHLTComponentDataType kAliHLTDataTypeTTree; // {ROOTTREE,"***"}
860 /** ROOT TH1 (can be used for all histograms, they derive from TH1)
861 * @ingroup alihlt_component_datatypes
863 extern const AliHLTComponentDataType kAliHLTDataTypeHistogram; // {ROOTHIST,"***"}
866 * @ingroup alihlt_component_datatypes
868 extern const AliHLTComponentDataType kAliHLTDataTypeTNtuple; // {ROOTTUPL,"***"}
870 /** General track array for the barrel tracks based on AliExternalTrackParam
871 * Data format defined by AliHLTTracksData
873 * We follow the naming scheme of AliESDEvent where 'Tracks' denote the
874 * barrel tracks and detector tracks get names 'DETTracks'
875 * @ingroup alihlt_component_datatypes
877 extern const AliHLTComponentDataType kAliHLTDataTypeTrack; // {HLTTRACK,"***"}
879 /** TClonesArray of AliExternalTrackParam
880 * @ingroup alihlt_component_datatypes
882 extern const AliHLTComponentDataType kAliHLTDataTypeExternalTrackParam;// {TCAEXTTR,"***"}
884 //////////////////////////////////////////////////////////////////////////
886 // FXS subscriber meta information
888 //////////////////////////////////////////////////////////////////////////
890 const int gkAliHLTFXSHeaderfOriginSize = 4;
891 const int gkAliHLTFXSHeaderfFileIDSize = 128;
892 const int gkAliHLTFXSHeaderfDDLNumberSize = 64;
894 /** Header in front of the data payload, in order to sent data to the FXS. */
895 struct AliHLTFXSHeader
897 AliHLTUInt32_t fHeaderVersion;
898 AliHLTUInt32_t fRunNumber;
899 char fOrigin[gkAliHLTFXSHeaderfOriginSize];
900 char fFileID[gkAliHLTFXSHeaderfFileIDSize];
901 char fDDLNumber[gkAliHLTFXSHeaderfDDLNumberSize];
904 //////////////////////////////////////////////////////////////////////////
906 // Component running environment
908 //////////////////////////////////////////////////////////////////////////
910 /** logging function */
911 typedef int (*AliHLTfctLogging)( void* param,
912 AliHLTComponentLogSeverity severity,
915 const char* message);
918 * @struct AliHLTAnalysisEnvironment
919 * Running environment for analysis components.
920 * The struct describes function callbacks for actions to be
921 * carried out by the calling framework, like memory allocation,
922 * property callbecks, logging, etc.
924 * @ingroup alihlt_wrapper_interface
926 struct AliHLTAnalysisEnvironment
928 /** size of the structure */
929 AliHLTUInt32_t fStructSize;
931 /** the component parameter given by the framework on creation
937 void* (*fAllocMemoryFunc)( void* param, unsigned long size );
939 /** allocate an EventDoneData structure.
941 int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd );
945 AliHLTfctLogging fLoggingFunc;
948 // I just keep this as a note pad. Has to be added to the end of the structure
949 // future addition already foreseen/envisioned
950 // IMPORTANT: don not just remove the defines as this breaks the binary
952 int (*fAllocShmMemoryFunc)( void* param, unsigned long size, AliHLTComponentBlockData* blockLocation );
956 * @struct AliHLTComponentEnvironment
957 * This was the original definition of the running environment.
958 * Due to a bug in the AliRootWrapperSubscriber/SimpleComponentWrapper,
959 * this structure can not be used any longer but is kept for backward
961 * @note The external interface provided by the libHLTbase is now kept
962 * frozen but should not be used any more. Use the interface provided
963 * by the libHLTinterface library.
965 * @ingroup alihlt_wrapper_interface_deprecated
967 struct AliHLTComponentEnvironment
969 AliHLTUInt32_t fStructSize;
971 void* (*fAllocMemoryFunc)( void* param, unsigned long size );
972 int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd );
973 AliHLTfctLogging fLoggingFunc;
976 //////////////////////////////////////////////////////////////////////////
978 // The external interface definition
980 //////////////////////////////////////////////////////////////////////////
983 * The component handle.
984 * Used as indification in the outside world.
985 * @ingroup alihlt_wrapper_interface
987 typedef void* AliHLTComponentHandle;
989 /** @ingroup alihlt_wrapper_interface */
990 const AliHLTComponentHandle kEmptyHLTComponentHandle = 0;
993 * Get a system call of the interface.
994 * @param function signature
995 * @return pointer to system call
996 * @ingroup alihlt_wrapper_interface
998 typedef void* (*AliHLTAnalysisFctGetInterfaceCall)(const char*);
1000 # define ALIHLTANALYSIS_INTERFACE_LIBRARY "libHLTinterface.so"
1001 # define ALIHLTANALYSIS_FCT_GETINTERFACECALL "AliHLTAnalysisGetInterfaceCall"
1003 /** @ingroup alihlt_wrapper_interface */
1004 typedef int (*AliHLTExtFctInitSystem)( unsigned long version, AliHLTAnalysisEnvironment* externalEnv, unsigned long runNo, const char* runType );
1006 /** @ingroup alihlt_wrapper_interface */
1007 typedef int (*AliHLTExtFctDeinitSystem)();
1009 /** @ingroup alihlt_wrapper_interface */
1010 typedef int (*AliHLTExtFctLoadLibrary)( const char* );
1012 /** @ingroup alihlt_wrapper_interface */
1013 typedef int (*AliHLTExtFctUnloadLibrary)( const char* );
1015 /** @ingroup alihlt_wrapper_interface */
1016 typedef int (*AliHLTExtFctCreateComponent)( const char*, void*, int, const char**, AliHLTComponentHandle*, const char* description );
1018 /** @ingroup alihlt_wrapper_interface */
1019 typedef int (*AliHLTExtFctDestroyComponent)( AliHLTComponentHandle );
1021 /** @ingroup alihlt_wrapper_interface */
1022 typedef int (*AliHLTExtFctProcessEvent)( AliHLTComponentHandle, const AliHLTComponentEventData*, const AliHLTComponentBlockData*,
1023 AliHLTComponentTriggerData*, AliHLTUInt8_t*,
1024 AliHLTUInt32_t*, AliHLTUInt32_t*,
1025 AliHLTComponentBlockData**,
1026 AliHLTComponentEventDoneData** );
1028 /** @ingroup alihlt_wrapper_interface */
1029 typedef int (*AliHLTExtFctGetOutputDataType)( AliHLTComponentHandle, AliHLTComponentDataType* );
1031 /** @ingroup alihlt_wrapper_interface */
1032 typedef int (*AliHLTExtFctGetOutputSize)( AliHLTComponentHandle, unsigned long*, double* );
1036 //////////////////////////////////////////////////////////////////////////
1038 // Data type helper functions
1040 //////////////////////////////////////////////////////////////////////////
1042 /** exact comparison of HLT component data types
1043 * @ingroup alihlt_component_datatypes
1045 inline bool MatchExactly( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1047 for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ )
1048 if ( dt1.fID[i] != dt2.fID[i] )
1050 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
1051 if ( dt1.fOrigin[i] != dt2.fOrigin[i] )
1056 /** Comparison operator for HLT component data types.
1057 * The operator takes wildcards into account, i.e. the ::kAliHLTAnyDataType,
1058 * ::kAliHLTAnyDataTypeID and ::kAliHLTDataOriginAny definitions.
1059 * @ingroup alihlt_component_datatypes
1061 inline bool operator==( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1063 if (MatchExactly(dt1, kAliHLTAllDataTypes)) return true;
1064 if (MatchExactly(dt2, kAliHLTAllDataTypes)) return true;
1066 bool any1=true, any2=true, void1=true, void2=true, match=true;
1067 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) {
1068 any1&=(dt1.fOrigin[i]==kAliHLTDataOriginAny[i]);
1069 any2&=(dt2.fOrigin[i]==kAliHLTDataOriginAny[i]);
1070 void1&=(dt1.fOrigin[i]==kAliHLTDataOriginVoid[i]);
1071 void2&=(dt2.fOrigin[i]==kAliHLTDataOriginVoid[i]);
1072 match&=dt1.fOrigin[i]==dt2.fOrigin[i];
1073 if (!(match || (any2 && !void1) || (any1 && !void2)))
1077 any1=true, any2=true, match=true;
1078 for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ ) {
1079 any1&=(dt1.fID[i]==kAliHLTAnyDataTypeID[i]);
1080 any2&=(dt2.fID[i]==kAliHLTAnyDataTypeID[i]);
1081 void1&=(dt1.fID[i]==kAliHLTVoidDataTypeID[i]);
1082 void2&=(dt2.fID[i]==kAliHLTVoidDataTypeID[i]);
1083 match&=dt1.fID[i]==dt2.fID[i];
1084 if (!(match || (any2 && !void1) || (any1 && !void2)))
1090 /** Comparison operator for HLT component data types
1091 * Invers of operator==
1092 * @ingroup alihlt_component_datatypes
1094 inline bool operator!=( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1099 /** merge operator for HLT component data types and origins
1100 * @ingroup alihlt_component_datatypes
1102 inline AliHLTComponentDataType operator|(const AliHLTComponentDataType srcdt, const char origin[kAliHLTComponentDataTypefOriginSize])
1104 AliHLTComponentDataType dt=srcdt;
1105 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
1106 dt.fOrigin[i]=origin[i];
1111 * Helper function to initialize a data type from an id char array and origin string.
1112 * @return data type structure initialized with the specified id and origin
1113 * @ingroup alihlt_component_datatypes
1115 inline AliHLTComponentDataType AliHLTComponentDataTypeInitializer(const char id[kAliHLTComponentDataTypefIDsize], const char* origin)
1117 AliHLTComponentDataType dt=kAliHLTVoidDataType;
1119 for (i = 0; i < kAliHLTComponentDataTypefIDsize; i++)
1121 for (i = 0; i < kAliHLTComponentDataTypefOriginSize && origin[i]!=0; i++ )
1122 dt.fOrigin[i]=origin[i];
1127 * Helper function to initialize a data type from a default data type and
1128 * an origin string. Basically it merges the specified origin into the data
1130 * @return data type structure initialized with the id from specified data type
1132 * @ingroup alihlt_component_datatypes
1134 inline AliHLTComponentDataType AliHLTComponentDataTypeInitializer(const AliHLTComponentDataType src, const char* origin)
1136 return AliHLTComponentDataTypeInitializer(src.fID, origin);