]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/BASE/AliHLTComponent.h
initialization of CDB in wrapper interface;added treatment of reconfiguration event
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTComponent.h
index 2934135b6709c4183bc5537bc55febaf3b06a047..f4586e6a2976af397afe61f9f076aa80b030a089 100644 (file)
@@ -323,6 +323,28 @@ class AliHLTComponent : public AliHLTLogging {
                            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.
+   */
+  int InitCDB(const char* cdbPath);
+
+  /**
+   * 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.
 
   /**
@@ -572,6 +594,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
@@ -746,6 +787,29 @@ 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,
@@ -921,6 +985,46 @@ class AliHLTComponent : public AliHLTLogging {
    */
   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
@@ -1086,6 +1190,12 @@ class AliHLTComponent : public AliHLTLogging {
   /** the current DDL list */
   AliHLTEventDDL* fpDDLList;                                       //! transient
 
-  ClassDef(AliHLTComponent, 3)
+  /** indicates that the CDB has been initialized locally */
+  bool fCDBInitialized;                                            //! transient
+
+  /** id of the component in the analysis chain */
+  string fChainId;                                                 //! transient
+
+  ClassDef(AliHLTComponent, 4)
 };
 #endif