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)
62 * kAliHLTDataTypeStreamerInfo (ROOTSTRI)
63 * 13 Changed AliHLTEventDDL to now contain 31 words. The extra word is
64 * for the EMCAL detector, which needs 46 DDLs after DCAL was added.
66 #define ALIHLT_DATA_TYPES_VERSION 13
68 //////////////////////////////////////////////////////////////////////////
70 // HLT data origin variables.
72 // By converting from defines to variables, the origins can be used with
75 // AliHLTComponentDataType dt;
76 // dt = kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC;
78 //////////////////////////////////////////////////////////////////////////
80 /** field size of datat type origin
81 * @ingroup alihlt_component_datatypes
83 const int kAliHLTComponentDataTypefOriginSize=4;
86 /** invalid data origin
87 * @ingroup alihlt_component_datatypes
89 # define kAliHLTDataOriginVoid "\0\0\0"
90 /** old invalid data origin, kept for backward compatibility */
91 # define kAliHLTVoidDataOrigin "\0\0\0"
93 /** wildcard data type origin
94 * @ingroup alihlt_component_datatypes
96 # define kAliHLTDataOriginAny "***"
97 /** old wildcard data type origin, kept for backward compatibility */
98 # define kAliHLTAnyDataOrigin "***"
100 /** Data origin HLT out
101 * @ingroup alihlt_component_datatypes
103 extern const char kAliHLTDataOriginOut[kAliHLTComponentDataTypefOriginSize];
105 /** Data origin HLT, used for HLT specifc data
106 * in offline chains. This not a bug!
107 * @ingroup alihlt_component_datatypes
109 extern const char kAliHLTDataOriginHLT[kAliHLTComponentDataTypefOriginSize];
111 /** Data origin Offline
112 * @ingroup alihlt_component_datatypes
114 extern const char kAliHLTDataOriginOffline[kAliHLTComponentDataTypefOriginSize];
116 /** Data origin HLT/PubSub private internal
117 * @ingroup alihlt_component_datatypes
119 extern const char kAliHLTDataOriginPrivate[kAliHLTComponentDataTypefOriginSize];
122 * @ingroup alihlt_component_datatypes
124 extern const char kAliHLTDataOriginTPC[kAliHLTComponentDataTypefOriginSize];
127 * @ingroup alihlt_component_datatypes
129 extern const char kAliHLTDataOriginPHOS[kAliHLTComponentDataTypefOriginSize];
132 * @ingroup alihlt_component_datatypes
134 extern const char kAliHLTDataOriginFMD[kAliHLTComponentDataTypefOriginSize];
137 * @ingroup alihlt_component_datatypes
139 extern const char kAliHLTDataOriginMUON[kAliHLTComponentDataTypefOriginSize];
142 * @ingroup alihlt_component_datatypes
144 extern const char kAliHLTDataOriginTRD[kAliHLTComponentDataTypefOriginSize];
147 * @ingroup alihlt_component_datatypes
149 extern const char kAliHLTDataOriginITS[kAliHLTComponentDataTypefOriginSize];
151 /** Data origin ITSOut
152 * @ingroup alihlt_component_datatypes
154 extern const char kAliHLTDataOriginITSOut[kAliHLTComponentDataTypefOriginSize];
156 /** Data origin ITS SPD
157 * @ingroup alihlt_component_datatypes
159 extern const char kAliHLTDataOriginITSSPD[kAliHLTComponentDataTypefOriginSize];
161 /** Data origin ITS SDD
162 * @ingroup alihlt_component_datatypes
164 extern const char kAliHLTDataOriginITSSDD[kAliHLTComponentDataTypefOriginSize];
166 /** Data origin ITS SSD
167 * @ingroup alihlt_component_datatypes
169 extern const char kAliHLTDataOriginITSSSD[kAliHLTComponentDataTypefOriginSize];
171 /** Data origin for examples
172 * @ingroup alihlt_component_datatypes
174 extern const char kAliHLTDataOriginSample[kAliHLTComponentDataTypefOriginSize];
176 /** Data origin EMCAL
177 * @ingroup alihlt_component_datatypes
179 extern const char kAliHLTDataOriginEMCAL[kAliHLTComponentDataTypefOriginSize];
181 //////////////////////////////////////////////////////////////////////////
183 // HLT common data type defines
185 //////////////////////////////////////////////////////////////////////////
187 /** field size of data type id
188 * @ingroup alihlt_component_datatypes
190 const int kAliHLTComponentDataTypefIDsize=8;
193 /** invalid data type id
194 * @ingroup alihlt_component_datatypes
196 # define kAliHLTVoidDataTypeID "\0\0\0\0\0\0\0"
198 /** special id for all data types: any + void
199 * @ingroup alihlt_component_datatypes
201 # define kAliHLTAllDataTypesID "ALLDATA"
203 /** special id for any valid data type id
204 * @ingroup alihlt_component_datatypes
206 # define kAliHLTAnyDataTypeID "*******"
209 * @ingroup alihlt_component_datatypes
211 # define kAliHLTDDLRawDataTypeID {'D','D','L','_','R','A','W',' '}
214 * Common data type for the output of cluster finders, the exact
215 * format depends on the origin (detector)
216 * @ingroup alihlt_component_datatypes
218 # define kAliHLTClustersDataTypeID {'C','L','U','S','T','E','R','S'}
220 /** calibration data for file exchange subscriber
221 * @ingroup alihlt_component_datatypes
223 # define kAliHLTFXSCalibDataTypeID {'F','X','S','_','C','A','L',' '}
225 /** start of run (SOR) event
227 * @ingroup alihlt_component_datatypes
229 # define kAliHLTSORDataTypeID {'S','T','A','R','T','O','F','R'}
231 /** end of run (EOR) event
233 * @ingroup alihlt_component_datatypes
235 # define kAliHLTEORDataTypeID {'E','N','D','O','F','R','U','N'}
237 /** run type data block
238 * string with run type as payload
239 * @ingroup alihlt_component_datatypes
241 # define kAliHLTRunTypeDataTypeID {'R','U','N','T','Y','P','E',' '}
244 * @ref AliHLTEventDDL
245 * @ingroup alihlt_component_datatypes
247 # define kAliHLTDDLDataTypeID {'D','D','L','L','I','S','T',' '}
250 * @ingroup alihlt_component_datatypes
252 # define kAliHLTDAQRDOUTDataTypeID "DAQRDOUT"
254 /** HLT readout list.
255 * @ingroup alihlt_component_datatypes
257 # define kAliHLTReadoutListDataTypeID {'H','L','T','R','D','L','S','T'}
260 * - empty payload, specification gives eventType
261 * @ingroup alihlt_component_datatypes
263 # define kAliHLTEventDataTypeID {'E','V','E','N','T','T','Y','P'}
265 /** ECS parameter event
266 * - sent during the SOR event by the framework
267 * - contains the full ECS parameter string
268 * @ingroup alihlt_component_datatypes
270 # define kAliHLTECSParamDataTypeID {'E','C','S','P','A','R','A','M'}
272 /** ComponentConfiguration event
273 * - payload contains the CDB path as string
274 * @ingroup alihlt_component_datatypes
276 # define kAliHLTComConfDataTypeID {'C','O','M','_','C','O','N','F'}
278 /** DCS value update event
279 * - payload contains string of relevant detectors
280 * @ingroup alihlt_component_datatypes
282 # define kAliHLTUpdtDCSDataTypeID {'U','P','D','T','_','D','C','S'}
285 * an AliMCEvent object of varying origin
286 * The 'V0' at the end allows a versioning
287 * @ingroup alihlt_component_datatypes
289 # define kAliHLTMCObjectDataTypeID {'A','L','I','M','C','_','V','0'}
291 /** ESDVertex data block
292 * an AliESDVertex object of varying origin
293 * The 'V0' at the end allows a versioning
294 * @ingroup alihlt_component_datatypes
296 # define kAliHLTESDVertexDataTypeID {'E','S','D','V','T','X','V','0'}
298 /** output of the GlobalVertexer data block
299 * The 'V0' at the end allows a versioning
300 * @ingroup alihlt_component_datatypes
302 # define kAliHLTDataTypeGlobalVertexerID {'G','L','B','V','T','X','V','0'}
305 * an AliESD object of varying origin
306 * The 'V0' at the end allows a versioning
307 * @ingroup alihlt_component_datatypes
309 # define kAliHLTESDObjectDataTypeID {'A','L','I','E','S','D','V','0'}
311 /** ESD tree data block
312 * TTree with an AliESD object of varying origin
313 * @ingroup alihlt_component_datatypes
315 # define kAliHLTESDTreeDataTypeID {'E','S','D','_','T','R','E','E'}
318 * - the digits tree of an AliRoot module
319 * @ingroup alihlt_component_datatypes
321 #define kAliHLTTreeDDataTypeID {'A','L','I','T','R','E','E','D'}
324 * - the rec points tree of an AliRoot module
325 * @ingroup alihlt_component_datatypes
327 #define kAliHLTTreeRDataTypeID {'A','L','I','T','R','E','E','R'}
329 /** HW Address selection data block
330 * - a selection list for 16 bit HW addresses
332 * @ingroup alihlt_component_datatypes
334 # define kAliHLTHwAddr16DataTypeID {'H','W','A','D','D','R','1','6'}
337 * - event statistics for given detectors
339 * @ingroup alihlt_component_datatypes
341 # define kAliHLTEventStatisticsDataTypeID {'E','V','_','S','T','A','T','I'}
345 * - origin : kAliHLTDataOriginOut ( HLT )
346 * @ingroup alihlt_component_datatypes
348 # define kAliHLTEventSummaryDataTypeID {'E','V','_','S','U','M','M','A'}
351 * - run statistics for given detectors
353 * @ingroup alihlt_component_datatypes
355 # define kAliHLTRunStatisticsDataTypeID {'R','U','N','S','T','A','T','I'}
359 * - origin : kAliHLTDataOriginOut ( HLT )
360 * @ingroup alihlt_component_datatypes
362 # define kAliHLTRunSummaryDataTypeID {'R','U','N','S','U','M','M','A'}
365 * - origin : kAliHLTDataOriginOut ( HLT )
366 * @ingroup alihlt_component_datatypes
368 # define kAliHLTTriggerDecisionDataTypeID {'T','R','I','G','_','D','E','C'}
370 /** Global trigger decision
371 * - origin : kAliHLTDataOriginOut ( HLT )
372 * @ingroup alihlt_component_datatypes
374 # define kAliHLTGlobalTriggerDataTypeID {'G','L','O','B','T','R','I','G'}
377 * - small block statistics info added to the data stream by
378 * the component base class
379 * - origin kAliHLTDataOriginPrivate
380 * @ingroup alihlt_component_datatypes
382 # define kAliHLTComponentStatisticsDataTypeID {'C','O','M','P','S','T','A','T'}
385 * - list of components in the chain to be percolated through the chain
386 * - each component adds it's chain id string and a generated 32bit id
387 * @ingroup alihlt_component_datatypes
389 # define kAliHLTComponentTableDataTypeID {'C','O','M','P','T','A','B','L'}
391 /** general ROOT TObject
392 * - a general TObject exported from the HLT analysis
394 * @ingroup alihlt_component_datatypes
396 #define kAliHLTTObjectDataTypeID {'R','O','O','T','T','O','B','J'}
398 /** ROOT streamer info
399 * - used for the transmission of streamer info for objects in the HLTOUT
400 * - origin kAliHLTDataOriginOut ( HLT )
401 * @ingroup alihlt_component_datatypes
403 #define kAliHLTStreamerInfoDataTypeID {'R','O','O','T','S','T','R','I'}
406 * - a TObjArray exported from the HLT analysis
408 * @ingroup alihlt_component_datatypes
410 #define kAliHLTTObjArrayDataTypeID {'R','O','O','T','O','B','A','R'}
413 * - a TTree object exported from the HLT analysis
415 * @ingroup alihlt_component_datatypes
417 #define kAliHLTTTreeDataTypeID {'R','O','O','T','T','R','E','E'}
420 * - a histogram object exported from the HLT analysis
421 * - class derives from TH1 (directly or indirectly) and inherits all common functionality
423 * @ingroup alihlt_component_datatypes
425 #define kAliHLTHistogramDataTypeID {'R','O','O','T','H','I','S','T'}
428 * - a TNtupl object exported from the HLT analysis
430 * @ingroup alihlt_component_datatypes
432 #define kAliHLTTNtupleDataTypeID {'R','O','O','T','T','U','P','L'}
435 * - Struct for Tracks based on AliExternalTrackParam
437 * @ingroup alihlt_component_datatypes
439 #define kAliHLTTrackDataTypeID {'H','L','T','T','R','A','C','K'}
441 /** Track Monte Carlo information
442 * @ingroup alihlt_component_datatypes
444 #define kAliHLTTrackMCDataTypeID {'T','R','A','C','K','_','M','C'}
446 /** TClonesArray of AliExternalTrackParam
447 * @ingroup alihlt_component_datatypes
449 #define kAliHLTExternalTrackParamDataTypeID {'T','C','A','E','X','T','T','R'}
452 * - Struct for jets based on AliHLTJETJets
454 * @ingroup alihlt_component_datatypes
456 #define kAliHLTJetDataTypeID {'H','L','T','J','E','T','V','0'}
459 * Common data type for the dEdx
460 * format depends on the origin (detector)
461 * @ingroup alihlt_component_datatypes
463 # define kAliHLTdEdxDataTypeID {'D','E','D','X',' ',' ',' ',' '}
468 //////////////////////////////////////////////////////////////////////////
470 // Basic HLT data types
472 //////////////////////////////////////////////////////////////////////////
474 typedef unsigned char AliHLTUInt8_t;
476 typedef signed char AliHLTInt8_t;
478 typedef unsigned short AliHLTUInt16_t;
480 typedef signed short AliHLTInt16_t;
482 typedef unsigned int AliHLTUInt32_t;
484 typedef signed int AliHLTInt32_t;
486 typedef unsigned long long AliHLTUInt64_t;
488 typedef signed long long AliHLTInt64_t;
490 typedef float AliHLTFloat32_t;
492 typedef double AliHLTFloat64_t;
494 typedef AliHLTUInt64_t AliHLTEventID_t;
496 //////////////////////////////////////////////////////////////////////////
498 // HLT logging levels
500 //////////////////////////////////////////////////////////////////////////
503 * Logging severities of the HLT
505 enum AliHLTComponentLogSeverity {
508 /** benchmark messages */
509 kHLTLogBenchmark = 0x1,
510 /** debug messages */
514 /** warning messages */
515 kHLTLogWarning = 0x8,
516 /** error messages */
518 /** fatal error messages */
520 /** few important messages not to be filtered out.
521 * redirected to kHLTLogInfo in AliRoot
523 kHLTLogImportant = 0x40,
524 /** special value to enable all messages */
526 /** the default logging filter */
527 kHLTLogDefault = 0x79
530 //////////////////////////////////////////////////////////////////////////
532 // HLT data structures for data exchange and external interface
534 //////////////////////////////////////////////////////////////////////////
537 * @struct AliHLTComponentEventData
540 struct AliHLTComponentEventData
542 AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
543 AliHLTEventID_t fEventID; /// 64 bit event ID number.
544 AliHLTUInt32_t fEventCreation_s; /// Event creation time in seconds (Should be added to fEventCreation_us*1e6).
545 AliHLTUInt32_t fEventCreation_us; /// Fractional event creation time in micro seconds.
546 AliHLTUInt32_t fBlockCnt; /// The number of raw data blocks received by the component.
550 * @struct AliHLTComponentShmData
551 * Shared memory descriptor.
552 * Irrelevant for analysis components.
554 struct AliHLTComponentShmData
556 AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
557 AliHLTUInt32_t fShmType; /// The type code of the shared memory.
558 AliHLTUInt64_t fShmID; /// The shared memory identifier.
562 * @defgroup alihlt_component_datatypes Common Component Data Types
563 * The analysis framework defines a number of common data types for
564 * usage in the detector modules, like e.g. ::kAliHLTAnyDataType
565 * and ::kAliHLTDataTypeDDLRaw. Those data types always have
566 * origin ::kAliHLTDataOriginAny. The correct detector origin can be
567 * set by using operator '|'
569 * AliHLTComponentDataType dt=kAliHLTDDLRawDataTypeID|kAliHLTDataOriginTPC
571 * @ingroup alihlt_component
575 * @struct AliHLTComponentDataType
576 * Data type descriptor for data blocks transferred through the processing
578 * @ingroup alihlt_component_datatypes
580 struct AliHLTComponentDataType
582 AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
583 char fID[kAliHLTComponentDataTypefIDsize]; /// Data type identifier.
584 char fOrigin[kAliHLTComponentDataTypefOriginSize]; /// Subsystem or detector origin of the data.
588 * @struct AliHLTComponentBlockData
589 * This is the decription of data blocks exchanged between components.
590 * \b IMPORTANT: The validity of fPtr and fOffset is different for input and
592 * - input blocks: The \em fPtr member always points to the beginning of the data
593 * of size \em fSize. fOffset is ignored and should be in most
595 * - output blocks: The \em fPtr member is ignored by the framework. \em fOffset
596 * must specify the start of the data relative to the output
597 * buffer. The data block has size \em fSize.
599 struct AliHLTComponentBlockData
601 /** size and version of the struct */
602 AliHLTUInt32_t fStructSize;
603 /** shared memory key, ignored by processing components */
604 AliHLTComponentShmData fShmKey;
605 /** offset of output data relative to the output buffer */
606 AliHLTUInt32_t fOffset;
607 /** start of the data for input data blocks, fOffset to be ignored*/
609 /** size of the data block */
610 AliHLTUInt32_t fSize;
611 /** data type of the data block */
612 AliHLTComponentDataType fDataType;
613 /** data specification of the data block */
614 AliHLTUInt32_t fSpecification;
618 * @struct AliHLTComponentEventDoneData
621 struct AliHLTComponentEventDoneData
623 AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
624 AliHLTUInt32_t fDataSize; /// Size of the data section (following this data member) in bytes.
625 void* fData; /// Start of the data section.
629 * @struct AliHLTRunDesc
631 * The struct is sent with the SOR and EOR events.
634 * The name of the member fRunType is a bit misleading. This is not
635 * the ALICE Run Type given by the ECS to the sub-system. The member
636 * is an internal HLT run type and a combination of the HLT running
637 * mode and the beam type.
639 * Bit 0-2: beam type identifier
645 AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
646 AliHLTUInt32_t fRunNo; /// The run number for the current active run.
647 AliHLTUInt32_t fRunType; /// The HLT run type.
651 * @struct AliHLTComponentStatistics
652 * Small block size summary added by the AliHLTComponent base class
653 * if component statistics are enabled (--enable-compstat).
655 * fLevel is retrieved from incoming block statistics and incremented.
656 * Incoming block statistics are appended to the newly added one if
657 * --enable-compstat=full has been chosen.
660 * 2009-01-14 fComponentCycleTime added
662 struct AliHLTComponentStatistics
664 AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
665 AliHLTUInt32_t fLevel; /// Indicates from which processing stage this information is from.
666 AliHLTUInt32_t fId; /// Unique identifier for the chain based on CRC code.
667 AliHLTUInt32_t fTime; /// Real wall time used to process the data (micro seconds).
668 AliHLTUInt32_t fCTime; /// CPU time used to process the data (micro seconds).
669 AliHLTUInt32_t fInputBlockCount; /// Number of input data blocks.
670 AliHLTUInt32_t fTotalInputSize; /// Total size in bytes of input data.
671 AliHLTUInt32_t fOutputBlockCount; /// Number of output data blocks.
672 AliHLTUInt32_t fTotalOutputSize; /// Total size in bytes of output data.
673 AliHLTUInt32_t fComponentCycleTime; /// Real wall time indicating the start of the data processing (micro seconds).
677 * @struct AliHLTComponentTableEntry
678 * Structure to be send on SOR event through the chain. Each component
679 * adds its chain id and component arguments to the list.
680 * The 'length' of the structure is variable and depends on the length
681 * of the strings in the buffer at the end.
683 * ComponentTableEntries are identified by a 32bit Id generated by a CRC
684 * algorithm from the chain Id of the component. This is not a 100% unique
685 * id but with a high probability. This approach accounts for the fact
686 * that all components are separated processes.
688 struct AliHLTComponentTableEntry
690 /** Size of this structure in bytes. */
691 AliHLTUInt32_t fStructSize;
692 /** size of the array of parent ids */
693 AliHLTUInt16_t fNofParents;
694 /** size of the description string in the appended buffer */
695 AliHLTUInt8_t fSizeDescription;
696 /** the strings: chain id, component args, reserved */
697 AliHLTUInt8_t fBuffer[1];
700 //////////////////////////////////////////////////////////////////////////
702 // Trigger meta information
704 //////////////////////////////////////////////////////////////////////////
706 /** field size of fAttribute */
707 const int gkAliHLTBlockDAttributeCount = 8;
709 /** field size of fCommonHeader */
710 const int gkAliHLTCommonHeaderCount = 8;
712 /** size of the DDL list first version */
713 const int gkAliHLTDDLListSizeV0 = 30;
715 /** size of the DDL list after DCAL added to EMCAL */
716 const int gkAliHLTDDLListSizeV1 = 31;
718 /** size of the DDL list */
719 const int gkAliHLTDDLListSize = gkAliHLTDDLListSizeV1;
721 /** Number of Trigger Classes of CTP in CDH */
722 const int gkNCTPTriggerClasses = 50;
725 * @struct AliHLTEventDDLV0
726 * First version of the DDL list event.
727 * The struct is send with the DDLLIST event.
728 * Used in the trigger structure for internal apperance of
729 * the DLLs as well as for the HLT readout list send to DAQ
730 * ( as DataType : kAliHLTDataTypeDDL )
732 struct AliHLTEventDDLV0
734 AliHLTUInt32_t fCount; /// Indicates the number of words in fList.
735 AliHLTUInt32_t fList[gkAliHLTDDLListSizeV0]; /// The list of DDL enable/disable bits.
739 * @struct AliHLTEventDDLV1
740 * DDL list event structure with extra word for DCAL bits.
742 struct AliHLTEventDDLV1
744 AliHLTUInt32_t fCount; /// Indicates the number of words in fList.
745 AliHLTUInt32_t fList[gkAliHLTDDLListSizeV1]; /// The list of DDL enable/disable bits.
749 * @typedef AliHLTEventDDL
750 * Current used default version of the AliHLTEventDDL structure.
752 typedef AliHLTEventDDLV1 AliHLTEventDDL;
755 * @struct AliHLTEventTriggerData
757 struct AliHLTEventTriggerData
759 AliHLTUInt8_t fAttributes[gkAliHLTBlockDAttributeCount]; /// List of data block attibutes.
760 AliHLTUInt64_t fHLTStatus; /// Bit field
761 AliHLTUInt32_t fCommonHeaderWordCnt; /// Number of words in fCommonHeader.
762 AliHLTUInt32_t fCommonHeader[gkAliHLTCommonHeaderCount]; /// The common header words.
765 AliHLTEventDDL fReadoutList; /// The default readout list structure.
766 AliHLTEventDDLV0 fReadoutListV0; /// Access to the old version of the readout list structure.
767 AliHLTEventDDLV1 fReadoutListV1; /// Access to the readout list structure with DCAL included.
772 * @struct AliHLTComponentTriggerData
775 struct AliHLTComponentTriggerData
777 AliHLTUInt32_t fStructSize; /// Size of this structure in bytes.
778 AliHLTUInt32_t fDataSize; /// Size of the data section (following this data member) in bytes.
779 void* fData; /// Start of the data section.
782 //////////////////////////////////////////////////////////////////////////
784 // HLT Event Type Specification
786 //////////////////////////////////////////////////////////////////////////
788 /** Unknown eventType specification */
789 const AliHLTUInt32_t gkAliEventTypeUnknown = ~(AliHLTUInt32_t)0;
790 /** SOR eventType specification */
791 const AliHLTUInt32_t gkAliEventTypeStartOfRun=1;
792 /** Data eventType specification */
793 const AliHLTUInt32_t gkAliEventTypeData=2;
794 /** EOR eventType specification */
795 const AliHLTUInt32_t gkAliEventTypeEndOfRun=4;
796 /** Corrupt eventType specification */
797 const AliHLTUInt32_t gkAliEventTypeCorruptID=8;
798 /** Calibration eventType specification */
799 const AliHLTUInt32_t gkAliEventTypeCalibration=16;
800 /** DataReplay eventType specification */
801 const AliHLTUInt32_t gkAliEventTypeDataReplay=32;
802 /** Configuration eventType specification */
803 const AliHLTUInt32_t gkAliEventTypeConfiguration=34;
804 /** Update DCS eventType specification */
805 const AliHLTUInt32_t gkAliEventTypeReadPreprocessor=35;
806 /** Tick eventType specification */
807 const AliHLTUInt32_t gkAliEventTypeTick=64;
808 /** Max eventType specification */
809 const AliHLTUInt32_t gkAliEventTypeMax=64;
811 //////////////////////////////////////////////////////////////////////////
813 // HLT defines and defaults
815 //////////////////////////////////////////////////////////////////////////
818 * @ingroup alihlt_component_datatypes
820 const AliHLTEventID_t kAliHLTVoidEventID=~(AliHLTEventID_t)0;
822 /** invalid data specification
823 * @ingroup alihlt_component_datatypes
825 const AliHLTUInt32_t kAliHLTVoidDataSpec = ~(AliHLTUInt32_t)0;
828 * @ingroup alihlt_component_datatypes
830 const AliHLTUInt32_t kAliHLTVoidRunNo = ~(AliHLTUInt32_t)0;
833 * @ingroup alihlt_component_datatypes
835 const AliHLTUInt32_t kAliHLTVoidRunType = ~(AliHLTUInt32_t)0;
837 /** invalid run descriptor
838 * @ingroup alihlt_component_datatypes
840 const AliHLTRunDesc kAliHLTVoidRunDesc={sizeof(AliHLTRunDesc), kAliHLTVoidRunNo, kAliHLTVoidRunType};
842 /** invalid shared memory type */
843 const AliHLTUInt32_t gkAliHLTComponentInvalidShmType = 0;
845 /** invalid shared memory id */
846 const AliHLTUInt64_t gkAliHLTComponentInvalidShmID = ~(AliHLTUInt64_t)0;
848 /** invalid data type
849 * @ingroup alihlt_component_datatypes
851 const AliHLTComponentDataType kAliHLTVoidDataType = {
852 sizeof(AliHLTComponentDataType),
853 kAliHLTVoidDataTypeID,
854 kAliHLTDataOriginVoid
857 /** all data types, means any + void data type
858 * @ingroup alihlt_component_datatypes
860 const AliHLTComponentDataType kAliHLTAllDataTypes = {
861 sizeof(AliHLTComponentDataType),
862 kAliHLTAllDataTypesID,
866 // there is currently a problem with rootcint if the predefined ids
867 // (commented below) are used. rootcint does not find the id if they
868 // are char arrays defined with {} and individual chars. If strings
869 // are used it works fine
871 * @ingroup alihlt_component_datatypes
873 const AliHLTComponentDataType kAliHLTAnyDataType = {
874 sizeof(AliHLTComponentDataType),
875 kAliHLTAnyDataTypeID,
879 /** multiple output data types
880 * @ingroup alihlt_component_datatypes
882 extern const AliHLTComponentDataType kAliHLTMultipleDataType;
884 /** data to file exchange subscriber
885 * @ingroup alihlt_component_datatypes
887 extern const AliHLTComponentDataType kAliHLTDataTypeFXSCalib;
889 /** DDL list data type
890 * @ingroup alihlt_component_datatypes
892 extern const AliHLTComponentDataType kAliHLTDataTypeDDL;
895 * @ingroup alihlt_component_datatypes
897 extern const AliHLTComponentDataType kAliHLTDataTypeDAQRDOUT;
900 * Common data type for the output of cluster finders, the exact
901 * format depends on the origin (detector)
902 * @ingroup alihlt_component_datatypes
904 extern const AliHLTComponentDataType kAliHLTDataTypeClusters;
907 * @ingroup alihlt_component_datatypes
909 extern const AliHLTComponentDataType kAliHLTDataTypeSOR;
912 * @ingroup alihlt_component_datatypes
914 extern const AliHLTComponentDataType kAliHLTDataTypeEOR;
916 /** Run type data block
917 * @ingroup alihlt_component_datatypes
919 extern const AliHLTComponentDataType kAliHLTDataTypeRunType;
921 /** Event type specification
922 * @ingroup alihlt_component_datatypes
924 extern const AliHLTComponentDataType kAliHLTDataTypeEvent;
926 /** ECS parameter event
927 * - sent during the SOR event by the framework
928 * - contains the full ECS parameter string
929 * @ingroup alihlt_component_datatypes
931 extern const AliHLTComponentDataType kAliHLTDataTypeECSParam; // {ECSPARAM:PRIV}
933 /** Configuration event data type
934 * @ingroup alihlt_component_datatypes
936 extern const AliHLTComponentDataType kAliHLTDataTypeComConf;
938 /** DCS value update event
939 * @ingroup alihlt_component_datatypes
941 extern const AliHLTComponentDataType kAliHLTDataTypeUpdtDCS;
943 /** RAW DDL data specification, origin is 'any', data publisher origin correctly
944 * @ingroup alihlt_component_datatypes
946 extern const AliHLTComponentDataType kAliHLTDataTypeDDLRaw;
948 /** AliMCEvent object data specification, origin is 'OFFL'
949 * @ingroup alihlt_component_datatypes
951 extern const AliHLTComponentDataType kAliHLTDataTypeMCObject;
953 /** ESD vertex object data specification, origin is 'any'
954 * @ingroup alihlt_component_datatypes
956 extern const AliHLTComponentDataType kAliHLTDataTypeESDVertex;
958 /** global vertexer data specification, origin is 'any'
959 * @ingroup alihlt_component_datatypes
961 extern const AliHLTComponentDataType kAliHLTDataTypeGlobalVertexer;
963 /** ESD object data specification, origin is 'any'
964 * @ingroup alihlt_component_datatypes
966 extern const AliHLTComponentDataType kAliHLTDataTypeESDObject;
968 /** ESD Tree data specification, origin is 'any'
969 * @ingroup alihlt_component_datatypes
971 extern const AliHLTComponentDataType kAliHLTDataTypeESDTree;
973 /** AliRoot TreeD data specification, origin is 'any'
974 * @ingroup alihlt_component_datatypes
976 extern const AliHLTComponentDataType kAliHLTDataTypeAliTreeD;
978 /** AliRoot TreeR data specification, origin is 'any'
979 * @ingroup alihlt_component_datatypes
981 extern const AliHLTComponentDataType kAliHLTDataTypeAliTreeR;
983 /** 16 bit Hardware address selection data specification, origin is 'any'
984 * @ingroup alihlt_component_datatypes
986 extern const AliHLTComponentDataType kAliHLTDataTypeHwAddr16;
989 * @ingroup alihlt_component_datatypes
991 extern const AliHLTComponentDataType kAliHLTDataTypeEventStatistics;
994 * @ingroup alihlt_component_datatypes
996 extern const AliHLTComponentDataType kAliHLTDataTypeEventSummary;
999 * @ingroup alihlt_component_datatypes
1001 extern const AliHLTComponentDataType kAliHLTDataTypeRunStatistics;
1004 * @ingroup alihlt_component_datatypes
1006 extern const AliHLTComponentDataType kAliHLTDataTypeRunSummary;
1008 /** Trigger decision
1009 * - origin : kAliHLTDataOriginOut ( HLT )
1010 * @ingroup alihlt_component_datatypes
1012 extern const AliHLTComponentDataType kAliHLTDataTypeTriggerDecision; // {TRIG_DEC:HLT }
1014 /** Trigger decision
1015 * - origin : kAliHLTDataOriginOut ( HLT )
1016 * @ingroup alihlt_component_datatypes
1018 extern const AliHLTComponentDataType kAliHLTDataTypeReadoutList; // {HLTRDLST:HLT }
1020 /** Global trigger decision
1021 * - origin : kAliHLTDataOriginOut ( HLT )
1022 * @ingroup alihlt_component_datatypes
1024 extern const AliHLTComponentDataType kAliHLTDataTypeGlobalTrigger; // {GLOBTRIG:HLT }
1026 /** Component block statistics
1027 * @ingroup alihlt_component_datatypes
1029 extern const AliHLTComponentDataType kAliHLTDataTypeComponentStatistics;
1032 * To be sent on SOR event, each component adds it's chain id string
1033 * and a generated 32bit identifier to the table
1034 * @ingroup alihlt_component_datatypes
1036 extern const AliHLTComponentDataType kAliHLTDataTypeComponentTable;
1038 //////////////////////////////////////////////////////////////////////////
1040 // Data Types for Monitoring objects
1042 //////////////////////////////////////////////////////////////////////////
1044 /** general ROOT TObject
1045 * @ingroup alihlt_component_datatypes
1047 extern const AliHLTComponentDataType kAliHLTDataTypeTObject; // {ROOTTOBJ,"***"}
1049 /** ROOT streamer info
1050 * @ingroup alihlt_component_datatypes
1052 extern const AliHLTComponentDataType kAliHLTDataTypeStreamerInfo; // {ROOTSTRI,HLT }
1055 * @ingroup alihlt_component_datatypes
1057 extern const AliHLTComponentDataType kAliHLTDataTypeTObjArray; // {ROOTOBAR,"***"}
1060 * @ingroup alihlt_component_datatypes
1062 extern const AliHLTComponentDataType kAliHLTDataTypeTTree; // {ROOTTREE,"***"}
1064 /** ROOT TH1 (can be used for all histograms, they derive from TH1)
1065 * @ingroup alihlt_component_datatypes
1067 extern const AliHLTComponentDataType kAliHLTDataTypeHistogram; // {ROOTHIST,"***"}
1070 * @ingroup alihlt_component_datatypes
1072 extern const AliHLTComponentDataType kAliHLTDataTypeTNtuple; // {ROOTTUPL,"***"}
1074 /** General track array for the barrel tracks based on AliExternalTrackParam
1075 * Data format defined by AliHLTTracksData
1077 * We follow the naming scheme of AliESDEvent where 'Tracks' denote the
1078 * barrel tracks and detector tracks get names 'DETTracks'
1079 * @ingroup alihlt_component_datatypes
1081 extern const AliHLTComponentDataType kAliHLTDataTypeTrack; // {HLTTRACK,"***"}
1083 /** Track Monte Carlo information
1085 extern const AliHLTComponentDataType kAliHLTDataTypeTrackMC; // {TRACK_MC,"***"}
1087 /** TClonesArray of AliExternalTrackParam
1088 * @ingroup alihlt_component_datatypes
1090 extern const AliHLTComponentDataType kAliHLTDataTypeExternalTrackParam; // {TCAEXTTR,"***"}
1092 /** Container containing jets (AliHLTJETJets)
1093 * Containing TClonesArray of AliAODJets
1094 * @ingroup alihlt_component_datatypes
1096 extern const AliHLTComponentDataType kAliHLTDataTypeJet; // {HLTJETV0,"***"}
1098 /** Container of ITS tracks
1099 * @ingroup alihlt_component_datatypes
1101 extern const AliHLTComponentDataType fgkITSTracksDataType;
1103 /** Container of calorimeter clusters
1104 * @ingroup alihlt_component_datatypes
1106 extern const AliHLTComponentDataType kAliHLTDataTypeCaloCluster;
1108 /** Container of dEdx
1109 * @ingroup alihlt_component_datatypes
1111 extern const AliHLTComponentDataType kAliHLTDataTypedEdx;
1113 //////////////////////////////////////////////////////////////////////////
1115 // FXS subscriber meta information
1117 //////////////////////////////////////////////////////////////////////////
1119 const int gkAliHLTFXSHeaderfOriginSize = 4;
1120 const int gkAliHLTFXSHeaderfFileIDSize = 128;
1121 const int gkAliHLTFXSHeaderfDDLNumberSize = 64;
1123 /** Header in front of the data payload, in order to sent data to the FXS. */
1124 struct AliHLTFXSHeader
1126 AliHLTUInt32_t fHeaderVersion; /// HLT software version number.
1127 AliHLTUInt32_t fRunNumber; /// The current run number.
1128 char fOrigin[gkAliHLTFXSHeaderfOriginSize]; /// The detector from which the FXS data is received.
1129 char fFileID[gkAliHLTFXSHeaderfFileIDSize]; /// File identifier for the stored data.
1130 char fDDLNumber[gkAliHLTFXSHeaderfDDLNumberSize]; /// The DDL bits.
1133 //////////////////////////////////////////////////////////////////////////
1135 // Component running environment
1137 //////////////////////////////////////////////////////////////////////////
1139 /** definition of a void fct pointer */
1140 typedef void (*AliHLTfctVoid)();
1142 /** logging function */
1143 typedef int (*AliHLTfctLogging)( void* param,
1144 AliHLTComponentLogSeverity severity,
1146 const char* keyword,
1147 const char* message);
1150 * @struct AliHLTAnalysisEnvironment
1151 * Running environment for analysis components.
1152 * The struct describes function callbacks for actions to be
1153 * carried out by the calling framework, like memory allocation,
1154 * property callbecks, logging, etc.
1156 * @ingroup alihlt_wrapper_interface
1158 struct AliHLTAnalysisEnvironment
1160 /** size of the structure */
1161 AliHLTUInt32_t fStructSize;
1163 /** the component parameter given by the framework on creation */
1166 /** allocated memory */
1167 void* (*fAllocMemoryFunc)( void* param, unsigned long size );
1169 /** allocate an EventDoneData structure. */
1170 int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd );
1172 /** logging callback */
1173 AliHLTfctLogging fLoggingFunc;
1176 // I just keep this as a note pad. Has to be added to the end of the structure
1177 // future addition already foreseen/envisioned
1178 // IMPORTANT: don not just remove the defines as this breaks the binary
1180 int (*fAllocShmMemoryFunc)( void* param, unsigned long size, AliHLTComponentBlockData* blockLocation );
1184 * @struct AliHLTComponentEnvironment
1185 * This was the original definition of the running environment.
1186 * Due to a bug in the AliRootWrapperSubscriber/SimpleComponentWrapper,
1187 * this structure can not be used any longer but is kept for backward
1189 * @note The external interface provided by the libHLTbase is now kept
1190 * frozen but should not be used any more. Use the interface provided
1191 * by the libHLTinterface library.
1193 * @ingroup alihlt_wrapper_interface_deprecated
1195 struct AliHLTComponentEnvironment
1197 AliHLTUInt32_t fStructSize;
1199 void* (*fAllocMemoryFunc)( void* param, unsigned long size );
1200 int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd );
1201 AliHLTfctLogging fLoggingFunc;
1204 //////////////////////////////////////////////////////////////////////////
1206 // The external interface definition
1208 //////////////////////////////////////////////////////////////////////////
1211 * The component handle.
1212 * Used as indification in the outside world.
1213 * @ingroup alihlt_wrapper_interface
1215 typedef void* AliHLTComponentHandle;
1217 /** @ingroup alihlt_wrapper_interface */
1218 const AliHLTComponentHandle kEmptyHLTComponentHandle = 0;
1221 * Get a system call of the interface.
1222 * @param function signature
1223 * @return pointer to system call
1224 * @ingroup alihlt_wrapper_interface
1226 typedef void* (*AliHLTAnalysisFctGetInterfaceCall)(const char*);
1228 # define ALIHLTANALYSIS_INTERFACE_LIBRARY "libHLTinterface.so"
1229 # define ALIHLTANALYSIS_FCT_GETINTERFACECALL "AliHLTAnalysisGetInterfaceCall"
1231 /** @ingroup alihlt_wrapper_interface */
1232 typedef int (*AliHLTExtFctInitSystem)( unsigned long version, AliHLTAnalysisEnvironment* externalEnv, unsigned long runNo, const char* runType );
1234 /** @ingroup alihlt_wrapper_interface */
1235 typedef int (*AliHLTExtFctDeinitSystem)();
1237 /** @ingroup alihlt_wrapper_interface */
1238 typedef int (*AliHLTExtFctLoadLibrary)( const char* );
1240 /** @ingroup alihlt_wrapper_interface */
1241 typedef int (*AliHLTExtFctUnloadLibrary)( const char* );
1243 /** @ingroup alihlt_wrapper_interface */
1244 typedef int (*AliHLTExtFctCreateComponent)( const char*, void*, int, const char**, AliHLTComponentHandle*, const char* description );
1246 /** @ingroup alihlt_wrapper_interface */
1247 typedef int (*AliHLTExtFctDestroyComponent)( AliHLTComponentHandle );
1249 /** @ingroup alihlt_wrapper_interface */
1250 typedef int (*AliHLTExtFctProcessEvent)( AliHLTComponentHandle, const AliHLTComponentEventData*, const AliHLTComponentBlockData*,
1251 AliHLTComponentTriggerData*, AliHLTUInt8_t*,
1252 AliHLTUInt32_t*, AliHLTUInt32_t*,
1253 AliHLTComponentBlockData**,
1254 AliHLTComponentEventDoneData** );
1256 /** @ingroup alihlt_wrapper_interface */
1257 typedef int (*AliHLTExtFctGetOutputDataType)( AliHLTComponentHandle, AliHLTComponentDataType* );
1259 /** @ingroup alihlt_wrapper_interface */
1260 typedef int (*AliHLTExtFctGetOutputSize)( AliHLTComponentHandle, unsigned long*, double* );
1264 //////////////////////////////////////////////////////////////////////////
1266 // Data type helper functions
1268 //////////////////////////////////////////////////////////////////////////
1270 /** exact comparison of HLT component data types
1271 * @ingroup alihlt_component_datatypes
1273 inline bool MatchExactly( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1275 for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ )
1276 if ( dt1.fID[i] != dt2.fID[i] )
1278 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
1279 if ( dt1.fOrigin[i] != dt2.fOrigin[i] )
1284 /** Comparison operator for HLT component data types.
1285 * The operator takes wildcards into account, i.e. the ::kAliHLTAnyDataType,
1286 * ::kAliHLTAnyDataTypeID and ::kAliHLTDataOriginAny definitions.
1287 * @ingroup alihlt_component_datatypes
1289 inline bool operator==( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1291 if (MatchExactly(dt1, kAliHLTAllDataTypes)) return true;
1292 if (MatchExactly(dt2, kAliHLTAllDataTypes)) return true;
1294 bool any1=true, any2=true, void1=true, void2=true, match=true;
1295 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) {
1296 any1&=(dt1.fOrigin[i]==kAliHLTDataOriginAny[i]);
1297 any2&=(dt2.fOrigin[i]==kAliHLTDataOriginAny[i]);
1298 void1&=(dt1.fOrigin[i]==kAliHLTDataOriginVoid[i]);
1299 void2&=(dt2.fOrigin[i]==kAliHLTDataOriginVoid[i]);
1300 match&=dt1.fOrigin[i]==dt2.fOrigin[i];
1301 if (!(match || (any2 && !void1) || (any1 && !void2)))
1305 any1=true, any2=true, match=true;
1306 for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ ) {
1307 any1&=(dt1.fID[i]==kAliHLTAnyDataTypeID[i]);
1308 any2&=(dt2.fID[i]==kAliHLTAnyDataTypeID[i]);
1309 void1&=(dt1.fID[i]==kAliHLTVoidDataTypeID[i]);
1310 void2&=(dt2.fID[i]==kAliHLTVoidDataTypeID[i]);
1311 match&=dt1.fID[i]==dt2.fID[i];
1312 if (!(match || (any2 && !void1) || (any1 && !void2)))
1318 /** Comparison operator for HLT component data types
1319 * Invers of operator==
1320 * @ingroup alihlt_component_datatypes
1322 inline bool operator!=( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1327 /** merge operator for HLT component data types and origins
1328 * @ingroup alihlt_component_datatypes
1330 inline AliHLTComponentDataType operator|(const AliHLTComponentDataType srcdt, const char origin[kAliHLTComponentDataTypefOriginSize])
1332 AliHLTComponentDataType dt=srcdt;
1333 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
1334 dt.fOrigin[i]=origin[i];
1339 * Helper function to initialize a data type from an id char array and origin string.
1340 * @return data type structure initialized with the specified id and origin
1341 * @ingroup alihlt_component_datatypes
1343 inline AliHLTComponentDataType AliHLTComponentDataTypeInitializer(const char id[kAliHLTComponentDataTypefIDsize], const char* origin)
1345 AliHLTComponentDataType dt=kAliHLTVoidDataType;
1347 for (i = 0; i < kAliHLTComponentDataTypefIDsize && id[i]!=0; i++)
1349 for (i = 0; i < kAliHLTComponentDataTypefOriginSize && origin[i]!=0; i++ )
1350 dt.fOrigin[i]=origin[i];
1355 * Helper function to initialize a data type from a default data type and
1356 * an origin string. Basically it merges the specified origin into the data
1358 * @return data type structure initialized with the id from specified data type
1360 * @ingroup alihlt_component_datatypes
1362 inline AliHLTComponentDataType AliHLTComponentDataTypeInitializer(const AliHLTComponentDataType src, const char* origin)
1364 return AliHLTComponentDataTypeInitializer(src.fID, origin);