#ifndef ALIHLTDATATYPES_H
#define ALIHLTDATATYPES_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+/* This file is property of and copyright by the ALICE HLT Project *
+ * ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/** @file AliHLTDataTypes.h
- @author Matthias Richter, Timm Steinbeck
+ @author Matthias Richter, Timm Steinbeck, Jochen Thaeder
@date
@brief Data type declaration for the HLT module.
*/
+//////////////////////////////////////////////////////////////////////////
+//
+// HLT data origin defines
+//
+//////////////////////////////////////////////////////////////////////////
+
+/** field size of datat type origin */
+const int kAliHLTComponentDataTypefOriginSize=4;
+
+
+/** invalid data origin */
+# define kAliHLTVoidDataOrigin "\0\0\0"
+
+/** special id for any data type origin */
+# define kAliHLTAnyDataOrigin "***"
+
+/** HLT out */
+# define kAliHLTDataOriginOut {'H','L','T',' '}
+
+/** HLT/PubSub private internal */
+# define kAliHLTDataOriginPrivate {'P','R','I','V'}
+
+/** TPC */
+# define kAliHLTDataOriginTPC {'T','P','C',' '}
+
+/** PHOS */
+# define kAliHLTDataOriginPHOS {'P','H','O','S'}
+
+/** MUON */
+# define kAliHLTDataOriginMUON {'M','U','O','N'}
+
+/** TRD */
+# define kAliHLTDataOriginTRD {'T','R','D',' '}
+
+/** ITS */
+# define kAliHLTDataOriginITS {'I','T','S',' '}
+
+//////////////////////////////////////////////////////////////////////////
+//
+// HLT common data type defines
+//
+//////////////////////////////////////////////////////////////////////////
+
+/** field size of data type id */
+const int kAliHLTComponentDataTypefIDsize=8;
+
+
+/** invalid data type id */
+# define kAliHLTVoidDataTypeID "\0\0\0\0\0\0\0"
+
+/** special id for any data type id */
+# define kAliHLTAnyDataTypeID "*******"
+
+/** calibration data for file exchange subscriber */
+# define kAliHLTFXSCalibDataTypeID {'F','X','S','_','C','A','L',' '}
+
+/** start of run (SOR) event
+ * @ref AliHLTEventDesc
+ */
+# define kAliHLTSORDataTypeID {'S','T','A','R','T','O','F','R'}
+
+/** end of run (EOR) event
+ * @ref AliHLTEventDesc
+ */
+# define kAliHLTEORDataTypeID {'E','N','D','O','F','R','U','N'}
+
+/** DDL list event
+ * @ref AliHLTEventDDL
+ */
+# define kAliHLTDDLDataTypeID {'D','D','L','L','I','S','T',' '}
+
using namespace std;
extern "C" {
+ //////////////////////////////////////////////////////////////////////////
+ //
+ // Basic HLT data types
+ //
+ //////////////////////////////////////////////////////////////////////////
typedef unsigned char AliHLTUInt8_t;
typedef AliHLTUInt64_t AliHLTEventID_t;
- enum AliHLTComponentLogSeverity { kHLTLogNone=0, kHLTLogBenchmark=1, kHLTLogDebug=2, kHLTLogInfo=4, kHLTLogWarning=8, kHLTLogError=16, kHLTLogFatal=32, kHLTLogAll=0x3f, kHLTLogDefault=0x3d };
+ //////////////////////////////////////////////////////////////////////////
+ //
+ // HLT logging levels
+ //
+ //////////////////////////////////////////////////////////////////////////
+ enum AliHLTComponentLogSeverity {
+ kHLTLogNone = 0,
+ kHLTLogBenchmark = 0x1,
+ kHLTLogDebug = 0x2,
+ kHLTLogInfo = 0x4,
+ kHLTLogWarning = 0x8,
+ kHLTLogError = 0x10,
+ kHLTLogFatal = 0x20,
+ kHLTLogAll = 0x3f,
+ kHLTLogDefault = 0x3d
+};
+
+ //////////////////////////////////////////////////////////////////////////
+ //
+ // HLT data structures for data exchange and external interface
+ //
+ //////////////////////////////////////////////////////////////////////////
+
+ /**
+ * @struct AliHLTComponentEventData
+ * Event descriptor
+ */
struct AliHLTComponentEventData
{
AliHLTUInt32_t fStructSize;
AliHLTUInt32_t fBlockCnt;
};
- const AliHLTEventID_t kAliHLTVoidEventID=~(AliHLTEventID_t)0;
+ /**
+ * @struct AliHLTComponentShmData
+ * Shared memory descriptor.
+ * Irrelevant for analysis components.
+ */
struct AliHLTComponentShmData
{
AliHLTUInt32_t fStructSize;
AliHLTUInt64_t fShmID;
};
- const AliHLTUInt32_t gkAliHLTComponentInvalidShmType = 0;
- const AliHLTUInt64_t gkAliHLTComponentInvalidShmID = ~(AliHLTUInt64_t)0;
-
- const int kAliHLTComponentDataTypefIDsize=8;
- const int kAliHLTComponentDataTypefOriginSize=4;
+ /**
+ * @struct AliHLTComponentDataType
+ * Data type decriptor for data blocks transferred through the processing
+ * chain.
+ */
struct AliHLTComponentDataType
{
AliHLTUInt32_t fStructSize;
- char fID[kAliHLTComponentDataTypefIDsize];
- char fOrigin[kAliHLTComponentDataTypefOriginSize];
+ char fID[kAliHLTComponentDataTypefIDsize]; //!
+ char fOrigin[kAliHLTComponentDataTypefOriginSize]; //!
};
-# define kAliHLTVoidDataTypeID "\0\0\0\0\0\0\0"
-# define kAliHLTVoidDataOrigin "\0\0\0"
-# define kAliHLTAnyDataTypeID "*******"
-# define kAliHLTAnyDataOrigin "***"
- const AliHLTComponentDataType kAliHLTVoidDataType = {sizeof(AliHLTComponentDataType), kAliHLTVoidDataTypeID, kAliHLTVoidDataOrigin};
- const AliHLTComponentDataType kAliHLTAnyDataType = {sizeof(AliHLTComponentDataType), kAliHLTAnyDataTypeID, kAliHLTAnyDataOrigin};
- const AliHLTUInt32_t kAliHLTVoidDataSpec = ~(AliHLTUInt32_t)0;
-
+ /**
+ * @struct AliHLTComponentBlockData
+ * Descriptor for data blocks.
+ */
struct AliHLTComponentBlockData
{
AliHLTUInt32_t fStructSize;
AliHLTUInt32_t fSpecification;
};
+ /**
+ * @struct AliHLTComponentTriggerData
+ * Trigger data, not yet defined
+ */
struct AliHLTComponentTriggerData
{
AliHLTUInt32_t fStructSize;
AliHLTUInt32_t fDataSize;
void* fData;
};
-
+
+ /**
+ * @struct AliHLTComponentEventDoneData
+ *
+ */
struct AliHLTComponentEventDoneData
{
AliHLTUInt32_t fStructSize;
void* fData;
};
- typedef int (*AliHLTfctLogging)( void* param, AliHLTComponentLogSeverity severity, const char* origin, const char* keyword, const char* message );
+ /**
+ * @struct AliHLTEventDesc
+ * Event descriptor.
+ * The struct is send with the SOR and EOR events.
+ */
+ struct AliHLTEventDesc
+ {
+ AliHLTUInt32_t fStructSize;
+ AliHLTUInt32_t fRunNo;
+ AliHLTUInt32_t fRunType;
+ };
+
+ /** size of the DDL list */
+ static const int gkAliHLTDDLListSize = 29;
+
+ /**
+ * @struct AliHLTEventDDL
+ * DDL list event.
+ * The struct is send with the DDLLIST event.
+ */
+ struct AliHLTEventDDL
+ {
+ AliHLTUInt32_t fCount;
+ AliHLTUInt32_t fList[gkAliHLTDDLListSize];
+ };
+
+ //////////////////////////////////////////////////////////////////////////
+ //
+ // HLT defines and defaults
+ //
+ //////////////////////////////////////////////////////////////////////////
+
+ /** invalid event id */
+ const AliHLTEventID_t kAliHLTVoidEventID=~(AliHLTEventID_t)0;
+
+ /** invalid data specification */
+ const AliHLTUInt32_t kAliHLTVoidDataSpec = ~(AliHLTUInt32_t)0;
+
+ /** invalid shared memory type */
+ const AliHLTUInt32_t gkAliHLTComponentInvalidShmType = 0;
+
+ /** invalid shared memory id */
+ const AliHLTUInt64_t gkAliHLTComponentInvalidShmID = ~(AliHLTUInt64_t)0;
+
+ /** invalid data type */
+ const AliHLTComponentDataType kAliHLTVoidDataType = {
+ sizeof(AliHLTComponentDataType),
+ kAliHLTVoidDataTypeID,
+ kAliHLTVoidDataOrigin
+ };
+
+ // 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
+ // are used it works fine
+ /** any data type */
+ const AliHLTComponentDataType kAliHLTAnyDataType = {
+ sizeof(AliHLTComponentDataType),
+ kAliHLTAnyDataTypeID,
+ kAliHLTAnyDataOrigin
+ };
+
+ /** data to file exchange subscriber */
+ extern const AliHLTComponentDataType kAliHLTDataTypeFXSCalib;
+
+ /** DDL list data type */
+ extern const AliHLTComponentDataType kAliHLTDataTypeDDL;
+
+ /** SOR data type */
+ extern const AliHLTComponentDataType kAliHLTDataTypeSOR;
+
+ /** EOR data type */
+ extern const AliHLTComponentDataType kAliHLTDataTypeEOR;
+ //////////////////////////////////////////////////////////////////////////
+ //
+ // FXS subscriber meta information
+ //
+ //////////////////////////////////////////////////////////////////////////
+
+ static const int gkAliHLTFXSHeaderfOriginSize = 4;
+ static const int gkAliHLTFXSHeaderfFileIDSize = 128;
+ static const int gkAliHLTFXSHeaderfDDLNumberSize = 64;
+
+ /** 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];
+ };
+
+ //////////////////////////////////////////////////////////////////////////
+ //
+ // Component running environment
+ //
+ //////////////////////////////////////////////////////////////////////////
+
+ /** logging function */
+ typedef int (*AliHLTfctLogging)( void* param,
+ AliHLTComponentLogSeverity severity,
+ const char* origin,
+ const char* keyword,
+ const char* message);
+
+ /**
+ * @struct AliHLTComponentEnvironment
+ * Running environment for analysis components.
+ * The struct describes function callbacks for
+ */
struct AliHLTComponentEnvironment
{
AliHLTUInt32_t fStructSize;
void* fParam;
void* (*fAllocMemoryFunc)( void* param, unsigned long size );
#if 0
- int (*fAllocShmMemoryFunc)( void* param, unsigned long size, AliHLTComponentBlockData* blockLocation ); // future addition already foreseen/envisioned
+ // 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
int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd );
AliHLTfctLogging fLoggingFunc;
};
}
+//////////////////////////////////////////////////////////////////////////
+//
+// Data type helper functions
+//
+//////////////////////////////////////////////////////////////////////////
+
inline bool operator==( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
{
for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ )
return false;
}
+
#endif