X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;ds=inline;f=HLT%2FBASE%2FAliHLTDataTypes.h;h=91cad257621ddb529fcd4ea3bc33cae0f37b81db;hb=575dee189356322738b7a8cd31845dcf3da027f3;hp=b27e7c2b231c4976ee0675ff9b882627d353f33c;hpb=297174de488a3c6a9f5c7f90778ce1e1e72a6a70;p=u%2Fmrichter%2FAliRoot.git diff --git a/HLT/BASE/AliHLTDataTypes.h b/HLT/BASE/AliHLTDataTypes.h index b27e7c2b231..91cad257621 100644 --- a/HLT/BASE/AliHLTDataTypes.h +++ b/HLT/BASE/AliHLTDataTypes.h @@ -31,8 +31,47 @@ * specs * 5 Data types for Run and Event summary, and for monitoring added * 6 Common data types for TreeD and TreeR defined + * kAliHLTAllDataTypes and kAliHLTDataOriginSample added + * kAliHLTDataOriginEMCAL added + * kAliHLTDataTypeRunType added + * 7 kAliHLTDataTypeComponentStatistics, kAliHLTDataTypeComponentTable, + * and AliHLTComponentStatistics have been added for optional + * component block statistics + * 8 new wrapper interface has been introduced, old wrapper interface + * deprecated but kept for backward compatibility, the PubSub + * interface is going to be compiled independently of AliHLT, new + * interface provided by the libHLTinterface.so + * AliHLTComponentEnvironment -> AliHLTAnalysisEnvironment + * 9 added data types for arrays of AliHLTExternalTrackParam sets and + * TClonesArrays of AliExternalTrackParam objects. + * 10 Changes for information objects neededfor running with offline + * chains and analysis tasks. + * kAliHLTMCObjectDataType added + * kAliHLTDataOriginOffline added + * kAliHLTDataOriginHLT added + * 11 extended AliHLTComponentStatistics: one more member to store the + * cycle time between events per component. + * 12 added common data type id 'CLUSTERS' + * added data type 'ECSPARAM' for the full ECS parameter string to + * be sebt during SOR + * added kAliHLTDataTypeTrackMC (TRACK_MC) data type + * added data types (note: interface version stays the same + * kAliHLTDataTypeDAQRDOUT (DAQRDOUT) + * kAliHLTDataTypeTriggerDecision (TRIG_DEC) + * kAliHLTDataTypeGlobalTrigger (GLOBTRIG) + * kAliHLTDataTypeStreamerInfo (ROOTSTRI) + * 13 Changed AliHLTEventDDL to now contain 31 words. The extra word is + * for the EMCAL detector, which needs 46 DDLs after DCAL was added. + * 14 Adding new data block type for HLT global trigger counters. + * Adding data block type for ESD content + * Adding data block type for forwarded component table blocks + * Adding new event type for software triggers. + * 15 Modifying data block types for trigger counter blocks. + * 16 Adding data type for the meta data block to be forwarded by the + * TCPDumpSubscriber for the Common Data Header (CDH) and readout + * list information. */ -#define ALIHLT_DATA_TYPES_VERSION 6 +#define ALIHLT_DATA_TYPES_VERSION 16 ////////////////////////////////////////////////////////////////////////// // @@ -42,7 +81,7 @@ // the operator| // // AliHLTComponentDataType dt; -// dt = kAliHLTDataTypeDDLRaw | gkAliHLTDataOriginTPC; +// dt = kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC; // ////////////////////////////////////////////////////////////////////////// @@ -71,6 +110,17 @@ const int kAliHLTComponentDataTypefOriginSize=4; */ extern const char kAliHLTDataOriginOut[kAliHLTComponentDataTypefOriginSize]; +/** Data origin HLT, used for HLT specifc data + * in offline chains. This not a bug! + * @ingroup alihlt_component_datatypes + */ +extern const char kAliHLTDataOriginHLT[kAliHLTComponentDataTypefOriginSize]; + +/** Data origin Offline + * @ingroup alihlt_component_datatypes + */ +extern const char kAliHLTDataOriginOffline[kAliHLTComponentDataTypefOriginSize]; + /** Data origin HLT/PubSub private internal * @ingroup alihlt_component_datatypes */ @@ -86,6 +136,11 @@ extern const char kAliHLTDataOriginTPC[kAliHLTComponentDataTypefOriginSize]; */ extern const char kAliHLTDataOriginPHOS[kAliHLTComponentDataTypefOriginSize]; +/** Data origin FMD + * @ingroup alihlt_component_datatypes + */ +extern const char kAliHLTDataOriginFMD[kAliHLTComponentDataTypefOriginSize]; + /** Data origin MUON * @ingroup alihlt_component_datatypes */ @@ -101,6 +156,82 @@ extern const char kAliHLTDataOriginTRD[kAliHLTComponentDataTypefOriginSize]; */ extern const char kAliHLTDataOriginITS[kAliHLTComponentDataTypefOriginSize]; +/** Data origin ITSOut + * @ingroup alihlt_component_datatypes + */ +extern const char kAliHLTDataOriginITSOut[kAliHLTComponentDataTypefOriginSize]; + +/** Data origin ITS SPD + * @ingroup alihlt_component_datatypes + */ +extern const char kAliHLTDataOriginITSSPD[kAliHLTComponentDataTypefOriginSize]; + +/** Data origin ITS SDD + * @ingroup alihlt_component_datatypes + */ +extern const char kAliHLTDataOriginITSSDD[kAliHLTComponentDataTypefOriginSize]; + +/** Data origin ITS SSD + * @ingroup alihlt_component_datatypes + */ +extern const char kAliHLTDataOriginITSSSD[kAliHLTComponentDataTypefOriginSize]; + +/** Data origin for examples + * @ingroup alihlt_component_datatypes + */ +extern const char kAliHLTDataOriginSample[kAliHLTComponentDataTypefOriginSize]; + +/** Data origin EMCAL + * @ingroup alihlt_component_datatypes + */ +extern const char kAliHLTDataOriginEMCAL[kAliHLTComponentDataTypefOriginSize]; + +/** Data origin TOF + * @ingroup alihlt_component_datatypes + */ +extern const char kAliHLTDataOriginTOF[kAliHLTComponentDataTypefOriginSize]; + +/** Data origin HMPID + * @ingroup alihlt_component_datatypes + */ +extern const char kAliHLTDataOriginHMPID[kAliHLTComponentDataTypefOriginSize]; + +/** Data origin CPV + * @ingroup alihlt_component_datatypes + */ +extern const char kAliHLTDataOriginCPV[kAliHLTComponentDataTypefOriginSize]; + +/** Data origin PMD + * @ingroup alihlt_component_datatypes + */ +extern const char kAliHLTDataOriginPMD[kAliHLTComponentDataTypefOriginSize]; + +/** Data origin T0 + * @ingroup alihlt_component_datatypes + */ +extern const char kAliHLTDataOriginT0[kAliHLTComponentDataTypefOriginSize]; + +/** Data origin VZERO + * @ingroup alihlt_component_datatypes + */ +extern const char kAliHLTDataOriginVZERO[kAliHLTComponentDataTypefOriginSize]; + +/** Data origin ZDC + * @ingroup alihlt_component_datatypes + */ +extern const char kAliHLTDataOriginZDC[kAliHLTComponentDataTypefOriginSize]; + +/** Data origin ACORDE + * @ingroup alihlt_component_datatypes + */ + +extern const char kAliHLTDataOriginACORDE[kAliHLTComponentDataTypefOriginSize]; + +/** Data origin TRG + * @ingroup alihlt_component_datatypes + */ +extern const char kAliHLTDataOriginTRG[kAliHLTComponentDataTypefOriginSize]; + ////////////////////////////////////////////////////////////////////////// // // HLT common data type defines @@ -118,7 +249,12 @@ const int kAliHLTComponentDataTypefIDsize=8; */ # define kAliHLTVoidDataTypeID "\0\0\0\0\0\0\0" -/** special id for any data type id +/** special id for all data types: any + void + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTAllDataTypesID "ALLDATA" + +/** special id for any valid data type id * @ingroup alihlt_component_datatypes */ # define kAliHLTAnyDataTypeID "*******" @@ -128,6 +264,13 @@ const int kAliHLTComponentDataTypefIDsize=8; */ # define kAliHLTDDLRawDataTypeID {'D','D','L','_','R','A','W',' '} +/** CLUSTERS data + * Common data type for the output of cluster finders, the exact + * format depends on the origin (detector) + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTClustersDataTypeID {'C','L','U','S','T','E','R','S'} + /** calibration data for file exchange subscriber * @ingroup alihlt_component_datatypes */ @@ -145,18 +288,41 @@ const int kAliHLTComponentDataTypefIDsize=8; */ # define kAliHLTEORDataTypeID {'E','N','D','O','F','R','U','N'} +/** run type data block + * string with run type as payload + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTRunTypeDataTypeID {'R','U','N','T','Y','P','E',' '} + /** DDL list event * @ref AliHLTEventDDL * @ingroup alihlt_component_datatypes */ # define kAliHLTDDLDataTypeID {'D','D','L','L','I','S','T',' '} +/** DAQ readout list + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTDAQRDOUTDataTypeID "DAQRDOUT" + +/** HLT readout list. + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTReadoutListDataTypeID {'H','L','T','R','D','L','S','T'} + /** EventType event * - empty payload, specification gives eventType * @ingroup alihlt_component_datatypes */ # define kAliHLTEventDataTypeID {'E','V','E','N','T','T','Y','P'} +/** ECS parameter event + * - sent during the SOR event by the framework + * - contains the full ECS parameter string + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTECSParamDataTypeID {'E','C','S','P','A','R','A','M'} + /** ComponentConfiguration event * - payload contains the CDB path as string * @ingroup alihlt_component_datatypes @@ -169,6 +335,46 @@ const int kAliHLTComponentDataTypefIDsize=8; */ # define kAliHLTUpdtDCSDataTypeID {'U','P','D','T','_','D','C','S'} +/** MC data block + * an AliMCEvent object of varying origin + * The 'V0' at the end allows a versioning + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTMCObjectDataTypeID {'A','L','I','M','C','_','V','0'} + +/** ESDVertex data block + * an AliESDVertex object of varying origin + * The 'V0' at the end allows a versioning + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTESDVertexDataTypeID {'E','S','D','V','T','X','V','0'} + +/** KFVertex data block + * an AliKFVertex object of varying origin + * The 'V0' at the end allows a versioning + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTKFVertexDataTypeID {'A','L','I','K','F','V','V','0'} + + +/** output of the GlobalVertexer data block + * The 'V0' at the end allows a versioning + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTDataTypeGlobalVertexerID {'G','L','B','V','T','X','V','0'} + +/** output of the PrimaryFinder data block + * The 'V0' at the end allows a versioning + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTDataTypePrimaryFinderID {'P','R','I','V','T','X','V','0'} + +/** output of the V0Finder data block + * The 'V0' at the end allows a versioning + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTDataTypeV0FinderID {'V','0','S','V','T','X','V','0'} + /** ESD data block * an AliESD object of varying origin * The 'V0' at the end allows a versioning @@ -176,6 +382,12 @@ const int kAliHLTComponentDataTypefIDsize=8; */ # define kAliHLTESDObjectDataTypeID {'A','L','I','E','S','D','V','0'} +/** ESD + * data blocks designated for the ESD + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTESDContentDataTypeID {'E','S','D','_','C','O','N','T'} + /** ESD tree data block * TTree with an AliESD object of varying origin * @ingroup alihlt_component_datatypes @@ -192,7 +404,7 @@ const int kAliHLTComponentDataTypefIDsize=8; * - the rec points tree of an AliRoot module * @ingroup alihlt_component_datatypes */ -#define kAliHLTTreeRDataTypeID {'A','L','I','T','R','E','E','D'} +#define kAliHLTTreeRDataTypeID {'A','L','I','T','R','E','E','R'} /** HW Address selection data block * - a selection list for 16 bit HW addresses @@ -229,6 +441,38 @@ const int kAliHLTComponentDataTypefIDsize=8; */ # define kAliHLTRunSummaryDataTypeID {'R','U','N','S','U','M','M','A'} +/** Trigger decision + * - origin : kAliHLTDataOriginOut ( HLT ) + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTTriggerDecisionDataTypeID {'T','R','I','G','_','D','E','C'} + +/** Global trigger decision + * - origin : kAliHLTDataOriginOut ( HLT ) + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTGlobalTriggerDataTypeID {'G','L','O','B','T','R','I','G'} + +/** Block Statistics + * - small block statistics info added to the data stream by + * the component base class + * - origin kAliHLTDataOriginPrivate + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTComponentStatisticsDataTypeID {'C','O','M','P','S','T','A','T'} + +/** Component table + * - list of components in the chain to be percolated through the chain + * - each component adds it's chain id string and a generated 32bit id + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTComponentTableDataTypeID {'C','O','M','P','T','A','B','L'} + +/** Forwarded component table + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTComponentFwdTableDataTypeID {'C','O','M','P','T','A','B','F'} + /** general ROOT TObject * - a general TObject exported from the HLT analysis * - varying origin @@ -236,6 +480,13 @@ const int kAliHLTComponentDataTypefIDsize=8; */ #define kAliHLTTObjectDataTypeID {'R','O','O','T','T','O','B','J'} +/** ROOT streamer info + * - used for the transmission of streamer info for objects in the HLTOUT + * - origin kAliHLTDataOriginOut ( HLT ) + * @ingroup alihlt_component_datatypes + */ +#define kAliHLTStreamerInfoDataTypeID {'R','O','O','T','S','T','R','I'} + /** ROOT TObjArray * - a TObjArray exported from the HLT analysis * - varying origin @@ -265,7 +516,57 @@ const int kAliHLTComponentDataTypefIDsize=8; */ #define kAliHLTTNtupleDataTypeID {'R','O','O','T','T','U','P','L'} -using namespace std; +/** HLT Track + * - Struct for Tracks based on AliExternalTrackParam + * - varying origin + * @ingroup alihlt_component_datatypes + */ +#define kAliHLTTrackDataTypeID {'H','L','T','T','R','A','C','K'} + +/** Track Monte Carlo information + * @ingroup alihlt_component_datatypes + */ +#define kAliHLTTrackMCDataTypeID {'T','R','A','C','K','_','M','C'} + +/** TClonesArray of AliExternalTrackParam + * @ingroup alihlt_component_datatypes + */ +#define kAliHLTExternalTrackParamDataTypeID {'T','C','A','E','X','T','T','R'} + +/** HLT Jet + * - Struct for jets based on AliHLTJETJets + * - varying origin + * @ingroup alihlt_component_datatypes + */ +#define kAliHLTJetDataTypeID {'H','L','T','J','E','T','V','0'} + +/** dEdx data + * Common data type for the dEdx + * format depends on the origin (detector) + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTdEdxDataTypeID {'D','E','D','X',' ',' ',' ',' '} + +/** dNdPt data + * Common data type for the dNdPt output object + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTdNdPtDataTypeID {'D','N','D','P','T',' ',' ',' '} + +/** Global input trigger counters data block type. + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTInputTriggerCountersDataTypeID {'I','N','T','R','G','C','N','T'} + +/** Global output trigger counters data block type. + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTOutputTriggerCountersDataTypeID {'O','T','T','R','G','C','N','T'} + +/** Generic meta data block type ID. + * @ingroup alihlt_component_datatypes + */ +# define kAliHLTMetaDataTypeID {'M','E','T','A','D','A','T','A'} extern "C" { ////////////////////////////////////////////////////////////////////////// @@ -328,7 +629,7 @@ extern "C" { kHLTLogAll = 0x7f, /** the default logging filter */ kHLTLogDefault = 0x79 -}; + }; ////////////////////////////////////////////////////////////////////////// // @@ -342,11 +643,11 @@ extern "C" { */ struct AliHLTComponentEventData { - AliHLTUInt32_t fStructSize; - AliHLTEventID_t fEventID; - AliHLTUInt32_t fEventCreation_s; - AliHLTUInt32_t fEventCreation_us; - AliHLTUInt32_t fBlockCnt; + AliHLTUInt32_t fStructSize; /// Size of this structure in bytes. + AliHLTEventID_t fEventID; /// 64 bit event ID number. + AliHLTUInt32_t fEventCreation_s; /// Event creation time in seconds (Should be added to fEventCreation_us*1e6). + AliHLTUInt32_t fEventCreation_us; /// Fractional event creation time in micro seconds. + AliHLTUInt32_t fBlockCnt; /// The number of raw data blocks received by the component. }; /** @@ -356,9 +657,9 @@ extern "C" { */ struct AliHLTComponentShmData { - AliHLTUInt32_t fStructSize; - AliHLTUInt32_t fShmType; - AliHLTUInt64_t fShmID; + AliHLTUInt32_t fStructSize; /// Size of this structure in bytes. + AliHLTUInt32_t fShmType; /// The type code of the shared memory. + AliHLTUInt64_t fShmID; /// The shared memory identifier. }; /** @@ -382,9 +683,9 @@ extern "C" { */ struct AliHLTComponentDataType { - AliHLTUInt32_t fStructSize; - char fID[kAliHLTComponentDataTypefIDsize]; //! - char fOrigin[kAliHLTComponentDataTypefOriginSize]; //! + AliHLTUInt32_t fStructSize; /// Size of this structure in bytes. + char fID[kAliHLTComponentDataTypefIDsize]; /// Data type identifier. + char fOrigin[kAliHLTComponentDataTypefOriginSize]; /// Subsystem or detector origin of the data. }; /** @@ -401,20 +702,23 @@ extern "C" { */ struct AliHLTComponentBlockData { - /* size and version of the struct */ + /** size and version of the struct */ AliHLTUInt32_t fStructSize; - /* shared memory key, ignored by processing components */ + /** shared memory key, ignored by processing components */ AliHLTComponentShmData fShmKey; - /* offset of output data relative to the output buffer */ + /** offset of output data relative to the output buffer */ AliHLTUInt32_t fOffset; - /* start of the data for input data blocks, fOffset to be ignored*/ + /** start of the data for input data blocks, fOffset to be ignored*/ void* fPtr; - /* size of the data block */ + /** size of the data block */ AliHLTUInt32_t fSize; - /* data type of the data block */ + /** data type of the data block */ AliHLTComponentDataType fDataType; - /* data specification of the data block */ + /** data specification of the data block */ AliHLTUInt32_t fSpecification; + + AliHLTComponentDataType GetDataType() const {return fDataType;} + AliHLTUInt32_t GetSpecification() const {return fSpecification;} }; /** @@ -423,21 +727,88 @@ extern "C" { */ struct AliHLTComponentEventDoneData { - AliHLTUInt32_t fStructSize; - AliHLTUInt32_t fDataSize; - void* fData; + AliHLTUInt32_t fStructSize; /// Size of this structure in bytes. + AliHLTUInt32_t fDataSize; /// Size of the data section (following this data member) in bytes. + void* fData; /// Start of the data section. }; /** * @struct AliHLTRunDesc * Event descriptor. - * The struct is send with the SOR and EOR events. + * The struct is sent with the SOR and EOR events. + * + * @note + * The name of the member fRunType is a bit misleading. This is not + * the ALICE Run Type given by the ECS to the sub-system. The member + * is an internal HLT run type and a combination of the HLT running + * mode and the beam type. + *
+   * Bit 0-2:   beam type identifier
+   * Bit 3-31:  HLT mode
+   * 
*/ struct AliHLTRunDesc { - AliHLTUInt32_t fStructSize; - AliHLTUInt32_t fRunNo; - AliHLTUInt32_t fRunType; + AliHLTUInt32_t fStructSize; /// Size of this structure in bytes. + AliHLTUInt32_t fRunNo; /// The run number for the current active run. + AliHLTUInt32_t fRunType; /// The HLT run type. + }; + + /** + * @struct AliHLTComponentStatistics + * Small block size summary added by the AliHLTComponent base class + * if component statistics are enabled (--enable-compstat). + * + * fLevel is retrieved from incoming block statistics and incremented. + * Incoming block statistics are appended to the newly added one if + * --enable-compstat=full has been chosen. + * + * ChangeLog: + * 2009-01-14 fComponentCycleTime added + */ + struct AliHLTComponentStatistics + { + AliHLTUInt32_t fStructSize; /// Size of this structure in bytes. + AliHLTUInt32_t fLevel; /// Indicates from which processing stage this information is from. + AliHLTUInt32_t fId; /// Unique identifier for the chain based on CRC code. + AliHLTUInt32_t fTime; /// Real wall time used to process the data (micro seconds). + AliHLTUInt32_t fCTime; /// CPU time used to process the data (micro seconds). + AliHLTUInt32_t fInputBlockCount; /// Number of input data blocks. + AliHLTUInt32_t fTotalInputSize; /// Total size in bytes of input data. + AliHLTUInt32_t fOutputBlockCount; /// Number of output data blocks. + AliHLTUInt32_t fTotalOutputSize; /// Total size in bytes of output data. + AliHLTUInt32_t fComponentCycleTime; /// Real wall time indicating the start of the data processing (micro seconds). + }; + + /** + * @struct AliHLTComponentTableEntry + * Structure to be send on SOR event through the chain. + * The 'length' of the structure is variable and depends on the length + * of the buffer at the end. + * + * ComponentTableEntries are sent with data type @ref kAliHLTDataTypeComponentTable + * and are identified by a 32bit Id specification generated by a CRC + * algorithm from the chain Id of the component. This is not a 100% unique + * id but with a high probability. This approach accounts for the fact + * that all components are separated processes. + * + * The buffer consists of an array of 32bit Ids containing the Ids of + * all direct parents taken from the specification of the data blocks. + * The number of parents is stored in fNofParents. Each component forwards the + * incoming component table entries with data type @ref kAliHLTDataTypeComponentFwdTable + * by that the direct parents can be identified. + * + * Following this array a description string contains the chain id, component args, and + * maybe more properties in the future. The current format is + * 'chain_id{component_id:component args}' e.g. TPC-CF_00_0{TPCClusterFinder32Bit:-deconvolute-time} + */ + struct AliHLTComponentTableEntry + { + AliHLTUInt32_t fStructSize; /// Size of this structure in bytes. + AliHLTUInt32_t fLevel; /// Indicates from which processing stage this information is from. + AliHLTUInt16_t fNofParents; /// size of the array of parent ids + AliHLTUInt8_t fSizeDescription; /// size of the description string in the appended buffer + AliHLTUInt8_t fBuffer[1]; /// the strings: chain id, component args, reserved }; ////////////////////////////////////////////////////////////////////////// @@ -450,38 +821,65 @@ extern "C" { const int gkAliHLTBlockDAttributeCount = 8; /** field size of fCommonHeader */ - const int gkAliHLTCommonHeaderCount = 8; + const int gkAliHLTCommonHeaderCount = 8; + + /** size of the DDL list first version */ + const int gkAliHLTDDLListSizeV0 = 30; + + /** size of the DDL list after DCAL added to EMCAL */ + const int gkAliHLTDDLListSizeV1 = 31; /** size of the DDL list */ - const int gkAliHLTDDLListSize = 30; + const int gkAliHLTDDLListSize = gkAliHLTDDLListSizeV1; /** Number of Trigger Classes of CTP in CDH */ const int gkNCTPTriggerClasses = 50; /** - * @struct AliHLTEventDDL - * DDL list event. + * @struct AliHLTEventDDLV0 + * First version of the DDL list event. * The struct is send with the DDLLIST event. * Used in the trigger structure for internal apperance of * the DLLs as well as for the HLT readout list send to DAQ * ( as DataType : kAliHLTDataTypeDDL ) */ - struct AliHLTEventDDL + struct AliHLTEventDDLV0 { - AliHLTUInt32_t fCount; - AliHLTUInt32_t fList[gkAliHLTDDLListSize]; + AliHLTUInt32_t fCount; /// Indicates the number of words in fList. + AliHLTUInt32_t fList[gkAliHLTDDLListSizeV0]; /// The list of DDL enable/disable bits. }; + /** + * @struct AliHLTEventDDLV1 + * DDL list event structure with extra word for DCAL bits. + */ + struct AliHLTEventDDLV1 + { + AliHLTUInt32_t fCount; /// Indicates the number of words in fList. + AliHLTUInt32_t fList[gkAliHLTDDLListSizeV1]; /// The list of DDL enable/disable bits. + }; + + /** + * @typedef AliHLTEventDDL + * Current used default version of the AliHLTEventDDL structure. + */ + typedef AliHLTEventDDLV1 AliHLTEventDDL; + /** * @struct AliHLTEventTriggerData */ struct AliHLTEventTriggerData { - AliHLTUInt8_t fAttributes[gkAliHLTBlockDAttributeCount]; - AliHLTUInt64_t fHLTStatus; // Bit field - AliHLTUInt32_t fCommonHeaderWordCnt; - AliHLTUInt32_t fCommonHeader[gkAliHLTCommonHeaderCount]; - AliHLTEventDDL fReadoutList; + AliHLTUInt8_t fAttributes[gkAliHLTBlockDAttributeCount]; /// List of data block attibutes. + AliHLTUInt64_t fHLTStatus; /// Bit field + AliHLTUInt32_t fCommonHeaderWordCnt; /// Number of words in fCommonHeader. + AliHLTUInt32_t fCommonHeader[gkAliHLTCommonHeaderCount]; /// The common header words. + union + { + AliHLTEventDDL fReadoutList; /// The default readout list structure. + AliHLTEventDDLV0 fReadoutListV0; /// Access to the old version of the readout list structure. + AliHLTEventDDLV1 fReadoutListV1; /// Access to the readout list structure with DCAL included. + }; }; /** @@ -490,9 +888,9 @@ extern "C" { */ struct AliHLTComponentTriggerData { - AliHLTUInt32_t fStructSize; - AliHLTUInt32_t fDataSize; - void* fData; + AliHLTUInt32_t fStructSize; /// Size of this structure in bytes. + AliHLTUInt32_t fDataSize; /// Size of the data section (following this data member) in bytes. + void* fData; /// Start of the data section. }; ////////////////////////////////////////////////////////////////////////// @@ -513,6 +911,8 @@ extern "C" { const AliHLTUInt32_t gkAliEventTypeCorruptID=8; /** Calibration eventType specification */ const AliHLTUInt32_t gkAliEventTypeCalibration=16; + /** Software eventType specification */ + const AliHLTUInt32_t gkAliEventTypeSoftware=24; /** DataReplay eventType specification */ const AliHLTUInt32_t gkAliEventTypeDataReplay=32; /** Configuration eventType specification */ @@ -540,6 +940,21 @@ extern "C" { */ const AliHLTUInt32_t kAliHLTVoidDataSpec = ~(AliHLTUInt32_t)0; + /** invalid run no + * @ingroup alihlt_component_datatypes + */ + const AliHLTUInt32_t kAliHLTVoidRunNo = ~(AliHLTUInt32_t)0; + + /** invalid run type + * @ingroup alihlt_component_datatypes + */ + const AliHLTUInt32_t kAliHLTVoidRunType = ~(AliHLTUInt32_t)0; + + /** invalid run descriptor + * @ingroup alihlt_component_datatypes + */ + const AliHLTRunDesc kAliHLTVoidRunDesc={sizeof(AliHLTRunDesc), kAliHLTVoidRunNo, kAliHLTVoidRunType}; + /** invalid shared memory type */ const AliHLTUInt32_t gkAliHLTComponentInvalidShmType = 0; @@ -555,6 +970,15 @@ extern "C" { kAliHLTDataOriginVoid }; + /** all data types, means any + void data type + * @ingroup alihlt_component_datatypes + */ + const AliHLTComponentDataType kAliHLTAllDataTypes = { + sizeof(AliHLTComponentDataType), + kAliHLTAllDataTypesID, + kAliHLTDataOriginAny + }; + // there is currently a problem with rootcint if the predefined ids // (commented below) are used. rootcint does not find the id if they // are char arrays defined with {} and individual chars. If strings @@ -583,6 +1007,18 @@ extern "C" { */ extern const AliHLTComponentDataType kAliHLTDataTypeDDL; + /** DAQ readout list + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeDAQRDOUT; + + /** CLUSTERS data + * Common data type for the output of cluster finders, the exact + * format depends on the origin (detector) + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeClusters; + /** SOR data type * @ingroup alihlt_component_datatypes */ @@ -593,11 +1029,23 @@ extern "C" { */ extern const AliHLTComponentDataType kAliHLTDataTypeEOR; + /** Run type data block + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeRunType; + /** Event type specification * @ingroup alihlt_component_datatypes */ extern const AliHLTComponentDataType kAliHLTDataTypeEvent; + /** ECS parameter event + * - sent during the SOR event by the framework + * - contains the full ECS parameter string + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeECSParam; // {ECSPARAM:PRIV} + /** Configuration event data type * @ingroup alihlt_component_datatypes */ @@ -613,13 +1061,47 @@ extern "C" { */ extern const AliHLTComponentDataType kAliHLTDataTypeDDLRaw; + /** AliMCEvent object data specification, origin is 'OFFL' + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeMCObject; + + /** ESD vertex object data specification, origin is 'any' + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeESDVertex; + + /** KF vertex object data specification, origin is 'any' + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeKFVertex; + + /** global vertexer data specification, origin is 'any' + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeGlobalVertexer; + + /** primary finder data specification, origin is 'any' + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypePrimaryFinder; + + /** primary finder data specification, origin is 'any' + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeV0Finder; + /** ESD object data specification, origin is 'any' * @ingroup alihlt_component_datatypes */ extern const AliHLTComponentDataType kAliHLTDataTypeESDObject; + /** ESD content data specification, origin is 'any' + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeESDContent; + /** ESD Tree data specification, origin is 'any' - * @ingroup alihlt_component_datatypes */ extern const AliHLTComponentDataType kAliHLTDataTypeESDTree; @@ -654,11 +1136,55 @@ extern "C" { */ extern const AliHLTComponentDataType kAliHLTDataTypeRunStatistics; - /** Event summary + /** Run summary * @ingroup alihlt_component_datatypes */ extern const AliHLTComponentDataType kAliHLTDataTypeRunSummary; + /** Trigger decision + * - origin : kAliHLTDataOriginOut ( HLT ) + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeTriggerDecision; // {TRIG_DEC:HLT } + + /** Trigger decision + * - origin : kAliHLTDataOriginOut ( HLT ) + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeReadoutList; // {HLTRDLST:HLT } + + /** Global trigger decision + * - origin : kAliHLTDataOriginOut ( HLT ) + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeGlobalTrigger; // {GLOBTRIG:HLT } + + /** Component block statistics + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeComponentStatistics; + + /** Component table + * To be sent on SOR event, each component adds it's chain id string + * and a generated 32bit identifier to the table + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeComponentTable; + + /** Forwarded component table + * To be sent on SOR event, each component forwards blocks of type + * @ref kAliHLTDataTypeComponentTable was kAliHLTDataTypeComponentFwdTable + * after adding the parent ids to its own table struct. + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeComponentFwdTable; + + /** + * Data type for the Common Data Header and readout list information sent by TCPDumpSubscriber. + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeTriggerMetaBlock; // {METADATA:PRIV} + ////////////////////////////////////////////////////////////////////////// // // Data Types for Monitoring objects @@ -669,6 +1195,11 @@ extern "C" { * @ingroup alihlt_component_datatypes */ extern const AliHLTComponentDataType kAliHLTDataTypeTObject; // {ROOTTOBJ,"***"} + + /** ROOT streamer info + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeStreamerInfo; // {ROOTSTRI,HLT } /** ROOT TObjArray * @ingroup alihlt_component_datatypes @@ -690,6 +1221,62 @@ extern "C" { */ extern const AliHLTComponentDataType kAliHLTDataTypeTNtuple; // {ROOTTUPL,"***"} + /** Global input trigger counters. + * - origin : kAliHLTDataOriginOut ( HLT ) + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeInputTriggerCounters; // {INTRGCNT:HLT } + + /** Global output trigger counters. + * - origin : kAliHLTDataOriginOut ( HLT ) + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeOutputTriggerCounters; // {OTTRGCNT:HLT } + + /** General track array for the barrel tracks based on AliExternalTrackParam + * Data format defined by AliHLTTracksData + * + * We follow the naming scheme of AliESDEvent where 'Tracks' denote the + * barrel tracks and detector tracks get names 'DETTracks' + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeTrack; // {HLTTRACK,"***"} + + /** Track Monte Carlo information + */ + extern const AliHLTComponentDataType kAliHLTDataTypeTrackMC; // {TRACK_MC,"***"} + + /** TClonesArray of AliExternalTrackParam + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeExternalTrackParam; // {TCAEXTTR,"***"} + + /** Container containing jets (AliHLTJETJets) + * Containing TClonesArray of AliAODJets + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeJet; // {HLTJETV0,"***"} + + /** Container of ITS tracks + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType fgkITSTracksDataType; + + /** Container of calorimeter clusters + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeCaloCluster; + + /** Container of dEdx + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypedEdx; + + /** Container of dNdPt + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypedNdPt; + ////////////////////////////////////////////////////////////////////////// // // FXS subscriber meta information @@ -703,11 +1290,11 @@ extern "C" { /** Header in front of the data payload, in order to sent data to the FXS. */ struct AliHLTFXSHeader { - AliHLTUInt32_t fHeaderVersion; - AliHLTUInt32_t fRunNumber; - char fOrigin[gkAliHLTFXSHeaderfOriginSize]; - char fFileID[gkAliHLTFXSHeaderfFileIDSize]; - char fDDLNumber[gkAliHLTFXSHeaderfDDLNumberSize]; + AliHLTUInt32_t fHeaderVersion; /// HLT software version number. + AliHLTUInt32_t fRunNumber; /// The current run number. + char fOrigin[gkAliHLTFXSHeaderfOriginSize]; /// The detector from which the FXS data is received. + char fFileID[gkAliHLTFXSHeaderfFileIDSize]; /// File identifier for the stored data. + char fDDLNumber[gkAliHLTFXSHeaderfDDLNumberSize]; /// The DDL bits. }; ////////////////////////////////////////////////////////////////////////// @@ -716,6 +1303,9 @@ extern "C" { // ////////////////////////////////////////////////////////////////////////// + /** definition of a void fct pointer */ + typedef void (*AliHLTfctVoid)(); + /** logging function */ typedef int (*AliHLTfctLogging)( void* param, AliHLTComponentLogSeverity severity, @@ -724,32 +1314,142 @@ extern "C" { const char* message); /** - * @struct AliHLTComponentEnvironment + * @struct AliHLTAnalysisEnvironment * Running environment for analysis components. - * The struct describes function callbacks for + * The struct describes function callbacks for actions to be + * carried out by the calling framework, like memory allocation, + * property callbecks, logging, etc. + * + * @ingroup alihlt_wrapper_interface */ - struct AliHLTComponentEnvironment + struct AliHLTAnalysisEnvironment { + /** size of the structure */ AliHLTUInt32_t fStructSize; + + /** the component parameter given by the framework on creation */ void* fParam; + + /** allocated memory */ void* (*fAllocMemoryFunc)( void* param, unsigned long size ); + + /** allocate an EventDoneData structure. */ + int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd ); + + /** logging callback */ + AliHLTfctLogging fLoggingFunc; + }; #if 0 - // future addition already foreseen/envisioned - // IMPORTANT: don not just remove the defines as this breaks the binary - // compatibility - int (*fAllocShmMemoryFunc)( void* param, unsigned long size, AliHLTComponentBlockData* blockLocation ); + // I just keep this as a note pad. Has to be added to the end of the structure + // future addition already foreseen/envisioned + // IMPORTANT: don not just remove the defines as this breaks the binary + // compatibility + int (*fAllocShmMemoryFunc)( void* param, unsigned long size, AliHLTComponentBlockData* blockLocation ); #endif + + /** + * @struct AliHLTComponentEnvironment + * This was the original definition of the running environment. + * Due to a bug in the AliRootWrapperSubscriber/SimpleComponentWrapper, + * this structure can not be used any longer but is kept for backward + * compatibility. + * @note The external interface provided by the libHLTbase is now kept + * frozen but should not be used any more. Use the interface provided + * by the libHLTinterface library. + * + * @ingroup alihlt_wrapper_interface_deprecated + */ + struct AliHLTComponentEnvironment + { + AliHLTUInt32_t fStructSize; + void* fParam; + void* (*fAllocMemoryFunc)( void* param, unsigned long size ); int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd ); AliHLTfctLogging fLoggingFunc; }; + + ////////////////////////////////////////////////////////////////////////// + // + // The external interface definition + // + ////////////////////////////////////////////////////////////////////////// + + /** + * The component handle. + * Used as indification in the outside world. + * @ingroup alihlt_wrapper_interface + */ + typedef void* AliHLTComponentHandle; + + /** @ingroup alihlt_wrapper_interface */ + const AliHLTComponentHandle kEmptyHLTComponentHandle = 0; + + /** + * Get a system call of the interface. + * @param function signature + * @return pointer to system call + * @ingroup alihlt_wrapper_interface + */ + typedef void* (*AliHLTAnalysisFctGetInterfaceCall)(const char*); + +# define ALIHLTANALYSIS_INTERFACE_LIBRARY "libHLTinterface.so" +# define ALIHLTANALYSIS_FCT_GETINTERFACECALL "AliHLTAnalysisGetInterfaceCall" + + /** @ingroup alihlt_wrapper_interface */ + typedef int (*AliHLTExtFctInitSystem)( unsigned long version, AliHLTAnalysisEnvironment* externalEnv, unsigned long runNo, const char* runType ); + + /** @ingroup alihlt_wrapper_interface */ + typedef int (*AliHLTExtFctDeinitSystem)(); + + /** @ingroup alihlt_wrapper_interface */ + typedef int (*AliHLTExtFctLoadLibrary)( const char* ); + + /** @ingroup alihlt_wrapper_interface */ + typedef int (*AliHLTExtFctUnloadLibrary)( const char* ); + + /** @ingroup alihlt_wrapper_interface */ + typedef int (*AliHLTExtFctCreateComponent)( const char*, void*, int, const char**, AliHLTComponentHandle*, const char* description ); + + /** @ingroup alihlt_wrapper_interface */ + typedef int (*AliHLTExtFctDestroyComponent)( AliHLTComponentHandle ); + + /** @ingroup alihlt_wrapper_interface */ + typedef int (*AliHLTExtFctProcessEvent)( AliHLTComponentHandle, const AliHLTComponentEventData*, const AliHLTComponentBlockData*, + AliHLTComponentTriggerData*, AliHLTUInt8_t*, + AliHLTUInt32_t*, AliHLTUInt32_t*, + AliHLTComponentBlockData**, + AliHLTComponentEventDoneData** ); + + /** @ingroup alihlt_wrapper_interface */ + typedef int (*AliHLTExtFctGetOutputDataType)( AliHLTComponentHandle, AliHLTComponentDataType* ); + + /** @ingroup alihlt_wrapper_interface */ + typedef int (*AliHLTExtFctGetOutputSize)( AliHLTComponentHandle, unsigned long*, double* ); + } +using namespace std; + ////////////////////////////////////////////////////////////////////////// // // Data type helper functions // ////////////////////////////////////////////////////////////////////////// +/** exact comparison of HLT component data types + * @ingroup alihlt_component_datatypes + */ +inline bool MatchExactly( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 ) +{ + for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ ) + if ( dt1.fID[i] != dt2.fID[i] ) + return false; + for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) + if ( dt1.fOrigin[i] != dt2.fOrigin[i] ) + return false; + return true; +} + /** Comparison operator for HLT component data types. * The operator takes wildcards into account, i.e. the ::kAliHLTAnyDataType, * ::kAliHLTAnyDataTypeID and ::kAliHLTDataOriginAny definitions. @@ -757,6 +1457,9 @@ extern "C" { */ inline bool operator==( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 ) { + if (MatchExactly(dt1, kAliHLTAllDataTypes)) return true; + if (MatchExactly(dt2, kAliHLTAllDataTypes)) return true; + bool any1=true, any2=true, void1=true, void2=true, match=true; for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) { any1&=(dt1.fOrigin[i]==kAliHLTDataOriginAny[i]); @@ -790,29 +1493,44 @@ inline bool operator!=( const AliHLTComponentDataType& dt1, const AliHLTComponen return !(dt1==dt2); } -/** exact comparison of HLT component data types +/** merge operator for HLT component data types and origins * @ingroup alihlt_component_datatypes */ -inline bool MatchExactly( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 ) +inline AliHLTComponentDataType operator|(const AliHLTComponentDataType srcdt, const char origin[kAliHLTComponentDataTypefOriginSize]) { - for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ ) - if ( dt1.fID[i] != dt2.fID[i] ) - return false; + AliHLTComponentDataType dt=srcdt; for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) - if ( dt1.fOrigin[i] != dt2.fOrigin[i] ) - return false; - return true; + dt.fOrigin[i]=origin[i]; + return dt; } -/** merge operator for HLT component data types and origins +/** + * Helper function to initialize a data type from an id char array and origin string. + * @return data type structure initialized with the specified id and origin * @ingroup alihlt_component_datatypes */ -inline AliHLTComponentDataType operator|(const AliHLTComponentDataType srcdt, const char origin[kAliHLTComponentDataTypefOriginSize]) +inline AliHLTComponentDataType AliHLTComponentDataTypeInitializer(const char id[kAliHLTComponentDataTypefIDsize], const char* origin) { - AliHLTComponentDataType dt=srcdt; - for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) + AliHLTComponentDataType dt=kAliHLTVoidDataType; + int i=0; + for (i = 0; i < kAliHLTComponentDataTypefIDsize && id[i]!=0; i++) + dt.fID[i]=id[i]; + for (i = 0; i < kAliHLTComponentDataTypefOriginSize && origin[i]!=0; i++ ) dt.fOrigin[i]=origin[i]; return dt; } +/** + * Helper function to initialize a data type from a default data type and + * an origin string. Basically it merges the specified origin into the data + * type. + * @return data type structure initialized with the id from specified data type + * and origin + * @ingroup alihlt_component_datatypes + */ +inline AliHLTComponentDataType AliHLTComponentDataTypeInitializer(const AliHLTComponentDataType src, const char* origin) +{ + return AliHLTComponentDataTypeInitializer(src.fID, origin); +} + #endif