]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
first sketch of the HLTOUT handler
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 Oct 2007 09:14:31 +0000 (09:14 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 Oct 2007 09:14:31 +0000 (09:14 +0000)
HLT/BASE/AliHLTModuleAgent.cxx
HLT/BASE/AliHLTModuleAgent.h
HLT/BASE/AliHLTOUT.cxx [new file with mode: 0644]
HLT/BASE/AliHLTOUT.h [new file with mode: 0644]
HLT/BASE/AliHLTOUTHandler.cxx [new file with mode: 0644]
HLT/BASE/AliHLTOUTHandler.h [new file with mode: 0644]
HLT/libHLTbase.pkg

index 086de37c2ded7bc151a68f807ea4ea640324c341..2b1e8abd3557892d303b9d7789362b8f1e64e4aa 100644 (file)
@@ -98,6 +98,30 @@ const char* AliHLTModuleAgent::GetRequiredComponentLibraries() const
   return NULL;
 }
 
+int AliHLTModuleAgent::GetHandlerDescription(AliHLTComponentDataType /*dt*/,
+                                            AliHLTUInt32_t /*spec*/,
+                                            AliHLTOUTHandlerDesc& /*desc*/) const
+{
+  // default method, nothing to be done, child classes can overload
+  return 0;
+}
+
+AliHLTOUTHandler* AliHLTModuleAgent::GetOutputHandler(AliHLTComponentDataType /*dt*/,
+                                                     AliHLTUInt32_t /*spec*/) const
+{
+  // default method, nothing to be done, child classes can overload
+  return NULL;
+}
+
+
+AliRawStream* AliHLTModuleAgent::GetRawStream(AliHLTComponentDataType /*dt*/,
+                                             AliHLTUInt32_t /*spec*/,
+                                             const AliHLTOUT* /*pData*/) const
+{
+  // default method, nothing to be done, child classes can overload
+  return NULL;
+}
+
 int AliHLTModuleAgent::ActivateComponentHandler(AliHLTComponentHandler* pHandler)
 {
   int iResult=0;
index 25bfa088d2b6914eb993d9fbb6b610862387746f..5d4b8f17356c8461b16c005f5720467e8427ac0e 100644 (file)
@@ -29,6 +29,9 @@
 
 class AliRunLoader;
 class AliRawReader;
+class AliRawStream;
+class AliHLTOUTHandler;
+class AliHLTOUT;
 
 /**
  * @class AliHLTModuleAgent
@@ -83,6 +86,22 @@ class AliRawReader;
  *       registration via global objects 
  *       @see @ref alihltcomponent-handling
  *                                                                          <br>
+ * - @ref GetHandlerDescription                                             <br>
+ *       the agent can announce which part of the HLTOUT data can be treated
+ *       by the library and through which method. Different types of handlers
+ *       are defined to fit the various formats of the HLTOUT data.
+ *       @see AliHLTOUTHandlerType
+ *
+ * - @ref GetOutputHandler                                                  <br>
+ *       Return AliHLTOUTHandler for a given data type and specification.
+ *       This is mainly intended to treat detector proprietary data.
+ *
+ * - @ref GetRawStream                                                      <br>
+ *       Return an AliRawStream object which is capable of treating the
+ *       specified data type and specification. Rawstream must be provided
+ *       for data blocks intended to be the input for AliRoot detector
+ *       reconstruction by replacing the normal input stream.
+ *
  * @section alihltmoduleagent_references References
  * @see @ref AliHLTReconstructor interface to the AliRoot reconstruction
  * @see @ref AliHLTAgentSample agent for the libAliHLTSample library
@@ -184,6 +203,69 @@ class AliHLTModuleAgent : public TObject, public AliHLTLogging {
    */
   virtual int RegisterComponents(AliHLTComponentHandler* pHandler) const;
 
+  /**
+   * IDs for output handlers.
+   * The agent can provide output handlers in order to treat the output
+   * data coming from the HLTOUT nodes.
+   */
+  enum AliHLTOUTHandlerType {
+    kUnknownOutput =0,
+    /** output is in ESD format */
+    kEsd,
+    /** agent can create a raw stream */
+    kRawstream,
+    /** agent provides a chain */
+    kChain,
+    /** agent provides detector specific handler */
+    kProprietary,
+    kLastOutputHandler
+  };
+
+  /**
+   * Output handler description.
+   * \em fModule: module name specific for the handler type
+   *              - kRawStream: class name of the Rawstream class
+   *              - kChain:     blank separated list of chains
+   *              - kProprietary: name of the handler class
+   */
+  struct AliHLTOUTHandlerDesc {
+    /** type of the handler */
+    AliHLTOUTHandlerType    fHType;
+    /** data type treated by the handler */
+    AliHLTComponentDataType fDt;
+    /** class or chain name */
+    const char*             fModule;
+  };
+
+  /**
+   * Get handler description for a data block.
+   * @param dt        [in] data type of the block
+   * @param spec      [in] specification of the block
+   * @param desc      [out] handler description
+   * @return 1 if the agent can provide a handler, 0 if not
+   */
+  virtual int GetHandlerDescription(AliHLTComponentDataType dt,
+                                   AliHLTUInt32_t spec,
+                                   AliHLTOUTHandlerDesc& desc) const;
+  /**
+   * Get handler for a data block of the HLTOUT data.
+   * @param dt        [in] data type of the block
+   * @param spec      [in] specification of the block
+   */
+  virtual AliHLTOUTHandler* GetOutputHandler(AliHLTComponentDataType dt,
+                                            AliHLTUInt32_t spec) const;
+
+  /**
+   * Get raw stream for a data block.
+   * @param dt        [in] data type of the block
+   * @param spec      [in] specification of the block
+   * @param pData     [in] data control object
+   * @return Rawstream object, NULL if no Rawstream available for data type/spec
+   */
+  virtual AliRawStream* GetRawStream(AliHLTComponentDataType dt,
+                                    AliHLTUInt32_t spec,
+                                    const AliHLTOUT* pData) const;
+
   /**
    * Old method kept for backward compatibility, redirected to @ref
    * GetReconstructionChains.
diff --git a/HLT/BASE/AliHLTOUT.cxx b/HLT/BASE/AliHLTOUT.cxx
new file mode 100644 (file)
index 0000000..d249790
--- /dev/null
@@ -0,0 +1,47 @@
+// $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>        *
+ *                  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   AliHLTOUT.cxx
+    @author Matthias Richter
+    @date   
+    @brief  The control class for HLTOUT data.                            */
+
+  // see header file for class documentation
+  // or
+  // refer to README to build package
+  // or
+  // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#include "AliHLTOUT.h"
+
+/** ROOT macro for the implementation of ROOT specific class methods */
+ClassImp(AliHLTOUT)
+
+AliHLTOUT::AliHLTOUT()
+{ 
+  // see header file for class documentation
+  // or
+  // refer to README to build package
+  // or
+  // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+}
+
+AliHLTOUT::~AliHLTOUT()
+{ 
+  // see header file for class documentation
+}
diff --git a/HLT/BASE/AliHLTOUT.h b/HLT/BASE/AliHLTOUT.h
new file mode 100644 (file)
index 0000000..8c8920c
--- /dev/null
@@ -0,0 +1,49 @@
+//-*- Mode: C++ -*-
+// @(#) $Id$
+
+#ifndef ALIHLTOUT_H
+#define ALIHLTOUT_H
+/* 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   AliHLTOUT.h
+    @author Matthias Richter
+    @date   
+    @brief  The control class for HLTOUT data.
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+                                                                          */
+#include "AliHLTLogging.h"
+
+/**
+ * @class AliHLTOUT
+ * The control class for HLTOUT data.
+ * The output of the HLT, either from the HLTOUT nodes or simulated output,
+ * is transferred and stored in the HOMER format. The AliHLTOUT class 
+ * implements scanning of the HOMER data for all HLTOUT DDL links and
+ * abstracts access to the complete HLTOUT data.
+ * 
+ */
+class AliHLTOUT : public AliHLTLogging {
+ public:
+  /** standard constructor */
+  AliHLTOUT();
+  /** standard destructor */
+  virtual ~AliHLTOUT();
+
+ protected:
+
+ private:
+  /** copy constructor prohibited */
+  AliHLTOUT(const AliHLTOUT&);
+  /** assignment operator prohibited */
+  AliHLTOUT& operator=(const AliHLTOUT&);
+
+  ClassDef(AliHLTOUT, 0)
+};
+#endif
diff --git a/HLT/BASE/AliHLTOUTHandler.cxx b/HLT/BASE/AliHLTOUTHandler.cxx
new file mode 100644 (file)
index 0000000..981fbe9
--- /dev/null
@@ -0,0 +1,47 @@
+// $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>        *
+ *                  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   AliHLTOUTHandler.cxx
+    @author Matthias Richter
+    @date   
+    @brief  Base class implementation of HLTOUT handlers.                    */
+
+  // see header file for class documentation
+  // or
+  // refer to README to build package
+  // or
+  // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#include "AliHLTOUTHandler.h"
+
+/** ROOT macro for the implementation of ROOT specific class methods */
+ClassImp(AliHLTOUTHandler)
+
+AliHLTOUTHandler::AliHLTOUTHandler()
+{ 
+  // see header file for class documentation
+  // or
+  // refer to README to build package
+  // or
+  // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+}
+
+AliHLTOUTHandler::~AliHLTOUTHandler()
+{ 
+  // see header file for class documentation
+}
diff --git a/HLT/BASE/AliHLTOUTHandler.h b/HLT/BASE/AliHLTOUTHandler.h
new file mode 100644 (file)
index 0000000..f688383
--- /dev/null
@@ -0,0 +1,56 @@
+//-*- Mode: C++ -*-
+// @(#) $Id$
+
+#ifndef ALIHLTOUTHANDLER_H
+#define ALIHLTOUTHANDLER_H
+/* 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   AliHLTOUTHandler.h
+    @author Matthias Richter
+    @date   
+    @brief  Base class declaration of HLTOUT handlers
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+                                                                          */
+#include "AliHLTLogging.h"
+
+class AliHLTOUT;
+
+/**
+ * @class AliHLTOUTHandler
+ * Base class declaration of HLT output handlers.
+ * The library implementation of the AliHLTModuleAgent allows to generate
+ * handlers for data blocks of the HLT output. This can be the output of
+ * the real HLT coming from the HLTOUT nodes, or simulated HLT output.   <br>
+ * \em Note: The created instance of AliHLTOUTHandler is
+ * deleted by the framework.
+ */
+class AliHLTOUTHandler : public AliHLTLogging {
+ public:
+  /** standard constructor */
+  AliHLTOUTHandler();
+  /** standard destructor */
+  virtual ~AliHLTOUTHandler();
+
+ protected:
+
+  /**
+   * Process the data.
+   */
+  virtual int ProcessData(AliHLTOUT* pData) = 0;
+
+ private:
+  /** copy constructor prohibited */
+  AliHLTOUTHandler(const AliHLTOUTHandler&);
+  /** assignment operator prohibited */
+  AliHLTOUTHandler& operator=(const AliHLTOUTHandler&);
+
+  ClassDef(AliHLTOUTHandler, 0)
+};
+#endif
index 8fda4203f9f1843b3fb01c3ef73a8386b489b9c4..f9e59d7285dbf7f58d3f2a5019135ca3ebdff6cd 100644 (file)
@@ -24,6 +24,8 @@ CLASS_HDRS:=          AliHLTComponent.h \
                AliHLTOfflineDataSource.h \
                AliHLTOfflineDataSink.h \
                AliHLTModuleAgent.h \
+               AliHLTOUT.h \
+               AliHLTOUTHandler.h \
                AliHLTMemoryFile.h \
                AliHLTMessage.h