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
53 #define ALIHLT_DATA_TYPES_VERSION 10
55 //////////////////////////////////////////////////////////////////////////
57 // HLT data origin variables.
59 // By converting from defines to variables, the origins can be used with
62 // AliHLTComponentDataType dt;
63 // dt = kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC;
65 //////////////////////////////////////////////////////////////////////////
67 /** field size of datat type origin
68 * @ingroup alihlt_component_datatypes
70 const int kAliHLTComponentDataTypefOriginSize=4;
73 /** invalid data origin
74 * @ingroup alihlt_component_datatypes
76 # define kAliHLTDataOriginVoid "\0\0\0"
77 /** old invalid data origin, kept for backward compatibility */
78 # define kAliHLTVoidDataOrigin "\0\0\0"
80 /** wildcard data type origin
81 * @ingroup alihlt_component_datatypes
83 # define kAliHLTDataOriginAny "***"
84 /** old wildcard data type origin, kept for backward compatibility */
85 # define kAliHLTAnyDataOrigin "***"
87 /** Data origin HLT out
88 * @ingroup alihlt_component_datatypes
90 extern const char kAliHLTDataOriginOut[kAliHLTComponentDataTypefOriginSize];
92 /** Data origin HLT, used for HLT specifc data
93 * in offline chains. This not a bug!
94 * @ingroup alihlt_component_datatypes
96 extern const char kAliHLTDataOriginHLT[kAliHLTComponentDataTypefOriginSize];
98 /** Data origin Offline
99 * @ingroup alihlt_component_datatypes
101 extern const char kAliHLTDataOriginOffline[kAliHLTComponentDataTypefOriginSize];
103 /** Data origin HLT/PubSub private internal
104 * @ingroup alihlt_component_datatypes
106 extern const char kAliHLTDataOriginPrivate[kAliHLTComponentDataTypefOriginSize];
109 * @ingroup alihlt_component_datatypes
111 extern const char kAliHLTDataOriginTPC[kAliHLTComponentDataTypefOriginSize];
114 * @ingroup alihlt_component_datatypes
116 extern const char kAliHLTDataOriginPHOS[kAliHLTComponentDataTypefOriginSize];
119 * @ingroup alihlt_component_datatypes
121 extern const char kAliHLTDataOriginFMD[kAliHLTComponentDataTypefOriginSize];
124 * @ingroup alihlt_component_datatypes
126 extern const char kAliHLTDataOriginMUON[kAliHLTComponentDataTypefOriginSize];
129 * @ingroup alihlt_component_datatypes
131 extern const char kAliHLTDataOriginTRD[kAliHLTComponentDataTypefOriginSize];
134 * @ingroup alihlt_component_datatypes
136 extern const char kAliHLTDataOriginITS[kAliHLTComponentDataTypefOriginSize];
138 /** Data origin ITS SPD
139 * @ingroup alihlt_component_datatypes
141 extern const char kAliHLTDataOriginITSSPD[kAliHLTComponentDataTypefOriginSize];
143 /** Data origin ITS SDD
144 * @ingroup alihlt_component_datatypes
146 extern const char kAliHLTDataOriginITSSDD[kAliHLTComponentDataTypefOriginSize];
148 /** Data origin ITS SSD
149 * @ingroup alihlt_component_datatypes
151 extern const char kAliHLTDataOriginITSSSD[kAliHLTComponentDataTypefOriginSize];
153 /** Data origin for examples
154 * @ingroup alihlt_component_datatypes
156 extern const char kAliHLTDataOriginSample[kAliHLTComponentDataTypefOriginSize];
158 /** Data origin EMCAL
159 * @ingroup alihlt_component_datatypes
161 extern const char kAliHLTDataOriginEMCAL[kAliHLTComponentDataTypefOriginSize];
163 //////////////////////////////////////////////////////////////////////////
165 // HLT common data type defines
167 //////////////////////////////////////////////////////////////////////////
169 /** field size of data type id
170 * @ingroup alihlt_component_datatypes
172 const int kAliHLTComponentDataTypefIDsize=8;
175 /** invalid data type id
176 * @ingroup alihlt_component_datatypes
178 # define kAliHLTVoidDataTypeID "\0\0\0\0\0\0\0"
180 /** special id for all data types: any + void
181 * @ingroup alihlt_component_datatypes
183 # define kAliHLTAllDataTypesID "ALLDATA"
185 /** special id for any valid data type id
186 * @ingroup alihlt_component_datatypes
188 # define kAliHLTAnyDataTypeID "*******"
191 * @ingroup alihlt_component_datatypes
193 # define kAliHLTDDLRawDataTypeID {'D','D','L','_','R','A','W',' '}
195 /** calibration data for file exchange subscriber
196 * @ingroup alihlt_component_datatypes
198 # define kAliHLTFXSCalibDataTypeID {'F','X','S','_','C','A','L',' '}
200 /** start of run (SOR) event
202 * @ingroup alihlt_component_datatypes
204 # define kAliHLTSORDataTypeID {'S','T','A','R','T','O','F','R'}
206 /** end of run (EOR) event
208 * @ingroup alihlt_component_datatypes
210 # define kAliHLTEORDataTypeID {'E','N','D','O','F','R','U','N'}
212 /** run type data block
213 * string with run type as payload
214 * @ingroup alihlt_component_datatypes
216 # define kAliHLTRunTypeDataTypeID {'R','U','N','T','Y','P','E',' '}
219 * @ref AliHLTEventDDL
220 * @ingroup alihlt_component_datatypes
222 # define kAliHLTDDLDataTypeID {'D','D','L','L','I','S','T',' '}
225 * - empty payload, specification gives eventType
226 * @ingroup alihlt_component_datatypes
228 # define kAliHLTEventDataTypeID {'E','V','E','N','T','T','Y','P'}
230 /** ComponentConfiguration event
231 * - payload contains the CDB path as string
232 * @ingroup alihlt_component_datatypes
234 # define kAliHLTComConfDataTypeID {'C','O','M','_','C','O','N','F'}
236 /** DCS value update event
237 * - payload contains string of relevant detectors
238 * @ingroup alihlt_component_datatypes
240 # define kAliHLTUpdtDCSDataTypeID {'U','P','D','T','_','D','C','S'}
243 * an AliMCEvent object of varying origin
244 * The 'V0' at the end allows a versioning
245 * @ingroup alihlt_component_datatypes
247 # define kAliHLTMCObjectDataTypeID {'A','L','I','M','C','_','V','0'}
250 * an AliESD object of varying origin
251 * The 'V0' at the end allows a versioning
252 * @ingroup alihlt_component_datatypes
254 # define kAliHLTESDObjectDataTypeID {'A','L','I','E','S','D','V','0'}
256 /** ESD tree data block
257 * TTree with an AliESD object of varying origin
258 * @ingroup alihlt_component_datatypes
260 # define kAliHLTESDTreeDataTypeID {'E','S','D','_','T','R','E','E'}
263 * - the digits tree of an AliRoot module
264 * @ingroup alihlt_component_datatypes
266 #define kAliHLTTreeDDataTypeID {'A','L','I','T','R','E','E','D'}
269 * - the rec points tree of an AliRoot module
270 * @ingroup alihlt_component_datatypes
272 #define kAliHLTTreeRDataTypeID {'A','L','I','T','R','E','E','R'}
274 /** HW Address selection data block
275 * - a selection list for 16 bit HW addresses
277 * @ingroup alihlt_component_datatypes
279 # define kAliHLTHwAddr16DataTypeID {'H','W','A','D','D','R','1','6'}
282 * - event statistics for given detectors
284 * @ingroup alihlt_component_datatypes
286 # define kAliHLTEventStatisticsDataTypeID {'E','V','_','S','T','A','T','I'}
290 * - origin : kAliHLTDataOriginOut ( HLT )
291 * @ingroup alihlt_component_datatypes
293 # define kAliHLTEventSummaryDataTypeID {'E','V','_','S','U','M','M','A'}
296 * - run statistics for given detectors
298 * @ingroup alihlt_component_datatypes
300 # define kAliHLTRunStatisticsDataTypeID {'R','U','N','S','T','A','T','I'}
304 * - origin : kAliHLTDataOriginOut ( HLT )
305 * @ingroup alihlt_component_datatypes
307 # define kAliHLTRunSummaryDataTypeID {'R','U','N','S','U','M','M','A'}
310 * - small block statistics info added to the data stream by
311 * the component base class
312 * - origin kAliHLTDataOriginPrivate
313 * @ingroup alihlt_component_datatypes
315 # define kAliHLTComponentStatisticsDataTypeID {'C','O','M','P','S','T','A','T'}
318 * - list of components in the chain to be percolated through the chain
319 * - each component adds it's chain id string and a generated 32bit id
320 * @ingroup alihlt_component_datatypes
322 # define kAliHLTComponentTableDataTypeID {'C','O','M','P','T','A','B','L'}
324 /** general ROOT TObject
325 * - a general TObject exported from the HLT analysis
327 * @ingroup alihlt_component_datatypes
329 #define kAliHLTTObjectDataTypeID {'R','O','O','T','T','O','B','J'}
332 * - a TObjArray exported from the HLT analysis
334 * @ingroup alihlt_component_datatypes
336 #define kAliHLTTObjArrayDataTypeID {'R','O','O','T','O','B','A','R'}
339 * - a TTree object exported from the HLT analysis
341 * @ingroup alihlt_component_datatypes
343 #define kAliHLTTTreeDataTypeID {'R','O','O','T','T','R','E','E'}
346 * - a histogram object exported from the HLT analysis
347 * - class derives from TH1 (directly or indirectly) and inherits all common functionality
349 * @ingroup alihlt_component_datatypes
351 #define kAliHLTHistogramDataTypeID {'R','O','O','T','H','I','S','T'}
354 * - a TNtupl object exported from the HLT analysis
356 * @ingroup alihlt_component_datatypes
358 #define kAliHLTTNtupleDataTypeID {'R','O','O','T','T','U','P','L'}
361 * - Struct for Tracks based on AliExternalTrackParam
363 * @ingroup alihlt_component_datatypes
365 #define kAliHLTTrackDataTypeID {'H','L','T','T','R','A','C','K'}
367 /** TClonesArray of AliExternalTrackParam
368 * @ingroup alihlt_component_datatypes
370 #define kAliHLTExternalTrackParamDataTypeID {'T','C','A','E','X','T','T','R'}
375 //////////////////////////////////////////////////////////////////////////
377 // Basic HLT data types
379 //////////////////////////////////////////////////////////////////////////
381 typedef unsigned char AliHLTUInt8_t;
383 typedef signed char AliHLTInt8_t;
385 typedef unsigned short AliHLTUInt16_t;
387 typedef signed short AliHLTInt16_t;
389 typedef unsigned int AliHLTUInt32_t;
391 typedef signed int AliHLTInt32_t;
393 typedef unsigned long long AliHLTUInt64_t;
395 typedef signed long long AliHLTInt64_t;
397 typedef float AliHLTFloat32_t;
399 typedef double AliHLTFloat64_t;
401 typedef AliHLTUInt64_t AliHLTEventID_t;
403 //////////////////////////////////////////////////////////////////////////
405 // HLT logging levels
407 //////////////////////////////////////////////////////////////////////////
410 * Logging severities of the HLT
412 enum AliHLTComponentLogSeverity {
415 /** benchmark messages */
416 kHLTLogBenchmark = 0x1,
417 /** debug messages */
421 /** warning messages */
422 kHLTLogWarning = 0x8,
423 /** error messages */
425 /** fatal error messages */
427 /** few important messages not to be filtered out.
428 * redirected to kHLTLogInfo in AliRoot
430 kHLTLogImportant = 0x40,
431 /** special value to enable all messages */
433 /** the default logging filter */
434 kHLTLogDefault = 0x79
437 //////////////////////////////////////////////////////////////////////////
439 // HLT data structures for data exchange and external interface
441 //////////////////////////////////////////////////////////////////////////
444 * @struct AliHLTComponentEventData
447 struct AliHLTComponentEventData
449 AliHLTUInt32_t fStructSize;
450 AliHLTEventID_t fEventID;
451 AliHLTUInt32_t fEventCreation_s;
452 AliHLTUInt32_t fEventCreation_us;
453 AliHLTUInt32_t fBlockCnt;
457 * @struct AliHLTComponentShmData
458 * Shared memory descriptor.
459 * Irrelevant for analysis components.
461 struct AliHLTComponentShmData
463 AliHLTUInt32_t fStructSize;
464 AliHLTUInt32_t fShmType;
465 AliHLTUInt64_t fShmID;
469 * @defgroup alihlt_component_datatypes Common Component Data Types
470 * The analysis framework defines a number of common data types for
471 * usage in the detector modules, like e.g. ::kAliHLTAnyDataType
472 * and ::kAliHLTDataTypeDDLRaw. Those data types always have
473 * origin ::kAliHLTDataOriginAny. The correct detector origin can be
474 * set by using operator '|'
476 * AliHLTComponentDataType dt=kAliHLTDDLRawDataTypeID|kAliHLTDataOriginTPC
478 * @ingroup alihlt_component
482 * @struct AliHLTComponentDataType
483 * Data type descriptor for data blocks transferred through the processing
485 * @ingroup alihlt_component_datatypes
487 struct AliHLTComponentDataType
489 AliHLTUInt32_t fStructSize;
490 char fID[kAliHLTComponentDataTypefIDsize]; //!
491 char fOrigin[kAliHLTComponentDataTypefOriginSize]; //!
495 * @struct AliHLTComponentBlockData
496 * This is the decription of data blocks exchanged between components.
497 * \b IMPORTANT: The validity of fPtr and fOffset is different for input and
499 * - input blocks: The \em fPtr member always points to the beginning of the data
500 * of size \em fSize. fOffset is ignored and should be in most
502 * - output blocks: The \em fPtr member is ignored by the framework. \em fOffset
503 * must specify the start of the data relative to the output
504 * buffer. The data block has size \em fSize.
506 struct AliHLTComponentBlockData
508 /* size and version of the struct */
509 AliHLTUInt32_t fStructSize;
510 /* shared memory key, ignored by processing components */
511 AliHLTComponentShmData fShmKey;
512 /* offset of output data relative to the output buffer */
513 AliHLTUInt32_t fOffset;
514 /* start of the data for input data blocks, fOffset to be ignored*/
516 /* size of the data block */
517 AliHLTUInt32_t fSize;
518 /* data type of the data block */
519 AliHLTComponentDataType fDataType;
520 /* data specification of the data block */
521 AliHLTUInt32_t fSpecification;
525 * @struct AliHLTComponentEventDoneData
528 struct AliHLTComponentEventDoneData
530 AliHLTUInt32_t fStructSize;
531 AliHLTUInt32_t fDataSize;
536 * @struct AliHLTRunDesc
538 * The struct is sent with the SOR and EOR events.
541 * The name of the member fRunType is a bit misleading. This is not
542 * the ALICE Run Type given by the ECS to the sub-system. The member
543 * is an internal HLT run type and a combination of the HLT running
544 * mode and the beam type.
546 * Bit 0-2: beam type identifier
552 AliHLTUInt32_t fStructSize;
553 AliHLTUInt32_t fRunNo;
554 AliHLTUInt32_t fRunType;
558 * @struct AliHLTComponentStatistics
559 * Small block size summary added by the AliHLTComponent base class
560 * if component statistics are enabled (--enable-compstat).
562 * fLevel is retrieved from incoming block statistics and incremented.
563 * Incoming block statistics are appended to the newly added one if
564 * --enable-compstat=full has been chosen.
566 struct AliHLTComponentStatistics
568 AliHLTUInt32_t fStructSize;
569 AliHLTUInt32_t fLevel;
571 AliHLTUInt32_t fTime;
572 AliHLTUInt32_t fCTime;
573 AliHLTUInt32_t fInputBlockCount;
574 AliHLTUInt32_t fTotalInputSize;
575 AliHLTUInt32_t fOutputBlockCount;
576 AliHLTUInt32_t fTotalOutputSize;
580 * @struct AliHLTComponentTableEntry
581 * Structure to be send on SOR event through the chain. Each component
582 * adds its chain id and component arguments to the list.
583 * The 'length' of the structure is variable and depends on the length
584 * of the strings in the buffer at the end.
586 * ComponentTableEntries are identified by a 32bit Id generated by a CRC
587 * algorithm from the chain Id of the component. This is not a 100% unique
588 * id but with a high probability. This approach accounts for the fact
589 * that all components are separated processes.
591 struct AliHLTComponentTableEntry
593 AliHLTUInt32_t fStructSize;
594 /** size of the array of parent ids */
595 AliHLTUInt16_t fNofParents;
596 /** size of the description string in the appended buffer */
597 AliHLTUInt8_t fSizeDescription;
598 /** the strings: chain id, component args, reserved */
599 AliHLTUInt8_t fBuffer[1];
602 //////////////////////////////////////////////////////////////////////////
604 // Trigger meta information
606 //////////////////////////////////////////////////////////////////////////
608 /** field size of fAttribute */
609 const int gkAliHLTBlockDAttributeCount = 8;
611 /** field size of fCommonHeader */
612 const int gkAliHLTCommonHeaderCount = 8;
614 /** size of the DDL list */
615 const int gkAliHLTDDLListSize = 30;
617 /** Number of Trigger Classes of CTP in CDH */
618 const int gkNCTPTriggerClasses = 50;
621 * @struct AliHLTEventDDL
623 * The struct is send with the DDLLIST event.
624 * Used in the trigger structure for internal apperance of
625 * the DLLs as well as for the HLT readout list send to DAQ
626 * ( as DataType : kAliHLTDataTypeDDL )
628 struct AliHLTEventDDL
630 AliHLTUInt32_t fCount;
631 AliHLTUInt32_t fList[gkAliHLTDDLListSize];
635 * @struct AliHLTEventTriggerData
637 struct AliHLTEventTriggerData
639 AliHLTUInt8_t fAttributes[gkAliHLTBlockDAttributeCount];
640 AliHLTUInt64_t fHLTStatus; // Bit field
641 AliHLTUInt32_t fCommonHeaderWordCnt;
642 AliHLTUInt32_t fCommonHeader[gkAliHLTCommonHeaderCount];
643 AliHLTEventDDL fReadoutList;
647 * @struct AliHLTComponentTriggerData
650 struct AliHLTComponentTriggerData
652 AliHLTUInt32_t fStructSize;
653 AliHLTUInt32_t fDataSize;
657 //////////////////////////////////////////////////////////////////////////
659 // HLT Event Type Specification
661 //////////////////////////////////////////////////////////////////////////
663 /** Unknown eventType specification */
664 const AliHLTUInt32_t gkAliEventTypeUnknown = ~(AliHLTUInt32_t)0;
665 /** SOR eventType specification */
666 const AliHLTUInt32_t gkAliEventTypeStartOfRun=1;
667 /** Data eventType specification */
668 const AliHLTUInt32_t gkAliEventTypeData=2;
669 /** EOR eventType specification */
670 const AliHLTUInt32_t gkAliEventTypeEndOfRun=4;
671 /** Corrupt eventType specification */
672 const AliHLTUInt32_t gkAliEventTypeCorruptID=8;
673 /** Calibration eventType specification */
674 const AliHLTUInt32_t gkAliEventTypeCalibration=16;
675 /** DataReplay eventType specification */
676 const AliHLTUInt32_t gkAliEventTypeDataReplay=32;
677 /** Configuration eventType specification */
678 const AliHLTUInt32_t gkAliEventTypeConfiguration=34;
679 /** Update DCS eventType specification */
680 const AliHLTUInt32_t gkAliEventTypeReadPreprocessor=35;
681 /** Tick eventType specification */
682 const AliHLTUInt32_t gkAliEventTypeTick=64;
683 /** Max eventType specification */
684 const AliHLTUInt32_t gkAliEventTypeMax=64;
686 //////////////////////////////////////////////////////////////////////////
688 // HLT defines and defaults
690 //////////////////////////////////////////////////////////////////////////
693 * @ingroup alihlt_component_datatypes
695 const AliHLTEventID_t kAliHLTVoidEventID=~(AliHLTEventID_t)0;
697 /** invalid data specification
698 * @ingroup alihlt_component_datatypes
700 const AliHLTUInt32_t kAliHLTVoidDataSpec = ~(AliHLTUInt32_t)0;
703 * @ingroup alihlt_component_datatypes
705 const AliHLTUInt32_t kAliHLTVoidRunNo = ~(AliHLTUInt32_t)0;
708 * @ingroup alihlt_component_datatypes
710 const AliHLTUInt32_t kAliHLTVoidRunType = ~(AliHLTUInt32_t)0;
712 /** invalid run descriptor
713 * @ingroup alihlt_component_datatypes
715 const AliHLTRunDesc kAliHLTVoidRunDesc={sizeof(AliHLTRunDesc), kAliHLTVoidRunNo, kAliHLTVoidRunType};
717 /** invalid shared memory type */
718 const AliHLTUInt32_t gkAliHLTComponentInvalidShmType = 0;
720 /** invalid shared memory id */
721 const AliHLTUInt64_t gkAliHLTComponentInvalidShmID = ~(AliHLTUInt64_t)0;
723 /** invalid data type
724 * @ingroup alihlt_component_datatypes
726 const AliHLTComponentDataType kAliHLTVoidDataType = {
727 sizeof(AliHLTComponentDataType),
728 kAliHLTVoidDataTypeID,
729 kAliHLTDataOriginVoid
732 /** all data types, means any + void data type
733 * @ingroup alihlt_component_datatypes
735 const AliHLTComponentDataType kAliHLTAllDataTypes = {
736 sizeof(AliHLTComponentDataType),
737 kAliHLTAllDataTypesID,
741 // there is currently a problem with rootcint if the predefined ids
742 // (commented below) are used. rootcint does not find the id if they
743 // are char arrays defined with {} and individual chars. If strings
744 // are used it works fine
746 * @ingroup alihlt_component_datatypes
748 const AliHLTComponentDataType kAliHLTAnyDataType = {
749 sizeof(AliHLTComponentDataType),
750 kAliHLTAnyDataTypeID,
754 /** multiple output data types
755 * @ingroup alihlt_component_datatypes
757 extern const AliHLTComponentDataType kAliHLTMultipleDataType;
759 /** data to file exchange subscriber
760 * @ingroup alihlt_component_datatypes
762 extern const AliHLTComponentDataType kAliHLTDataTypeFXSCalib;
764 /** DDL list data type
765 * @ingroup alihlt_component_datatypes
767 extern const AliHLTComponentDataType kAliHLTDataTypeDDL;
770 * @ingroup alihlt_component_datatypes
772 extern const AliHLTComponentDataType kAliHLTDataTypeSOR;
775 * @ingroup alihlt_component_datatypes
777 extern const AliHLTComponentDataType kAliHLTDataTypeEOR;
779 /** Run type data block
780 * @ingroup alihlt_component_datatypes
782 extern const AliHLTComponentDataType kAliHLTDataTypeRunType;
784 /** Event type specification
785 * @ingroup alihlt_component_datatypes
787 extern const AliHLTComponentDataType kAliHLTDataTypeEvent;
789 /** Configuration event data type
790 * @ingroup alihlt_component_datatypes
792 extern const AliHLTComponentDataType kAliHLTDataTypeComConf;
794 /** DCS value update event
795 * @ingroup alihlt_component_datatypes
797 extern const AliHLTComponentDataType kAliHLTDataTypeUpdtDCS;
799 /** RAW DDL data specification, origin is 'any', data publisher origin correctly
800 * @ingroup alihlt_component_datatypes
802 extern const AliHLTComponentDataType kAliHLTDataTypeDDLRaw;
804 /** AliMCEvent object data specification, origin is 'OFFL'
805 * @ingroup alihlt_component_datatypes
807 extern const AliHLTComponentDataType kAliHLTDataTypeMCObject;
809 /** ESD object data specification, origin is 'any'
810 * @ingroup alihlt_component_datatypes
812 extern const AliHLTComponentDataType kAliHLTDataTypeESDObject;
814 /** ESD Tree data specification, origin is 'any'
815 * @ingroup alihlt_component_datatypes
817 extern const AliHLTComponentDataType kAliHLTDataTypeESDTree;
819 /** AliRoot TreeD data specification, origin is 'any'
820 * @ingroup alihlt_component_datatypes
822 extern const AliHLTComponentDataType kAliHLTDataTypeAliTreeD;
824 /** AliRoot TreeR data specification, origin is 'any'
825 * @ingroup alihlt_component_datatypes
827 extern const AliHLTComponentDataType kAliHLTDataTypeAliTreeR;
829 /** 16 bit Hardware address selection data specification, origin is 'any'
830 * @ingroup alihlt_component_datatypes
832 extern const AliHLTComponentDataType kAliHLTDataTypeHwAddr16;
835 * @ingroup alihlt_component_datatypes
837 extern const AliHLTComponentDataType kAliHLTDataTypeEventStatistics;
840 * @ingroup alihlt_component_datatypes
842 extern const AliHLTComponentDataType kAliHLTDataTypeEventSummary;
845 * @ingroup alihlt_component_datatypes
847 extern const AliHLTComponentDataType kAliHLTDataTypeRunStatistics;
850 * @ingroup alihlt_component_datatypes
852 extern const AliHLTComponentDataType kAliHLTDataTypeRunSummary;
854 /** Component block statistics
855 * @ingroup alihlt_component_datatypes
857 extern const AliHLTComponentDataType kAliHLTDataTypeComponentStatistics;
860 * To be sent on SOR event, each component adds it's chain id string
861 * and a generated 32bit identifier to the table
862 * @ingroup alihlt_component_datatypes
864 extern const AliHLTComponentDataType kAliHLTDataTypeComponentTable;
866 //////////////////////////////////////////////////////////////////////////
868 // Data Types for Monitoring objects
870 //////////////////////////////////////////////////////////////////////////
872 /** general ROOT TObject
873 * @ingroup alihlt_component_datatypes
875 extern const AliHLTComponentDataType kAliHLTDataTypeTObject; // {ROOTTOBJ,"***"}
878 * @ingroup alihlt_component_datatypes
880 extern const AliHLTComponentDataType kAliHLTDataTypeTObjArray; // {ROOTOBAR,"***"}
883 * @ingroup alihlt_component_datatypes
885 extern const AliHLTComponentDataType kAliHLTDataTypeTTree; // {ROOTTREE,"***"}
887 /** ROOT TH1 (can be used for all histograms, they derive from TH1)
888 * @ingroup alihlt_component_datatypes
890 extern const AliHLTComponentDataType kAliHLTDataTypeHistogram; // {ROOTHIST,"***"}
893 * @ingroup alihlt_component_datatypes
895 extern const AliHLTComponentDataType kAliHLTDataTypeTNtuple; // {ROOTTUPL,"***"}
897 /** General track array for the barrel tracks based on AliExternalTrackParam
898 * Data format defined by AliHLTTracksData
900 * We follow the naming scheme of AliESDEvent where 'Tracks' denote the
901 * barrel tracks and detector tracks get names 'DETTracks'
902 * @ingroup alihlt_component_datatypes
904 extern const AliHLTComponentDataType kAliHLTDataTypeTrack; // {HLTTRACK,"***"}
906 /** TClonesArray of AliExternalTrackParam
907 * @ingroup alihlt_component_datatypes
909 extern const AliHLTComponentDataType kAliHLTDataTypeExternalTrackParam;// {TCAEXTTR,"***"}
911 //////////////////////////////////////////////////////////////////////////
913 // FXS subscriber meta information
915 //////////////////////////////////////////////////////////////////////////
917 const int gkAliHLTFXSHeaderfOriginSize = 4;
918 const int gkAliHLTFXSHeaderfFileIDSize = 128;
919 const int gkAliHLTFXSHeaderfDDLNumberSize = 64;
921 /** Header in front of the data payload, in order to sent data to the FXS. */
922 struct AliHLTFXSHeader
924 AliHLTUInt32_t fHeaderVersion;
925 AliHLTUInt32_t fRunNumber;
926 char fOrigin[gkAliHLTFXSHeaderfOriginSize];
927 char fFileID[gkAliHLTFXSHeaderfFileIDSize];
928 char fDDLNumber[gkAliHLTFXSHeaderfDDLNumberSize];
931 //////////////////////////////////////////////////////////////////////////
933 // Component running environment
935 //////////////////////////////////////////////////////////////////////////
937 /** logging function */
938 typedef int (*AliHLTfctLogging)( void* param,
939 AliHLTComponentLogSeverity severity,
942 const char* message);
945 * @struct AliHLTAnalysisEnvironment
946 * Running environment for analysis components.
947 * The struct describes function callbacks for actions to be
948 * carried out by the calling framework, like memory allocation,
949 * property callbecks, logging, etc.
951 * @ingroup alihlt_wrapper_interface
953 struct AliHLTAnalysisEnvironment
955 /** size of the structure */
956 AliHLTUInt32_t fStructSize;
958 /** the component parameter given by the framework on creation
964 void* (*fAllocMemoryFunc)( void* param, unsigned long size );
966 /** allocate an EventDoneData structure.
968 int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd );
972 AliHLTfctLogging fLoggingFunc;
975 // I just keep this as a note pad. Has to be added to the end of the structure
976 // future addition already foreseen/envisioned
977 // IMPORTANT: don not just remove the defines as this breaks the binary
979 int (*fAllocShmMemoryFunc)( void* param, unsigned long size, AliHLTComponentBlockData* blockLocation );
983 * @struct AliHLTComponentEnvironment
984 * This was the original definition of the running environment.
985 * Due to a bug in the AliRootWrapperSubscriber/SimpleComponentWrapper,
986 * this structure can not be used any longer but is kept for backward
988 * @note The external interface provided by the libHLTbase is now kept
989 * frozen but should not be used any more. Use the interface provided
990 * by the libHLTinterface library.
992 * @ingroup alihlt_wrapper_interface_deprecated
994 struct AliHLTComponentEnvironment
996 AliHLTUInt32_t fStructSize;
998 void* (*fAllocMemoryFunc)( void* param, unsigned long size );
999 int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd );
1000 AliHLTfctLogging fLoggingFunc;
1003 //////////////////////////////////////////////////////////////////////////
1005 // The external interface definition
1007 //////////////////////////////////////////////////////////////////////////
1010 * The component handle.
1011 * Used as indification in the outside world.
1012 * @ingroup alihlt_wrapper_interface
1014 typedef void* AliHLTComponentHandle;
1016 /** @ingroup alihlt_wrapper_interface */
1017 const AliHLTComponentHandle kEmptyHLTComponentHandle = 0;
1020 * Get a system call of the interface.
1021 * @param function signature
1022 * @return pointer to system call
1023 * @ingroup alihlt_wrapper_interface
1025 typedef void* (*AliHLTAnalysisFctGetInterfaceCall)(const char*);
1027 # define ALIHLTANALYSIS_INTERFACE_LIBRARY "libHLTinterface.so"
1028 # define ALIHLTANALYSIS_FCT_GETINTERFACECALL "AliHLTAnalysisGetInterfaceCall"
1030 /** @ingroup alihlt_wrapper_interface */
1031 typedef int (*AliHLTExtFctInitSystem)( unsigned long version, AliHLTAnalysisEnvironment* externalEnv, unsigned long runNo, const char* runType );
1033 /** @ingroup alihlt_wrapper_interface */
1034 typedef int (*AliHLTExtFctDeinitSystem)();
1036 /** @ingroup alihlt_wrapper_interface */
1037 typedef int (*AliHLTExtFctLoadLibrary)( const char* );
1039 /** @ingroup alihlt_wrapper_interface */
1040 typedef int (*AliHLTExtFctUnloadLibrary)( const char* );
1042 /** @ingroup alihlt_wrapper_interface */
1043 typedef int (*AliHLTExtFctCreateComponent)( const char*, void*, int, const char**, AliHLTComponentHandle*, const char* description );
1045 /** @ingroup alihlt_wrapper_interface */
1046 typedef int (*AliHLTExtFctDestroyComponent)( AliHLTComponentHandle );
1048 /** @ingroup alihlt_wrapper_interface */
1049 typedef int (*AliHLTExtFctProcessEvent)( AliHLTComponentHandle, const AliHLTComponentEventData*, const AliHLTComponentBlockData*,
1050 AliHLTComponentTriggerData*, AliHLTUInt8_t*,
1051 AliHLTUInt32_t*, AliHLTUInt32_t*,
1052 AliHLTComponentBlockData**,
1053 AliHLTComponentEventDoneData** );
1055 /** @ingroup alihlt_wrapper_interface */
1056 typedef int (*AliHLTExtFctGetOutputDataType)( AliHLTComponentHandle, AliHLTComponentDataType* );
1058 /** @ingroup alihlt_wrapper_interface */
1059 typedef int (*AliHLTExtFctGetOutputSize)( AliHLTComponentHandle, unsigned long*, double* );
1063 //////////////////////////////////////////////////////////////////////////
1065 // Data type helper functions
1067 //////////////////////////////////////////////////////////////////////////
1069 /** exact comparison of HLT component data types
1070 * @ingroup alihlt_component_datatypes
1072 inline bool MatchExactly( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1074 for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ )
1075 if ( dt1.fID[i] != dt2.fID[i] )
1077 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
1078 if ( dt1.fOrigin[i] != dt2.fOrigin[i] )
1083 /** Comparison operator for HLT component data types.
1084 * The operator takes wildcards into account, i.e. the ::kAliHLTAnyDataType,
1085 * ::kAliHLTAnyDataTypeID and ::kAliHLTDataOriginAny definitions.
1086 * @ingroup alihlt_component_datatypes
1088 inline bool operator==( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1090 if (MatchExactly(dt1, kAliHLTAllDataTypes)) return true;
1091 if (MatchExactly(dt2, kAliHLTAllDataTypes)) return true;
1093 bool any1=true, any2=true, void1=true, void2=true, match=true;
1094 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) {
1095 any1&=(dt1.fOrigin[i]==kAliHLTDataOriginAny[i]);
1096 any2&=(dt2.fOrigin[i]==kAliHLTDataOriginAny[i]);
1097 void1&=(dt1.fOrigin[i]==kAliHLTDataOriginVoid[i]);
1098 void2&=(dt2.fOrigin[i]==kAliHLTDataOriginVoid[i]);
1099 match&=dt1.fOrigin[i]==dt2.fOrigin[i];
1100 if (!(match || (any2 && !void1) || (any1 && !void2)))
1104 any1=true, any2=true, match=true;
1105 for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ ) {
1106 any1&=(dt1.fID[i]==kAliHLTAnyDataTypeID[i]);
1107 any2&=(dt2.fID[i]==kAliHLTAnyDataTypeID[i]);
1108 void1&=(dt1.fID[i]==kAliHLTVoidDataTypeID[i]);
1109 void2&=(dt2.fID[i]==kAliHLTVoidDataTypeID[i]);
1110 match&=dt1.fID[i]==dt2.fID[i];
1111 if (!(match || (any2 && !void1) || (any1 && !void2)))
1117 /** Comparison operator for HLT component data types
1118 * Invers of operator==
1119 * @ingroup alihlt_component_datatypes
1121 inline bool operator!=( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1126 /** merge operator for HLT component data types and origins
1127 * @ingroup alihlt_component_datatypes
1129 inline AliHLTComponentDataType operator|(const AliHLTComponentDataType srcdt, const char origin[kAliHLTComponentDataTypefOriginSize])
1131 AliHLTComponentDataType dt=srcdt;
1132 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
1133 dt.fOrigin[i]=origin[i];
1138 * Helper function to initialize a data type from an id char array and origin string.
1139 * @return data type structure initialized with the specified id and origin
1140 * @ingroup alihlt_component_datatypes
1142 inline AliHLTComponentDataType AliHLTComponentDataTypeInitializer(const char id[kAliHLTComponentDataTypefIDsize], const char* origin)
1144 AliHLTComponentDataType dt=kAliHLTVoidDataType;
1146 for (i = 0; i < kAliHLTComponentDataTypefIDsize; i++)
1148 for (i = 0; i < kAliHLTComponentDataTypefOriginSize && origin[i]!=0; i++ )
1149 dt.fOrigin[i]=origin[i];
1154 * Helper function to initialize a data type from a default data type and
1155 * an origin string. Basically it merges the specified origin into the data
1157 * @return data type structure initialized with the id from specified data type
1159 * @ingroup alihlt_component_datatypes
1161 inline AliHLTComponentDataType AliHLTComponentDataTypeInitializer(const AliHLTComponentDataType src, const char* origin)
1163 return AliHLTComponentDataTypeInitializer(src.fID, origin);