]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
HLT data types defined and documented
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 17 Jul 2007 15:48:07 +0000 (15:48 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 17 Jul 2007 15:48:07 +0000 (15:48 +0000)
HLT/BASE/AliHLTComponent.h
HLT/BASE/AliHLTDataTypes.cxx [new file with mode: 0644]
HLT/BASE/AliHLTDataTypes.h
HLT/BASE/AliHLTMemoryFile.h
HLT/libHLTbase.pkg

index 4917724d007e737661d5d06508555b76776659dc..a34c6c6e506b4cf61438bfca15421bf2901cca0f 100644 (file)
@@ -926,7 +926,7 @@ class AliHLTComponent : public AliHLTLogging {
    * as buffer, only the block descriptor will be build. If a header is specified, 
    * it will be inserted before the buffer, default is no header.
    * @param pBuffer     pointer to buffer
-   * @param iSize       size of the buffer in byte
+   * @param iBufferSize size of the buffer in byte
    * @param dt          data type
    * @param spec        data specification
    * @param pHeader     pointer to header
diff --git a/HLT/BASE/AliHLTDataTypes.cxx b/HLT/BASE/AliHLTDataTypes.cxx
new file mode 100644 (file)
index 0000000..bde5ea7
--- /dev/null
@@ -0,0 +1,57 @@
+// $Id$
+
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project        * 
+ * ALICE Experiment at CERN, All rights reserved.                         *
+ *                                                                        *
+ * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no>        *
+ *                  Timm Steinbeck <timm@kip.uni-heidelberg.de>           *
+ *                  Jochen Thaeder <thaeder@kip.uni-heidelberg.de>        *
+ *                  for The ALICE HLT Project.                            *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/** @file   AliHLTComponent.cxx
+    @author Matthias Richter, Timm Steinbeck, Jochen Thaeder
+    @date   
+    @brief  Implementation of data types. */
+
+#include "AliHLTDataTypes.h"
+
+// those types can not be implemented in the header files as rootcint
+// can not cope with the type id and origin defines.
+
+/** data to file exchange subscriber */
+const AliHLTComponentDataType kAliHLTDataTypeFXSCalib = {
+  sizeof(AliHLTComponentDataType),
+  kAliHLTFXSCalibDataTypeID,
+  kAliHLTDataOriginOut
+};
+
+/** DDL list data type */
+const AliHLTComponentDataType kAliHLTDataTypeDDL  = {
+  sizeof(AliHLTComponentDataType),
+  kAliHLTDDLDataTypeID,
+  kAliHLTDataOriginOut
+};
+
+/** SOR data type */
+const AliHLTComponentDataType kAliHLTDataTypeSOR  = {
+  sizeof(AliHLTComponentDataType),
+  kAliHLTSORDataTypeID,
+  kAliHLTDataOriginPrivate
+};
+
+/** EOR data type */
+const AliHLTComponentDataType kAliHLTDataTypeEOR  = {
+  sizeof(AliHLTComponentDataType),
+  kAliHLTEORDataTypeID,
+  kAliHLTDataOriginPrivate
+};
index 13b8487309c9ab99eea0db15b7bd3dd0d17abac6..19fd94babf153181733206951b199e99f9e4aa46 100644 (file)
@@ -2,18 +2,95 @@
 
 #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;
 
@@ -25,8 +102,34 @@ extern "C" {
 
   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;
@@ -36,7 +139,11 @@ extern "C" {
     AliHLTUInt32_t fBlockCnt;
   };
 
-  const AliHLTEventID_t kAliHLTVoidEventID=~(AliHLTEventID_t)0;
+  /**
+   * @struct AliHLTComponentShmData
+   * Shared memory descriptor.
+   * Irrelevant for analysis components.
+   */
   struct AliHLTComponentShmData
   {
     AliHLTUInt32_t fStructSize;
@@ -44,26 +151,22 @@ extern "C" {
     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;
@@ -75,13 +178,21 @@ extern "C" {
     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;
@@ -89,21 +200,140 @@ extern "C" {
     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++ )
@@ -126,4 +356,5 @@ inline bool operator!=( const AliHLTComponentDataType& dt1, const AliHLTComponen
     return false;
     }
 
+
 #endif 
index bceb0dbf5e07460c1c8b5f32d075d909c059a4d2..15930c634415e91d4aed86db50462b0d011c22e2 100644 (file)
@@ -49,7 +49,7 @@ class AliHLTMemoryFile : public TFile, public AliHLTLogging {
    * @return neg. error code if failed
    *         - -ENOSPC    buffer size too small
    */
-  int WriteHeader(const char* pHeader, int size);
+  int WriteHeader(const char* pHeader, int iSize);
 
   /**
    * Write a header at the beginning of the file.
index 274c1b14e35db881ad15b25a11614fa58c163d77..ac4c634d72ce11576f781d4180343eb5eeb21d27 100644 (file)
@@ -19,6 +19,7 @@ MODULE_SRCS=  AliHLTComponent.cxx \
                AliHLTOfflineDataSink.cxx \
                AliHLTModuleAgent.cxx \
                AliHLTMemoryFile.cxx \
+               AliHLTDataTypes.cxx \
                AliHLTMessage.cxx
 
 CLASS_HDRS:=   AliHLTComponent.h \