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
46 #define ALIHLT_DATA_TYPES_VERSION 8
48 //////////////////////////////////////////////////////////////////////////
50 // HLT data origin variables.
52 // By converting from defines to variables, the origins can be used with
55 // AliHLTComponentDataType dt;
56 // dt = kAliHLTDataTypeDDLRaw | gkAliHLTDataOriginTPC;
58 //////////////////////////////////////////////////////////////////////////
60 /** field size of datat type origin
61 * @ingroup alihlt_component_datatypes
63 const int kAliHLTComponentDataTypefOriginSize=4;
66 /** invalid data origin
67 * @ingroup alihlt_component_datatypes
69 # define kAliHLTDataOriginVoid "\0\0\0"
70 /** old invalid data origin, kept for backward compatibility */
71 # define kAliHLTVoidDataOrigin "\0\0\0"
73 /** wildcard data type origin
74 * @ingroup alihlt_component_datatypes
76 # define kAliHLTDataOriginAny "***"
77 /** old wildcard data type origin, kept for backward compatibility */
78 # define kAliHLTAnyDataOrigin "***"
80 /** Data origin HLT out
81 * @ingroup alihlt_component_datatypes
83 extern const char kAliHLTDataOriginOut[kAliHLTComponentDataTypefOriginSize];
85 /** Data origin HLT/PubSub private internal
86 * @ingroup alihlt_component_datatypes
88 extern const char kAliHLTDataOriginPrivate[kAliHLTComponentDataTypefOriginSize];
91 * @ingroup alihlt_component_datatypes
93 extern const char kAliHLTDataOriginTPC[kAliHLTComponentDataTypefOriginSize];
96 * @ingroup alihlt_component_datatypes
98 extern const char kAliHLTDataOriginPHOS[kAliHLTComponentDataTypefOriginSize];
101 * @ingroup alihlt_component_datatypes
103 extern const char kAliHLTDataOriginMUON[kAliHLTComponentDataTypefOriginSize];
106 * @ingroup alihlt_component_datatypes
108 extern const char kAliHLTDataOriginTRD[kAliHLTComponentDataTypefOriginSize];
111 * @ingroup alihlt_component_datatypes
113 extern const char kAliHLTDataOriginITS[kAliHLTComponentDataTypefOriginSize];
115 /** Data origin for examples
116 * @ingroup alihlt_component_datatypes
118 extern const char kAliHLTDataOriginSample[kAliHLTComponentDataTypefOriginSize];
120 /** Data origin EMCAL
121 * @ingroup alihlt_component_datatypes
123 extern const char kAliHLTDataOriginEMCAL[kAliHLTComponentDataTypefOriginSize];
125 //////////////////////////////////////////////////////////////////////////
127 // HLT common data type defines
129 //////////////////////////////////////////////////////////////////////////
131 /** field size of data type id
132 * @ingroup alihlt_component_datatypes
134 const int kAliHLTComponentDataTypefIDsize=8;
137 /** invalid data type id
138 * @ingroup alihlt_component_datatypes
140 # define kAliHLTVoidDataTypeID "\0\0\0\0\0\0\0"
142 /** special id for all data types: any + void
143 * @ingroup alihlt_component_datatypes
145 # define kAliHLTAllDataTypesID "ALLDATA"
147 /** special id for any valid data type id
148 * @ingroup alihlt_component_datatypes
150 # define kAliHLTAnyDataTypeID "*******"
153 * @ingroup alihlt_component_datatypes
155 # define kAliHLTDDLRawDataTypeID {'D','D','L','_','R','A','W',' '}
157 /** calibration data for file exchange subscriber
158 * @ingroup alihlt_component_datatypes
160 # define kAliHLTFXSCalibDataTypeID {'F','X','S','_','C','A','L',' '}
162 /** start of run (SOR) event
164 * @ingroup alihlt_component_datatypes
166 # define kAliHLTSORDataTypeID {'S','T','A','R','T','O','F','R'}
168 /** end of run (EOR) event
170 * @ingroup alihlt_component_datatypes
172 # define kAliHLTEORDataTypeID {'E','N','D','O','F','R','U','N'}
174 /** run type data block
175 * string with run type as payload
176 * @ingroup alihlt_component_datatypes
178 # define kAliHLTRunTypeDataTypeID {'R','U','N','T','Y','P','E',' '}
181 * @ref AliHLTEventDDL
182 * @ingroup alihlt_component_datatypes
184 # define kAliHLTDDLDataTypeID {'D','D','L','L','I','S','T',' '}
187 * - empty payload, specification gives eventType
188 * @ingroup alihlt_component_datatypes
190 # define kAliHLTEventDataTypeID {'E','V','E','N','T','T','Y','P'}
192 /** ComponentConfiguration event
193 * - payload contains the CDB path as string
194 * @ingroup alihlt_component_datatypes
196 # define kAliHLTComConfDataTypeID {'C','O','M','_','C','O','N','F'}
198 /** DCS value update event
199 * - payload contains string of relevant detectors
200 * @ingroup alihlt_component_datatypes
202 # define kAliHLTUpdtDCSDataTypeID {'U','P','D','T','_','D','C','S'}
205 * an AliESD object of varying origin
206 * The 'V0' at the end allows a versioning
207 * @ingroup alihlt_component_datatypes
209 # define kAliHLTESDObjectDataTypeID {'A','L','I','E','S','D','V','0'}
211 /** ESD tree data block
212 * TTree with an AliESD object of varying origin
213 * @ingroup alihlt_component_datatypes
215 # define kAliHLTESDTreeDataTypeID {'E','S','D','_','T','R','E','E'}
218 * - the digits tree of an AliRoot module
219 * @ingroup alihlt_component_datatypes
221 #define kAliHLTTreeDDataTypeID {'A','L','I','T','R','E','E','D'}
224 * - the rec points tree of an AliRoot module
225 * @ingroup alihlt_component_datatypes
227 #define kAliHLTTreeRDataTypeID {'A','L','I','T','R','E','E','D'}
229 /** HW Address selection data block
230 * - a selection list for 16 bit HW addresses
232 * @ingroup alihlt_component_datatypes
234 # define kAliHLTHwAddr16DataTypeID {'H','W','A','D','D','R','1','6'}
237 * - event statistics for given detectors
239 * @ingroup alihlt_component_datatypes
241 # define kAliHLTEventStatisticsDataTypeID {'E','V','_','S','T','A','T','I'}
245 * - origin : kAliHLTDataOriginOut ( HLT )
246 * @ingroup alihlt_component_datatypes
248 # define kAliHLTEventSummaryDataTypeID {'E','V','_','S','U','M','M','A'}
251 * - run statistics for given detectors
253 * @ingroup alihlt_component_datatypes
255 # define kAliHLTRunStatisticsDataTypeID {'R','U','N','S','T','A','T','I'}
259 * - origin : kAliHLTDataOriginOut ( HLT )
260 * @ingroup alihlt_component_datatypes
262 # define kAliHLTRunSummaryDataTypeID {'R','U','N','S','U','M','M','A'}
265 * - small block statistics info added to the data stream by
266 * the component base class
267 * - origin kAliHLTDataOriginPrivate
268 * @ingroup alihlt_component_datatypes
270 # define kAliHLTComponentStatisticsDataTypeID {'C','O','M','P','S','T','A','T'}
273 * - list of components in the chain to be percolated through the chain
274 * - each component adds it's chain id string and a generated 32bit id
275 * @ingroup alihlt_component_datatypes
277 # define kAliHLTComponentTableDataTypeID {'C','O','M','P','T','A','B','L'}
279 /** general ROOT TObject
280 * - a general TObject exported from the HLT analysis
282 * @ingroup alihlt_component_datatypes
284 #define kAliHLTTObjectDataTypeID {'R','O','O','T','T','O','B','J'}
287 * - a TObjArray exported from the HLT analysis
289 * @ingroup alihlt_component_datatypes
291 #define kAliHLTTObjArrayDataTypeID {'R','O','O','T','O','B','A','R'}
294 * - a TTree object exported from the HLT analysis
296 * @ingroup alihlt_component_datatypes
298 #define kAliHLTTTreeDataTypeID {'R','O','O','T','T','R','E','E'}
301 * - a histogram object exported from the HLT analysis
302 * - class derives from TH1 (directly or indirectly) and inherits all common functionality
304 * @ingroup alihlt_component_datatypes
306 #define kAliHLTHistogramDataTypeID {'R','O','O','T','H','I','S','T'}
309 * - a TNtupl object exported from the HLT analysis
311 * @ingroup alihlt_component_datatypes
313 #define kAliHLTTNtupleDataTypeID {'R','O','O','T','T','U','P','L'}
318 //////////////////////////////////////////////////////////////////////////
320 // Basic HLT data types
322 //////////////////////////////////////////////////////////////////////////
324 typedef unsigned char AliHLTUInt8_t;
326 typedef signed char AliHLTInt8_t;
328 typedef unsigned short AliHLTUInt16_t;
330 typedef signed short AliHLTInt16_t;
332 typedef unsigned int AliHLTUInt32_t;
334 typedef signed int AliHLTInt32_t;
336 typedef unsigned long long AliHLTUInt64_t;
338 typedef signed long long AliHLTInt64_t;
340 typedef float AliHLTFloat32_t;
342 typedef double AliHLTFloat64_t;
344 typedef AliHLTUInt64_t AliHLTEventID_t;
346 //////////////////////////////////////////////////////////////////////////
348 // HLT logging levels
350 //////////////////////////////////////////////////////////////////////////
353 * Logging severities of the HLT
355 enum AliHLTComponentLogSeverity {
358 /** benchmark messages */
359 kHLTLogBenchmark = 0x1,
360 /** debug messages */
364 /** warning messages */
365 kHLTLogWarning = 0x8,
366 /** error messages */
368 /** fatal error messages */
370 /** few important messages not to be filtered out.
371 * redirected to kHLTLogInfo in AliRoot
373 kHLTLogImportant = 0x40,
374 /** special value to enable all messages */
376 /** the default logging filter */
377 kHLTLogDefault = 0x79
380 //////////////////////////////////////////////////////////////////////////
382 // HLT data structures for data exchange and external interface
384 //////////////////////////////////////////////////////////////////////////
387 * @struct AliHLTComponentEventData
390 struct AliHLTComponentEventData
392 AliHLTUInt32_t fStructSize;
393 AliHLTEventID_t fEventID;
394 AliHLTUInt32_t fEventCreation_s;
395 AliHLTUInt32_t fEventCreation_us;
396 AliHLTUInt32_t fBlockCnt;
400 * @struct AliHLTComponentShmData
401 * Shared memory descriptor.
402 * Irrelevant for analysis components.
404 struct AliHLTComponentShmData
406 AliHLTUInt32_t fStructSize;
407 AliHLTUInt32_t fShmType;
408 AliHLTUInt64_t fShmID;
412 * @defgroup alihlt_component_datatypes Common Component Data Types
413 * The analysis framework defines a number of common data types for
414 * usage in the detector modules, like e.g. ::kAliHLTAnyDataType
415 * and ::kAliHLTDataTypeDDLRaw. Those data types always have
416 * origin ::kAliHLTDataOriginAny. The correct detector origin can be
417 * set by using operator '|'
419 * AliHLTComponentDataType dt=kAliHLTDDLRawDataTypeID|kAliHLTDataOriginTPC
421 * @ingroup alihlt_component
425 * @struct AliHLTComponentDataType
426 * Data type descriptor for data blocks transferred through the processing
428 * @ingroup alihlt_component_datatypes
430 struct AliHLTComponentDataType
432 AliHLTUInt32_t fStructSize;
433 char fID[kAliHLTComponentDataTypefIDsize]; //!
434 char fOrigin[kAliHLTComponentDataTypefOriginSize]; //!
438 * @struct AliHLTComponentBlockData
439 * This is the decription of data blocks exchanged between components.
440 * \b IMPORTANT: The validity of fPtr and fOffset is different for input and
442 * - input blocks: The \em fPtr member always points to the beginning of the data
443 * of size \em fSize. fOffset is ignored and should be in most
445 * - output blocks: The \em fPtr member is ignored by the framework. \em fOffset
446 * must specify the start of the data relative to the output
447 * buffer. The data block has size \em fSize.
449 struct AliHLTComponentBlockData
451 /* size and version of the struct */
452 AliHLTUInt32_t fStructSize;
453 /* shared memory key, ignored by processing components */
454 AliHLTComponentShmData fShmKey;
455 /* offset of output data relative to the output buffer */
456 AliHLTUInt32_t fOffset;
457 /* start of the data for input data blocks, fOffset to be ignored*/
459 /* size of the data block */
460 AliHLTUInt32_t fSize;
461 /* data type of the data block */
462 AliHLTComponentDataType fDataType;
463 /* data specification of the data block */
464 AliHLTUInt32_t fSpecification;
468 * @struct AliHLTComponentEventDoneData
471 struct AliHLTComponentEventDoneData
473 AliHLTUInt32_t fStructSize;
474 AliHLTUInt32_t fDataSize;
479 * @struct AliHLTRunDesc
481 * The struct is sent with the SOR and EOR events.
484 * The name of the member fRunType is a bit misleading. This is not
485 * the ALICE Run Type given by the ECS to the sub-system. The member
486 * is an internal HLT run type and a combination of the HLT running
487 * mode and the beam type.
489 * Bit 0-2: beam type identifier
495 AliHLTUInt32_t fStructSize;
496 AliHLTUInt32_t fRunNo;
497 AliHLTUInt32_t fRunType;
501 * @struct AliHLTComponentStatistics
502 * Small block size summary added by the AliHLTComponent base class
503 * if component statistics are enabled (--enable-compstat).
505 * fLevel is retrieved from incoming block statistics and incremented.
506 * Incoming block statistics are appended to the newly added one if
507 * --enable-compstat=full has been chosen.
509 struct AliHLTComponentStatistics
511 AliHLTUInt32_t fStructSize;
512 AliHLTUInt32_t fLevel;
514 AliHLTUInt32_t fTime;
515 AliHLTUInt32_t fCTime;
516 AliHLTUInt32_t fInputBlockCount;
517 AliHLTUInt32_t fTotalInputSize;
518 AliHLTUInt32_t fOutputBlockCount;
519 AliHLTUInt32_t fTotalOutputSize;
523 * @struct AliHLTComponentTableEntry
524 * Structure to be send on SOR event through the chain. Each component
525 * adds its chain id and component arguments to the list.
526 * The 'length' of the structure is variable and depends on the length
527 * of the strings in the buffer at the end.
529 struct AliHLTComponentTableEntry
531 AliHLTUInt32_t fStructSize;
532 /** the 32bit Id is generated by a CRC algorithm from the
533 chain Id of the component. This is not a 100% unique id
534 but with a high probability */
536 /** size of the chain id string in the appended buffer */
537 AliHLTUInt8_t fSizeChainId;
538 /** size of the comp argument string in the appended buffer */
539 AliHLTUInt8_t fSizeCompArgs;
540 /** some reserved size */
541 AliHLTUInt8_t fSizeReserved;
542 /** the strings: chain id, component args, reserved */
543 AliHLTUInt8_t fBuffer[1];
546 //////////////////////////////////////////////////////////////////////////
548 // Trigger meta information
550 //////////////////////////////////////////////////////////////////////////
552 /** field size of fAttribute */
553 const int gkAliHLTBlockDAttributeCount = 8;
555 /** field size of fCommonHeader */
556 const int gkAliHLTCommonHeaderCount = 8;
558 /** size of the DDL list */
559 const int gkAliHLTDDLListSize = 30;
561 /** Number of Trigger Classes of CTP in CDH */
562 const int gkNCTPTriggerClasses = 50;
565 * @struct AliHLTEventDDL
567 * The struct is send with the DDLLIST event.
568 * Used in the trigger structure for internal apperance of
569 * the DLLs as well as for the HLT readout list send to DAQ
570 * ( as DataType : kAliHLTDataTypeDDL )
572 struct AliHLTEventDDL
574 AliHLTUInt32_t fCount;
575 AliHLTUInt32_t fList[gkAliHLTDDLListSize];
579 * @struct AliHLTEventTriggerData
581 struct AliHLTEventTriggerData
583 AliHLTUInt8_t fAttributes[gkAliHLTBlockDAttributeCount];
584 AliHLTUInt64_t fHLTStatus; // Bit field
585 AliHLTUInt32_t fCommonHeaderWordCnt;
586 AliHLTUInt32_t fCommonHeader[gkAliHLTCommonHeaderCount];
587 AliHLTEventDDL fReadoutList;
591 * @struct AliHLTComponentTriggerData
594 struct AliHLTComponentTriggerData
596 AliHLTUInt32_t fStructSize;
597 AliHLTUInt32_t fDataSize;
601 //////////////////////////////////////////////////////////////////////////
603 // HLT Event Type Specification
605 //////////////////////////////////////////////////////////////////////////
607 /** Unknown eventType specification */
608 const AliHLTUInt32_t gkAliEventTypeUnknown = ~(AliHLTUInt32_t)0;
609 /** SOR eventType specification */
610 const AliHLTUInt32_t gkAliEventTypeStartOfRun=1;
611 /** Data eventType specification */
612 const AliHLTUInt32_t gkAliEventTypeData=2;
613 /** EOR eventType specification */
614 const AliHLTUInt32_t gkAliEventTypeEndOfRun=4;
615 /** Corrupt eventType specification */
616 const AliHLTUInt32_t gkAliEventTypeCorruptID=8;
617 /** Calibration eventType specification */
618 const AliHLTUInt32_t gkAliEventTypeCalibration=16;
619 /** DataReplay eventType specification */
620 const AliHLTUInt32_t gkAliEventTypeDataReplay=32;
621 /** Configuration eventType specification */
622 const AliHLTUInt32_t gkAliEventTypeConfiguration=34;
623 /** Update DCS eventType specification */
624 const AliHLTUInt32_t gkAliEventTypeReadPreprocessor=35;
625 /** Tick eventType specification */
626 const AliHLTUInt32_t gkAliEventTypeTick=64;
627 /** Max eventType specification */
628 const AliHLTUInt32_t gkAliEventTypeMax=64;
630 //////////////////////////////////////////////////////////////////////////
632 // HLT defines and defaults
634 //////////////////////////////////////////////////////////////////////////
637 * @ingroup alihlt_component_datatypes
639 const AliHLTEventID_t kAliHLTVoidEventID=~(AliHLTEventID_t)0;
641 /** invalid data specification
642 * @ingroup alihlt_component_datatypes
644 const AliHLTUInt32_t kAliHLTVoidDataSpec = ~(AliHLTUInt32_t)0;
647 * @ingroup alihlt_component_datatypes
649 const AliHLTUInt32_t kAliHLTVoidRunNo = ~(AliHLTUInt32_t)0;
652 * @ingroup alihlt_component_datatypes
654 const AliHLTUInt32_t kAliHLTVoidRunType = ~(AliHLTUInt32_t)0;
656 /** invalid run descriptor
657 * @ingroup alihlt_component_datatypes
659 const AliHLTRunDesc kAliHLTVoidRunDesc={sizeof(AliHLTRunDesc), kAliHLTVoidRunNo, kAliHLTVoidRunType};
661 /** invalid shared memory type */
662 const AliHLTUInt32_t gkAliHLTComponentInvalidShmType = 0;
664 /** invalid shared memory id */
665 const AliHLTUInt64_t gkAliHLTComponentInvalidShmID = ~(AliHLTUInt64_t)0;
667 /** invalid data type
668 * @ingroup alihlt_component_datatypes
670 const AliHLTComponentDataType kAliHLTVoidDataType = {
671 sizeof(AliHLTComponentDataType),
672 kAliHLTVoidDataTypeID,
673 kAliHLTDataOriginVoid
676 /** all data types, means any + void data type
677 * @ingroup alihlt_component_datatypes
679 const AliHLTComponentDataType kAliHLTAllDataTypes = {
680 sizeof(AliHLTComponentDataType),
681 kAliHLTAllDataTypesID,
685 // there is currently a problem with rootcint if the predefined ids
686 // (commented below) are used. rootcint does not find the id if they
687 // are char arrays defined with {} and individual chars. If strings
688 // are used it works fine
690 * @ingroup alihlt_component_datatypes
692 const AliHLTComponentDataType kAliHLTAnyDataType = {
693 sizeof(AliHLTComponentDataType),
694 kAliHLTAnyDataTypeID,
698 /** multiple output data types
699 * @ingroup alihlt_component_datatypes
701 extern const AliHLTComponentDataType kAliHLTMultipleDataType;
703 /** data to file exchange subscriber
704 * @ingroup alihlt_component_datatypes
706 extern const AliHLTComponentDataType kAliHLTDataTypeFXSCalib;
708 /** DDL list data type
709 * @ingroup alihlt_component_datatypes
711 extern const AliHLTComponentDataType kAliHLTDataTypeDDL;
714 * @ingroup alihlt_component_datatypes
716 extern const AliHLTComponentDataType kAliHLTDataTypeSOR;
719 * @ingroup alihlt_component_datatypes
721 extern const AliHLTComponentDataType kAliHLTDataTypeEOR;
723 /** Run type data block
724 * @ingroup alihlt_component_datatypes
726 extern const AliHLTComponentDataType kAliHLTDataTypeRunType;
728 /** Event type specification
729 * @ingroup alihlt_component_datatypes
731 extern const AliHLTComponentDataType kAliHLTDataTypeEvent;
733 /** Configuration event data type
734 * @ingroup alihlt_component_datatypes
736 extern const AliHLTComponentDataType kAliHLTDataTypeComConf;
738 /** DCS value update event
739 * @ingroup alihlt_component_datatypes
741 extern const AliHLTComponentDataType kAliHLTDataTypeUpdtDCS;
743 /** RAW DDL data specification, origin is 'any', data publisher origin correctly
744 * @ingroup alihlt_component_datatypes
746 extern const AliHLTComponentDataType kAliHLTDataTypeDDLRaw;
748 /** ESD object data specification, origin is 'any'
749 * @ingroup alihlt_component_datatypes
751 extern const AliHLTComponentDataType kAliHLTDataTypeESDObject;
753 /** ESD Tree data specification, origin is 'any'
755 * @ingroup alihlt_component_datatypes
757 extern const AliHLTComponentDataType kAliHLTDataTypeESDTree;
759 /** AliRoot TreeD data specification, origin is 'any'
760 * @ingroup alihlt_component_datatypes
762 extern const AliHLTComponentDataType kAliHLTDataTypeAliTreeD;
764 /** AliRoot TreeR data specification, origin is 'any'
765 * @ingroup alihlt_component_datatypes
767 extern const AliHLTComponentDataType kAliHLTDataTypeAliTreeR;
769 /** 16 bit Hardware address selection data specification, origin is 'any'
770 * @ingroup alihlt_component_datatypes
772 extern const AliHLTComponentDataType kAliHLTDataTypeHwAddr16;
775 * @ingroup alihlt_component_datatypes
777 extern const AliHLTComponentDataType kAliHLTDataTypeEventStatistics;
780 * @ingroup alihlt_component_datatypes
782 extern const AliHLTComponentDataType kAliHLTDataTypeEventSummary;
785 * @ingroup alihlt_component_datatypes
787 extern const AliHLTComponentDataType kAliHLTDataTypeRunStatistics;
790 * @ingroup alihlt_component_datatypes
792 extern const AliHLTComponentDataType kAliHLTDataTypeRunSummary;
794 /** Component block statistics
795 * @ingroup alihlt_component_datatypes
797 extern const AliHLTComponentDataType kAliHLTDataTypeComponentStatistics;
800 * To be sent on SOR event, each component adds it's chain id string
801 * and a generated 32bit identifier to the table
802 * @ingroup alihlt_component_datatypes
804 extern const AliHLTComponentDataType kAliHLTDataTypeComponentTable;
806 //////////////////////////////////////////////////////////////////////////
808 // Data Types for Monitoring objects
810 //////////////////////////////////////////////////////////////////////////
812 /** general ROOT TObject
813 * @ingroup alihlt_component_datatypes
815 extern const AliHLTComponentDataType kAliHLTDataTypeTObject; // {ROOTTOBJ,"***"}
818 * @ingroup alihlt_component_datatypes
820 extern const AliHLTComponentDataType kAliHLTDataTypeTObjArray; // {ROOTOBAR,"***"}
823 * @ingroup alihlt_component_datatypes
825 extern const AliHLTComponentDataType kAliHLTDataTypeTTree; // {ROOTTREE,"***"}
827 /** ROOT TH1 (can be used for all histograms, they derive from TH1)
828 * @ingroup alihlt_component_datatypes
830 extern const AliHLTComponentDataType kAliHLTDataTypeHistogram; // {ROOTHIST,"***"}
833 * @ingroup alihlt_component_datatypes
835 extern const AliHLTComponentDataType kAliHLTDataTypeTNtuple; // {ROOTTUPL,"***"}
837 //////////////////////////////////////////////////////////////////////////
839 // FXS subscriber meta information
841 //////////////////////////////////////////////////////////////////////////
843 const int gkAliHLTFXSHeaderfOriginSize = 4;
844 const int gkAliHLTFXSHeaderfFileIDSize = 128;
845 const int gkAliHLTFXSHeaderfDDLNumberSize = 64;
847 /** Header in front of the data payload, in order to sent data to the FXS. */
848 struct AliHLTFXSHeader
850 AliHLTUInt32_t fHeaderVersion;
851 AliHLTUInt32_t fRunNumber;
852 char fOrigin[gkAliHLTFXSHeaderfOriginSize];
853 char fFileID[gkAliHLTFXSHeaderfFileIDSize];
854 char fDDLNumber[gkAliHLTFXSHeaderfDDLNumberSize];
857 //////////////////////////////////////////////////////////////////////////
859 // Component running environment
861 //////////////////////////////////////////////////////////////////////////
863 /** logging function */
864 typedef int (*AliHLTfctLogging)( void* param,
865 AliHLTComponentLogSeverity severity,
868 const char* message);
871 * @struct AliHLTAnalysisEnvironment
872 * Running environment for analysis components.
873 * The struct describes function callbacks for actions to be
874 * carried out by the calling framework, like memory allocation,
875 * property callbecks, logging, etc.
877 * @ingroup alihlt_wrapper_interface
879 struct AliHLTAnalysisEnvironment
881 /** size of the structure */
882 AliHLTUInt32_t fStructSize;
884 /** the component parameter given by the framework on creation
890 void* (*fAllocMemoryFunc)( void* param, unsigned long size );
892 /** allocate an EventDoneData structure.
894 int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd );
898 AliHLTfctLogging fLoggingFunc;
901 // I just keep this as a note pad. Has to be added to the end of the structure
902 // future addition already foreseen/envisioned
903 // IMPORTANT: don not just remove the defines as this breaks the binary
905 int (*fAllocShmMemoryFunc)( void* param, unsigned long size, AliHLTComponentBlockData* blockLocation );
909 * @struct AliHLTComponentEnvironment
910 * This was the original definition of the running environment.
911 * Due to a bug in the AliRootWrapperSubscriber/SimpleComponentWrapper,
912 * this structure can not be used any longer but is kept for backward
914 * @note The external interface provided by the libHLTbase is now kept
915 * frozen but should not be used any more. Use the interface provided
916 * by the libHLTinterface library.
918 * @ingroup alihlt_wrapper_interface_deprecated
920 struct AliHLTComponentEnvironment
922 AliHLTUInt32_t fStructSize;
924 void* (*fAllocMemoryFunc)( void* param, unsigned long size );
925 int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd );
926 AliHLTfctLogging fLoggingFunc;
929 //////////////////////////////////////////////////////////////////////////
931 // The external interface definition
933 //////////////////////////////////////////////////////////////////////////
936 * The component handle.
937 * Used as indification in the outside world.
938 * @ingroup alihlt_wrapper_interface
940 typedef void* AliHLTComponentHandle;
942 /** @ingroup alihlt_wrapper_interface */
943 const AliHLTComponentHandle kEmptyHLTComponentHandle = 0;
946 * Get a system call of the interface.
947 * @param function signature
948 * @return pointer to system call
949 * @ingroup alihlt_wrapper_interface
951 typedef void* (*AliHLTAnalysisFctGetInterfaceCall)(const char*);
953 # define ALIHLTANALYSIS_INTERFACE_LIBRARY "libHLTinterface.so"
954 # define ALIHLTANALYSIS_FCT_GETINTERFACECALL "AliHLTAnalysisGetInterfaceCall"
956 /** @ingroup alihlt_wrapper_interface */
957 typedef int (*AliHLTExtFctInitSystem)( unsigned long version, AliHLTAnalysisEnvironment* externalEnv, unsigned long runNo, const char* runType );
959 /** @ingroup alihlt_wrapper_interface */
960 typedef int (*AliHLTExtFctDeinitSystem)();
962 /** @ingroup alihlt_wrapper_interface */
963 typedef int (*AliHLTExtFctLoadLibrary)( const char* );
965 /** @ingroup alihlt_wrapper_interface */
966 typedef int (*AliHLTExtFctUnloadLibrary)( const char* );
968 /** @ingroup alihlt_wrapper_interface */
969 typedef int (*AliHLTExtFctCreateComponent)( const char*, void*, int, const char**, AliHLTComponentHandle*, const char* description );
971 /** @ingroup alihlt_wrapper_interface */
972 typedef int (*AliHLTExtFctDestroyComponent)( AliHLTComponentHandle );
974 /** @ingroup alihlt_wrapper_interface */
975 typedef int (*AliHLTExtFctProcessEvent)( AliHLTComponentHandle, const AliHLTComponentEventData*, const AliHLTComponentBlockData*,
976 AliHLTComponentTriggerData*, AliHLTUInt8_t*,
977 AliHLTUInt32_t*, AliHLTUInt32_t*,
978 AliHLTComponentBlockData**,
979 AliHLTComponentEventDoneData** );
981 /** @ingroup alihlt_wrapper_interface */
982 typedef int (*AliHLTExtFctGetOutputDataType)( AliHLTComponentHandle, AliHLTComponentDataType* );
984 /** @ingroup alihlt_wrapper_interface */
985 typedef int (*AliHLTExtFctGetOutputSize)( AliHLTComponentHandle, unsigned long*, double* );
989 //////////////////////////////////////////////////////////////////////////
991 // Data type helper functions
993 //////////////////////////////////////////////////////////////////////////
995 /** exact comparison of HLT component data types
996 * @ingroup alihlt_component_datatypes
998 inline bool MatchExactly( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1000 for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ )
1001 if ( dt1.fID[i] != dt2.fID[i] )
1003 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
1004 if ( dt1.fOrigin[i] != dt2.fOrigin[i] )
1009 /** Comparison operator for HLT component data types.
1010 * The operator takes wildcards into account, i.e. the ::kAliHLTAnyDataType,
1011 * ::kAliHLTAnyDataTypeID and ::kAliHLTDataOriginAny definitions.
1012 * @ingroup alihlt_component_datatypes
1014 inline bool operator==( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1016 if (MatchExactly(dt1, kAliHLTAllDataTypes)) return true;
1017 if (MatchExactly(dt2, kAliHLTAllDataTypes)) return true;
1019 bool any1=true, any2=true, void1=true, void2=true, match=true;
1020 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) {
1021 any1&=(dt1.fOrigin[i]==kAliHLTDataOriginAny[i]);
1022 any2&=(dt2.fOrigin[i]==kAliHLTDataOriginAny[i]);
1023 void1&=(dt1.fOrigin[i]==kAliHLTDataOriginVoid[i]);
1024 void2&=(dt2.fOrigin[i]==kAliHLTDataOriginVoid[i]);
1025 match&=dt1.fOrigin[i]==dt2.fOrigin[i];
1026 if (!(match || (any2 && !void1) || (any1 && !void2)))
1030 any1=true, any2=true, match=true;
1031 for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ ) {
1032 any1&=(dt1.fID[i]==kAliHLTAnyDataTypeID[i]);
1033 any2&=(dt2.fID[i]==kAliHLTAnyDataTypeID[i]);
1034 void1&=(dt1.fID[i]==kAliHLTVoidDataTypeID[i]);
1035 void2&=(dt2.fID[i]==kAliHLTVoidDataTypeID[i]);
1036 match&=dt1.fID[i]==dt2.fID[i];
1037 if (!(match || (any2 && !void1) || (any1 && !void2)))
1043 /** Comparison operator for HLT component data types
1044 * Invers of operator==
1045 * @ingroup alihlt_component_datatypes
1047 inline bool operator!=( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
1052 /** merge operator for HLT component data types and origins
1053 * @ingroup alihlt_component_datatypes
1055 inline AliHLTComponentDataType operator|(const AliHLTComponentDataType srcdt, const char origin[kAliHLTComponentDataTypefOriginSize])
1057 AliHLTComponentDataType dt=srcdt;
1058 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
1059 dt.fOrigin[i]=origin[i];