]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/sim/AliHLTOUTComponent.h
coding rules and class documentation
[u/mrichter/AliRoot.git] / HLT / sim / AliHLTOUTComponent.h
index 2e296c540842a24952ddd00599b545c91f714d08..5cc470569c818dd97e0bcd328c4a0fb0c14a10dd 100644 (file)
@@ -1,4 +1,5 @@
-// @(#) $Id$
+//-*- Mode: C++ -*-
+// $Id$
 
 #ifndef ALIHLTOUTCOMPONENT_H
 #define ALIHLTOUTCOMPONENT_H
@@ -6,17 +7,11 @@
 //* ALICE Experiment at CERN, All rights reserved.                         *
 //* See cxx source for full Copyright notice                               *
 
-/** @file   AliHLTOUTComponent.h
-    @author Matthias Richter
-    @date   
-    @brief  The HLTOUT data sink component similar to HLTOUT nodes
-*/
-
-// see class description below
-// or
-// refer to README to build package
-// or
-// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+/// @file   AliHLTOUTComponent.h
+/// @author Matthias Richter
+/// @date   
+/// @brief  The HLTOUT data sink component similar to HLTOUT nodes.
+/// @note   Used in the AliRoot environment only.
 
 #include "AliHLTOfflineDataSink.h"
 
@@ -31,6 +26,9 @@ typedef vector<AliHLTMonitoringWriter*> AliHLTMonitoringWriterPVector;
  * The HLTOUT data sink component which models the behavior of the HLTOUT
  * nodes of the HLT cluster.
  * <h2>General properties:</h2>
+ * The HLTOUT component is attached at the end of a chain. It stores all input
+ * block in the HOMER format, distributed over a number of DDL link. The data
+ * is stored in a digit file or in raw ddl files.
  *
  * Component ID: \b HLTOUT <br>
  * Library: \b libHLTrec.so     <br>
@@ -44,6 +42,12 @@ typedef vector<AliHLTMonitoringWriter*> AliHLTMonitoringWriterPVector;
  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
  * \li -links      <i> n   </i> <br>
  *      number of output ddl links
+ * \li -digitfile  <i> name   </i> <br>
+ *      name of the digit file to write (default HLT.Digits.root)
+ * \li -rawout[=on,off]  <br>
+ *      switch raw output on/off (default on)
+ * \li -digitout[=on,off]  <br>
+ *      switch digit output on/off (default on)
  *
  * <h2>Configuration:</h2>
  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
@@ -71,8 +75,14 @@ typedef vector<AliHLTMonitoringWriter*> AliHLTMonitoringWriterPVector;
  */
 class AliHLTOUTComponent : public AliHLTOfflineDataSink  {
  public:
-  /** standard constructor */
-  AliHLTOUTComponent();
+  /// type of the HLTOUT component
+  enum EType {
+    kGlobal = 0, // generate according to global flags
+    kDigits = 1, // generate only digits: ID HLTOUTdigits
+    kRaw    = 2  // generate only raw:    ID HLTOUTraw
+  };
+  /// constructor for different component types
+  AliHLTOUTComponent(EType type=kGlobal);
   /** destructor */
   virtual ~AliHLTOUTComponent();
 
@@ -92,6 +102,11 @@ class AliHLTOUTComponent : public AliHLTOfflineDataSink  {
    */
   static void ClearGlobalOption(unsigned int options);
 
+  /**
+   * Test one of the global options
+   */
+  static bool TestGlobalOption(unsigned int option);
+
   enum {
     /** write the raw files of the HLT links */
     kWriteRawFiles = 0x1,
@@ -105,6 +120,9 @@ class AliHLTOUTComponent : public AliHLTOfflineDataSink  {
    */
   int DoInit( int argc, const char** argv );
 
+  /// inherited from AliHLTComponent,  component specific argument scan
+  int ScanConfigurationArgument(int argc, const char** argv);
+
   /**
    * Deinit method.
    */
@@ -125,14 +143,31 @@ class AliHLTOUTComponent : public AliHLTOfflineDataSink  {
 
   /**
    * Fill ESD for one event.
+   * Empty now, data written in Write() at the end of DumpEvent()
    * @param eventNo       event No. \em Note: this is an internal enumeration of the
    *                      processed events.
    * @param runLoader     the AliRoot runloader
-   * @param esd           an AliESDEvent instance
    * @return neg. error code if failed 
    */
   int FillESD(int eventNo, AliRunLoader* runLoader, AliESDEvent* esd);
 
+  /**
+   * Write the ecoded HLTOUT data to raw and digits files.
+   * Originally data was written in the FillESD function of the
+   * AliHLTOfflineInterface. Mainly for the sake of availability of the
+   * AliLoader. This concept has not turned out to be succesful and the
+   * development went a slightly different direction with the concept of
+   * HLTOUT handlers.
+   * 2010-04-14 change the original FillESD() to Write(), keep the body
+   * of the function
+   *
+   * @param eventNo       event No. \em Note: this is an internal enumeration of the
+   *                      processed events.
+   * @param runLoader     the AliRoot runloader
+   * @return neg. error code if failed 
+   */
+  int Write(int eventNo, AliRunLoader* runLoader);
+
  private:
   /** copy constructor prohibited */
   AliHLTOUTComponent(const AliHLTOUTComponent&);
@@ -198,6 +233,12 @@ class AliHLTOUTComponent : public AliHLTOfflineDataSink  {
   /** global options for all instances */
   static int fgOptions; //! transient
 
+  /// component options set from component type or global options at DoInit
+  int fOptions; //! transient
+
+  /** digit file name */
+  TString fDigitFileName; //! transient
+
   /** the root file for the HLT 'digit' output */
   TFile* fpDigitFile; //!transient
 
@@ -213,6 +254,12 @@ class AliHLTOUTComponent : public AliHLTOfflineDataSink  {
   /** Data size kept in the internal buffer */
   int fReservedData; //!transient
 
-  ClassDef(AliHLTOUTComponent, 3)
+  /// type of the component
+  EType fType; //! type of the component
+
+  /// counter for round robin usage of HLTOUT links
+  int fRoundRobinCounter; //! counter for round robin usage of HLTOUT links
+
+  ClassDef(AliHLTOUTComponent, 0)
 };
 #endif