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
57 * added kAliHLTDataTypeTrackMC (TRACK_MC) data type
58 * added data types (note: interface version stays the same
59 * kAliHLTDataTypeDAQRDOUT (DAQRDOUT)
60 * kAliHLTDataTypeTriggerDecision (TRIG_DEC)
61 * kAliHLTDataTypeGlobalTrigger (GLOBTRIG)
63 #define ALIHLT_DATA_TYPES_VERSION 12
65 //////////////////////////////////////////////////////////////////////////
67 // HLT data origin variables.
69 // By converting from defines to variables, the origins can be used with
72 // AliHLTComponentDataType dt;
73 // dt = kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC;
75 //////////////////////////////////////////////////////////////////////////
77 /** field size of datat type origin
78 * @ingroup alihlt_component_datatypes
80 const int kAliHLTComponentDataTypefOriginSize=4;
83 /** invalid data origin
84 * @ingroup alihlt_component_datatypes
86 # define kAliHLTDataOriginVoid "\0\0\0"
87 /** old invalid data origin, kept for backward compatibility */
88 # define kAliHLTVoidDataOrigin "\0\0\0"
90 /** wildcard data type origin
91 * @ingroup alihlt_component_datatypes
93 # define kAliHLTDataOriginAny "***"
94 /** old wildcard data type origin, kept for backward compatibility */
95 # define kAliHLTAnyDataOrigin "***"
97 /** Data origin HLT out
98 * @ingroup alihlt_component_datatypes
100 extern const char kAliHLTDataOriginOut[kAliHLTComponentDataTypefOriginSize];
102 /** Data origin HLT, used for HLT specifc data
103 * in offline chains. This not a bug!
104 * @ingroup alihlt_component_datatypes
106 extern const char kAliHLTDataOriginHLT[kAliHLTComponentDataTypefOriginSize];
108 /** Data origin Offline
109 * @ingroup alihlt_component_datatypes
111 extern const char kAliHLTDataOriginOffline[kAliHLTComponentDataTypefOriginSize];
113 /** Data origin HLT/PubSub private internal
114 * @ingroup alihlt_component_datatypes
116 extern const char kAliHLTDataOriginPrivate[kAliHLTComponentDataTypefOriginSize];
119 * @ingroup alihlt_component_datatypes
121 extern const char kAliHLTDataOriginTPC[kAliHLTComponentDataTypefOriginSize];
124 * @ingroup alihlt_component_datatypes
126 extern const char kAliHLTDataOriginPHOS[kAliHLTComponentDataTypefOriginSize];
129 * @ingroup alihlt_component_datatypes
131 extern const char kAliHLTDataOriginFMD[kAliHLTComponentDataTypefOriginSize];
134 * @ingroup alihlt_component_datatypes
136 extern const char kAliHLTDataOriginMUON[kAliHLTComponentDataTypefOriginSize];
139 * @ingroup alihlt_component_datatypes
141 extern const char kAliHLTDataOriginTRD[kAliHLTComponentDataTypefOriginSize];
144 * @ingroup alihlt_component_datatypes
146 extern const char kAliHLTDataOriginITS[kAliHLTComponentDataTypefOriginSize];
148 /** Data origin ITS SPD
149 * @ingroup alihlt_component_datatypes
151 extern const char kAliHLTDataOriginITSSPD[kAliHLTComponentDataTypefOriginSize];
153 /** Data origin ITS SDD
154 * @ingroup alihlt_component_datatypes
156 extern const char kAliHLTDataOriginITSSDD[kAliHLTComponentDataTypefOriginSize];
158 /** Data origin ITS SSD
159 * @ingroup alihlt_component_datatypes
161 extern const char kAliHLTDataOriginITSSSD[kAliHLTComponentDataTypefOriginSize];
163 /** Data origin for examples
164 * @ingroup alihlt_component_datatypes
166 extern const char kAliHLTDataOriginSample[kAliHLTComponentDataTypefOriginSize];
168 /** Data origin EMCAL
169 * @ingroup alihlt_component_datatypes
171 extern const char kAliHLTDataOriginEMCAL[kAliHLTComponentDataTypefOriginSize];
173 //////////////////////////////////////////////////////////////////////////
175 // HLT common data type defines
177 //////////////////////////////////////////////////////////////////////////
179 /** field size of data type id
180 * @ingroup alihlt_component_datatypes
182 const int kAliHLTComponentDataTypefIDsize=8;
185 /** invalid data type id
186 * @ingroup alihlt_component_datatypes
188 # define kAliHLTVoidDataTypeID "\0\0\0\0\0\0\0"
190 /** special id for all data types: any + void
191 * @ingroup alihlt_component_datatypes
193 # define kAliHLTAllDataTypesID "ALLDATA"
195 /** special id for any valid data type id
196 * @ingroup alihlt_component_datatypes
198 # define kAliHLTAnyDataTypeID "*******"
201 * @ingroup alihlt_component_datatypes
203 # define kAliHLTDDLRawDataTypeID {'D','D','L','_','R','A','W',' '}
206 * Common data type for the output of cluster finders, the exact
207 * format depends on the origin (detector)
208 * @ingroup alihlt_component_datatypes
210 # define kAliHLTClustersDataTypeID {'C','L','U','S','T','E','R','S'}
212 /** calibration data for file exchange subscriber
213 * @ingroup alihlt_component_datatypes
215 # define kAliHLTFXSCalibDataTypeID {'F','X','S','_','C','A','L',' '}
217 /** start of run (SOR) event
219 * @ingroup alihlt_component_datatypes
221 # define kAliHLTSORDataTypeID {'S','T','A','R','T','O','F','R'}
223 /** end of run (EOR) event
225 * @ingroup alihlt_component_datatypes
227 # define kAliHLTEORDataTypeID {'E','N','D','O','F','R','U','N'}
229 /** run type data block
230 * string with run type as payload
231 * @ingroup alihlt_component_datatypes
233 # define kAliHLTRunTypeDataTypeID {'R','U','N','T','Y','P','E',' '}
236 * @ref AliHLTEventDDL
237 * @ingroup alihlt_component_datatypes
239 # define kAliHLTDDLDataTypeID {'D','D','L','L','I','S','T',' '}
242 * @ingroup alihlt_component_datatypes
244 # define kAliHLTDAQRDOUTDataTypeID "DAQRDOUT"
247 * - empty payload, specification gives eventType
248 * @ingroup alihlt_component_datatypes
250 # define kAliHLTEventDataTypeID {'E','V','E','N','T','T','Y','P'}
252 /** ECS parameter event
253 * - sent during the SOR event by the framework
254 * - contains the full ECS parameter string
255 * @ingroup alihlt_component_datatypes
257 # define kAliHLTECSParamDataTypeID {'E','C','S','P','A','R','A','M'}
259 /** ComponentConfiguration event
260 * - payload contains the CDB path as string
261 * @ingroup alihlt_component_datatypes
263 # define kAliHLTComConfDataTypeID {'C','O','M','_','C','O','N','F'}
265 /** DCS value update event
266 * - payload contains string of relevant detectors
267 * @ingroup alihlt_component_datatypes
269 # define kAliHLTUpdtDCSDataTypeID {'U','P','D','T','_','D','C','S'}
272 * an AliMCEvent object of varying origin
273 * The 'V0' at the end allows a versioning
274 * @ingroup alihlt_component_datatypes
276 # define kAliHLTMCObjectDataTypeID {'A','L','I','M','C','_','V','0'}
279 * an AliESD object of varying origin
280 * The 'V0' at the end allows a versioning
281 * @ingroup alihlt_component_datatypes
283 # define kAliHLTESDObjectDataTypeID {'A','L','I','E','S','D','V','0'}
285 /** ESD tree data block
286 * TTree with an AliESD object of varying origin
287 * @ingroup alihlt_component_datatypes
289 # define kAliHLTESDTreeDataTypeID {'E','S','D','_','T','R','E','E'}
292 * - the digits tree of an AliRoot module
293 * @ingroup alihlt_component_datatypes
295 #define kAliHLTTreeDDataTypeID {'A','L','I','T','R','E','E','D'}
298 * - the rec points tree of an AliRoot module
299 * @ingroup alihlt_component_datatypes
301 #define kAliHLTTreeRDataTypeID {'A','L','I','T','R','E','E','R'}
303 /** HW Address selection data block
304 * - a selection list for 16 bit HW addresses
306 * @ingroup alihlt_component_datatypes
308 # define kAliHLTHwAddr16DataTypeID {'H','W','A','D','D','R','1','6'}
311 * - event statistics for given detectors
313 * @ingroup alihlt_component_datatypes
315 # define kAliHLTEventStatisticsDataTypeID {'E','V','_','S','T','A','T','I'}
319 * - origin : kAliHLTDataOriginOut ( HLT )
320 * @ingroup alihlt_component_datatypes
322 # define kAliHLTEventSummaryDataTypeID {'E','V','_','S','U','M','M','A'}
325 * - run statistics for given detectors
327 * @ingroup alihlt_component_datatypes
329 # define kAliHLTRunStatisticsDataTypeID {'R','U','N','S','T','A','T','I'}
333 * - origin : kAliHLTDataOriginOut ( HLT )
334 * @ingroup alihlt_component_datatypes
336 # define kAliHLTRunSummaryDataTypeID {'R','U','N','S','U','M','M','A'}
339 * - origin : kAliHLTDataOriginOut ( HLT )
340 * @ingroup alihlt_component_datatypes
342 # define kAliHLTTriggerDecisionDataTypeID {'T','R','I','G','_','D','E','C'}
344 /** Global trigger decision
345 * - origin : kAliHLTDataOriginOut ( HLT )
346 * @ingroup alihlt_component_datatypes
348 # define kAliHLTGlobalTriggerDataTypeID {'G','L','O','B','T','R','I','G'}
351 * - small block statistics info added to the data stream by
352 * the component base class
353 * - origin kAliHLTDataOriginPrivate
354 * @ingroup alihlt_component_datatypes
356 # define kAliHLTComponentStatisticsDataTypeID {'C','O','M','P','S','T','A','T'}
359 * - list of components in the chain to be percolated through the chain
360 * - each component adds it's chain id string and a generated 32bit id
361 * @ingroup alihlt_component_datatypes
363 # define kAliHLTComponentTableDataTypeID {'C','O','M','P','T','A','B','L'}
365 /** general ROOT TObject
366 * - a general TObject exported from the HLT analysis
368 * @ingroup alihlt_component_datatypes
370 #define kAliHLTTObjectDataTypeID {'R','O','O','T','T','O','B','J'}
373 * - a TObjArray exported from the HLT analysis
375 * @ingroup alihlt_component_datatypes
377 #define kAliHLTTObjArrayDataTypeID {'R','O','O','T','O','B','A','R'}
380 * - a TTree object exported from the HLT analysis
382 * @ingroup alihlt_component_datatypes
384 #define kAliHLTTTreeDataTypeID {'R','O','O','T','T','R','E','E'}
387 * - a histogram object exported from the HLT analysis
388 * - class derives from TH1 (directly or indirectly) and inherits all common functionality
390 * @ingroup alihlt_component_datatypes
392 #define kAliHLTHistogramDataTypeID {'R','O','O','T','H','I','S','T'}
395 * - a TNtupl object exported from the HLT analysis
397 * @ingroup alihlt_component_datatypes
399 #define kAliHLTTNtupleDataTypeID {'R','O','O','T','T','U','P','L'}
402 * - Struct for Tracks based on AliExternalTrackParam
404 * @ingroup alihlt_component_datatypes
406 #define kAliHLTTrackDataTypeID {'H','L','T','T','R','A','C','K'}
408 /** Track Monte Carlo information
409 * @ingroup alihlt_component_datatypes
411 #define kAliHLTTrackMCDataTypeID {'T','R','A','C','K','_','M','C'}
413 /** TClonesArray of AliExternalTrackParam
414 * @ingroup alihlt_component_datatypes
416 #define kAliHLTExternalTrackParamDataTypeID {'T','C','A','E','X','T','T','R'}
419 * - Struct for jets based on AliHLTJETJets
421 * @ingroup alihlt_component_datatypes
423 #define kAliHLTJetDataTypeID {'H','L','T','J','E','T','V','0'}
428 //////////////////////////////////////////////////////////////////////////
430 // Basic HLT data types
432 //////////////////////////////////////////////////////////////////////////
434 typedef unsigned char AliHLTUInt8_t;
436 typedef signed char AliHLTInt8_t;
438 typedef unsigned short AliHLTUInt16_t;
440 typedef signed short AliHLTInt16_t;
442 typedef unsigned int AliHLTUInt32_t;
444 typedef signed int AliHLTInt32_t;
446 typedef unsigned long long AliHLTUInt64_t;
448 typedef signed long long AliHLTInt64_t;
450 typedef float AliHLTFloat32_t;
452 typedef double AliHLTFloat64_t;
454 typedef AliHLTUInt64_t AliHLTEventID_t;
456 //////////////////////////////////////////////////////////////////////////
458 // HLT logging levels
460 //////////////////////////////////////////////////////////////////////////
463 * Logging severities of the HLT
465 enum AliHLTComponentLogSeverity {
468 /** benchmark messages */
469 kHLTLogBenchmark = 0x1,
470 /** debug messages */
474 /** warning messages */
475 kHLTLogWarning = 0x8,
476 /** error messages */
478 /** fatal error messages */
480 /** few important messages not to be filtered out.
481 * redirected to kHLTLogInfo in AliRoot
483 kHLTLogImportant = 0x40,
484 /** special value to enable all messages */
486 /** the default logging filter */
487 kHLTLogDefault = 0x79
490 //////////////////////////////////////////////////////////////////////////
492 // HLT data structures for data exchange and external interface
494 //////////////////////////////////////////////////////////////////////////
497 * @struct AliHLTComponentEventData
500 struct AliHLTComponentEventData
502 AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
503 AliHLTEventID_t fEventID; /// 64 bit event ID number.
504 AliHLTUInt32_t fEventCreation_s; /// Event creation time in seconds (Should be added to fEventCreation_us*1e6).
505 AliHLTUInt32_t fEventCreation_us; /// Fractional event creation time in micro seconds.
506 AliHLTUInt32_t fBlockCnt; /// The number of raw data blocks received by the component.
510 * @struct AliHLTComponentShmData
511 * Shared memory descriptor.
512 * Irrelevant for analysis components.
514 struct AliHLTComponentShmData
516 AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
517 AliHLTUInt32_t fShmType; /// The type code of the shared memory.
518 AliHLTUInt64_t fShmID; /// The shared memory identifier.
522 * @defgroup alihlt_component_datatypes Common Component Data Types
523 * The analysis framework defines a number of common data types for
524 * usage in the detector modules, like e.g. ::kAliHLTAnyDataType
525 * and ::kAliHLTDataTypeDDLRaw. Those data types always have
526 * origin ::kAliHLTDataOriginAny. The correct detector origin can be
527 * set by using operator '|'
529 * AliHLTComponentDataType dt=kAliHLTDDLRawDataTypeID|kAliHLTDataOriginTPC
531 * @ingroup alihlt_component
535 * @struct AliHLTComponentDataType
536 * Data type descriptor for data blocks transferred through the processing
538 * @ingroup alihlt_component_datatypes
540 struct AliHLTComponentDataType
542 AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
543 char fID[kAliHLTComponentDataTypefIDsize]; /// Data type identifier.
544 char fOrigin[kAliHLTComponentDataTypefOriginSize]; /// Subsystem or detector origin of the data.
548 * @struct AliHLTComponentBlockData
549 * This is the decription of data blocks exchanged between components.
550 * \b IMPORTANT: The validity of fPtr and fOffset is different for input and
552 * - input blocks: The \em fPtr member always points to the beginning of the data
553 * of size \em fSize. fOffset is ignored and should be in most
555 * - output blocks: The \em fPtr member is ignored by the framework. \em fOffset
556 * must specify the start of the data relative to the output
557 * buffer. The data block has size \em fSize.
559 struct AliHLTComponentBlockData
561 /** size and version of the struct */
562 AliHLTUInt32_t fStructSize;
563 /** shared memory key, ignored by processing components */
564 AliHLTComponentShmData fShmKey;
565 /** offset of output data relative to the output buffer */
566 AliHLTUInt32_t fOffset;
567 /** start of the data for input data blocks, fOffset to be ignored*/
569 /** size of the data block */
570 AliHLTUInt32_t fSize;
571 /** data type of the data block */
572 AliHLTComponentDataType fDataType;
573 /** data specification of the data block */
574 AliHLTUInt32_t fSpecification;
578 * @struct AliHLTComponentEventDoneData
581 struct AliHLTComponentEventDoneData
583 AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
584 AliHLTUInt32_t fDataSize; /// Size of the data section (following this data member) in bytes.
585 void* fData; /// Start of the data section.
589 * @struct AliHLTRunDesc
591 * The struct is sent with the SOR and EOR events.
594 * The name of the member fRunType is a bit misleading. This is not
595 * the ALICE Run Type given by the ECS to the sub-system. The member
596 * is an internal HLT run type and a combination of the HLT running
597 * mode and the beam type.
599 * Bit 0-2: beam type identifier
605 AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
606 AliHLTUInt32_t fRunNo; /// The run number for the current active run.
607 AliHLTUInt32_t fRunType; /// The HLT run type.
611 * @struct AliHLTComponentStatistics
612 * Small block size summary added by the AliHLTComponent base class
613 * if component statistics are enabled (--enable-compstat).
615 * fLevel is retrieved from incoming block statistics and incremented.
616 * Incoming block statistics are appended to the newly added one if
617 * --enable-compstat=full has been chosen.
620 * 2009-01-14 fComponentCycleTime added
622 struct AliHLTComponentStatistics
624 AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
625 AliHLTUInt32_t fLevel; /// Indicates from which processing stage this information is from.
626 AliHLTUInt32_t fId; /// Unique identifier for the chain based on CRC code.
627 AliHLTUInt32_t fTime; /// Real wall time used to process the data (micro seconds).
628 AliHLTUInt32_t fCTime; /// CPU time used to process the data (micro seconds).
629 AliHLTUInt32_t fInputBlockCount; /// Number of input data blocks.
630 AliHLTUInt32_t fTotalInputSize; /// Total size in bytes of input data.
631 AliHLTUInt32_t fOutputBlockCount; /// Number of output data blocks.
632 AliHLTUInt32_t fTotalOutputSize; /// Total size in bytes of output data.
633 AliHLTUInt32_t fComponentCycleTime; /// Real wall time indicating the start of the data processing (micro seconds).
637 * @struct AliHLTComponentTableEntry
638 * Structure to be send on SOR event through the chain. Each component
639 * adds its chain id and component arguments to the list.
640 * The 'length' of the structure is variable and depends on the length
641 * of the strings in the buffer at the end.
643 * ComponentTableEntries are identified by a 32bit Id generated by a CRC
644 * algorithm from the chain Id of the component. This is not a 100% unique
645 * id but with a high probability. This approach accounts for the fact
646 * that all components are separated processes.
648 struct AliHLTComponentTableEntry
650 /** Size of this structure in bytes. */
651 AliHLTUInt32_t fStructSize;
652 /** size of the array of parent ids */
653 AliHLTUInt16_t fNofParents;
654 /** size of the description string in the appended buffer */
655 AliHLTUInt8_t fSizeDescription;
656 /** the strings: chain id, component args, reserved */
657 AliHLTUInt8_t fBuffer[1];
660 //////////////////////////////////////////////////////////////////////////
662 // Trigger meta information
664 //////////////////////////////////////////////////////////////////////////
666 /** field size of fAttribute */
667 const int gkAliHLTBlockDAttributeCount = 8;
669 /** field size of fCommonHeader */
670 const int gkAliHLTCommonHeaderCount = 8;
672 /** size of the DDL list */
673 const int gkAliHLTDDLListSize = 30;
675 /** Number of Trigger Classes of CTP in CDH */
676 const int gkNCTPTriggerClasses = 50;
679 * @struct AliHLTEventDDL
681 * The struct is send with the DDLLIST event.
682 * Used in the trigger structure for internal apperance of
683 * the DLLs as well as for the HLT readout list send to DAQ
684 * ( as DataType : kAliHLTDataTypeDDL )
686 struct AliHLTEventDDL
688 AliHLTUInt32_t fCount; /// Indicates the number of words in fList.
689 AliHLTUInt32_t fList[gkAliHLTDDLListSize]; /// The list of DDL enable/disable bits.
693 * @struct AliHLTEventTriggerData
695 struct AliHLTEventTriggerData
697 AliHLTUInt8_t fAttributes[gkAliHLTBlockDAttributeCount]; /// List of data block attibutes.
698 AliHLTUInt64_t fHLTStatus; /// Bit field
699 AliHLTUInt32_t fCommonHeaderWordCnt; /// Number of words in fCommonHeader.
700 AliHLTUInt32_t fCommonHeader[gkAliHLTCommonHeaderCount]; /// The common header words.
701 AliHLTEventDDL fReadoutList; /// The readout list structure.
705 * @struct AliHLTComponentTriggerData
708 struct AliHLTComponentTriggerData
710 AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
711 AliHLTUInt32_t fDataSize; /// Size of the data section (following this data member) in bytes.
712 void* fData; /// Start of the data section.
715 //////////////////////////////////////////////////////////////////////////
717 // HLT Event Type Specification
719 //////////////////////////////////////////////////////////////////////////
721 /** Unknown eventType specification */
722 const AliHLTUInt32_t gkAliEventTypeUnknown = ~(AliHLTUInt32_t)0;
723 /** SOR eventType specification */
724 const AliHLTUInt32_t gkAliEventTypeStartOfRun=1;
725 /** Data eventType specification */
726 const AliHLTUInt32_t gkAliEventTypeData=2;
727 /** EOR eventType specification */
728 const AliHLTUInt32_t gkAliEventTypeEndOfRun=4;
729 /** Corrupt eventType specification */
730 const AliHLTUInt32_t gkAliEventTypeCorruptID=8;
731 /** Calibration eventType specification */
732 const AliHLTUInt32_t gkAliEventTypeCalibration=16;
733 /** DataReplay eventType specification */
734 const AliHLTUInt32_t gkAliEventTypeDataReplay=32;
735 /** Configuration eventType specification */
736 const AliHLTUInt32_t gkAliEventTypeConfiguration=34;
737 /** Update DCS eventType specification */
738 const AliHLTUInt32_t gkAliEventTypeReadPreprocessor=35;
739 /** Tick eventType specification */
740 const AliHLTUInt32_t gkAliEventTypeTick=64;
741 /** Max eventType specification */
742 const AliHLTUInt32_t gkAliEventTypeMax=64;
744 //////////////////////////////////////////////////////////////////////////
746 // HLT defines and defaults
748 //////////////////////////////////////////////////////////////////////////
751 * @ingroup alihlt_component_datatypes
753 const AliHLTEventID_t kAliHLTVoidEventID=~(AliHLTEventID_t)0;
755 /** invalid data specification
756 * @ingroup alihlt_component_datatypes
758 const AliHLTUInt32_t kAliHLTVoidDataSpec = ~(AliHLTUInt32_t)0;
761 * @ingroup alihlt_component_datatypes
763 const AliHLTUInt32_t kAliHLTVoidRunNo = ~(AliHLTUInt32_t)0;
766 * @ingroup alihlt_component_datatypes
768 const AliHLTUInt32_t kAliHLTVoidRunType = ~(AliHLTUInt32_t)0;
770 /** invalid run descriptor
771 * @ingroup alihlt_component_datatypes
773 const AliHLTRunDesc kAliHLTVoidRunDesc={sizeof(AliHLTRunDesc), kAliHLTVoidRunNo, kAliHLTVoidRunType};
775 /** invalid shared memory type */
776 const AliHLTUInt32_t gkAliHLTComponentInvalidShmType = 0;
778 /** invalid shared memory id */
779 const AliHLTUInt64_t gkAliHLTComponentInvalidShmID = ~(AliHLTUInt64_t)0;
781 /** invalid data type
782 * @ingroup alihlt_component_datatypes
784 const AliHLTComponentDataType kAliHLTVoidDataType = {
785 sizeof(AliHLTComponentDataType),
786 kAliHLTVoidDataTypeID,
787 kAliHLTDataOriginVoid
790 /** all data types, means any + void data type
791 * @ingroup alihlt_component_datatypes
793 const AliHLTComponentDataType kAliHLTAllDataTypes = {
794 sizeof(AliHLTComponentDataType),
795 kAliHLTAllDataTypesID,
799 // there is currently a problem with rootcint if the predefined ids
800 // (commented below) are used. rootcint does not find the id if they
801 // are char arrays defined with {} and individual chars. If strings
802 // are used it works fine
804 * @ingroup alihlt_component_datatypes
806 const AliHLTComponentDataType kAliHLTAnyDataType = {
807 sizeof(AliHLTComponentDataType),
808 kAliHLTAnyDataTypeID,
812 /** multiple output data types
813 * @ingroup alihlt_component_datatypes
815 extern const AliHLTComponentDataType kAliHLTMultipleDataType;
817 /** data to file exchange subscriber
818 * @ingroup alihlt_component_datatypes
820 extern const AliHLTComponentDataType kAliHLTDataTypeFXSCalib;
822 /** DDL list data type
823 * @ingroup alihlt_component_datatypes
825 extern const AliHLTComponentDataType kAliHLTDataTypeDDL;
828 * @ingroup alihlt_component_datatypes
830 extern const AliHLTComponentDataType kAliHLTDataTypeDAQRDOUT;
833 * Common data type for the output of cluster finders, the exact
834 * format depends on the origin (detector)
835 * @ingroup alihlt_component_datatypes
837 extern const AliHLTComponentDataType kAliHLTDataTypeClusters;
840 * @ingroup alihlt_component_datatypes
842 extern const AliHLTComponentDataType kAliHLTDataTypeSOR;
845 * @ingroup alihlt_component_datatypes
847 extern const AliHLTComponentDataType kAliHLTDataTypeEOR;
849 /** Run type data block
850 * @ingroup alihlt_component_datatypes
852 extern const AliHLTComponentDataType kAliHLTDataTypeRunType;
854 /** Event type specification
855 * @ingroup alihlt_component_datatypes
857 extern const AliHLTComponentDataType kAliHLTDataTypeEvent;
859 /** ECS parameter event
860 * - sent during the SOR event by the framework
861 * - contains the full ECS parameter string
862 * @ingroup alihlt_component_datatypes
864 extern const AliHLTComponentDataType kAliHLTDataTypeECSParam; // {ECSPARAM:PRIV}
866 /** Configuration event data type
867 * @ingroup alihlt_component_datatypes
869 extern const AliHLTComponentDataType kAliHLTDataTypeComConf;
871 /** DCS value update event
872 * @ingroup alihlt_component_datatypes
874 extern const AliHLTComponentDataType kAliHLTDataTypeUpdtDCS;
876 /** RAW DDL data specification, origin is 'any', data publisher origin correctly
877 * @ingroup alihlt_component_datatypes
879 extern const AliHLTComponentDataType kAliHLTDataTypeDDLRaw;
881 /** AliMCEvent object data specification, origin is 'OFFL'
882 * @ingroup alihlt_component_datatypes
884 extern const AliHLTComponentDataType kAliHLTDataTypeMCObject;
886 /** ESD object data specification, origin is 'any'
887 * @ingroup alihlt_component_datatypes
889 extern const AliHLTComponentDataType kAliHLTDataTypeESDObject;
891 /** ESD Tree data specification, origin is 'any'
892 * @ingroup alihlt_component_datatypes
894 extern const AliHLTComponentDataType kAliHLTDataTypeESDTree;
896 /** AliRoot TreeD data specification, origin is 'any'
897 * @ingroup alihlt_component_datatypes
899 extern const AliHLTComponentDataType kAliHLTDataTypeAliTreeD;
901 /** AliRoot TreeR data specification, origin is 'any'
902 * @ingroup alihlt_component_datatypes
904 extern const AliHLTComponentDataType kAliHLTDataTypeAliTreeR;
906 /** 16 bit Hardware address selection data specification, origin is 'any'
907 * @ingroup alihlt_component_datatypes
909 extern const AliHLTComponentDataType kAliHLTDataTypeHwAddr16;
912 * @ingroup alihlt_component_datatypes
914 extern const AliHLTComponentDataType kAliHLTDataTypeEventStatistics;
917 * @ingroup alihlt_component_datatypes
919 extern const AliHLTComponentDataType kAliHLTDataTypeEventSummary;
922 * @ingroup alihlt_component_datatypes
924 extern const AliHLTComponentDataType kAliHLTDataTypeRunStatistics;
927 * @ingroup alihlt_component_datatypes
929 extern const AliHLTComponentDataType kAliHLTDataTypeRunSummary;
932 * - origin : kAliHLTDataOriginOut ( HLT )
933 * @ingroup alihlt_component_datatypes
935 extern const AliHLTComponentDataType kAliHLTDataTypeTriggerDecision; // {TRIG_DEC:HLT }
937 /** Global trigger decision
938 * - origin : kAliHLTDataOriginOut ( HLT )
939 * @ingroup alihlt_component_datatypes
941 extern const AliHLTComponentDataType kAliHLTDataTypeGlobalTrigger; // {GLOBTRIG:HLT }
943 /** Component block statistics
944 * @ingroup alihlt_component_datatypes
946 extern const AliHLTComponentDataType kAliHLTDataTypeComponentStatistics;
949 * To be sent on SOR event, each component adds it's chain id string
950 * and a generated 32bit identifier to the table
951 * @ingroup alihlt_component_datatypes
953 extern const AliHLTComponentDataType kAliHLTDataTypeComponentTable;
955 //////////////////////////////////////////////////////////////////////////
957 // Data Types for Monitoring objects
959 //////////////////////////////////////////////////////////////////////////
961 /** general ROOT TObject
962 * @ingroup alihlt_component_datatypes
964 extern const AliHLTComponentDataType kAliHLTDataTypeTObject; // {ROOTTOBJ,"***"}
967 * @ingroup alihlt_component_datatypes
969 extern const AliHLTComponentDataType kAliHLTDataTypeTObjArray; // {ROOTOBAR,"***"}
972 * @ingroup alihlt_component_datatypes
974 extern const AliHLTComponentDataType kAliHLTDataTypeTTree; // {ROOTTREE,"***"}
976 /** ROOT TH1 (can be used for all histograms, they derive from TH1)
977 * @ingroup alihlt_component_datatypes
979 extern const AliHLTComponentDataType kAliHLTDataTypeHistogram; // {ROOTHIST,"***"}
982 * @ingroup alihlt_component_datatypes
984 extern const AliHLTComponentDataType kAliHLTDataTypeTNtuple; // {ROOTTUPL,"***"}
986 /** General track array for the barrel tracks based on AliExternalTrackParam
987 * Data format defined by AliHLTTracksData
989 * We follow the naming scheme of AliESDEvent where 'Tracks' denote the
990 * barrel tracks and detector tracks get names 'DETTracks'
991 * @ingroup alihlt_component_datatypes
993 extern const AliHLTComponentDataType kAliHLTDataTypeTrack; // {HLTTRACK,"***"}
995 /** Track Monte Carlo information
997 extern const AliHLTComponentDataType kAliHLTDataTypeTrackMC; // {TRACK_MC,"***"}
999 /** TClonesArray of AliExternalTrackParam
1000 * @ingroup alihlt_component_datatypes
1002 extern const AliHLTComponentDataType kAliHLTDataTypeExternalTrackParam; // {TCAEXTTR,"***"}
1004 /** Container containing jets (AliHLTJETJets)
1005 * Containing TClonesArray of AliAODJets
1006 * @ingroup alihlt_component_datatypes
1008 extern const AliHLTComponentDataType kAliHLTDataTypeJet; // {HLTJETV0,"***"}
1010 /** Container of ITS tracks
1011 * @ingroup alihlt_component_datatypes
1013 extern const AliHLTComponentDataType fgkITSTracksDataType;
1015 //////////////////////////////////////////////////////////////////////////
1017 // FXS subscriber meta information
1019 //////////////////////////////////////////////////////////////////////////
1021 const int gkAliHLTFXSHeaderfOriginSize = 4;
1022 const int gkAliHLTFXSHeaderfFileIDSize = 128;
1023 const int gkAliHLTFXSHeaderfDDLNumberSize = 64;
1025 /** Header in front of the data payload, in order to sent data to the FXS. */
1026 struct AliHLTFXSHeader
1028 AliHLTUInt32_t fHeaderVersion; /// HLT software version number.
1029 AliHLTUInt32_t fRunNumber; /// The current run number.
1030 char fOrigin[gkAliHLTFXSHeaderfOriginSize]; /// The detector from which the FXS data is received.
1031 char fFileID[gkAliHLTFXSHeaderfFileIDSize]; /// File identifier for the stored data.
1032 char fDDLNumber[gkAliHLTFXSHeaderfDDLNumberSize]; /// The DDL bits.
1035 //////////////////////////////////////////////////////////////////////////
1037 // Component running environment
1039 //////////////////////////////////////////////////////////////////////////
1041 /** logging function */
1042 typedef int (*AliHLTfctLogging)( void* param,
1043 AliHLTComponentLogSeverity severity,
1045 const char* keyword,
1046 const char* message);
1049 * @struct AliHLTAnalysisEnvironment
1050 * Running environment for analysis components.
1051 * The struct describes function callbacks for actions to be
1052 * carried out by the calling framework, like memory allocation,
1053 * property callbecks, logging, etc.
1055 * @ingroup alihlt_wrapper_interface
1057 struct AliHLTAnalysisEnvironment
1059 /** size of the structure */
1060 AliHLTUInt32_t fStructSize;
1062 /** the component parameter given by the framework on creation */
1065 /** allocated memory */
1066 void* (*fAllocMemoryFunc)( void* param, unsigned long size );
1068 /** allocate an EventDoneData structure. */
1069 int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd );
1071 /** logging callback */
1072 AliHLTfctLogging fLoggingFunc;
1075 // I just keep this as a note pad. Has to be added to the end of the structure
1076 // future addition already foreseen/envisioned
1077 // IMPORTANT: don not just remove the defines as this breaks the binary
1079 int (*fAllocShmMemoryFunc)( void* param, unsigned long size, AliHLTComponentBlockData* blockLocation );
1083 * @struct AliHLTComponentEnvironment
1084 * This was the original definition of the running environment.
1085 * Due to a bug in the AliRootWrapperSubscriber/SimpleComponentWrapper,
1086 * this structure can not be used any longer but is kept for backward
1088 * @note The external interface provided by the libHLTbase is now kept
1089 * frozen but should not be used any more. Use the interface provided
1090 * by the libHLTinterface library.
1092 * @ingroup alihlt_wrapper_interface_deprecated
1094 struct AliHLTComponentEnvironment
1096 AliHLTUInt32_t fStructSize;
1098 void* (*fAllocMemoryFunc)( void* param, unsigned long size );
1099 int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd );
1100 AliHLTfctLogging fLoggingFunc;
1103 //////////////////////////////////////////////////////////////////////////
1105 // The external interface definition
1107 //////////////////////////////////////////////////////////////////////////
1110 * The component handle.
1111 * Used as indification in the outside world.
1112 * @ingroup alihlt_wrapper_interface
1114 typedef void* AliHLTComponentHandle;
1116 /** @ingroup alihlt_wrapper_interface */
1117 const AliHLTComponentHandle kEmptyHLTComponentHandle = 0;
1120 * Get a system call of the interface.
1121 * @param function signature
1122 * @return pointer to system call
1123 * @ingroup alihlt_wrapper_interface
1125 typedef void* (*AliHLTAnalysisFctGetInterfaceCall)(const char*);
1127 # define ALIHLTANALYSIS_INTERFACE_LIBRARY "libHLTinterface.so"
1128 # define ALIHLTANALYSIS_FCT_GETINTERFACECALL "AliHLTAnalysisGetInterfaceCall"
1130 /** @ingroup alihlt_wrapper_interface */
1131 typedef int (*AliHLTExtFctInitSystem)( unsigned long version, AliHLTAnalysisEnvironment* externalEnv, unsigned long runNo, const char* runType );
1133 /** @ingroup alihlt_wrapper_interface */
1134 typedef int (*AliHLTExtFctDeinitSystem)();
1136 /** @ingroup alihlt_wrapper_interface */
1137 typedef int (*AliHLTExtFctLoadLibrary)( const char* );
1139 /** @ingroup alihlt_wrapper_interface */
1140 typedef int (*AliHLTExtFctUnloadLibrary)( const char* );
1142 /** @ingroup alihlt_wrapper_interface */
1143 typedef int (*AliHLTExtFctCreateComponent)( const char*, void*, int, const char**, AliHLTComponentHandle*, const char* description );
1145 /** @ingroup alihlt_wrapper_interface */
1146 typedef int (*AliHLTExtFctDestroyComponent)( AliHLTComponentHandle );
1148 /** @ingroup alihlt_wrapper_interface */
1149 typedef int (*AliHLTExtFctProcessEvent)( AliHLTComponentHandle, const AliHLTComponentEventData*, const AliHLTComponentBlockData*,
1150 AliHLTComponentTriggerData*, AliHLTUInt8_t*,
1151 AliHLTUInt32_t*, AliHLTUInt32_t*,
1152 AliHLTComponentBlockData**,
1153 AliHLTComponentEventDoneData** );
1155 /** @ingroup alihlt_wrapper_interface */
1156 typedef int (*AliHLTExtFctGetOutputDataType)( AliHLTComponentHandle, AliHLTComponentDataType* );
1158 /** @ingroup alihlt_wrapper_interface */
1159 typedef int (*AliHLTExtFctGetOutputSize)( AliHLTComponentHandle, unsigned long*, double* );
1163 //////////////////////////////////////////////////////////////////////////
1165 // Data type helper functions
1167 //////////////////////////////////////////////////////////////////////////
1169 /** exact comparison of HLT component data types
1170 * @ingroup alihlt_component_datatypes
1172 inline bool MatchExactly( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1174 for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ )
1175 if ( dt1.fID[i] != dt2.fID[i] )
1177 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
1178 if ( dt1.fOrigin[i] != dt2.fOrigin[i] )
1183 /** Comparison operator for HLT component data types.
1184 * The operator takes wildcards into account, i.e. the ::kAliHLTAnyDataType,
1185 * ::kAliHLTAnyDataTypeID and ::kAliHLTDataOriginAny definitions.
1186 * @ingroup alihlt_component_datatypes
1188 inline bool operator==( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1190 if (MatchExactly(dt1, kAliHLTAllDataTypes)) return true;
1191 if (MatchExactly(dt2, kAliHLTAllDataTypes)) return true;
1193 bool any1=true, any2=true, void1=true, void2=true, match=true;
1194 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) {
1195 any1&=(dt1.fOrigin[i]==kAliHLTDataOriginAny[i]);
1196 any2&=(dt2.fOrigin[i]==kAliHLTDataOriginAny[i]);
1197 void1&=(dt1.fOrigin[i]==kAliHLTDataOriginVoid[i]);
1198 void2&=(dt2.fOrigin[i]==kAliHLTDataOriginVoid[i]);
1199 match&=dt1.fOrigin[i]==dt2.fOrigin[i];
1200 if (!(match || (any2 && !void1) || (any1 && !void2)))
1204 any1=true, any2=true, match=true;
1205 for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ ) {
1206 any1&=(dt1.fID[i]==kAliHLTAnyDataTypeID[i]);
1207 any2&=(dt2.fID[i]==kAliHLTAnyDataTypeID[i]);
1208 void1&=(dt1.fID[i]==kAliHLTVoidDataTypeID[i]);
1209 void2&=(dt2.fID[i]==kAliHLTVoidDataTypeID[i]);
1210 match&=dt1.fID[i]==dt2.fID[i];
1211 if (!(match || (any2 && !void1) || (any1 && !void2)))
1217 /** Comparison operator for HLT component data types
1218 * Invers of operator==
1219 * @ingroup alihlt_component_datatypes
1221 inline bool operator!=( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1226 /** merge operator for HLT component data types and origins
1227 * @ingroup alihlt_component_datatypes
1229 inline AliHLTComponentDataType operator|(const AliHLTComponentDataType srcdt, const char origin[kAliHLTComponentDataTypefOriginSize])
1231 AliHLTComponentDataType dt=srcdt;
1232 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
1233 dt.fOrigin[i]=origin[i];
1238 * Helper function to initialize a data type from an id char array and origin string.
1239 * @return data type structure initialized with the specified id and origin
1240 * @ingroup alihlt_component_datatypes
1242 inline AliHLTComponentDataType AliHLTComponentDataTypeInitializer(const char id[kAliHLTComponentDataTypefIDsize], const char* origin)
1244 AliHLTComponentDataType dt=kAliHLTVoidDataType;
1246 for (i = 0; i < kAliHLTComponentDataTypefIDsize && id[i]!=0; i++)
1248 for (i = 0; i < kAliHLTComponentDataTypefOriginSize && origin[i]!=0; i++ )
1249 dt.fOrigin[i]=origin[i];
1254 * Helper function to initialize a data type from a default data type and
1255 * an origin string. Basically it merges the specified origin into the data
1257 * @return data type structure initialized with the id from specified data type
1259 * @ingroup alihlt_component_datatypes
1261 inline AliHLTComponentDataType AliHLTComponentDataTypeInitializer(const AliHLTComponentDataType src, const char* origin)
1263 return AliHLTComponentDataTypeInitializer(src.fID, origin);