]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/BASE/AliHLTComponent.h
minor change, making helper methods globally available
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTComponent.h
index c4a33945ae74b3a6665fd12df44d3f4391bc54ad..a279a4c1be374b46609a9c16a2b1141fa4d511ab 100644 (file)
@@ -3,7 +3,8 @@
 
 #ifndef ALIHLTCOMPONENT_H
 #define ALIHLTCOMPONENT_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   AliHLTComponent.h
@@ -46,6 +47,17 @@ typedef AliHLTComponentEventDoneData AliHLTComponent_EventDoneData;
 class AliHLTComponentHandler;
 class TObjArray;
 class TStopwatch;
+class AliHLTComponent;
+class AliHLTMemoryFile;
+
+/** list of component data type structures */
+typedef vector<AliHLTComponentDataType>   AliHLTComponentDataTypeList;
+/** list of component block data structures */
+typedef vector<AliHLTComponentBlockData>  AliHLTComponentBlockDataList;
+/** list of component pointers */
+typedef vector<AliHLTComponent*>          AliHLTComponentPList;
+/** list of memory file pointers */
+typedef vector<AliHLTMemoryFile*>         AliHLTMemoryFilePList;
 
 /**
  * @class AliHLTComponent
@@ -69,6 +81,10 @@ class TStopwatch;
  * @subsection alihltcomponent-opt-mehods Optional handlers
  * - @ref DoInit
  * - @ref DoDeinit
+ * - @ref GetOutputDataTypes
+ *   If the component has multiple output data types @ref GetOutputDataType
+ *   should return @ref kAliHLTMultipleDataType. The framework will invoke
+ *   @ref GetOutputDataTypes, a list can be filled.
  *
  * @subsection alihltcomponent-processing-mehods Data processing
  * 
@@ -107,6 +123,7 @@ class TStopwatch;
  * member functions for those environment dependend functions. The member 
  * functions are used by the component implementation and are re-mapped to the
  * corresponding functions.
+ *
  * @section alihltcomponent-interfaces Component interfaces
  * Each of the 3 standard component base classes AliHLTProcessor, AliHLTDataSource
  * and AliHLTDataSink provides it's own processing method (see
@@ -117,6 +134,32 @@ class TStopwatch;
  * The @ref alihltcomponent-high-level-interface is the standard processing
  * method and will be used whenever the low-level method is not overloaded.
  *
+ * In both cases it is necessary to calculate/estimate the size of the output
+ * buffer before the processing. Output buffers can never be allocated inside
+ * the component because of the push-architecture of the HLT.
+ * For that reason the @ref GetOutputDataSize function should return a rough
+ * estimatian of the data to be produced by the component. The component is
+ * responsible for checking the memory size and must return -ENOSPC if the
+ * available buffer is to small, and update the estimator respectively. The
+ * framework will allocate a buffer of appropriate size and call the processing
+ * again.
+ *
+ * @subsection alihltcomponent-error-codes Data processing
+ * For return codes, the following scheme applies:
+ * - The data processing methods have to indicate error conditions by a negative
+ * error/return code. Preferably the system error codes are used like
+ * e.g. -EINVAL. This requires to include the header
+ * <pre>
+ * \#include \<cerrno\>
+ * </pre>
+ * - If no suitable input block could be found (e.g. no clusters for the TPC cluster
+ * finder) set size to 0, block list is empty, return 0
+ * - If no ususable or significant signal could be found in the input blocks
+ * return an empty output block, set size accordingly, and return 0. An empty output
+ * block here could be either a real empty one of size 0 (in which case size also
+ * would have to be set to zero) or a block filled with just the minimum necessary
+ * accounting/meta-structures. E.g. in the TPC
+ *
  * @subsection alihltcomponent-high-level-interface High-level interface
  * The high-level component interface provides functionality to exchange ROOT
  * structures between components. In contrast to the 
@@ -147,8 +190,11 @@ class TStopwatch;
  *        add event information to the output
  * 
  * In addition, the processing methods are simplified a bit by cutting out most of
- * the parameters. The component implementation 
- * @see AliHLTProcessor AliHLTDataSource AliHLTDataSink
+ * the parameters.
+ * @see 
+ * - @ref AliHLTProcessor::DoEvent
+ * - @ref AliHLTDataSource::GetEvent
+ * - @ref AliHLTDataSink::DumpEvent
  *
  * \em IMPORTANT: objects and block descriptors provided by the high-level interface
  *  <b>MUST NOT BE DELETED</b> by the caller.
@@ -204,10 +250,6 @@ class AliHLTComponent : public AliHLTLogging {
  public:
   /** standard constructor */
   AliHLTComponent();
-  /** not a valid copy constructor, defined according to effective C++ style */
-  AliHLTComponent(const AliHLTComponent&);
-  /** not a valid assignment op, but defined according to effective C++ style */
-  AliHLTComponent& operator=(const AliHLTComponent&);
   /** standard destructor */
   virtual ~AliHLTComponent();
 
@@ -278,9 +320,38 @@ class AliHLTComponent : public AliHLTLogging {
   virtual int DoProcessing( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, 
                            AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, 
                            AliHLTUInt32_t& size,
-                           vector<AliHLTComponentBlockData>& outputBlocks,
+                           AliHLTComponentBlockDataList& outputBlocks,
                            AliHLTComponentEventDoneData*& edd ) = 0;
 
+  /**
+   * Init the CDB.
+   * The function must not be called when running in AliRoot unless it it
+   * really wanted. The CDB path will be set to the specified path, which might
+   * override the path initialized at the beginning of the AliRoot reconstruction.
+   *
+   * The method is used from the external interface in order to set the correct
+   * path when running on-line. The function also initializes the function
+   * callback for setting the run no during operation.
+   *
+   * A separation of library and component handling is maybe appropriate in the
+   * future. Using the global component handler here is maybe not the cleanest
+   * solution.
+   * @param cdbPath      path of the CDB
+   * @param pHandler     the component handler used for llibrary handling.
+   */
+  int InitCDB(const char* cdbPath, AliHLTComponentHandler* pHandler);
+
+  /**
+   * Set the run no for the CDB.
+   * The function must not be called when running in AliRoot unless it it
+   * really wanted. The CDB path will be set to the specified path, which might
+   * override the run no initialized at the beginning of the AliRoot reconstruction.
+   *
+   * The method is used from the external interface in order to set the correct
+   * path when running on-line.
+   */
+  int SetCDBRunNo(int runNo);
+
   // Information member functions for registration.
 
   /**
@@ -303,7 +374,7 @@ class AliHLTComponent : public AliHLTLogging {
    * The function is pure virtual and must be implemented by the child class.
    * @return list of data types in the vector reference
    */
-  virtual void GetInputDataTypes( vector<AliHLTComponentDataType>& ) = 0;
+  virtual void GetInputDataTypes( AliHLTComponentDataTypeList& ) = 0;
 
   /**
    * Get the output data type of the component.
@@ -312,6 +383,17 @@ class AliHLTComponent : public AliHLTLogging {
    */
   virtual AliHLTComponentDataType GetOutputDataType() = 0;
 
+  /**
+   * Get the output data types of the component.
+   * The function can be implemented to indicate multiple output data types
+   * in the target array.
+   * @ref GetOutputDataType must return @ref kAliHLTMultipleDataType in order
+   * to invoke this method.
+   * @param tgtList          list to receive the data types
+   * @return no of output data types, data types in the target list
+   */
+  virtual int GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList);
+
   /**
    * Get a ratio by how much the data volume is shrinked or enhanced.
    * The function is pure virtual and must be implemented by the child class.
@@ -338,7 +420,7 @@ class AliHLTComponent : public AliHLTLogging {
    * @param tgtList   reference to a vector list to receive the matching data types.
    * @return >= 0 success, neg. error code if failed
    */ 
-  int FindMatchingDataTypes(AliHLTComponent* pConsumer, vector<AliHLTComponentDataType>* tgtList);
+  int FindMatchingDataTypes(AliHLTComponent* pConsumer, AliHLTComponentDataTypeList* tgtList);
  
   /**
    * Set the global component handler.
@@ -354,13 +436,17 @@ class AliHLTComponent : public AliHLTLogging {
 
   /**
    * Helper function to convert the data type to a string.
+   * @param type        data type structure
+   * @param mode        0 print string origin:type          <br>
+   *                    1 print chars                       <br>
+   *                    2 print numbers
    */
-  static string DataType2Text( const AliHLTComponentDataType& type );
+  static string DataType2Text( const AliHLTComponentDataType& type, int mode=0);
 
   /**
    * Helper function to print content of data type.
    */
-  void PrintDataTypeContent(AliHLTComponentDataType& dt, const char* format=NULL) const;
+  static void PrintDataTypeContent(AliHLTComponentDataType& dt, const char* format=NULL);
 
   /**
    * helper function to initialize AliHLTComponentEventData structure
@@ -372,7 +458,50 @@ class AliHLTComponent : public AliHLTLogging {
    * This is just a helper function to examine an @ref AliHLTComponentDataType
    * structur.
    */
-  void PrintComponentDataTypeInfo(const AliHLTComponentDataType& dt);
+  static void PrintComponentDataTypeInfo(const AliHLTComponentDataType& dt);
+
+  /**
+   * Fill AliHLTComponentBlockData structure with default values.
+   * @param blockData   reference to data structure
+   */
+  static void FillBlockData( AliHLTComponentBlockData& blockData );
+
+  /**
+   * Fill AliHLTComponentShmData structure with default values.
+   * @param shmData   reference to data structure
+   */
+  static void FillShmData( AliHLTComponentShmData& shmData );
+
+  /**
+   * Fill AliHLTComponentDataType structure with default values.
+   * @param dataType   reference to data structure
+   */
+  static void FillDataType( AliHLTComponentDataType& dataType );
+  
+  /**
+   * Copy data type structure
+   * Copies the value an AliHLTComponentDataType structure to another one
+   * @param[out] tgtdt   target structure
+   * @param[in] srcdt   source structure
+   */
+  static void CopyDataType(AliHLTComponentDataType& tgtdt, const AliHLTComponentDataType& srcdt);
+
+  /**
+   * Set the ID and Origin of an AliHLTComponentDataType structure.
+   * The function sets the fStructureSize member and copies the strings
+   * to the ID and Origin. Only characters from the valid part of the string
+   * are copied, the rest is filled with 0's. <br>
+   * Please note that the fID and fOrigin members are not strings, just arrays of
+   * chars of size @ref kAliHLTComponentDataTypefIDsize and
+   * @ref kAliHLTComponentDataTypefOriginSize respectively and not necessarily with
+   * a terminating zero. <br>
+   * It is possible to pass NULL pointers as id or origin argument, in that case they
+   * are just ignored.
+   * @param tgtdt   target data type structure
+   * @param id      ID string
+   * @param origin  Origin string
+   */
+  static void SetDataType(AliHLTComponentDataType& tgtdt, const char* id, const char* origin);
 
   /**
    * Stopwatch type for benchmarking.
@@ -406,7 +535,9 @@ class AliHLTComponent : public AliHLTLogging {
     /** constructor */
     AliHLTStopwatchGuard(TStopwatch* pStart);
     /** copy constructor (not for use) */
-    AliHLTStopwatchGuard(AliHLTStopwatchGuard&);
+    AliHLTStopwatchGuard(const AliHLTStopwatchGuard&);
+    /** assignment operator (not for use) */
+    AliHLTStopwatchGuard& operator=(const AliHLTStopwatchGuard&);
     /** destructor */
     ~AliHLTStopwatchGuard();
 
@@ -458,47 +589,6 @@ class AliHLTComponent : public AliHLTLogging {
 
  protected:
 
-  /**
-   * Fill AliHLTComponentBlockData structure with default values.
-   * @param blockData   reference to data structure
-   */
-  void FillBlockData( AliHLTComponentBlockData& blockData ) const;
-
-  /**
-   * Fill AliHLTComponentShmData structure with default values.
-   * @param shmData   reference to data structure
-   */
-  void FillShmData( AliHLTComponentShmData& shmData ) const;
-
-  /**
-   * Fill AliHLTComponentDataType structure with default values.
-   * @param dataType   reference to data structure
-   */
-  void FillDataType( AliHLTComponentDataType& dataType ) const;
-  
-  /**
-   * Copy data type structure
-   * Copies the value an AliHLTComponentDataType structure to another one
-   * @param[out] tgtdt   target structure
-   * @param[in] srcdt   source structure
-   */
-  void CopyDataType(AliHLTComponentDataType& tgtdt, const AliHLTComponentDataType& srcdt);
-
-  /**
-   * Set the ID and Origin of an AliHLTComponentDataType structure.
-   * The function sets the fStructureSize member and copies the strings
-   * to the ID and Origin. Only characters from the valid part of the string
-   * are copied, the rest is fille with 0's.
-   * Please note that the fID and fOrigin members are not strings, just arrays of
-   * chars of size @ref kAliHLTComponentDataTypefIDsize and
-   * @ref kAliHLTComponentDataTypefOriginSize respectively and not necessarily with
-   * a terminating zero.
-   * @param tgtdt   target data type structure
-   * @param id      ID string
-   * @param origin  Origin string
-   */
-  void SetDataType(AliHLTComponentDataType& tgtdt, const char* id, const char* origin);
-
   /**
    * Default method for the internal initialization.
    * The method is called by @ref Init
@@ -511,6 +601,25 @@ class AliHLTComponent : public AliHLTLogging {
    */
   virtual int DoDeinit();
 
+  /**
+   * Reconfigure the component.
+   * The method is called when an event of type @ref kAliHLTDataTypeComConf
+   * {COM_CONF:PRIV} is received by the component. If the event is sent as
+   * part of a normal event, the component configuration is called first.
+   *
+   * The CDB path parameter specifies the path in the CDB, i.e. without
+   * leading absolute path of the CDB location. The framework might alse
+   * provide the id of the component in the analysis chain.
+   *
+   * \b Note: The CDB will be initialized by the framework, either already set
+   * from AliRoot or from the wrapper interface during initialization.
+   *
+   * @param cdbEntry     path of the cdbEntry
+   * @param chainId      the id of the component in the analysis chain
+   * @note both parameters can be NULL, check before usage
+   */
+  virtual int Reconfigure(const char* cdbEntry, const char* chainId);
+
   /**
    * General memory allocation method.
    * All memory which is going to be used 'outside' of the interface must
@@ -530,7 +639,7 @@ class AliHLTComponent : public AliHLTLogging {
    * framework. Function pointers are transferred via the @ref
    * AliHLTComponentEnvironment structure.
    */
-  int MakeOutputDataBlockList( const vector<AliHLTComponentBlockData>& blocks, AliHLTUInt32_t* blockCount,
+  int MakeOutputDataBlockList( const AliHLTComponentBlockDataList& blocks, AliHLTUInt32_t* blockCount,
                               AliHLTComponentBlockData** outputBlocks );
 
   /**
@@ -685,37 +794,73 @@ class AliHLTComponent : public AliHLTLogging {
    */
   AliHLTUInt32_t GetSpecification(const AliHLTComponentBlockData* pBlock=NULL);
 
+  /**
+   * Forward an input object to the output.
+   * Forward the input block of an object previously fetched via
+   * GetFirstInputObject/NextInputObject or the last one if no object
+   * specified.
+   * The block descriptor of the input block is forwarded to the
+   * output block list.
+   * @param pObject     pointer to TObject
+   * @return neg. error code if failed
+   */
+  int Forward(const TObject* pObject);
+
+  /**
+   * Forward an input block to the output.
+   * Forward the input block fetched via GetFirstInputObject/
+   * NextInputBlock or the last one if no block specified.
+   * The block descriptor of the input block is forwarded to the
+   * output block list.
+   * @param pBlock     pointer to input block
+   * @return neg. error code if failed
+   */
+  int Forward(const AliHLTComponentBlockData* pBlock=NULL);
+
   /**
    * Insert an object into the output.
+   * If header is specified, it will be inserted before the root object,
+   * default is no header.
    * @param pObject     pointer to root object
    * @param dt          data type of the object
    * @param spec        data specification
+   * @param pHeader     pointer to header
+   * @param headerSize  size of Header
    * @return neg. error code if failed 
    */
   int PushBack(TObject* pObject, const AliHLTComponentDataType& dt, 
-              AliHLTUInt32_t spec=kAliHLTVoidDataSpec);
+              AliHLTUInt32_t spec=kAliHLTVoidDataSpec, 
+              void* pHeader=NULL, int headerSize=0);
 
   /**
    * Insert an object into the output.
+   * If header is specified, it will be inserted before the root object,
+   * default is no header.
    * @param pObject     pointer to root object
    * @param dtID        data type ID of the object
    * @param dtOrigin    data type origin of the object
    * @param spec        data specification
+   * @param pHeader     pointer to header
+   * @param headerSize  size of Header
    * @return neg. error code if failed 
    */
   int PushBack(TObject* pObject, const char* dtID, const char* dtOrigin,
-              AliHLTUInt32_t spec=kAliHLTVoidDataSpec);
-
+              AliHLTUInt32_t spec=kAliHLTVoidDataSpec,
+              void* pHeader=NULL, int headerSize=0);
   /**
    * Insert an object into the output.
    * @param pBuffer     pointer to buffer
    * @param iSize       size of the buffer
    * @param dt          data type of the object
    * @param spec        data specification
+   * @param pHeader     pointer to header
+   * @param headerSize size of Header
    * @return neg. error code if failed 
    */
   int PushBack(void* pBuffer, int iSize, const AliHLTComponentDataType& dt,
-              AliHLTUInt32_t spec=kAliHLTVoidDataSpec);
+              AliHLTUInt32_t spec=kAliHLTVoidDataSpec,
+              void* pHeader=NULL, int headerSize=0);
 
   /**
    * Insert an object into the output.
@@ -724,10 +869,13 @@ class AliHLTComponent : public AliHLTLogging {
    * @param dtID        data type ID of the object
    * @param dtOrigin    data type origin of the object
    * @param spec        data specification
+   * @param pHeader     pointer to header
+   * @param headerSize size of Header
    * @return neg. error code if failed 
    */
   int PushBack(void* pBuffer, int iSize, const char* dtID, const char* dtOrigin,
-              AliHLTUInt32_t spec=kAliHLTVoidDataSpec);
+              AliHLTUInt32_t spec=kAliHLTVoidDataSpec,
+              void* pHeader=NULL, int headerSize=0);
 
   /**
    * Estimate size of a TObject
@@ -736,13 +884,176 @@ class AliHLTComponent : public AliHLTLogging {
    */
   int EstimateObjectSize(TObject* pObject) const;
 
+  /**
+   * Create a memory file in the output stream.
+   * This method creates a TFile object which stores all data in
+   * memory instead of disk. The TFile object is published as binary data.
+   * The instance can be used like a normal TFile object. The TFile::Close
+   * or @ref CloseMemoryFile method has to be called in order to flush the
+   * output stream.
+   *
+   * \b Note: The returned object is deleted by the framework.
+   * @param capacity    total size reserved for the memory file
+   * @param dtID        data type ID of the file
+   * @param dtOrigin    data type origin of the file
+   * @param spec        data specification
+   * @return file handle, NULL if failed 
+   */
+  AliHLTMemoryFile* CreateMemoryFile(int capacity, const char* dtID, const char* dtOrigin,
+                                    AliHLTUInt32_t spec=kAliHLTVoidDataSpec);
+
+  /**
+   * Create a memory file in the output stream.
+   * This method creates a TFile object which stores all data in
+   * memory instead of disk. The TFile object is published as binary data.
+   * The instance can be used like a normal TFile object. The TFile::Close
+   * or @ref CloseMemoryFile method has to be called in order to flush the
+   * output stream.
+   *
+   * \b Note: The returned object is deleted by the framework.
+   * @param capacity    total size reserved for the memory file
+   * @param dt          data type of the file
+   * @param spec        data specification
+   * @return file handle, NULL if failed 
+   */
+  AliHLTMemoryFile* CreateMemoryFile(int capacity, 
+                                    const AliHLTComponentDataType& dt=kAliHLTAnyDataType,
+                                    AliHLTUInt32_t spec=kAliHLTVoidDataSpec);
+
+  /**
+   * Create a memory file in the output stream.
+   * This method creates a TFile object which stores all data in
+   * memory instead of disk. The TFile object is published as binary data.
+   * The instance can be used like a normal TFile object. The TFile::Close
+   * or @ref CloseMemoryFile method has to be called in order to flush the
+   * output stream.
+   *
+   * \b Note: The returned object is deleted by the framework.
+   * @param dtID        data type ID of the file
+   * @param dtOrigin    data type origin of the file
+   * @param spec        data specification
+   * @param capacity    fraction of the available output buffer size
+   * @return file handle, NULL if failed 
+   */
+  AliHLTMemoryFile* CreateMemoryFile(const char* dtID, const char* dtOrigin,
+                                    AliHLTUInt32_t spec=kAliHLTVoidDataSpec,
+                                    float capacity=1.0);
+
+  /**
+   * Create a memory file in the output stream.
+   * This method creates a TFile object which stores all data in
+   * memory instead of disk. The TFile object is published as binary data.
+   * The instance can be used like a normal TFile object. The TFile::Close
+   * or @ref CloseMemoryFile method has to be called in order to flush the
+   * output stream.
+   *
+   * \b Note: The returned object is deleted by the framework.
+   * @param dt          data type of the file
+   * @param spec        data specification
+   * @param capacity    fraction of the available output buffer size
+   * @return file handle, NULL if failed 
+   */
+  AliHLTMemoryFile* CreateMemoryFile(const AliHLTComponentDataType& dt=kAliHLTAnyDataType,
+                                    AliHLTUInt32_t spec=kAliHLTVoidDataSpec,
+                                    float capacity=1.0);
+
+  /**
+   * Write an object to memory file in the output stream.
+   * @param pFile       file handle
+   * @param pObject     pointer to root object
+   * @param key         key in ROOT file
+   * @param option      options, see TObject::Write
+   * @return neg. error code if failed
+   *         - -ENOSPC    no space left
+   */
+  int Write(AliHLTMemoryFile* pFile, const TObject* pObject, const char* key=NULL, int option=TObject::kOverwrite);
+
+  /**
+   * Close object memory file.
+   * @param pFile       file handle
+   * @return neg. error code if failed
+   *         - -ENOSPC    buffer size too small
+   */
+  int CloseMemoryFile(AliHLTMemoryFile* pFile);
+
   /**
    * Insert event-done data information into the output.
    * @param edd          event-done data information
    */
   int CreateEventDoneData(AliHLTComponentEventDoneData edd);
 
+  /**
+   * Get current run number
+   */
+  AliHLTUInt32_t GetRunNo() const;
+
+  /**
+   * Get the current run type.
+   */
+  AliHLTUInt32_t GetRunType() const;
+
+  /**
+   * Set a bit to 1 in a readout list ( = AliHLTEventDDL )
+   * -> enable DDL for readout
+   * @param list        readout list
+   * @param ddlId       DDL Id to be turned on ( Decimal )
+   */
+  void EnableDDLBit(AliHLTEventDDL &list, Int_t ddlId ) const {
+    SetDDLBit( list, ddlId, kTRUE ); 
+  }
+
+  /**
+   * Set a bit to 0 in a readout list ( = AliHLTEventDDL )
+   * -> disable DDL for readout
+   * @param list        readout list
+   * @param ddlId       DDL Id to be turned on ( Decimal )
+   */
+  void DisableDDLBit(AliHLTEventDDL &list, Int_t ddlId ) const { 
+    SetDDLBit( list, ddlId, kFALSE );  
+  }
+  
+  /**
+   * Set or unset  bit a readout list ( = AliHLTEventDDL )
+   * -> enable or disable DDL for readout
+   * @param list        readout list
+   * @param ddlId       DDL Id to be turned on ( Decimal )
+   * @param state       kTRUE sets it, kFALSE unsets it
+   */
+  void SetDDLBit(AliHLTEventDDL &list, Int_t ddlId, Bool_t state ) const;
+  
+  /**
+   * Get the first word of a detector, which has a set DDL bit. 
+   * Beware, this only works if DDLs of 1 detector are set. In the 
+   * case of the TPC and TOF, which use 8 and 3 words, the first 
+   * word is returned.
+   * @param list        readout list
+   * @return            returns the detector index, -1 if no bit is set
+   *                    at all or several detectors (=error)
+   */
+  Int_t GetFirstUsedDDLWord(AliHLTEventDDL &list) const;
+
+  /**
+   * Copy a struct from block data.
+   * The function checks for block size and struct size. The least common
+   * size will be copied to the target struct, remaining fields are initialized
+   * to zero.<br>
+   * The target struct must have a 32bit struct size indicator as first member.
+   * @param pStruct     target struct
+   * @param iStructSize size of the struct
+   * @param iBlockNo    index of input block
+   * @param structname  name of the struct (log messages)
+   * @param eventname   name of the event (log messages)
+   * @return size copied, neg. error if failed
+   */
+  int CopyStruct(void* pStruct, unsigned int iStructSize, unsigned int iBlockNo,
+                const char* structname="", const char* eventname="");
+
  private:
+  /** copy constructor prohibited */
+  AliHLTComponent(const AliHLTComponent&);
+  /** assignment operator prohibited */
+  AliHLTComponent& operator=(const AliHLTComponent&);
+
   /**
    * Increment the internal event counter.
    * To be used by the friend classes AliHLTProcessor, AliHLTDataSource
@@ -754,13 +1065,17 @@ class AliHLTComponent : public AliHLTLogging {
 
   /**
    * Find the first input block of specified data type beginning at index.
+   * Input blocks containing a TObject have the size of the object as an
+   * unsigned 32 bit number in the first 4 bytes. This has to match the block
+   * size minus 4.
    * @param dt          data type
    * @param startIdx    index to start the search
+   * @param bObject     check if this is an object
    * @return index of the block, -ENOENT if no block found
    *
    * @internal
    */
-  int FindInputBlock(const AliHLTComponentDataType& dt, int startIdx=-1) const;
+  int FindInputBlock(const AliHLTComponentDataType& dt, int startIdx=-1, int bObject=0) const;
 
   /**
    * Get index in the array of input bocks.
@@ -810,16 +1125,20 @@ class AliHLTComponent : public AliHLTLogging {
    * This is the only method to insert blocks into the output stream, called
    * from all types of the Pushback method. The actual data might have been
    * written to the output buffer already. In that case NULL can be provided
-   * as buffer, only the block descriptor will be build.
+   * 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
+   * @param iHeaderSize size of Header
+   * @return neg. error code if failed
    */
-  int InsertOutputBlock(void* pBuffer, int iSize,
+  int InsertOutputBlock(void* pBuffer, int iBufferSize,
                        const AliHLTComponentDataType& dt,
-                       AliHLTUInt32_t spec);
-
+                       AliHLTUInt32_t spec,
+                       void* pHeader=NULL, int iHeaderSize=0);
 
   /** The global component handler instance */
   static AliHLTComponentHandler* fgpComponentHandler;              //! transient
@@ -864,11 +1183,26 @@ class AliHLTComponent : public AliHLTLogging {
   AliHLTUInt32_t fOutputBufferFilled;                              // see above
 
   /** list of ouput block data descriptors */
-  vector<AliHLTComponentBlockData> fOutputBlocks;                  // see above
+  AliHLTComponentBlockDataList fOutputBlocks;                      // see above
 
   /** stopwatch array */
   TObjArray* fpStopwatches;                                        //! transient
 
-  ClassDef(AliHLTComponent, 2)
+  /** array of memory files AliHLTMemoryFile */
+  AliHLTMemoryFilePList fMemFiles;                                 //! transient
+
+  /** descriptor of the current run */
+  AliHLTRunDesc* fpRunDesc;                                        //! transient
+
+  /** the current DDL list */
+  AliHLTEventDDL* fpDDLList;                                       //! transient
+
+  /** external fct to set CDB run no, indicates external CDB initialization */
+  void* fCDBSetRunNoFunc;                                          //! transient
+
+  /** id of the component in the analysis chain */
+  string fChainId;                                                 //! transient
+
+  ClassDef(AliHLTComponent, 5)
 };
 #endif