HLT sample applications
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 17 Apr 2007 16:39:33 +0000 (16:39 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 17 Apr 2007 16:39:33 +0000 (16:39 +0000)
- publisher for AliLoader trees added
- sample analysis chain added tp sample lib
- tutorial and documentation
- benchmark functionality added to AliHLTSystem

26 files changed:
HLT/BASE/AliHLTComponent.cxx
HLT/BASE/AliHLTComponent.h
HLT/BASE/AliHLTDataBuffer.h
HLT/BASE/AliHLTModuleAgent.cxx
HLT/BASE/AliHLTModuleAgent.h
HLT/BASE/AliHLTOfflineInterface.cxx
HLT/BASE/AliHLTSystem.cxx
HLT/BASE/AliHLTSystem.h
HLT/BASE/Makefile.am
HLT/BASE/util/AliHLTFilePublisher.h
HLT/BASE/util/AliHLTLoaderPublisherComponent.cxx [new file with mode: 0644]
HLT/BASE/util/AliHLTLoaderPublisherComponent.h [new file with mode: 0644]
HLT/ChangeLog
HLT/Makefile.am
HLT/SampleLib/AliHLTAgentSample.cxx
HLT/SampleLib/AliHLTAgentSample.h
HLT/SampleLib/AliHLTSampleOfflineSinkComponent.cxx [new file with mode: 0644]
HLT/SampleLib/AliHLTSampleOfflineSinkComponent.h [new file with mode: 0644]
HLT/SampleLib/Makefile.am
HLT/SampleLib/tutorial.c
HLT/configure.ac
HLT/doc/doxygen.conf.in
HLT/libAliHLTSample.pkg
HLT/libAliHLTUtil.pkg
HLT/src/AliHLTReconstructor.cxx
HLT/src/AliHLTReconstructor.h

index 9ab55b5c4b4fd26ef06304e5581fad9f91962799..7995190e0bc67872c88b02b39e94eb6d29b7ee01 100644 (file)
@@ -32,9 +32,19 @@ using namespace std;
 #include "TString.h"
 #include "TObjArray.h"
 #include "TClass.h"
+#include "TStopwatch.h"
 
 /** ROOT macro for the implementation of ROOT specific class methods */
-ClassImp(AliHLTComponent)
+ClassImp(AliHLTComponent);
+
+/** stopwatch macro using the stopwatch guard */
+#define ALIHLTCOMPONENT_STOPWATCH(type) AliHLTStopwatchGuard swguard(fpStopwatches!=NULL?reinterpret_cast<TStopwatch*>(fpStopwatches->At((int)type)):NULL)
+//#define ALIHLTCOMPONENT_STOPWATCH(type) 
+
+/** stopwatch macro for operations of the base class */
+#define ALIHLTCOMPONENT_BASE_STOPWATCH() ALIHLTCOMPONENT_STOPWATCH(kSWBase)
+/** stopwatch macro for operations of the detector algorithm (DA) */
+#define ALIHLTCOMPONENT_DA_STOPWATCH() ALIHLTCOMPONENT_STOPWATCH(kSWDA)
 
 AliHLTComponent::AliHLTComponent()
   :
@@ -51,7 +61,8 @@ AliHLTComponent::AliHLTComponent()
   fpOutputBuffer(NULL),
   fOutputBufferSize(0),
   fOutputBufferFilled(0),
-  fOutputBlocks()
+  fOutputBlocks(),
+  fpStopwatches(new TObjArray(kSWTypeCount))
 {
   // see header file for class documentation
   // or
@@ -80,7 +91,8 @@ AliHLTComponent::AliHLTComponent(const AliHLTComponent&)
   fpOutputBuffer(NULL),
   fOutputBufferSize(0),
   fOutputBufferFilled(0),
-  fOutputBlocks()
+  fOutputBlocks(),
+  fpStopwatches(NULL)
 {
   // see header file for class documentation
   HLTFatal("copy constructor untested");
@@ -431,6 +443,7 @@ const TObject* AliHLTComponent::GetFirstInputObject(const AliHLTComponentDataTyp
                                                    int bForce)
 {
   // see header file for function documentation
+  ALIHLTCOMPONENT_BASE_STOPWATCH();
   fSearchDataType=dt;
   if (classname) fClassName=classname;
   else fClassName.clear();
@@ -452,6 +465,7 @@ const TObject* AliHLTComponent::GetFirstInputObject(const char* dtID,
                                                    int         bForce)
 {
   // see header file for function documentation
+  ALIHLTCOMPONENT_BASE_STOPWATCH();
   AliHLTComponentDataType dt;
   SetDataType(dt, dtID, dtOrigin);
   return GetFirstInputObject(dt, classname, bForce);
@@ -460,6 +474,7 @@ const TObject* AliHLTComponent::GetFirstInputObject(const char* dtID,
 const TObject* AliHLTComponent::GetNextInputObject(int bForce)
 {
   // see header file for function documentation
+  ALIHLTCOMPONENT_BASE_STOPWATCH();
   int idx=FindInputBlock(fSearchDataType, fCurrentInputBlock+1);
   //HLTDebug("found block %d when searching for data type %s", idx, DataType2Text(fSearchDataType).c_str());
   TObject* pObj=NULL;
@@ -550,11 +565,13 @@ int AliHLTComponent::CleanupInputObjects()
     if (pObj) delete pObj;
   }
   delete array;
+  return 0;
 }
 
 AliHLTComponentDataType AliHLTComponent::GetDataType(const TObject* pObject)
 {
   // see header file for function documentation
+  ALIHLTCOMPONENT_BASE_STOPWATCH();
   AliHLTComponentDataType dt=kAliHLTVoidDataType;
   int idx=fCurrentInputBlock;
   if (pObject) {
@@ -576,6 +593,7 @@ AliHLTComponentDataType AliHLTComponent::GetDataType(const TObject* pObject)
 AliHLTUInt32_t AliHLTComponent::GetSpecification(const TObject* pObject)
 {
   // see header file for function documentation
+  ALIHLTCOMPONENT_BASE_STOPWATCH();
   AliHLTUInt32_t iSpec=kAliHLTVoidDataSpec;
   int idx=fCurrentInputBlock;
   if (pObject) {
@@ -597,6 +615,7 @@ AliHLTUInt32_t AliHLTComponent::GetSpecification(const TObject* pObject)
 const AliHLTComponentBlockData* AliHLTComponent::GetFirstInputBlock(const AliHLTComponentDataType& dt)
 {
   // see header file for function documentation
+  ALIHLTCOMPONENT_BASE_STOPWATCH();
   fSearchDataType=dt;
   fClassName.clear();
   int idx=FindInputBlock(fSearchDataType, 0);
@@ -612,6 +631,7 @@ const AliHLTComponentBlockData* AliHLTComponent::GetFirstInputBlock(const char*
                                                                    const char* dtOrigin)
 {
   // see header file for function documentation
+  ALIHLTCOMPONENT_BASE_STOPWATCH();
   AliHLTComponentDataType dt;
   SetDataType(dt, dtID, dtOrigin);
   return GetFirstInputBlock(dt);
@@ -620,6 +640,7 @@ const AliHLTComponentBlockData* AliHLTComponent::GetFirstInputBlock(const char*
 const AliHLTComponentBlockData* AliHLTComponent::GetNextInputBlock()
 {
   // see header file for function documentation
+  ALIHLTCOMPONENT_BASE_STOPWATCH();
   int idx=FindInputBlock(fSearchDataType, fCurrentInputBlock+1);
   const AliHLTComponentBlockData* pBlock=NULL;
   if (idx>=0) {
@@ -648,6 +669,7 @@ int AliHLTComponent::FindInputBlock(const AliHLTComponentBlockData* pBlock)
 AliHLTUInt32_t AliHLTComponent::GetSpecification(const AliHLTComponentBlockData* pBlock)
 {
   // see header file for function documentation
+  ALIHLTCOMPONENT_BASE_STOPWATCH();
   AliHLTUInt32_t iSpec=kAliHLTVoidDataSpec;
   int idx=fCurrentInputBlock;
   if (pBlock) {
@@ -666,6 +688,7 @@ AliHLTUInt32_t AliHLTComponent::GetSpecification(const AliHLTComponentBlockData*
 int AliHLTComponent::PushBack(TObject* pObject, const AliHLTComponentDataType& dt, AliHLTUInt32_t spec)
 {
   // see header file for function documentation
+  ALIHLTCOMPONENT_BASE_STOPWATCH();
   int iResult=0;
   if (pObject) {
     AliHLTMessage msg(kMESS_OBJECT);
@@ -690,6 +713,7 @@ int AliHLTComponent::PushBack(TObject* pObject, const AliHLTComponentDataType& d
 int AliHLTComponent::PushBack(TObject* pObject, const char* dtID, const char* dtOrigin, AliHLTUInt32_t spec)
 {
   // see header file for function documentation
+  ALIHLTCOMPONENT_BASE_STOPWATCH();
   AliHLTComponentDataType dt;
   SetDataType(dt, dtID, dtOrigin);
   return PushBack(pObject, dt, spec);
@@ -698,12 +722,14 @@ int AliHLTComponent::PushBack(TObject* pObject, const char* dtID, const char* dt
 int AliHLTComponent::PushBack(void* pBuffer, int iSize, const AliHLTComponentDataType& dt, AliHLTUInt32_t spec)
 {
   // see header file for function documentation
+  ALIHLTCOMPONENT_BASE_STOPWATCH();
   return InsertOutputBlock(pBuffer, iSize, dt, spec);
 }
 
 int AliHLTComponent::PushBack(void* pBuffer, int iSize, const char* dtID, const char* dtOrigin, AliHLTUInt32_t spec)
 {
   // see header file for function documentation
+  ALIHLTCOMPONENT_BASE_STOPWATCH();
   AliHLTComponentDataType dt;
   SetDataType(dt, dtID, dtOrigin);
   return PushBack(pBuffer, iSize, dt, spec);
@@ -772,6 +798,7 @@ int AliHLTComponent::ProcessEvent( const AliHLTComponentEventData& evtData,
                                   AliHLTComponentEventDoneData*& edd )
 {
   // see header file for function documentation
+  ALIHLTCOMPONENT_BASE_STOPWATCH();
   int iResult=0;
   fCurrentEvent=evtData.fEventID;
   fCurrentEventData=evtData;
@@ -784,7 +811,10 @@ int AliHLTComponent::ProcessEvent( const AliHLTComponentEventData& evtData,
   fOutputBlocks.clear();
   
   vector<AliHLTComponentBlockData> blockData;
-  iResult=DoProcessing(evtData, blocks, trigData, outputPtr, size, blockData, edd);
+  { // dont delete, sets the scope for the stopwatch guard
+    ALIHLTCOMPONENT_DA_STOPWATCH();
+    iResult=DoProcessing(evtData, blocks, trigData, outputPtr, size, blockData, edd);
+  } // end of the scope of the stopwatch guard
   if (iResult>=0) {
     if (fOutputBlocks.size()>0) {
       //HLTDebug("got %d block(s) via high level interface", fOutputBlocks.size());
@@ -811,3 +841,100 @@ int AliHLTComponent::ProcessEvent( const AliHLTComponentEventData& evtData,
   return iResult;
 }
 
+AliHLTComponent::AliHLTStopwatchGuard::AliHLTStopwatchGuard()
+  :
+  fpStopwatch(NULL),
+  fpPrec(NULL)
+{
+  // standard constructor (not for use)
+}
+
+AliHLTComponent::AliHLTStopwatchGuard::AliHLTStopwatchGuard(TStopwatch* pStopwatch)
+  :
+  fpStopwatch(pStopwatch),
+  fpPrec(NULL)
+{
+  // constructor
+
+  // check for already existing guard
+  if (fgpCurrent) fpPrec=fgpCurrent;
+  fgpCurrent=this;
+
+  // stop the preceeding guard if it controls a different stopwatch
+  int bStart=1;
+  if (fpPrec && fpPrec!=this) bStart=fpPrec->Hold(fpStopwatch);
+
+  // start the stopwatch if the current guard controls a different one
+  if (fpStopwatch && bStart==1) fpStopwatch->Start(kFALSE);
+}
+
+AliHLTComponent::AliHLTStopwatchGuard::AliHLTStopwatchGuard(AliHLTStopwatchGuard&)
+  :
+  fpStopwatch(NULL),
+  fpPrec(NULL)
+{
+  // copy constructor (not for use)
+}
+
+AliHLTComponent::AliHLTStopwatchGuard* AliHLTComponent::AliHLTStopwatchGuard::fgpCurrent=NULL;
+
+AliHLTComponent::AliHLTStopwatchGuard::~AliHLTStopwatchGuard()
+{
+  // destructor
+
+  // resume the preceeding guard if it controls a different stopwatch
+  int bStop=1;
+  if (fpPrec && fpPrec!=this) bStop=fpPrec->Resume(fpStopwatch);
+
+  // stop the stopwatch if the current guard controls a different one
+  if (fpStopwatch && bStop==1) fpStopwatch->Stop();
+
+  // resume to the preceeding guard
+  fgpCurrent=fpPrec;
+}
+
+int AliHLTComponent::AliHLTStopwatchGuard::Hold(TStopwatch* pSucc)
+{
+  // see header file for function documentation
+  if (fpStopwatch!=NULL && fpStopwatch!=pSucc) fpStopwatch->Stop();
+  return fpStopwatch!=pSucc?1:0;
+}
+
+int AliHLTComponent::AliHLTStopwatchGuard::Resume(TStopwatch* pSucc)
+{
+  // see header file for function documentation
+  if (fpStopwatch!=NULL && fpStopwatch!=pSucc) fpStopwatch->Start(kFALSE);
+  return fpStopwatch!=pSucc?1:0;
+}
+
+int AliHLTComponent::SetStopwatch(TObject* pSW, AliHLTStopwatchType type) 
+{
+  // see header file for function documentation
+  int iResult=0;
+  if (pSW!=NULL && type<kSWTypeCount) {
+    if (fpStopwatches) {
+      TObject* pObj=fpStopwatches->At((int)type);
+      if (pSW==NULL        // explicit reset
+         || pObj==NULL) { // explicit set
+       fpStopwatches->AddAt(pSW, (int)type);
+      } else if (pObj!=pSW) {
+       HLTWarning("stopwatch %d already set, reset first", (int)type);
+       iResult=-EBUSY;
+      }
+    }
+  } else {
+    iResult=-EINVAL;
+  }
+  return iResult;
+}
+
+int AliHLTComponent::SetStopwatches(TObjArray* pStopwatches)
+{
+  // see header file for function documentation
+  if (pStopwatches==NULL) return -EINVAL;
+
+  int iResult=0;
+  for (int i=0 ; i<(int)kSWTypeCount && pStopwatches->GetEntries(); i++)
+    SetStopwatch(pStopwatches->At(i), (AliHLTStopwatchType)i);
+  return iResult;
+}
index db1f6724d7d45b9142f4f11bafcc10338eaf9a6e..703267e64ec764d954cfc64f2fb5e108365fd963 100644 (file)
@@ -39,6 +39,7 @@ typedef AliHLTComponentEventDoneData AliHLTComponent_EventDoneData;
 
 class AliHLTComponentHandler;
 class TObjArray;
+class TStopwatch;
 
 /**
  * @class AliHLTComponent
@@ -68,9 +69,9 @@ class TObjArray;
  * 
  * @subsection alihltcomponent-type Component type
  * Components can be of type
- * - @ref kSource:    components which only produce data 
- * - @ref kProcessor: components which consume and produce data
- * - @ref kSink:      components which only consume data
+ * - @ref kSource     components which only produce data 
+ * - @ref kProcessor  components which consume and produce data
+ * - @ref kSink       components which only consume data
  *
  * where data production and consumption refer to the analysis data stream. In
  * order to indicate the type, a child component can overload the
@@ -367,6 +368,87 @@ class AliHLTComponent : public AliHLTLogging {
    */
   void PrintComponentDataTypeInfo(const AliHLTComponentDataType& dt);
 
+  /**
+   * Stopwatch type for benchmarking.
+   */
+  enum AliHLTStopwatchType {
+    /** total time for event processing */
+    kSWBase,
+    /** detector algorithm w/o interface callbacks */
+    kSWDA,
+    /** data sources */
+    kSWInput,
+    /** data sinks */
+    kSWOutput,
+    /** number of types */
+    kSWTypeCount
+  };
+
+  /**
+   * Helper class for starting and stopping a stopwatch.
+   * The guard can be used by instantiating an object in a function. The
+   * specified stopwatch is started and the previous stopwatch put on
+   * hold. When the function is terminated, the object is deleted automatically
+   * deleted, stopping the stopwatch and starting the one on hold.<br>
+   * \em IMPORTANT: never create dynamic objects from this guard as this violates
+   * the idea of a guard.
+   */
+  class AliHLTStopwatchGuard {
+  public:
+    /** standard constructor (not for use) */
+    AliHLTStopwatchGuard();
+    /** constructor */
+    AliHLTStopwatchGuard(TStopwatch* pStart);
+    /** copy constructor (not for use) */
+    AliHLTStopwatchGuard(AliHLTStopwatchGuard&);
+    /** destructor */
+    ~AliHLTStopwatchGuard();
+
+  private:
+    /**
+     * Hold the previous guard for the existence of this guard.
+     * Checks whether this guard controls a new stopwatch. In that case, the
+     * previous guard and its stopwatch are put on hold.
+     * @param pSucc        instance of the stopwatch of the new guard
+     * @return    1 if pSucc is a different stopwatch which should
+     *            be started<br>
+     *            0 if it controls the same stopwatch
+     */
+    int Hold(TStopwatch* pSucc);
+
+    /**
+     * Resume the previous guard.
+     * Checks whether the peceeding guard controls a different stopwatch. In that
+     * case, the its stopwatch is resumed.
+     * @param pSucc        instance of the stopwatch of the new guard
+     * @return    1 if pSucc is a different stopwatch which should
+     *            be stopped<br>
+     *            0 if it controls the same stopwatch
+     */
+    int Resume(TStopwatch* pSucc);
+
+    /** the stopwatch controlled by this guard */
+    TStopwatch* fpStopwatch;                                                //!transient
+
+    /** previous stopwatch guard, put on hold during existence of the guard */
+    AliHLTStopwatchGuard* fpPrec;                                           //!transient
+
+    /** active stopwatch guard */
+    static AliHLTStopwatchGuard* fgpCurrent;                                //!transient
+  };
+
+  /**
+   * Set a stopwatch for a given purpose.
+   * @param pSW         stopwatch object
+   * @param type        type of the stopwatch
+   */
+  int SetStopwatch(TObject* pSW, AliHLTStopwatchType type=kSWBase);
+
+  /**
+   * Init a set of stopwatches.
+   * @param pStopwatches object array of stopwatches
+   */
+  int SetStopwatches(TObjArray* pStopwatches);
 
  protected:
 
@@ -778,6 +860,9 @@ class AliHLTComponent : public AliHLTLogging {
   /** list of ouput block data descriptors */
   vector<AliHLTComponentBlockData> fOutputBlocks;                  // see above
 
-  ClassDef(AliHLTComponent, 1)
+  /** stopwatch array */
+  TObjArray* fpStopwatches;                                        //! transient
+
+  ClassDef(AliHLTComponent, 2)
 };
 #endif
index 7c03243013537adc57edd4779358514f21a815d4..5bba4074dbd8e5ed5ef410fe7ac18d1f3fa10729 100644 (file)
@@ -248,7 +248,8 @@ class AliHLTDataBuffer : public TObject, public AliHLTLogging
    *          of the consumer, neg. error code if failed <br>
    *          -EINVAL       invalid parameter <br>
    */
-  int FindMatchingDataSegments(const AliHLTComponent* pConsumer, vector<AliHLTDataSegment>& tgtList);
+  int FindMatchingDataSegments(const AliHLTComponent* pConsumer, 
+                              vector<AliHLTDataBuffer::AliHLTDataSegment>& tgtList);
 
   /**
    * Reset the data buffer.
index 333e751d2b80999761ef606d6296cfb56a1e5555..8101ef524491fbc600658dbd63196db849ddb1c4 100644 (file)
@@ -99,7 +99,16 @@ int AliHLTModuleAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
   return 0;
 }
 
-const char* AliHLTModuleAgent::GetTopConfigurations(AliRunLoader* runloader) const
+const char* AliHLTModuleAgent::GetLocalRecConfigurations(AliRunLoader* runloader) const
+{
+  // default method, nothing to be done, child classes can overload
+  if (runloader==NULL) {
+    // get rid of 'unused parameter' warning
+  }
+  return NULL;
+}
+
+const char* AliHLTModuleAgent::GetEventRecConfigurations(AliRunLoader* runloader) const
 {
   // default method, nothing to be done, child classes can overload
   if (runloader==NULL) {
index 87a01f5315b02108b64a9528a37ac38c85a47940..fddcc96765d05bef350775735be661ded9a0ef94 100644 (file)
@@ -25,23 +25,49 @@ class AliRunLoader;
  * @brief Agent helper class for HLT sub modules, e.g. PHOS, TPC, Trigger
  *
  * This class implements the agent base class for the HLT sub modules.
- * The agent of a library gives information on the features of the module,
- * like the configurations to run and other component libraries it depends
- * on.
- * 
+ * The agent of a library gives information on the features of the library/
+ * components, like the configurations to run and other component libraries
+ * it depends on.
+ * @note There must not be more than one agent per module/library.
+ *
  * All HLT component libraries are loaded on demand through the HLT steering
  * instance (@ref AliHLTSystem). A library can implement an agent derived 
  * from this base class, and has to define one global object of this agent
  * in the code. The agent will be registered automatically, and the features
  * can be queried when required.
  *
- * This is usually done during running the AliRoot Reconstruction (see
- * <tt>AliReconstruction</tt>. The HLT implemets the AliHLTReconstructor which
- * holds the HLT steering object. Several flags can be specified as options
- * via the SetOption method of AliReconstruction, including the component
- * libraries to be loaded.
+ * This is usually done during running the AliRoot reconstruction (see AliRoot
+ * documentation on <tt> AliReconstruction</tt>). The HLT implemets the @ref
+ * AliHLTReconstructor which holds the HLT steering object. Several flags can
+ * be specified as options via the <tt>SetOption</tt> method of 
+ * <tt>AliReconstruction</tt>, including the component libraries to be loaded.
+ *
+ * @section alihltmoduleagent_interface Agent interface
+ * The child can implement the following functions:
+ * - @ref CreateConfigurations                                              <br>
+ *       create HLT configuration forming an HLT analysis chain.
+ *
+ * - @ref GetLocalRecConfigurations                                         <br>
+ *       configurations run during local event reconstruction. 
+ *       @note Local event reconstruction is the first step of the 
+ *       reconstruction chain. All events are processed at once.
+ *                                                                          <br>
+ * - @ref GetEventRecConfigurations                                         <br>
+ *       configurations run during event reconstruction.
+ *       @note This is the reconstruction on event by event basis.
+ *                                                                          <br>
+ * - @ref GetRequiredComponentLibraries                                     <br>
+ *       can indicate further libraries which are required for running the
+ *       chains (e.g. if components of another library are used).
  *
- * There must be only one agent per module/library.
+ * - @ref RegisterComponents                                                <br>
+ *       register componens, this can be used to avoid the component
+ *       registration via global objects 
+ *       @see @ref alihltcomponent-handling
+ *                                                                          <br>
+ * @section alihltmoduleagent_references References
+ * @see @ref AliHLTReconstructor interface to the AliRoot reconstruction
+ * @see @ref AliHLTAgentSample agent for the libAliHLTSample library
  *
  * @ingroup alihlt_system
  */
@@ -61,8 +87,8 @@ class AliHLTModuleAgent : public TObject, public AliHLTLogging {
 
   /**
    * Print status info.
-   * Short summary on registered agents. This function acts globally on the list
-   * of agents if no specific agent is specified.
+   * Short summary on registered agents. This function acts globally on the
+   * list of agents if no specific agent is specified.
    */
   static void PrintStatus(const char* agent=NULL);
 
@@ -91,7 +117,7 @@ class AliHLTModuleAgent : public TObject, public AliHLTLogging {
                                   AliRunLoader* runloader=NULL) const;
 
   /**
-   * Get the top configurations belonging to this module.
+   * Get the top configurations for local event reconstruction.
    * A top configuration describes a processing chain. It can simply be
    * described by the last configuration(s) in the chain. 
    * The agent can adapt the configurations to be registered to the current
@@ -99,7 +125,16 @@ class AliHLTModuleAgent : public TObject, public AliHLTLogging {
    * @param runloader  [in] AliRoot runloader
    * @return string containing the top configurations separated by blanks
    */
-  virtual const char* GetTopConfigurations(AliRunLoader* runloader=NULL) const;
+  virtual const char* GetLocalRecConfigurations(AliRunLoader* runloader=NULL) const;
+
+  /**
+   * Get the top configurations for event reconstruction.
+   * The same as for @ref GetLocalRecConfigurations, but for the reconstruction on
+   * event by event basis.
+   * @param runloader  [in] AliRoot runloader
+   * @return string containing the top configurations separated by blanks
+   */
+  virtual const char* GetEventRecConfigurations(AliRunLoader* runloader=NULL) const;
 
   /**
    * Component libraries which the configurations of this agent depend on.
@@ -117,6 +152,14 @@ class AliHLTModuleAgent : public TObject, public AliHLTLogging {
    */
   virtual int RegisterComponents(AliRunLoader* runloader=NULL) const;
 
+  /**
+   * Old method kept for backward compatibility, redirected to @ref
+   * GetLocalRecConfigurations.
+   */
+  const char* GetTopConfigurations(AliRunLoader* runloader=NULL) const {
+    return GetLocalRecConfigurations(runloader);
+  }
+
  protected:
 
  private:
index 0d1c3c6aee90df93e5933a6175487fb0f27e8ba0..59ead57a9c325c4e17ace85d2eb9efcecaba0a7b 100644 (file)
@@ -143,8 +143,8 @@ int AliHLTOfflineInterface::SetParamsToComponents(AliRunLoader* runLoader, AliRa
     fgCurrentLnk=fgCurrentLnk->Next();
   }
   if (iResult>=0) {
-      log.LoggingVarargs(kHLTLogInfo, "AliHLTOfflineInterface","SetParamsToComponents", __FILE__, __LINE__,
-                       "parameters set to %d offline interface component(s)", count);
+//       log.LoggingVarargs(kHLTLogInfo, "AliHLTOfflineInterface","SetParamsToComponents", __FILE__, __LINE__,
+//                     "parameters set to %d offline interface component(s)", count);
   }
   return iResult;
 }
index 26ce765e53505e8cbdbed5e07336a88c2d34c132..e316e71970f1fd67f0c2bcd7ec66ae3a7464d4ad 100644 (file)
@@ -37,6 +37,7 @@ using namespace std;
 #include <TObjArray.h>
 #include <TObjString.h>
 #include <TString.h>
+#include <TStopwatch.h>
 
 /** ROOT macro for the implementation of ROOT specific class methods */
 ClassImp(AliHLTSystem)
@@ -299,7 +300,16 @@ int AliHLTSystem::Run(Int_t iNofEvents)
   int iResult=0;
   int iCount=0;
   SetStatusFlags(kRunning);
-  if ((iResult=InitTasks())>=0) {
+  TStopwatch StopwatchBase; StopwatchBase.Reset();
+  TStopwatch StopwatchDA; StopwatchDA.Reset();
+  TStopwatch StopwatchInput; StopwatchInput.Reset();
+  TStopwatch StopwatchOutput; StopwatchOutput.Reset();
+  TObjArray Stopwatches;
+  Stopwatches.AddAt(&StopwatchBase, (int)AliHLTComponent::kSWBase);
+  Stopwatches.AddAt(&StopwatchDA, (int)AliHLTComponent::kSWDA);
+  Stopwatches.AddAt(&StopwatchInput, (int)AliHLTComponent::kSWInput);
+  Stopwatches.AddAt(&StopwatchOutput, (int)AliHLTComponent::kSWOutput);
+  if ((iResult=InitTasks())>=0 && (iResult=InitBenchmarking(&Stopwatches))>=0) {
     if ((iResult=StartTasks())>=0) {
       for (int i=0; i<iNofEvents && iResult>=0; i++) {
        iResult=ProcessTasks(i);
@@ -323,7 +333,18 @@ int AliHLTSystem::Run(Int_t iNofEvents)
   } else if (iResult!=-ENOENT) {
     HLTError("can not initialize task list");
   }
-  if (iResult>=0) iResult=iCount;
+  if (iResult>=0) {
+    iResult=iCount;
+    HLTInfo("HLT statistics:\n"
+           "    base:              R:%.3fs C:%.3fs\n"
+           "    input:             R:%.3fs C:%.3fs\n"
+           "    output:            R:%.3fs C:%.3fs\n"
+           "    event processing : R:%.3fs C:%.3fs"
+           , StopwatchBase.RealTime(),StopwatchBase.CpuTime()
+           , StopwatchInput.RealTime(),StopwatchInput.CpuTime()
+           , StopwatchOutput.RealTime(),StopwatchOutput.CpuTime()
+           , StopwatchDA.RealTime(),StopwatchDA.CpuTime());
+  }
   ClearStatusFlags(kRunning);
   return iResult;
 }
@@ -351,6 +372,54 @@ int AliHLTSystem::InitTasks()
   return iResult;
 }
 
+int AliHLTSystem::InitBenchmarking(TObjArray* pStopwatches)
+{
+  // see header file for class documentation
+  if (pStopwatches==NULL) return -EINVAL;
+
+  int iResult=0;
+  TObjLink *lnk=fTaskList.FirstLink();
+  while (lnk && iResult>=0) {
+    TObject* obj=lnk->GetObject();
+    if (obj) {
+      AliHLTTask* pTask=(AliHLTTask*)obj;
+      AliHLTComponent* pComp=NULL;
+      if (iResult>=0 && (pComp=pTask->GetComponent())!=NULL) {
+       switch (pComp->GetComponentType()) {
+       case AliHLTComponent::kProcessor:
+         pComp->SetStopwatches(pStopwatches);
+         break;
+       case AliHLTComponent::kSource:
+         {
+           // this switch determines whether the time consumption of the
+           // AliHLTComponent base methods should be counted to the input
+           // stopwatch or base stopwatch.
+           //int inputBase=(int)AliHLTComponent::kSWBase;
+           int inputBase=(int)AliHLTComponent::kSWInput;
+           pComp->SetStopwatch(pStopwatches->At(inputBase), AliHLTComponent::kSWBase);
+           pComp->SetStopwatch(pStopwatches->At((int)AliHLTComponent::kSWInput), AliHLTComponent::kSWDA);
+         }
+         break;
+       case AliHLTComponent::kSink:
+         {
+           // this switch determines whether the time consumption of the
+           // AliHLTComponent base methods should be counted to the output
+           // stopwatch or base stopwatch.
+           //int outputBase=(int)AliHLTComponent::kSWBase;
+           int outputBase=(int)AliHLTComponent::kSWOutput;
+           pComp->SetStopwatch(pStopwatches->At(outputBase), AliHLTComponent::kSWBase);
+           pComp->SetStopwatch(pStopwatches->At((int)AliHLTComponent::kSWOutput), AliHLTComponent::kSWDA);
+         }
+         break;
+       }
+      }
+    } else {
+    }
+    lnk = lnk->Next();
+  }
+  return iResult;
+}
+
 int AliHLTSystem::StartTasks()
 {
   // see header file for class documentation
@@ -575,7 +644,7 @@ int AliHLTSystem::BuildTaskListsFromTopConfigurations(AliRunLoader* runloader)
   int iResult=0;
   AliHLTModuleAgent* pAgent=AliHLTModuleAgent::GetFirstAgent();
   while (pAgent && iResult>=0) {
-    TString tops=pAgent->GetTopConfigurations(runloader);
+    TString tops=pAgent->GetLocalRecConfigurations(runloader);
     HLTDebug("top configurations for agent %s (%p): %s", pAgent->GetName(), pAgent, tops.Data());
     TObjArray* pTokens=tops.Tokenize(" ");
     if (pTokens) {
index b97387c28bac1dd21e91402c6fe937f3f512d1cf..70ca889c9df0d2df6141e89eb5c3781d54bb4178 100644 (file)
@@ -27,6 +27,8 @@ class AliHLTTask;
 class AliRunLoader;
 class AliRawReader;
 class AliESD;
+class TObjArray;
+class TStopwatch;
 
 /**
  * @class AliHLTSystem
@@ -137,6 +139,14 @@ class AliHLTSystem : public AliHLTLogging {
    */
   int InitTasks();
 
+  /**
+   * Init the stopwatches for all tasks.
+   * @param pStopwatches    object array of stopwatches, for types
+   *                        @see AliHLTComponent::AliHLTStopwatchType
+   * @return neg error code if failed
+   */
+  int InitBenchmarking(TObjArray* pStopwatches);
+
   /**
    * Start task list.
    * The @ref AliHLTTask::StartRun method is called for each task, the
index 12eb38e65eb095b12f2af76c75d3782dba1861ae..7e7a7dceb7229d40c91dd9b5bcb285aab9cbe4d4 100644 (file)
@@ -21,7 +21,7 @@ bin_SCRIPTS                   = setenv.sh setenv.csh
 lib_LTLIBRARIES                        =  libHLTbase.la
 
 # version info for the library
-LIBRARY_VERSION                        = '3:0:0'
+LIBRARY_VERSION                        = '3:1:1'
 
 # MODDIR is set by the AliRoot build system and denotes the topdir
 # of the module, we must set it since the package definition libHLTbase.pkg
index 58964ffa3a3ce069a23e17dbe328dd9649c7b6f0..d11debaa1d7028a4688139366aa34b2ef9a9ef0e 100644 (file)
@@ -22,9 +22,7 @@
  * of files.<br>
  *
  * Component ID: \b FilePublisher <br>
- * Library: \b libHLTBase (in order to use the component from the external
- * interface, it might be necessary to specify a dummy library with the
- * \em -componentlibrary argument).
+ * Library: \b libAliHLTUtil.
  *
  * Mandatory arguments: <br>
  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formating -->
diff --git a/HLT/BASE/util/AliHLTLoaderPublisherComponent.cxx b/HLT/BASE/util/AliHLTLoaderPublisherComponent.cxx
new file mode 100644 (file)
index 0000000..d22cd88
--- /dev/null
@@ -0,0 +1,211 @@
+// @(#) $Id$
+
+/** @file   AliHLTLoaderPublisherComponent.cxx
+    @author Matthias Richter
+    @date   
+    @brief  A general tree publisher component for the AliLoader.
+*/
+
+#include "AliHLTLoaderPublisherComponent.h"
+#include "AliRunLoader.h"
+#include "AliLoader.h"
+#include "AliLog.h"
+#include "TTree.h"
+
+/** global instance for agent registration */
+AliHLTLoaderPublisherComponent gAliHLTLoaderPublisherComponent;
+
+/** ROOT macro for the implementation of ROOT specific class methods */
+ClassImp(AliHLTLoaderPublisherComponent)
+
+AliHLTLoaderPublisherComponent::AliHLTLoaderPublisherComponent()
+  :
+  fMaxSize(0),
+  fLoaderType(),
+  fTreeType("digits"),
+  fVerbose(kFALSE),
+  fDataType(kAliHLTAnyDataType),
+  fSpecification(0),
+  fpLoader(NULL)
+{
+  // see header file for class documentation
+  // or
+  // refer to README to build package
+  // or
+  // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+}
+
+AliHLTLoaderPublisherComponent::~AliHLTLoaderPublisherComponent()
+{
+  // see header file for class documentation
+}
+
+const char* AliHLTLoaderPublisherComponent::GetComponentID()
+{
+  // see header file for class documentation
+  return "AliLoaderPublisher";
+}
+
+AliHLTComponentDataType AliHLTLoaderPublisherComponent::GetOutputDataType()
+{
+  return fDataType;
+}
+
+void AliHLTLoaderPublisherComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
+{
+  constBase=fMaxSize;
+  inputMultiplier=1;
+}
+
+AliHLTComponent* AliHLTLoaderPublisherComponent::Spawn()
+{
+  // see header file for class documentation
+  return new AliHLTLoaderPublisherComponent;
+}
+
+int AliHLTLoaderPublisherComponent::DoInit( int argc, const char** argv )
+{
+  // see header file for class documentation
+  int iResult=0;
+
+  // scan arguments
+  TString argument="";
+  int bMissingParam=0;
+  for (int i=0; i<argc && iResult>=0; i++) {
+    argument=argv[i];
+    if (argument.IsNull()) continue;
+
+    // -loader
+    if (argument.CompareTo("-loader")==0) {
+      if ((bMissingParam=(++i>=argc))) break;
+      fLoaderType=argv[i];
+
+      // -tree
+    } else if (argument.CompareTo("-tree")==0) {
+      if ((bMissingParam=(++i>=argc))) break;
+      fTreeType=argv[i];
+
+      // -verbose
+    } else if (argument.CompareTo("-verbose")==0) {
+      fVerbose=kTRUE;
+
+      // -datatype
+    } else if (argument.CompareTo("-datatype")==0) {
+      if ((bMissingParam=(++i>=argc))) break;
+      memcpy(&fDataType.fID, argv[i], TMath::Min(kAliHLTComponentDataTypefIDsize, (Int_t)strlen(argv[i])));
+      if ((bMissingParam=(++i>=argc))) break;
+      memcpy(&fDataType.fOrigin, argv[i], TMath::Min(kAliHLTComponentDataTypefOriginSize, (Int_t)strlen(argv[i])));
+
+      // -dataspec
+    } else if (argument.CompareTo("-dataspec")==0) {
+      if ((bMissingParam=(++i>=argc))) break;
+      TString parameter(argv[i]);
+      parameter.Remove(TString::kLeading, ' '); // remove all blanks
+      if (parameter.IsDigit()) {
+       fSpecification=(AliHLTUInt32_t)parameter.Atoi();
+      } else if (parameter.BeginsWith("0x") &&
+                parameter.Replace(0,2,"",0).IsHex()) {
+       sscanf(parameter.Data(),"%x", &fSpecification);
+      } else {
+       HLTError("wrong parameter for argument %s, number expected", argument.Data());
+       iResult=-EINVAL;
+      }
+    } else {
+      HLTError("unknown argument %s", argument.Data());
+      iResult=-EINVAL;
+    }
+  }
+  if (bMissingParam) {
+    HLTError("missing parameter for argument %s", argument.Data());
+    iResult=-EINVAL;
+  }
+
+  if (iResult<0) return iResult;
+
+  if (fLoaderType.IsNull()) {
+    HLTError("loader type required, use \'-loader\' option");
+    return -EINVAL;
+  }
+
+  // fetch runLoader instance from interface
+  AliRunLoader* pRunLoader=GetRunLoader();
+  if (pRunLoader) {
+
+    // get the TPC loader
+    fpLoader=pRunLoader->GetLoader(fLoaderType.Data());
+    if (fpLoader) {
+      // prepare the loader
+      fpLoader->LoadDigits("read");
+
+      // scan trough all events and estimate the size of the digits
+      for (int i=0; i<pRunLoader->GetNumberOfEvents(); i++) {
+       pRunLoader->GetEvent(i);
+       TTree* pTree=GetTree();
+       if (pTree) {
+         int size=EstimateObjectSize(pTree);
+         if (size>fMaxSize) fMaxSize=size;
+         if (fVerbose) {
+           AliInfoStream() << "event " << i << " " 
+                           << fTreeType <<" size " << size 
+                           << " count " << pTree->GetEntries() << endl;
+         }
+       } else {
+         AliWarningStream() << "no " << fTreeType << " tree for event " << i << endl;
+       }
+      }
+    } else {
+      AliErrorStream() << "can not get loader of type " << fLoaderType << endl;
+      iResult=-EFAULT;
+    }    
+  } else {
+    AliErrorStream() << "can not get runLoader" << endl;
+    iResult=-EFAULT;
+  }
+  return iResult;
+}
+
+int AliHLTLoaderPublisherComponent::DoDeinit()
+{
+  // see header file for class documentation
+  int iResult=0;
+  if (fpLoader) {
+    fpLoader->UnloadDigits();
+  }
+  fpLoader=NULL;
+  return iResult;
+}
+
+int AliHLTLoaderPublisherComponent::GetEvent(const AliHLTComponentEventData& evtData,
+                                                AliHLTComponentTriggerData& trigData)
+{
+  // see header file for class documentation
+  int iResult=0;
+  // fetch runLoader instance from interface
+  AliRunLoader* pRunLoader=GetRunLoader();
+  if (pRunLoader && fpLoader) {
+    pRunLoader->GetEvent(GetEventCount());
+    TTree* pTree=GetTree();
+    if (pTree) {
+      PushBack(pTree, fDataType);
+    } else {
+      AliWarningStream() << "no " << fTreeType << " tree for event " << GetEventCount() << endl;
+    }
+  } else {
+    AliErrorStream() << "component not initialized" << endl;
+  }
+  return iResult;
+}
+
+TTree* AliHLTLoaderPublisherComponent::GetTree()
+{
+  TTree* pTree=NULL;
+  if (fpLoader) {
+    if (fTreeType.CompareTo("digits")==0)
+      pTree=fpLoader->TreeD();
+    else if (fTreeType.CompareTo("clusters")==0) {
+      pTree=fpLoader->TreeR();
+    }
+  } else {
+  }
+  return pTree;
+}
diff --git a/HLT/BASE/util/AliHLTLoaderPublisherComponent.h b/HLT/BASE/util/AliHLTLoaderPublisherComponent.h
new file mode 100644 (file)
index 0000000..72b041e
--- /dev/null
@@ -0,0 +1,135 @@
+//-*- Mode: C++ -*-
+// @(#) $Id$
+
+#ifndef ALIHLTLOADERPUBLISHERCOMPONENT_H
+#define ALIHLTLOADERPUBLISHERCOMPONENT_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/** @file   AliHLTLoaderPublisherComponent.h
+    @author Matthias Richter
+    @date   
+    @brief  A general tree publisher component for the AliLoader.
+*/
+
+#include "AliHLTOfflineDataSource.h"
+
+class AliLoader;
+
+/**
+ * @class AliHLTLoaderPublisherComponent
+ * A general tree publisher component for the AliLoader.
+ * 
+ * Component ID: \b AliLoaderPublisher <br>
+ * Library: \b libAliHLTUtil.
+ *
+ * Mandatory arguments: <br>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formating -->
+ * \li -loader       <i> loader name      </i>
+ *      e.g. <tt> -loader TPCLoader </tt>
+ * \li -tree         <i> tree name </i> : digits (default), clusters     
+ *      e.g. <tt> -tree digits </tt>
+ * \li -verbose<br>
+ *      print out some more info messages, mainly for the sake of tutorials
+ * \li -datatype     <i> datatype   dataorigin </i> <br>
+ *      data type ID and origin, e.g. <tt>-datatype DIGITS TPC </tt>
+ * \li -dataspec     <i> specification </i> <br>
+ *      data specification treated as decimal number or hex number if
+ *      prepended by '0x'
+ *
+ * Optional arguments:<br>
+ *
+ *
+ * @ingroup alihlt_system
+ */
+class AliHLTLoaderPublisherComponent : public AliHLTOfflineDataSource {
+ public:
+  /** standard constructor */
+  AliHLTLoaderPublisherComponent();
+  /** destructor */
+  virtual ~AliHLTLoaderPublisherComponent();
+
+  /**
+   * Get the id of the component.
+   * Each component is identified by a unique id.
+   * The function is pure virtual and must be implemented by the child class.
+   * @return component id (string)
+   */
+  const char* GetComponentID();
+
+  /**
+   * Get the output data type of the component.
+   * The function is pure virtual and must be implemented by the child class.
+   * @return output data type
+   */
+  AliHLTComponentDataType GetOutputDataType();
+
+  /**
+   * 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.
+   * @param constBase        <i>return</i>: additive part, independent of the
+   *                                   input data volume  
+   * @param inputMultiplier  <i>return</i>: multiplication ratio
+   * @return values in the reference variables
+   */
+  void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
+
+  /**
+   * Spawn function.
+   * Each component must implement a spawn function to create a new instance of 
+   * the class. Basically the function must return <i>new <b>my_class_name</b></i>.
+   * @return new class instance
+   */
+  virtual AliHLTComponent* Spawn();
+
+ protected:
+  /**
+   * Init method.
+   */
+  int DoInit( int argc, const char** argv );
+
+  /**
+   * Deinit method.
+   */
+  int DoDeinit();
+
+  /**
+   * Data source method.
+   * @param evtData       event data structure
+   * @param trigData     trigger data structure
+   * @return
+   */
+  int GetEvent(const AliHLTComponentEventData& evtData,
+              AliHLTComponentTriggerData& trigData);
+
+ private:
+  /**
+   * Get tree of type specified in fTreeType from loader.
+   */
+  TTree* GetTree();
+
+  /** max output block size, estimate during DoInit */
+  Int_t                   fMaxSize;                                //!transient
+
+  /** loader string */
+  TString                 fLoaderType;                             //!transient
+
+  /** tree string */
+  TString                 fTreeType;                               //!transient
+
+  /** be verbose: info printouts */
+  Bool_t                  fVerbose;                                //!transient
+
+  /** data type */
+  AliHLTComponentDataType fDataType;                               //!transient
+
+  /** data specification */
+  AliHLTUInt32_t          fSpecification;                          //!transient
+
+  /** instance of the AliLoader */
+  AliLoader*              fpLoader;                                //!transient
+
+  ClassDef(AliHLTLoaderPublisherComponent, 0);
+};
+
+#endif
index eac0faa14dce78429228085bbd24af8cf700fae6..54308f381837ff83f375cb723df1e93a8dede33e 100644 (file)
@@ -1,3 +1,8 @@
+2007-04-17 HLT sample applications
+       - publisher for AliLoader trees added
+       - sample analysis chain added tp sample lib
+       - tutorial and documentation
+       - benchmark functionality added to AliHLTSystem
 2007-03-14 aliroot integration
        - AliHLTSystem interface methods to AliHLTReconstructor implemeted
        - AliHLTModuleAgent introduced for each HLT module, sample
index 3e81d52cfe73244f6b36d374e81a81bded54326a..b974e21513a3d87134e9f82829232067c10ef503 100644 (file)
@@ -31,6 +31,7 @@ EXTRA_DIST            = libHLTbase.pkg \
                          libAliHLTPHOS.pkg \
                          libAliHLTTPC.pkg \
                          libAliHLTTRD.pkg \
+                         src/AliHLTReconstructor.h \
                          hlt.conf
 
 DIST_SUBDIRS           = $(SUBDIRS)
index 31f319fd301501d4ca82b73c64afc77dcc297c9e..63fca1251d890be3140b5bddd9a558500ab3f47a 100644 (file)
@@ -13,8 +13,8 @@
 /** global instance for agent registration */
 AliHLTAgentSample gAliHLTAgentSample;
 
-const char* gAliHLTAgentSampleData="/tmp/testdata";
-const char* gAliHLTAgentSampleOut="/tmp/hltout";
+const char* AliHLTAgentSample::fgkAliHLTAgentSampleData="/tmp/testdata";
+const char* AliHLTAgentSample::fgkAliHLTAgentSampleOut="/tmp/hltout";
 
 /** ROOT macro for the implementation of ROOT specific class methods */
 ClassImp(AliHLTAgentSample)
@@ -33,21 +33,21 @@ AliHLTAgentSample::~AliHLTAgentSample()
   // see header file for class documentation
 
   // delete the test data
-  ofstream dump(gAliHLTAgentSampleData, ios::in);
+  ofstream dump(fgkAliHLTAgentSampleData, ios::in);
   if (dump.good()) {
     TString arg("rm -f ");
-    arg+=gAliHLTAgentSampleData;
+    arg+=fgkAliHLTAgentSampleData;
     gSystem->Exec(arg.Data());
   }
 }
 
 int AliHLTAgentSample::CreateConfigurations(AliHLTConfigurationHandler* handler,
-                                         AliRunLoader* runloader) const
+                                           AliRunLoader* runloader) const
 {
   // see header file for class documentation
 
   // create some test data
-  ofstream dump(gAliHLTAgentSampleData, (ios::openmode)0);
+  ofstream dump(fgkAliHLTAgentSampleData, (ios::openmode)0);
   dump << "This is just some test data for the ALICE HLT analysis example";
   dump << "---- not copied" << endl;
   dump.close();
@@ -55,24 +55,30 @@ int AliHLTAgentSample::CreateConfigurations(AliHLTConfigurationHandler* handler,
   if (handler) {
     // the publisher configuration for the test data
     TString arg("-datafile ");
-    arg+=gAliHLTAgentSampleData;
+    arg+=fgkAliHLTAgentSampleData;
     HLTDebug(arg.Data());
-    handler->CreateConfiguration("fp1"  , "FilePublisher", NULL , arg.Data());
+    handler->CreateConfiguration("sample-fp1"  , "FilePublisher", NULL , arg.Data());
 
     // the configuration for the dummy component
-    handler->CreateConfiguration("cp"   , "Dummy"        , "fp1", "output_percentage 80");
+    handler->CreateConfiguration("sample-cp"   , "Dummy"        , "sample-fp1", "output_percentage 80");
 
     // the writer configuration
-    arg="-datafile "; arg+=gAliHLTAgentSampleOut;
-    handler->CreateConfiguration("sink1", "FileWriter"   , "cp" , arg.Data());
+    arg="-datafile "; arg+=fgkAliHLTAgentSampleOut;
+    handler->CreateConfiguration("sample-sink1", "FileWriter"   , "sample-cp" , arg.Data());
+
+    // sample offline source
+    handler->CreateConfiguration("sample-offsrc", "AliLoaderPublisher"   , NULL , "-loader TPCLoader -tree digits -verbose");
+
+    // sample offline sink
+    handler->CreateConfiguration("sample-offsnk", "SampleOfflineDataSink"   , "sample-offsrc" , NULL);
   }
   return 0;
 }
 
-const char* AliHLTAgentSample::GetTopConfigurations(AliRunLoader* runloader) const
+const char* AliHLTAgentSample::GetLocalRecConfigurations(AliRunLoader* runloader) const
 {
   // see header file for class documentation
-  return "sink1";
+  return "sample-sink1 sample-offsnk";
 }
 
 const char* AliHLTAgentSample::GetRequiredComponentLibraries() const
index cb5ffabb1f57e1f620f6cb7c2ac7079152bd9733..6c4879d57c28a5ce5084d9649e84a4f07153dd27 100644 (file)
 
 /**
  * @class AliHLTAgentSample
- * This is the agent for the AliHLTSample library.
+ * This is the agent for the AliHLTSample library.<br>
+ * The AliHLTSample library illustrates usage of the HLT framework. The
+ * agent provides information on the features of the sample components
+ * and the configuration which should be run during AliRoot reconstruction.
  *
+ * The sample agent implements all interface function provided by @ref
+ * AliHLTModuleAgent :
+ * - @ref CreateConfigurations <br>
+ *   The method gets an instance of the AliHLTConfigurationHanler to add
+ *   configurations, e.g. 
+ *   <pre>
+ *   handler->CreateConfiguration("my-puplisher"  , "FilePublisher", NULL , "data.bin");
+ *   ...
+ *   handler->CreateConfiguration("my-analysis-chain"  , "FileWriter", "my-processor" , "my arguments");
+ *   </pre>
+ * - @ref GetLocalRecConfigurations <br>
+ *   returns a string of blank separated configurations to be run during
+ *   local event reconstruction.
+ *   <pre>
+ *   return "my-data-sink my-analysis-chain";
+ *   </pre>
+ * - @ref GetRequiredComponentLibraries <br>
+ *   returns a string of blank separated libraries which have to be loaded
+ *   in addition
+ *   <pre>
+ *   return "libAliHLTUtil.so";
+ *   </pre>
+ * - not implemented are the in iterface methods
+ *   - @ref AliHLTModuleAgent::GetEventRecConfigurations
+ *   - @ref AliHLTModuleAgent::RegisterComponents
+ *
+ * In order to hook the sample library up to the HLT system on global object
+ * @ref gAliHLTAgentSample of the agent is defined in the source code.
+ * 
  * @ingroup alihlt_system
  */
 class AliHLTAgentSample : public AliHLTModuleAgent {
@@ -30,7 +62,7 @@ class AliHLTAgentSample : public AliHLTModuleAgent {
   virtual ~AliHLTAgentSample();
 
   /**
-   * Register all configurations belonging to this module with the
+   * Register all configurations belonging to the sample library with the
    * AliHLTConfigurationHandler. The agent can adapt the configurations
    * to be registered to the current AliRoot setup by checking the
    * runloader.
@@ -42,15 +74,15 @@ class AliHLTAgentSample : public AliHLTModuleAgent {
                           AliRunLoader* runloader=NULL) const;
 
   /**
-   * Get the top configurations belonging to this module.
+   * Get the top configurations for local event reconstruction.
    * A top configuration describes a processing chain. It can simply be
    * described by the last configuration(s) in the chain. 
    * The agent can adapt the configurations to be registered to the current
    * AliRoot setup by checking the runloader.
-   * @param runloader    AliRoot runloader
-   * @return number of configurations, neg. error code if failed
+   * @param runloader  [in] AliRoot runloader
+   * @return string containing the top configurations separated by blanks
    */
-  const char* GetTopConfigurations(AliRunLoader* runloader=NULL) const;
+  const char* GetLocalRecConfigurations(AliRunLoader* runloader=NULL) const;
 
   /**
    * Component libraries which the configurations of this agent depend on.
@@ -61,7 +93,14 @@ class AliHLTAgentSample : public AliHLTModuleAgent {
  protected:
 
  private:
-  ClassDef(AliHLTAgentSample, 0);
+  /** file name of the generated test data*/
+  static const char* fgkAliHLTAgentSampleData;                      //!transient
+
+  /** file name of the output file */
+  static const char* fgkAliHLTAgentSampleOut;                       //!transient
+
+  /** ROOT specific member definition */
+  ClassDef(AliHLTAgentSample, 1);
 };
 
 #endif
diff --git a/HLT/SampleLib/AliHLTSampleOfflineSinkComponent.cxx b/HLT/SampleLib/AliHLTSampleOfflineSinkComponent.cxx
new file mode 100644 (file)
index 0000000..54540e5
--- /dev/null
@@ -0,0 +1,88 @@
+// @(#) $Id$
+
+/** @file   AliHLTSampleOfflineSinkComponent.cxx
+    @author Matthias Richter
+    @date   
+    @brief  A sample offline sink component.
+*/
+
+#include "AliHLTSampleOfflineSinkComponent.h"
+#include "AliRunLoader.h"
+#include "AliLoader.h"
+#include "AliLog.h"
+#include "TTree.h"
+
+/** global instance for agent registration */
+AliHLTSampleOfflineSinkComponent gAliHLTSampleOfflineSinkComponent;
+
+/** ROOT macro for the implementation of ROOT specific class methods */
+ClassImp(AliHLTSampleOfflineSinkComponent)
+
+AliHLTSampleOfflineSinkComponent::AliHLTSampleOfflineSinkComponent()
+{
+  // see header file for class documentation
+  // or
+  // refer to README to build package
+  // or
+  // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+}
+
+AliHLTSampleOfflineSinkComponent::~AliHLTSampleOfflineSinkComponent()
+{
+  // see header file for class documentation
+}
+
+const char* AliHLTSampleOfflineSinkComponent::GetComponentID()
+{
+  // see header file for class documentation
+  return "SampleOfflineDataSink";
+}
+
+void AliHLTSampleOfflineSinkComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
+{
+  // see header file for class documentation
+  list.clear();
+  list.push_back(kAliHLTAnyDataType);
+}
+
+AliHLTComponent* AliHLTSampleOfflineSinkComponent::Spawn()
+{
+  // see header file for class documentation
+  return new AliHLTSampleOfflineSinkComponent;
+}
+
+int AliHLTSampleOfflineSinkComponent::DoInit( int argc, const char** argv )
+{
+  // see header file for class documentation
+  int iResult=0;
+  return iResult;
+}
+
+int AliHLTSampleOfflineSinkComponent::DoDeinit()
+{
+  // see header file for class documentation
+  int iResult=0;
+  return iResult;
+}
+
+int AliHLTSampleOfflineSinkComponent::DumpEvent(const AliHLTComponentEventData& evtData,
+                                               AliHLTComponentTriggerData& trigData)
+{
+  // see header file for class documentation
+  int iResult=0;
+  AliInfoStream() << "dump event " << GetEventCount() << endl;
+  TTree* pTree=(TTree*)GetFirstInputObject(kAliHLTAnyDataType, "TTree");
+  while (pTree) {
+    AliInfoStream() << " got TTree object with " << pTree->GetEntries() << " entries" << endl;
+    pTree=(TTree*)GetNextInputObject();
+  }
+  return iResult;
+}
+
+int AliHLTSampleOfflineSinkComponent::FillESD(int eventNo, AliRunLoader* runLoader, AliESD* esd) 
+{
+  // see header file for class documentation
+  int iResult=0;
+  AliInfoStream() << "event " << eventNo << endl;
+  return iResult;
+}
diff --git a/HLT/SampleLib/AliHLTSampleOfflineSinkComponent.h b/HLT/SampleLib/AliHLTSampleOfflineSinkComponent.h
new file mode 100644 (file)
index 0000000..459788f
--- /dev/null
@@ -0,0 +1,94 @@
+//-*- Mode: C++ -*-
+// @(#) $Id$
+
+#ifndef ALIHLTSAMPLEOFFLINESINKCOMPONENT_H
+#define ALIHLTSAMPLEOFFLINESINKCOMPONENT_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx sink for full Copyright notice                               */
+
+/** @file   AliHLTSampleOfflineSinkComponent.h
+    @author Matthias Richter
+    @date   
+    @brief  This is a sample offline interface component.
+*/
+
+#include "AliHLTOfflineDataSink.h"
+
+class AliLoader;
+
+/**
+ * @class AliHLTSampleOfflineSinkComponent
+ * This is a sample offline interface component.
+ *
+ * @ingroup alihlt_system
+ */
+class AliHLTSampleOfflineSinkComponent : public AliHLTOfflineDataSink {
+ public:
+  /**
+   * standard constructor. The agent is automatically registered in the
+   * global agent manager
+   */
+  AliHLTSampleOfflineSinkComponent();
+  /** destructor */
+  virtual ~AliHLTSampleOfflineSinkComponent();
+
+  /**
+   * Get the id of the component.
+   * Each component is identified by a unique id.
+   * The function is pure virtual and must be implemented by the child class.
+   * @return component id (string)
+   */
+  const char* GetComponentID();
+
+  /**
+   * Get the input data types of the component.
+   * 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>& );
+
+  /**
+   * Spawn function.
+   * Each component must implement a spawn function to create a new instance of 
+   * the class. Basically the function must return <i>new <b>my_class_name</b></i>.
+   * @return new class instance
+   */
+  virtual AliHLTComponent* Spawn();
+
+  /**
+   * Fill ESD for one event.
+   * Fill the ESD with the previously reconstructed data. Interface method called by
+   * the AliHLTOfflineInterface framework.
+   * @param eventNo       event No. \em Note: this is an internal enumeration of the
+   *                      processed events.
+   * @param runLoader     the AliRoot runloader
+   * @param esd           an AliESD instance
+   * @return neg. error code if failed 
+   */
+  int FillESD(int eventNo, AliRunLoader* runLoader, AliESD* esd);
+
+ protected:
+  /**
+   * Init method.
+   */
+  int DoInit( int argc, const char** argv );
+
+  /**
+   * Deinit method.
+   */
+  int DoDeinit();
+
+  /**
+   * Data sink method.
+   * @param evtData       event data structure
+   * @param trigData     trigger data structure
+   * @return
+   */
+  int DumpEvent(const AliHLTComponentEventData& evtData,
+               AliHLTComponentTriggerData& trigData);
+
+ private:
+  ClassDef(AliHLTSampleOfflineSinkComponent, 0);
+};
+
+#endif
index 60ff6cee641d018bb3505dbc079c8dd3da62362f..e9c2ca350f7bc188b4c58cce09c4d612c75bd9f2 100644 (file)
@@ -95,7 +95,7 @@ $(DICTCPP:.cxx=.h): $(DICTCPP)
 
 $(DICTCPP): $(DICTHEADERS:%=$(srcdir)/%) $(DICTDEF)
        if [ -x $(ROOTCINT) ]; then $(ROOTCINT) -f $@ -c $(CPPFLAGS) $(AM_CPPFLAGS) $(DEFS) $(foreach i, $(DICTINCLUDE), $(i)) $^ ; fi
-$(DICTDEF): Makefile.am
+$(DICTDEF): Makefile.am $(PKGDEF)
        @echo '//automatically generated ROOT DICT definition' > $@
        @echo '//!!! DO NOT EDIT THIS FILE !!!' >> $@
        @echo '//add further class definitions to the CLASS_HDRS variable in Makefile.am' >> $@
index 808465a6e0195fe86c165fee77dc5824e915e32c..76f64f2c9264ec502e55d3aa91bcf49042e6bb2b 100644 (file)
     @date   
     @brief  HLT examples and tutorial. */
 
-/** @defgroup alihlt_tutorial HLT examples and tutorial
-    @brief HLT examples and tutorial
+/** 
+@defgroup alihlt_tutorial HLT examples and tutorial
 
-    A description will follow ...
-*/
+-# @ref tut_hltsystem
+   -# @ref tut_load_libraries
+   -# @ref tut_dummy_chain
+   -# @ref tut_tpc_sector
+-# @ref tut_reconstruction
+   -# @ref tut_module_agent
+   -# @ref tut_reconstruction_sample
+
+<br>
+<br>
+@section tut_hltsystem Running Components in the HLT System
+
+@subsection tut_load_libraries Library setup
+Component libraries must be loader via the AliHLTComponentHandler
+or AliHLTSystem::LoadComponentLibraries. You can run the following
+macro from the AliRoot promt.
+<pre>
+{
+  AliHLTSystem gHLT;
+  gHLT.LoadComponentLibraries("libAliHLTUtil.so");
+}
+</pre>
+
+<br>
+@subsection tut_dummy_chain Example: Running a dummy chain
+The simplest chain consists of a publisher component, a processor
+and a data sink. The AliHLTDummyComponent is a sample component
+which just copies a fraction of the input data to the output.
+You can run the following macro from the AliRoot promt.
+<pre>
+{
+  AliHLTSystem gHLT;
+  gHLT.LoadComponentLibraries("libAliHLTUtil.so libAliHLTSample.so");
+  AliHLTConfiguration publisher("fp1", "FilePublisher", NULL, "-datafile some-data.dat");
+  AliHLTConfiguration copy("cp", "Dummy", "fp1", "output_percentage 80");
+  AliHLTConfiguration sink1("sink1", "FileWriter", "cp", NULL);
+  gHLT.BuildTaskList(&sink1);
+  gHLT.Run();
+}
+</pre>
+@note You have to specify a real file name instead of \em some-data.dat
+
+<br>
+@subsection tut_tpc_sector Example: One sector of the TPC
+This example builds an analysis chain for TPC sector 0. It works on 
+simulated data and assumes the ddl files to be present in the current
+directory.
+<pre>
+{
+  AliHLTSystem gHLT;
+  // load the component library
+  gHLT.LoadComponentLibraries("libAliHLTUtil.so libAliHLTTPC.so");
+
+  // data source components
+  AliHLTConfiguration fp0("fp0", "FilePublisher", NULL, "-datafile TPC_768.ddl -datatype DDL_RWPK 'TPC '"
+                                                       "-dataspec 0x00000000");
+  AliHLTConfiguration fp1("fp1", "FilePublisher", NULL, "-datafile TPC_769.ddl -datatype DDL_RWPK 'TPC '"
+                                                        "-dataspec 0x00000101");
+  AliHLTConfiguration fp2("fp2", "FilePublisher", NULL, "-datafile TPC_840.ddl -datatype DDL_RWPK 'TPC '"
+                                                        "-dataspec 0x00000202");
+  AliHLTConfiguration fp3("fp3", "FilePublisher", NULL, "-datafile TPC_841.ddl -datatype DDL_RWPK 'TPC '"
+                                                       "-dataspec 0x00000303");
+  AliHLTConfiguration fp4("fp4", "FilePublisher", NULL, "-datafile TPC_842.ddl -datatype DDL_RWPK 'TPC '"
+                                                       "-dataspec 0x00000404");
+  AliHLTConfiguration fp5("fp5", "FilePublisher", NULL, "-datafile TPC_843.ddl -datatype DDL_RWPK 'TPC '"
+                                                       "-dataspec 0x00000505");
+
+  // cluster finders
+  AliHLTConfiguration cf0("cf0", "TPCClusterFinderPacked", "fp0", "pp-run rawreadermode 4 timebins 446");
+  AliHLTConfiguration cf1("cf1", "TPCClusterFinderPacked", "fp1", "pp-run rawreadermode 4 timebins 446");
+  AliHLTConfiguration cf2("cf2", "TPCClusterFinderPacked", "fp2", "pp-run rawreadermode 4 timebins 446");
+  AliHLTConfiguration cf3("cf3", "TPCClusterFinderPacked", "fp3", "pp-run rawreadermode 4 timebins 446");
+  AliHLTConfiguration cf4("cf4", "TPCClusterFinderPacked", "fp4", "pp-run rawreadermode 4 timebins 446");
+  AliHLTConfiguration cf5("cf5", "TPCClusterFinderPacked", "fp5", "pp-run rawreadermode 4 timebins 446");
+
+  // tracker
+  AliHLTConfiguration tracker("tracker", "TPCSliceTracker", "cf0 cf1 cf2 cf3 cf4 cf5", "pp-run bfield 0.5");
+
+  // the data sink component
+  AliHLTConfiguration writer("writer", "TPCEsdWriter", "tracker", "-datafile AliESDs.root");
+
+  gHLT.BuildTaskList(&writer);
+  gHLT.Run();
+}
+</pre>
+    
+@section tut_reconstruction AliRoot reconstruction
+The HLT analysis components can be run either in the AliRoot
+reconstruction or the HLT online framework.
+The integration into the AliRoot reconstruction works via the
+@ref AliHLTReconstructor plugin. The intention is to run HLT analysis
+chains in AliRoot in the same way as in the online framework, i.e.
+the full components are run also from the offline framework rather
+than just the algorithm hooked on by a special interface class.
+By this one achieves the highest possible compatibility.
+
+We think of the HLT as a 'black box' with data input and output. In
+addition there is access to calibration data from OCDB (or the local
+HLT copy HCDB). All components can only work on the data they get as
+input. As the different detector algorithms/components will run in 
+separated processes and even on different machines, no data exchange
+is possible via global data structures and variables possible.
+
+The AliRoot reconstruction consists mainly of three steps:
+-# local event reconstruction: this is usually the place for digit/raw
+data conversion to clusters/space points. All the events are processed
+at once. If HLT analysis chain are executed in the local event
+reconstruction, the chain must contain an output recorder as the ESD
+is filled on an event by event basis and the corresponding method called
+later.
+-# event reconstruction: this is the reconstruction on an event by event
+basis. Immediately after the reconstruction, the FillESD method is
+called.
+-# ESD fill: the reconstructed event is written to the ESD.
+
+@subsection tut_module_agent The Module Agent
+Each component library has to implement a module agent in order to be
+hooked up to the AliRoot reconstruction system. The agent defines the
+features of the libraries and the configurations to be run during the
+different steps of the reconstruction. The agent 
+- can register all components of the library. This is an 
+  alternative to the component registration via global objects (see 
+  @ref alihltcomponent-handling).
+- registers HLT configurations (see @ref AliHLTConfiguration)
+- specifies the configurations to be run
+- specifies additional component libraries required to run the
+  configurations.
+
+Finally, one global object of the module agent has to be specified in
+the source code. All registration and integration into the HLT system
+is carried out automatically.
+
+@see 
+    @ref AliHLTModuleAgent for the interface description <br>
+    @ref AliHLTAgentSample for a sample implementation
+
+@subsection tut_reconstruction_sample The sample library
+The libAliHLTSample library provides examples how to implement the
+library agent (@ref AliHLTAgentSample), how to add configurations and
+define HLT chains for reconstruction. 
+
+The sample library is not part of the default libraries loaded by the
+HLT steering during reconstruction. The example can be run by the
+following macro in AliRoot (provided you have a simulated event in the
+current directory):
+<pre>
+{
+  AliReconstruction rec;                 // the reconstruction instance
+  rec.SetRunLocalReconstruction("HLT");  // run local rec only for HLT 
+  rec.SetRunTracking("");                // switch off tracking
+  rec.SetOption("HLT", "libAliHLTSample.so");
+  rec.Run();
+}
+</pre>
+
+The agent defines the following chains:
+-# a simple data copying consisting of a
+   - @ref AliHLTFilePublisher  publishes some data generated before in /tmp
+   - @ref AliHLTDummyComponent copies a fraction of the incoming data
+   - @ref AliHLTFileWriter     writes the data input to a file
+-# digit publishing from the TPCloader <br>
+   This chain illustrates how data can be published from the AliRunLoader
+   in order to be processed by another component (not in the sample chain).
+   Finally, the @ref AliHLTSampleOfflineSinkComponent is component which is
+   the backend and has again the AliRoot structures.
+   - @ref AliHLTLoaderPublisherComponent
+   - @ref AliHLTSampleOfflineSinkComponent
+
+In the same way any other component library can be integrated into the
+AliRoot reconstruction.
+
+ */
 
 /* note pad
 
index 55479f12e0b0bf6975cca3f74f1dd84e55efd1f3..f3f091a42c2a286884ae614711e961be32514816 100644 (file)
@@ -557,6 +557,13 @@ fi
 AC_SUBST([HAVE_DOT])
 AC_SUBST([DOT_PATH])
 
+dnl HAVE_SRC_SUBDIR=${abs_top_srcdir}/src
+dnl echo $HAVE_SRC_SUBDIR
+dnl if ! test -d $HAVE_SRC_SUBDIR; then
+dnl   HAVE_SRC_SUBDIR=
+dnl fi
+dnl AC_SUBST([HAVE_SRC_SUBDIR])
+
 dnl ------------------------------------------------------------------
 dnl inatallation directory for libraries
 dnl 
index 47a6a7fe743ee4a41ed9f1636c6650d4baa1aedd..060701116362627add6db66628efddc6fab90e98 100644 (file)
@@ -65,12 +65,32 @@ WARN_LOGFILE           =
 INPUT                  = @top_srcdir@/doc      \
                         @top_srcdir@/BASE      \
                         @top_srcdir@/TPCLib    \
-                        @top_srcdir@/SampleLib
+                        @top_srcdir@/SampleLib \
+                        @top_srcdir@/src
+
 FILE_PATTERNS          = *.h *.c *.cpp *.hpp *.cxx
 RECURSIVE              = YES
 EXCLUDE                = @top_srcdir@/BASE/HLTbaseLinkDef.h \
                         @top_srcdir@/TPCLib/AliHLTTPCLinkDef.h \
-                        @top_srcdir@/TPCLib/AliHLTTPCClustFinderNew.cxx
+                        @top_srcdir@/TPCLib/AliHLTTPCClustFinderNew.cxx \
+                        @top_srcdir@/src/AliHLTConfMapPoint.cxx \
+                        @top_srcdir@/src/AliHLTFileHandler.cxx \
+                        @top_srcdir@/src/AliHLTLogger.cxx \
+                        @top_srcdir@/src/AliHLTTrackMerger.cxx \
+                        @top_srcdir@/src/AliHLTTransform.cxx \
+                        @top_srcdir@/src/AliLevel3.h \
+                        @top_srcdir@/src/AliLevel3.cxx \
+                        @top_srcdir@/src/AliHLTLogging.h \
+                        @top_srcdir@/src/AliHLTDisplay.h \
+                        @top_srcdir@/src/AliHLTDisplay.cxx \
+                        @top_srcdir@/src/AliHLTBenchmark.h \
+                        @top_srcdir@/src/AliHLTBenchmark.cxx \
+                        @top_srcdir@/src/AliHLTRawDataFileHandler.h \
+                        @top_srcdir@/src/AliHLTRawDataFileHandler.cxx \
+                        @top_srcdir@/src/AliHLTClustFinderNew.h \
+                        @top_srcdir@/src/AliHLTClustFinderNew.cxx \
+                        @top_srcdir@/src/AliHLTFileHandler.h \
+                        @top_srcdir@/src/AliHLTFileHandler.cxx
 
 EXCLUDE_SYMLINKS       = NO
 EXCLUDE_PATTERNS       = 
@@ -83,7 +103,7 @@ FILTER_SOURCE_FILES    = NO
 #---------------------------------------------------------------------------
 # configuration options related to source browsing
 #---------------------------------------------------------------------------
-SOURCE_BROWSER         = NO
+SOURCE_BROWSER         = YES
 INLINE_SOURCES         = NO
 STRIP_CODE_COMMENTS    = YES
 REFERENCED_BY_RELATION = YES
index fba06100ad0a3179539df7c11e45797c87f21e52..3f8451bda57ff0ffd6437724018520d97b8a39c7 100644 (file)
@@ -10,6 +10,7 @@
 MODULE_SRCS=   AliHLTSampleComponent1.cxx \
                AliHLTSampleComponent2.cxx \
                AliHLTAgentSample.cxx \
+               AliHLTSampleOfflineSinkComponent.cxx \
                AliHLTDummyComponent.cxx
 
 # class header files, the link definition for the root dictionary
@@ -17,6 +18,7 @@ MODULE_SRCS=  AliHLTSampleComponent1.cxx \
 CLASS_HDRS:=   AliHLTSampleComponent1.h \
                AliHLTSampleComponent2.h \
                AliHLTAgentSample.h \
+               AliHLTSampleOfflineSinkComponent.h \
                AliHLTDummyComponent.h
 
 # library headers
index ca52e2ee15f2645a63ddae6f241c741b9a654e19..9c60815054e38b680e7e67d4c80d5866314be59f 100644 (file)
@@ -6,11 +6,13 @@ include $(MODDIR)/hlt.conf
 MODULE_SRCS=   AliHLTFilePublisher.cxx \
                AliHLTRootFilePublisherComponent.cxx \
                AliHLTRootFileWriterComponent.cxx \
+               AliHLTLoaderPublisherComponent.cxx \
                AliHLTAgentUtil.cxx
 
 CLASS_HDRS:=   AliHLTFilePublisher.h \
                AliHLTRootFilePublisherComponent.h \
                AliHLTRootFileWriterComponent.h \
+               AliHLTLoaderPublisherComponent.h \
                AliHLTAgentUtil.h
 
 MODULE_HDRS:=  $(CLASS_HDRS)
index 194ae0beb3f3ea224c04c82096c75e7568d9c52b..649211d8d7ff299b6843acd9105fa1caae4591c9 100644 (file)
@@ -7,9 +7,6 @@
 // <loizides@ikf.uni-frankfurt.de>                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
-// very ugly but it has to work fast
-#ifdef use_reconstruction
-
 #include <Riostream.h>
 #include <TSystem.h>
 #include <TArrayF.h>
@@ -47,6 +44,7 @@
 using namespace std;
 #endif
 
+/** HLT default component libraries */
 const char* kHLTDefaultLibs[]= {
   "libAliHLTUtil.so", 
   "libAliHLTTPC.so", 
@@ -482,4 +480,3 @@ void AliHLTReconstructor::FillDHLTRecPoint(AliRawReader* rawReader, Int_t nofEve
 
 }
 
-#endif
index ad8e4e012d1d4c9223d1f480982fc07812de40c9..014b2fcb78d741b89e8e4a8c96fcf5fe993baed3 100644 (file)
@@ -5,11 +5,39 @@
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
-#ifdef use_reconstruction
 #include "AliReconstructor.h"
 
 class AliHLTSystem;
 
+/**
+ * @class AliHLTReconstructor
+ * AliHLTReconstructor AliRoot event reconstruction plugin for the HLT.
+ * The AliHLTReconstructor holds an instance of the @ref AliHLTSystem
+ * steering class. The actual reconstruction depends on the loaded component
+ * libraries. Each library must implement a module agent (@ref AliHLTModuleAgent)
+ * in order to provide information on the supported features and the
+ * configurations to be run.
+ *
+ * The default component libraries which are loaded through the initialization
+ * are determined by the @ref kHLTDefaultLibs array. The library loading can
+ * be overridden by an option to the AliHLTReconstructor through the
+ * <tt>SetOption</tt> method of <tt>AliReconstruction</tt>, e.g.
+ * <pre>
+ * AliReconstruction rec;
+ * rec.SetOption("HLT", "libAliHLTSample.so");
+ * </pre>
+ * will only load <tt>libAliHLTSample.so</tt>
+ * 
+ * Optional arguments:<br>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formating -->
+ * \li loglevel=<i>level</i><br>
+ *     level can be a hex number encoding the @ref AliHLTComponentLogSeverity
+ * \li alilog=off <br>
+ *     disables the logging of HLT log messages through <tt>AliLog</tt> <br>
+ *
+ * For further information on the AliRoot reconstruction refer to the AliRoot
+ * documentation, namely <tt>AliReconstruction</tt>.
+ */
 class AliHLTReconstructor: public AliReconstructor {
 public:
   AliHLTReconstructor();
@@ -74,7 +102,6 @@ private:
 
   ClassDef(AliHLTReconstructor, 1)   // class for the TPC reconstruction
 };
-#endif
 
 typedef AliHLTReconstructor AliL3Reconstructor; // for backward compatibility