]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- support for event by event reconstruction added to AliHLTSystem
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 9 Oct 2007 21:54:36 +0000 (21:54 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 9 Oct 2007 21:54:36 +0000 (21:54 +0000)
- AliHLTModuleAgent interface functions adapted to the final simulation/reconstruction scheme

14 files changed:
HLT/BASE/AliHLTModuleAgent.cxx
HLT/BASE/AliHLTModuleAgent.h
HLT/BASE/AliHLTSystem.cxx
HLT/BASE/AliHLTSystem.h
HLT/BASE/util/AliHLTAgentUtil.cxx
HLT/BASE/util/AliHLTAgentUtil.h
HLT/MUON/OfflineInterface/AliHLTMUONAgent.cxx
HLT/MUON/OfflineInterface/AliHLTMUONAgent.h
HLT/SampleLib/AliHLTAgentSample.cxx
HLT/SampleLib/AliHLTAgentSample.h
HLT/TPCLib/AliHLTTPCAgent.cxx
HLT/TPCLib/AliHLTTPCAgent.h
HLT/rec/AliHLTReconstructor.cxx
HLT/sim/AliHLTSimulation.cxx

index 55f3d592e2e0f4bb0280ac84c4196b168168da7a..f8d284e9efe8ce1abbb1947ae19397bf08565f44 100644 (file)
@@ -40,21 +40,6 @@ AliHLTModuleAgent::AliHLTModuleAgent()
   Register(this);
 }
 
   Register(this);
 }
 
-AliHLTModuleAgent::AliHLTModuleAgent(const AliHLTModuleAgent&)
-  :
-  TObject(),
-  AliHLTLogging(),
-  fpNext(NULL)
-{
-  // see header file for function documentation
-}
-
-AliHLTModuleAgent& AliHLTModuleAgent::operator=(const AliHLTModuleAgent&)
-{
-  // see header file for function documentation
-  return *this;
-}
-
 AliHLTModuleAgent::~AliHLTModuleAgent()
 {
   // see header file for function documentation
 AliHLTModuleAgent::~AliHLTModuleAgent()
 {
   // see header file for function documentation
@@ -92,19 +77,15 @@ void AliHLTModuleAgent::PrintStatus(const char* agent)
 }
 
 int AliHLTModuleAgent::CreateConfigurations(AliHLTConfigurationHandler* /*handler*/,
 }
 
 int AliHLTModuleAgent::CreateConfigurations(AliHLTConfigurationHandler* /*handler*/,
+                                           AliRawReader* /*rawReader*/,
                                            AliRunLoader* /*runloader*/) const
 {
   // default method, nothing to be done, child classes can overload
   return 0;
 }
 
                                            AliRunLoader* /*runloader*/) const
 {
   // default method, nothing to be done, child classes can overload
   return 0;
 }
 
-const char* AliHLTModuleAgent::GetLocalRecConfigurations(AliRunLoader* /*runloader*/) const
-{
-  // default method, nothing to be done, child classes can overload
-  return NULL;
-}
-
-const char* AliHLTModuleAgent::GetEventRecConfigurations(AliRunLoader* /*runloader*/) const
+const char* AliHLTModuleAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
+                                                      AliRunLoader* /*runloader*/) const
 {
   // default method, nothing to be done, child classes can overload
   return NULL;
 {
   // default method, nothing to be done, child classes can overload
   return NULL;
@@ -116,7 +97,8 @@ const char* AliHLTModuleAgent::GetRequiredComponentLibraries() const
   return NULL;
 }
 
   return NULL;
 }
 
-int AliHLTModuleAgent::RegisterComponents(AliRunLoader* /*runloader*/) const
+int AliHLTModuleAgent::RegisterComponents(AliRawReader* /*rawReader*/,
+                                         AliRunLoader* /*runloader*/) const
 {
   // default method, nothing to be done, child classes can overload
   return 0;
 {
   // default method, nothing to be done, child classes can overload
   return 0;
index 74bebf7b2bac13c079fbcce3cd7b75bb5063a6eb..fb0bb11554d9a65441affb68cb33018a15b7f1fb 100644 (file)
@@ -27,6 +27,7 @@
 #include "AliHLTConfigurationHandler.h"
 
 class AliRunLoader;
 #include "AliHLTConfigurationHandler.h"
 
 class AliRunLoader;
+class AliRawReader;
 
 /**
  * @class AliHLTModuleAgent
 
 /**
  * @class AliHLTModuleAgent
@@ -38,6 +39,11 @@ class AliRunLoader;
  * it depends on.
  * @note There must not be more than one agent per module/library.
  *
  * it depends on.
  * @note There must not be more than one agent per module/library.
  *
+ * If a run loader is available, reconstruction is performed on simulated
+ * data as part of <tt>AliSimulation</tt>, if the raw reader is present on
+ * raw data as part of <tt>AliReconstruction</tt>. The configurations
+ * can adapt to the two cases.
+ *
  * 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
  * 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
@@ -45,25 +51,28 @@ class AliRunLoader;
  * can be queried when required.
  *
  * This is usually done during running the AliRoot reconstruction (see AliRoot
  * can be queried when required.
  *
  * 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 
+ * documentation on <tt> AliSimulation </tt> and <tt> AliReconstruction <tt>).
+ * The HLT implemets the @ref AliHLTSimulation and @ref
+ * AliHLTReconstructor which hold the HLT steering object. Several flags can
+ * be specified as options via the <tt>SetRunHLT</tt> method of
+ * <tt>AliSimulation</tt> and 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>
  * <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.
+ *       Create HLT configuration forming an HLT analysis chain.            <br>
+ *       Reconstruction of raw data or simulated data from digits needs
+ *       usually different configurations. If a run loader is available,
+ *       reconstruction is performed on simulated data, on raw data if the
+ *       raw reader is present.
  *
  *
- * - @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.
+ * - @ref GetReconstructionChains                                           <br>
+ *       Configurations run during event reconstruction.                    <br>
+ *       Define chains to be run during the recunstruction step,
+ *       Depending on the availability of AliRoot run loader or raw reader
  *                                                                          <br>
  *                                                                          <br>
+ *
  * - @ref GetRequiredComponentLibraries                                     <br>
  *       can indicate further libraries which are required for running the
  *       chains (e.g. if components of another library are used).
  * - @ref GetRequiredComponentLibraries                                     <br>
  *       can indicate further libraries which are required for running the
  *       chains (e.g. if components of another library are used).
@@ -86,10 +95,6 @@ class AliHLTModuleAgent : public TObject, public AliHLTLogging {
    * global agent manager
    */
   AliHLTModuleAgent();
    * global agent manager
    */
   AliHLTModuleAgent();
-  /** not a valid copy constructor, defined according to effective C++ style */
-  AliHLTModuleAgent(const AliHLTModuleAgent&);
-  /** not a valid assignment op, but defined according to effective C++ style */
-  AliHLTModuleAgent& operator=(const AliHLTModuleAgent&);
   /** destructor */
   virtual ~AliHLTModuleAgent();
 
   /** destructor */
   virtual ~AliHLTModuleAgent();
 
@@ -116,36 +121,38 @@ class AliHLTModuleAgent : public TObject, public AliHLTLogging {
    * Register all configurations belonging to this module with the
    * AliHLTConfigurationHandler. The agent can adapt the configurations
    * to be registered to the current AliRoot setup by checking the
    * Register all configurations belonging to this module with the
    * AliHLTConfigurationHandler. The agent can adapt the configurations
    * to be registered to the current AliRoot setup by checking the
-   * runloader.
+   * runloader and the raw reader. <br>
+   * Run loader and raw reader are usually not present at the same time.
+   * If a run loader is available, reconstruction is performed on simulated
+   * data, if the raw reader is present on raw data. The configurations
+   * can adapt to the two cases.
+   *
    * @param handler   [in] the configuration handler
    * @param handler   [in] the configuration handler
+   * @param rawReader [in] AliRoot RawReader instance 
    * @param runloader [in] AliRoot runloader
    * @return neg. error code if failed
    */
   virtual int CreateConfigurations(AliHLTConfigurationHandler* handler,
    * @param runloader [in] AliRoot runloader
    * @return neg. error code if failed
    */
   virtual int CreateConfigurations(AliHLTConfigurationHandler* handler,
+                                  AliRawReader* rawReader=NULL,
                                   AliRunLoader* runloader=NULL) const;
 
   /**
                                   AliRunLoader* runloader=NULL) const;
 
   /**
-   * Get the top configurations for local event reconstruction.
+   * Get the top configurations for 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
    * 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  [in] AliRoot runloader
-   * @return string containing the top configurations separated by blanks
-   */
-  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
+   * AliRoot setup by checking the run loader and the raw reader.
+   * @param rawReader [in] AliRoot RawReader instance 
+   * @param runloader [in] AliRoot runloader
    * @return string containing the top configurations separated by blanks
    */
    * @return string containing the top configurations separated by blanks
    */
-  virtual const char* GetEventRecConfigurations(AliRunLoader* runloader=NULL) const;
+  virtual const char* GetReconstructionChains(AliRawReader* rawReader=NULL,
+                                             AliRunLoader* runloader=NULL) const;
 
   /**
 
   /**
-   * Component libraries which the configurations of this agent depend on.
+   * Component libraries which the configurations of this agent depend on. <br>
+   * @note This is not the right place to specify libraries which this component
+   * library depends. Dependencies must be linked or loaded before.
    * @return list of component libraries as a blank-separated string.
    */
   virtual const char* GetRequiredComponentLibraries() const;
    * @return list of component libraries as a blank-separated string.
    */
   virtual const char* GetRequiredComponentLibraries() const;
@@ -158,19 +165,25 @@ class AliHLTModuleAgent : public TObject, public AliHLTLogging {
    * \em Note: The sample object is owned by the agent, make sure to delete
    * it.
    */
    * \em Note: The sample object is owned by the agent, make sure to delete
    * it.
    */
-  virtual int RegisterComponents(AliRunLoader* runloader=NULL) const;
+  virtual int RegisterComponents(AliRawReader* rawReader=NULL,
+                                AliRunLoader* runloader=NULL) const;
 
   /**
    * Old method kept for backward compatibility, redirected to @ref
 
   /**
    * Old method kept for backward compatibility, redirected to @ref
-   * GetLocalRecConfigurations.
+   * GetReconstructionChains.
    */
   const char* GetTopConfigurations(AliRunLoader* runloader=NULL) const {
    */
   const char* GetTopConfigurations(AliRunLoader* runloader=NULL) const {
-    return GetLocalRecConfigurations(runloader);
+    return GetReconstructionChains(NULL,runloader);
   }
 
  protected:
 
  private:
   }
 
  protected:
 
  private:
+  /** copy constructor prohibited */
+  AliHLTModuleAgent(const AliHLTModuleAgent&);
+  /** assignment operator prohibited */
+  AliHLTModuleAgent& operator=(const AliHLTModuleAgent&);
+
   /**
    * Register agent in the global list.
    * @return neg. error code if failed
   /**
    * Register agent in the global list.
    * @return neg. error code if failed
index ce9bed1d6d8b24d75a60fc77ea1bf98911d502cb..bbb4b2446fc0315a74c45be17e46bc0a89b054ba 100644 (file)
@@ -61,7 +61,10 @@ AliHLTSystem::AliHLTSystem()
   fpConfigurationHandler(new AliHLTConfigurationHandler()),
   fTaskList(),
   fState(0),
   fpConfigurationHandler(new AliHLTConfigurationHandler()),
   fTaskList(),
   fState(0),
-  fLocalRec()
+  fChains(),
+  fStopwatches(new TObjArray),
+  fEventCount(-1),
+  fGoodEvents(-1)
 {
   // see header file for class documentation
   // or
 {
   // see header file for class documentation
   // or
@@ -324,56 +327,38 @@ void AliHLTSystem::PrintTaskList()
   }
 }
 
   }
 }
 
-int AliHLTSystem::Run(Int_t iNofEvents
+int AliHLTSystem::Run(Int_t iNofEvents, int bStop)
 {
   // see header file for class documentation
   int iResult=0;
   int iCount=0;
   SetStatusFlags(kRunning);
 {
   // see header file for class documentation
   int iResult=0;
   int iCount=0;
   SetStatusFlags(kRunning);
-  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);
-       if (iResult>=0) {
-         HLTInfo("Event %d successfully finished (%d)", i, iResult);
-         iResult=0;
+  if (fEventCount>=0 || (iResult=InitTasks())>=0) {
+    if (fEventCount>=0 || (iResult=StartTasks())>=0) {
+      if (fEventCount==0) {
+       InitBenchmarking(fStopwatches);
+      } else {
+       //ResumeBenchmarking(fStopwatches);    
+      }
+      for (int i=fEventCount; i<fEventCount+iNofEvents && iResult>=0; i++) {
+       if ((iResult=ProcessTasks(i))>=0) {
+         fGoodEvents++;
          iCount++;
        } else {
          iCount++;
        } else {
-         HLTError("Processing of event %d failed (%d)", i, iResult);
          // TODO: define different running modes to either ignore errors in
          // event processing or not
          // currently ignored 
          // TODO: define different running modes to either ignore errors in
          // event processing or not
          // currently ignored 
-         //iResult=0;
+         iResult=0;
        }
       }
        }
       }
-      StopTasks();
-    } else {
-      HLTError("can not start task list");
+      fEventCount+=iNofEvents;
+      if (bStop) StopTasks();
+      //else PauseBenchmarking(fStopwatches);
     }
     }
-    DeinitTasks();
-  } else if (iResult!=-ENOENT) {
-    HLTError("can not initialize task list");
+    if (bStop) DeinitTasks();
   }
   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());
   } else  if (iResult==-ENOENT) {
     iResult=0; // do not propagate the error
   }
   } else  if (iResult==-ENOENT) {
     iResult=0; // do not propagate the error
   }
@@ -386,6 +371,7 @@ int AliHLTSystem::InitTasks()
   // see header file for class documentation
   int iResult=0;
   TObjLink *lnk=fTaskList.FirstLink();
   // see header file for class documentation
   int iResult=0;
   TObjLink *lnk=fTaskList.FirstLink();
+
   if (lnk==NULL) {
     HLTWarning("Task list is empty, aborting ...");
     return -ENOENT;
   if (lnk==NULL) {
     HLTWarning("Task list is empty, aborting ...");
     return -ENOENT;
@@ -400,16 +386,29 @@ int AliHLTSystem::InitTasks()
     lnk = lnk->Next();
   }
   if (iResult<0) {
     lnk = lnk->Next();
   }
   if (iResult<0) {
+    HLTError("can not initialize task list, error %d", iResult);
   }
   }
+
   return iResult;
 }
 
 int AliHLTSystem::InitBenchmarking(TObjArray* pStopwatches)
 {
   // see header file for class documentation
   return iResult;
 }
 
 int AliHLTSystem::InitBenchmarking(TObjArray* pStopwatches)
 {
   // see header file for class documentation
-  if (pStopwatches==NULL) return -EINVAL;
-
   int iResult=0;
   int iResult=0;
+  if (pStopwatches==NULL) return 0;
+
+  for (int i=0; i<(int)AliHLTComponent::kSWTypeCount; i++) {
+    TStopwatch* pStopwatch= new TStopwatch;
+    if (pStopwatch) {
+      pStopwatch->Reset();
+      pStopwatches->AddAt(pStopwatch, i);
+    } else {
+      iResult=-ENOMEM;
+      break;
+    }
+  }
+
   TObjLink *lnk=fTaskList.FirstLink();
   while (lnk && iResult>=0) {
     TObject* obj=lnk->GetObject();
   TObjLink *lnk=fTaskList.FirstLink();
   while (lnk && iResult>=0) {
     TObject* obj=lnk->GetObject();
@@ -454,6 +453,45 @@ int AliHLTSystem::InitBenchmarking(TObjArray* pStopwatches)
   return iResult;
 }
 
   return iResult;
 }
 
+int AliHLTSystem::PrintBenchmarking(TObjArray* pStopwatches, int bClean)
+{
+  // see header file for class documentation
+  int iInitialized=1;
+  if (pStopwatches==NULL) return 0;
+
+  for (int i=0; i<(int)AliHLTComponent::kSWTypeCount; i++) {
+    if (!dynamic_cast<TStopwatch*>(pStopwatches->At(i))) {
+      iInitialized=0;
+      break;
+    }
+  }
+
+  if (iInitialized!=0) {
+    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"
+           , dynamic_cast<TStopwatch*>(pStopwatches->At(AliHLTComponent::kSWBase))->RealTime()
+           , dynamic_cast<TStopwatch*>(pStopwatches->At(AliHLTComponent::kSWBase))->CpuTime()
+           , dynamic_cast<TStopwatch*>(pStopwatches->At(AliHLTComponent::kSWInput))->RealTime()
+           , dynamic_cast<TStopwatch*>(pStopwatches->At(AliHLTComponent::kSWInput))->CpuTime()
+           , dynamic_cast<TStopwatch*>(pStopwatches->At(AliHLTComponent::kSWOutput))->RealTime()
+           , dynamic_cast<TStopwatch*>(pStopwatches->At(AliHLTComponent::kSWOutput))->CpuTime()
+           , dynamic_cast<TStopwatch*>(pStopwatches->At(AliHLTComponent::kSWDA))->RealTime()
+           , dynamic_cast<TStopwatch*>(pStopwatches->At(AliHLTComponent::kSWDA))->CpuTime()
+           );
+  }
+
+  if (bClean) {
+    for (int i=0; i<(int)AliHLTComponent::kSWTypeCount; i++) {
+      TObject* pObj=pStopwatches->RemoveAt(i);
+      if (pObj) delete pObj;
+    }
+  }
+  return 0;
+}
+
 int AliHLTSystem::StartTasks()
 {
   // see header file for class documentation
 int AliHLTSystem::StartTasks()
 {
   // see header file for class documentation
@@ -469,6 +507,10 @@ int AliHLTSystem::StartTasks()
     lnk = lnk->Next();
   }
   if (iResult<0) {
     lnk = lnk->Next();
   }
   if (iResult<0) {
+    HLTError("can not start task list, error %d", iResult);
+  } else {
+    fEventCount=0;
+    fGoodEvents=0;
   }
   return iResult;
 }
   }
   return iResult;
 }
@@ -489,6 +531,14 @@ int AliHLTSystem::ProcessTasks(Int_t eventNo)
     }
     lnk = lnk->Next();
   }
     }
     lnk = lnk->Next();
   }
+
+  if (iResult>=0) {
+    HLTInfo("Event %d successfully finished (%d)", eventNo, iResult);
+    iResult=0;
+  } else {
+    HLTError("Processing of event %d failed (%d)", eventNo, iResult);
+  }
+
   return iResult;
 }
 
   return iResult;
 }
 
@@ -506,6 +556,7 @@ int AliHLTSystem::StopTasks()
     }
     lnk = lnk->Next();
   }
     }
     lnk = lnk->Next();
   }
+  PrintBenchmarking(fStopwatches, 1 /*clean*/);
   return iResult;
 }
 
   return iResult;
 }
 
@@ -523,6 +574,9 @@ int AliHLTSystem::DeinitTasks()
     }
     lnk = lnk->Next();
   }
     }
     lnk = lnk->Next();
   }
+  fEventCount=-1;
+  fGoodEvents=-1;
+
   return iResult;
 }
 
   return iResult;
 }
 
@@ -545,11 +599,19 @@ int AliHLTSystem::Reconstruct(int nofEvents, AliRunLoader* runLoader,
 {
   // see header file for class documentation
   int iResult=0;
 {
   // see header file for class documentation
   int iResult=0;
-  if (runLoader || rawReader) {
-    HLTInfo("Run Loader %p, Raw Reader %p , %d events", runLoader, rawReader, nofEvents);
+  if (runLoader || rawReader || nofEvents==0) {
+    if (nofEvents>0) {HLTInfo("Run Loader %p, Raw Reader %p , %d event(s)", runLoader, rawReader, nofEvents);}
     if (CheckStatus(kReady)) {
     if (CheckStatus(kReady)) {
+      if (nofEvents==0) {
+       // special case to close the reconstruction
+       StopTasks();
+       DeinitTasks();
+      } else {
       if ((iResult=AliHLTOfflineInterface::SetParamsToComponents(runLoader, rawReader))>=0) {
       if ((iResult=AliHLTOfflineInterface::SetParamsToComponents(runLoader, rawReader))>=0) {
-       iResult=Run(nofEvents);
+       // the system always remains started after event processing, a specific
+       // call with nofEvents==0 is neede to execute the stop sequence
+       iResult=Run(nofEvents, 0);
+      }
       }
     } else {
       HLTError("wrong state %#x, required flags %#x", GetStatusFlags(), kReady);
       }
     } else {
       HLTError("wrong state %#x, required flags %#x", GetStatusFlags(), kReady);
@@ -565,7 +627,7 @@ int AliHLTSystem::FillESD(int eventNo, AliRunLoader* runLoader, AliESDEvent* esd
 {
   // see header file for class documentation
   int iResult=0;
 {
   // see header file for class documentation
   int iResult=0;
-  if (runLoader) {
+  if (runLoader || esd) {
     HLTInfo("Event %d: Run Loader %p, ESD %p", eventNo, runLoader, esd);
     iResult=AliHLTOfflineInterface::FillComponentESDs(eventNo, runLoader, esd);
   } else {
     HLTInfo("Event %d: Run Loader %p, ESD %p", eventNo, runLoader, esd);
     iResult=AliHLTOfflineInterface::FillComponentESDs(eventNo, runLoader, esd);
   } else {
@@ -608,6 +670,12 @@ int AliHLTSystem::LoadComponentLibraries(const char* libraries)
 }
 
 int AliHLTSystem::Configure(AliRunLoader* runloader)
 }
 
 int AliHLTSystem::Configure(AliRunLoader* runloader)
+{
+  // see header file for class documentation
+  Configure(NULL, runloader);
+}
+
+int AliHLTSystem::Configure(AliRawReader* rawReader, AliRunLoader* runloader)
 {
   // see header file for class documentation
   int iResult=0;
 {
   // see header file for class documentation
   int iResult=0;
@@ -619,9 +687,9 @@ int AliHLTSystem::Configure(AliRunLoader* runloader)
   if (CheckFilter(kHLTLogDebug))
     AliHLTModuleAgent::PrintStatus();
   if (CheckStatus(kConfigurationLoaded)==0) {
   if (CheckFilter(kHLTLogDebug))
     AliHLTModuleAgent::PrintStatus();
   if (CheckStatus(kConfigurationLoaded)==0) {
-    iResult=LoadConfigurations(runloader);
+    iResult=LoadConfigurations(rawReader, runloader);
   } else {
   } else {
-    if (fLocalRec.Length()==0) {
+    if (fChains.Length()==0) {
       HLTError("custom configuration(s) specified, but no configuration to run in local reconstruction, use \'localrec=<conf>\' option");
       iResult=-ENOENT;
     }
       HLTError("custom configuration(s) specified, but no configuration to run in local reconstruction, use \'localrec=<conf>\' option");
       iResult=-ENOENT;
     }
@@ -630,7 +698,7 @@ int AliHLTSystem::Configure(AliRunLoader* runloader)
     SetStatusFlags(kConfigurationLoaded);
     if (CheckFilter(kHLTLogDebug))
       fpConfigurationHandler->PrintConfigurations();
     SetStatusFlags(kConfigurationLoaded);
     if (CheckFilter(kHLTLogDebug))
       fpConfigurationHandler->PrintConfigurations();
-    iResult=BuildTaskListsFromTopConfigurations(runloader);
+    iResult=BuildTaskListsFromTopConfigurations(rawReader, runloader);
     if (iResult>=0) {
       SetStatusFlags(kTaskListCreated);
     }
     if (iResult>=0) {
       SetStatusFlags(kTaskListCreated);
     }
@@ -677,8 +745,8 @@ int AliHLTSystem::ScanOptions(const char* options)
            iResult=-EBADF;
          }
        } else if (token.Contains("localrec=")) {
            iResult=-EBADF;
          }
        } else if (token.Contains("localrec=")) {
-         TString param=token.ReplaceAll("localrec=", "");
-         fLocalRec=param.ReplaceAll(",", " ");
+         TString param=token.ReplaceAll("chains=", "");
+         fChains=param.ReplaceAll(",", " ");
        } else if (token.BeginsWith("lib") && token.EndsWith(".so")) {
          libs+=token;
          libs+=" ";
        } else if (token.BeginsWith("lib") && token.EndsWith(".so")) {
          libs+=token;
          libs+=" ";
@@ -720,7 +788,7 @@ int AliHLTSystem::Reset(int bForce)
   return iResult;
 }
 
   return iResult;
 }
 
-int AliHLTSystem::LoadConfigurations(AliRunLoader* runloader)
+int AliHLTSystem::LoadConfigurations(AliRawReader* rawReader, AliRunLoader* runloader)
 {
   // see header file for class documentation
   if (CheckStatus(kRunning)) {
 {
   // see header file for class documentation
   if (CheckStatus(kRunning)) {
@@ -737,14 +805,14 @@ int AliHLTSystem::LoadConfigurations(AliRunLoader* runloader)
     }
     if (iResult>=0) {
       HLTDebug("load configurations for agent %s (%p)", pAgent->GetName(), pAgent);
     }
     if (iResult>=0) {
       HLTDebug("load configurations for agent %s (%p)", pAgent->GetName(), pAgent);
-      pAgent->CreateConfigurations(fpConfigurationHandler, runloader);
+      pAgent->CreateConfigurations(fpConfigurationHandler, rawReader, runloader);
       pAgent=AliHLTModuleAgent::GetNextAgent();
     }
   }
   return iResult;
 }
 
       pAgent=AliHLTModuleAgent::GetNextAgent();
     }
   }
   return iResult;
 }
 
-int AliHLTSystem::BuildTaskListsFromTopConfigurations(AliRunLoader* runloader)
+int AliHLTSystem::BuildTaskListsFromTopConfigurations(AliRawReader* rawReader, AliRunLoader* runloader)
 {
   // see header file for class documentation
   if (CheckStatus(kRunning)) {
 {
   // see header file for class documentation
   if (CheckStatus(kRunning)) {
@@ -758,13 +826,13 @@ int AliHLTSystem::BuildTaskListsFromTopConfigurations(AliRunLoader* runloader)
 
   int iResult=0;
   AliHLTModuleAgent* pAgent=AliHLTModuleAgent::GetFirstAgent();
 
   int iResult=0;
   AliHLTModuleAgent* pAgent=AliHLTModuleAgent::GetFirstAgent();
-  while ((pAgent || fLocalRec.Length()>0) && iResult>=0) {
+  while ((pAgent || fChains.Length()>0) && iResult>=0) {
     TString tops;
     TString tops;
-    if (fLocalRec.Length()>0) {
-      tops=fLocalRec;
+    if (fChains.Length()>0) {
+      tops=fChains;
       HLTInfo("custom local reconstruction configurations: %s", tops.Data());
     } else {
       HLTInfo("custom local reconstruction configurations: %s", tops.Data());
     } else {
-      tops=pAgent->GetLocalRecConfigurations(runloader);
+      tops=pAgent->GetReconstructionChains(rawReader, runloader);
       HLTInfo("local reconstruction configurations for agent %s (%p): %s", pAgent->GetName(), pAgent, tops.Data());
     }
     TObjArray* pTokens=tops.Tokenize(" ");
       HLTInfo("local reconstruction configurations for agent %s (%p): %s", pAgent->GetName(), pAgent, tops.Data());
     }
     TObjArray* pTokens=tops.Tokenize(" ");
@@ -782,7 +850,7 @@ int AliHLTSystem::BuildTaskListsFromTopConfigurations(AliRunLoader* runloader)
       delete pTokens;
     }
     
       delete pTokens;
     }
     
-    if (fLocalRec.Length()>0) {
+    if (fChains.Length()>0) {
       break; // ignore the agents
     }
     pAgent=AliHLTModuleAgent::GetNextAgent();
       break; // ignore the agents
     }
     pAgent=AliHLTModuleAgent::GetNextAgent();
index d0f43e23593de9ab517e0f899432d3181411897b..ab6a686bdde9fdd3ad114ff79da50110af584892 100644 (file)
@@ -136,12 +136,16 @@ class AliHLTSystem : public AliHLTLogging {
    * Run the task list.
    * The method checks whether the task list has already been build. If not,
    * or the configuration list has been changed, the @ref BuildTaskList
    * Run the task list.
    * The method checks whether the task list has already been build. If not,
    * or the configuration list has been changed, the @ref BuildTaskList
-   * method is scalled
+   * method is called.                                                    <br>
    * All tasks of the list will be subsequently processed for each event.
    * All tasks of the list will be subsequently processed for each event.
+   * The system can remain started if the \em bStop parameter is 0. In that
+   * case the system just waits for the next event. A specific call with
+   * nofEvents==0 is needed to execute the stop sequence.
    * @param iNofEvents number of events
    * @param iNofEvents number of events
+   * @param bStop      stop the chain after processing
    * @return number of reconstructed events, neg error code if failed
    */
    * @return number of reconstructed events, neg error code if failed
    */
-  int Run(Int_t iNofEvents=1);
+  int Run(Int_t iNofEvents=1, int bStop=1);
 
   /**
    * Init all tasks from the list.
 
   /**
    * Init all tasks from the list.
@@ -159,6 +163,15 @@ class AliHLTSystem : public AliHLTLogging {
    */
   int InitBenchmarking(TObjArray* pStopwatches);
 
    */
   int InitBenchmarking(TObjArray* pStopwatches);
 
+  /**
+   * Print benchmarking summary.
+   * Optionak: clean up stop watches.
+   * @param pStopwatches    object array of stopwatches
+   * @param bClean          delete stop watches if 1
+   * @return neg error code if failed
+   */
+  int PrintBenchmarking(TObjArray* pStopwatches, int bClean=0);
+
   /**
    * Start task list.
    * The @ref AliHLTTask::StartRun method is called for each task, the
   /**
    * Start task list.
    * The @ref AliHLTTask::StartRun method is called for each task, the
@@ -197,13 +210,23 @@ class AliHLTSystem : public AliHLTLogging {
   static void* AllocMemory( void* param, unsigned long size );
 
   /**
   static void* AllocMemory( void* param, unsigned long size );
 
   /**
-   * Reconstruction inside AliRoot.
-   * To be called by the AliHLTReconstructor plugin during the
-   * LocalReconstruction step of the AliRoot reconstruction. The latter means
-   * that all events are reconstructed at once, the event loop is internally
-   * implemented. In contrast to that, the FillESD method is called event by
-   * event. This requires an 'ESD' recorder at the end of the HLT chain, in
-   * order to have the reconstructed events available for the FillESD loop.
+   * AliRoot embedded reconstruction.
+   * Main entry point to execute the HLT reconstruction from AliRoot. Called
+   * either by the AliHLTReconstructor plugin during AliRoot reconstruction
+   * of raw data, or AliHLTSimulation during simulation of data.
+   *
+   * The two cases are distinguished by the availablility of the run loader
+   * and raw reader.
+   * - AliRoot simulation: run loader is available and is propagated to the
+   *   module agents (AliHLTModuleAgent) to generate the corresponding
+   *   configurations and chains, and to the AliHLTOfflineSource components.
+   * - AliRoot reconstruction: raw reader is available and is propagated to
+   *   the agents and AliHLTOfflineSource components.
+   *
+   * The system remains started after the processing and just waits for the
+   * next event. A specific call with nofEvents==0 is needed to execute the
+   * stop sequence.
+   *
    * The 'runLoader' and 'rawReader' parameters are set to all active
    * AliHLTOfflineDataSource's and the HLT chain is processed for the given
    * number of events. If the rawReader is NULL, reconstruction is done on
    * The 'runLoader' and 'rawReader' parameters are set to all active
    * AliHLTOfflineDataSource's and the HLT chain is processed for the given
    * number of events. If the rawReader is NULL, reconstruction is done on
@@ -252,12 +275,21 @@ class AliHLTSystem : public AliHLTLogging {
    * - module agents are requested to register configurations
    * - task lists are built from the top configurations of the modules
    *
    * - module agents are requested to register configurations
    * - task lists are built from the top configurations of the modules
    *
+   * @param rawReader    instance of the raw reader or NULL
    * @param runloader    optional instance of the run loader
    * @return neg. error code if failed <br>
    *         -EBUSY      system is in kRunning state <br>
    */
    * @param runloader    optional instance of the run loader
    * @return neg. error code if failed <br>
    *         -EBUSY      system is in kRunning state <br>
    */
-  int Configure(AliRunLoader* runloader=NULL);
+  int Configure(AliRawReader* rawReader, AliRunLoader* runloader=NULL);
 
 
+  /**
+   * Old method kept for backward compatibilty.
+   *
+   * @param runloader    optional instance of the run loader
+   * @return neg. error code if failed <br>
+   *         -EBUSY      system is in kRunning state <br>
+   */
+  int Configure(AliRunLoader* runloader=NULL);
 
   /**
    * Scan options.
 
   /**
    * Scan options.
@@ -269,7 +301,7 @@ class AliHLTSystem : public AliHLTLogging {
    *     disable redirection of log messages to AliLog class
    * \li config=<i>macro</i>
    *     configuration macro
    *     disable redirection of log messages to AliLog class
    * \li config=<i>macro</i>
    *     configuration macro
-   * \li localrec=<i>configuration</i>
+   * \li chains=<i>configuration</i>
    *     comma separated list of configurations to be run during local
    *     reconstruction
    */
    *     comma separated list of configurations to be run during local
    *     reconstruction
    */
@@ -288,15 +320,20 @@ class AliHLTSystem : public AliHLTLogging {
    * Load the configurations specified by the module agents.
    * The runLoader is passed to the agent and allows configuration
    * selection.
    * Load the configurations specified by the module agents.
    * The runLoader is passed to the agent and allows configuration
    * selection.
+   * @param rawReader    instance of the raw reader or NULL
+   * @param runloader    optional instance of the run loader
    * @return neg. error code if failed 
    */
    * @return neg. error code if failed 
    */
-  int LoadConfigurations(AliRunLoader* runloader=NULL);
+  int LoadConfigurations(AliRawReader* rawReader, AliRunLoader* runloader=NULL);
 
   /**
    * Get the top configurations of all agents and build the task lists.
 
   /**
    * Get the top configurations of all agents and build the task lists.
+   * @param rawReader    instance of the raw reader or NULL
+   * @param runloader    optional instance of the run loader
    * @return neg. error code if failed 
    */
    * @return neg. error code if failed 
    */
-  int BuildTaskListsFromTopConfigurations(AliRunLoader* runloader=NULL);
+  int BuildTaskListsFromTopConfigurations(AliRawReader* rawReader, 
+                                         AliRunLoader* runloader=NULL);
 
   enum AliHLTSystemState_t {
     kUninitialized       = 0x0,
 
   enum AliHLTSystemState_t {
     kUninitialized       = 0x0,
@@ -304,7 +341,8 @@ class AliHLTSystem : public AliHLTLogging {
     kConfigurationLoaded = 0x2,
     kTaskListCreated     = 0x4,
     kReady               = 0x7,
     kConfigurationLoaded = 0x2,
     kTaskListCreated     = 0x4,
     kReady               = 0x7,
-    kRunning             = 0x8,
+    kStarted             = 0x8,
+    kRunning             = 0x10,
     kError               = 0x1000
   };
 
     kError               = 0x1000
   };
 
@@ -352,11 +390,20 @@ class AliHLTSystem : public AliHLTLogging {
   /** state of the object */
   int fState;                                                      // see above
 
   /** state of the object */
   int fState;                                                      // see above
 
-  /** configurations to be run during local reconstruction */
-  TString fLocalRec;                                               //!transient
+  /** chains to be run during reconstruction */
+  TString fChains;                                                 //!transient
+
+  /* array of stopwatches */
+  TObjArray* fStopwatches;                                         //!transient
+
+  /* number of events processed in total */                        
+  int fEventCount;                                                 //!transient
+
+  /* number of events processed successfully */
+  int fGoodEvents;                                                 //!transient
 
  private:
 
  private:
-  ClassDef(AliHLTSystem, 3);
+  ClassDef(AliHLTSystem, 4);
 };
 
 #endif
 };
 
 #endif
index 3b925ff8cb9aee5ab2b1736b93e3e8b17430b5ff..1949ccd7d9a872e74e5fac4776a9d8003180d32d 100644 (file)
@@ -45,16 +45,16 @@ AliHLTAgentUtil::~AliHLTAgentUtil()
   // see header file for class documentation
 }
 
   // see header file for class documentation
 }
 
-int AliHLTAgentUtil::CreateConfigurations(AliHLTConfigurationHandler* handler,
+int AliHLTAgentUtil::CreateConfigurations(AliHLTConfigurationHandler* /*handler*/,
+                                         AliRawReader* /*rawReader*/,
                                          AliRunLoader* /*runloader*/) const
 {
   // see header file for class documentation
                                          AliRunLoader* /*runloader*/) const
 {
   // see header file for class documentation
-  if (handler) {
-  }
   return 0;
 }
 
   return 0;
 }
 
-const char* AliHLTAgentUtil::GetLocalRecConfigurations(AliRunLoader* /*runloader*/) const
+const char* AliHLTAgentUtil::GetReconstructionChains(AliRawReader* /*rawReader*/,
+                                                    AliRunLoader* /*runloader*/) const
 {
   // see header file for class documentation
   return NULL;
 {
   // see header file for class documentation
   return NULL;
@@ -63,5 +63,5 @@ const char* AliHLTAgentUtil::GetLocalRecConfigurations(AliRunLoader* /*runloader
 const char* AliHLTAgentUtil::GetRequiredComponentLibraries() const
 {
   // see header file for class documentation
 const char* AliHLTAgentUtil::GetRequiredComponentLibraries() const
 {
   // see header file for class documentation
-  return "libAliHLTUtil.so";
+  return NULL;
 }
 }
index 2c69a371454ed1ae2199ef49d70b5d3ad1506571..b83a769da05dd0170603a6daa8d2b866f47d67e0 100644 (file)
@@ -34,11 +34,13 @@ class AliHLTAgentUtil : public AliHLTModuleAgent {
    * AliHLTConfigurationHandler. The agent can adapt the configurations
    * to be registered to the current AliRoot setup by checking the
    * runloader.
    * AliHLTConfigurationHandler. The agent can adapt the configurations
    * to be registered to the current AliRoot setup by checking the
    * runloader.
-   * @param handler      the configuration handler
-   * @param runloader    AliRoot runloader
+   * @param handler   [in] the configuration handler
+   * @param rawReader [in] AliRoot RawReader instance 
+   * @param runloader [in] AliRoot runloader
    * @return neg. error code if failed
    */
   int CreateConfigurations(AliHLTConfigurationHandler* handler,
    * @return neg. error code if failed
    */
   int CreateConfigurations(AliHLTConfigurationHandler* handler,
+                          AliRawReader* rawReader=NULL,
                           AliRunLoader* runloader=NULL) const;
 
   /**
                           AliRunLoader* runloader=NULL) const;
 
   /**
@@ -47,11 +49,12 @@ class AliHLTAgentUtil : public AliHLTModuleAgent {
    * 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.
    * 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 rawReader [in] AliRoot RawReader instance 
+   * @param runloader [in] AliRoot runloader
+   * @return string containing the top configurations separated by blanks
    */
    */
-  const char* GetLocalRecConfigurations(AliRunLoader* runloader=NULL) const;
-
+  const char* GetReconstructionChains(AliRawReader* rawReader=NULL,
+                                     AliRunLoader* runloader=NULL) const;
   /**
    * Component libraries which the configurations of this agent depend on.
    * @return list of component libraries as a blank-separated string.
   /**
    * Component libraries which the configurations of this agent depend on.
    * @return list of component libraries as a blank-separated string.
index 3d2e709b4a1c6171de25626ef6179025ded054ba..90ed7971bcea9b3a8a62e6b8c68c3f4c8ac07378 100644 (file)
@@ -42,8 +42,8 @@ AliHLTMUONAgent::~AliHLTMUONAgent()
 {
 }
 
 {
 }
 
-const char* AliHLTMUONAgent::GetLocalRecConfigurations(
-               AliRunLoader* runloader
+const char* AliHLTMUONAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
+                                                    AliRunLoader* /*runloader*/
        ) const
 {
        return "dhlt-simhits";
        ) const
 {
        return "dhlt-simhits";
@@ -59,7 +59,8 @@ const char* AliHLTMUONAgent::GetRequiredComponentLibraries() const
 
 int AliHLTMUONAgent::CreateConfigurations(
                AliHLTConfigurationHandler* handler,
 
 int AliHLTMUONAgent::CreateConfigurations(
                AliHLTConfigurationHandler* handler,
-               AliRunLoader* runloader
+               AliRawReader* /*rawReader*/,
+               AliRunLoader* /*runloader*/
        ) const
 {
        if (handler == NULL) return 0;
        ) const
 {
        if (handler == NULL) return 0;
index 8992d0a5d7a43c28319788b2f87be17eff8adb42..7621b7a5ea7b88c6c9c0afa4b34be272c11da8dc 100644 (file)
@@ -36,6 +36,7 @@ public:
         */
        int CreateConfigurations(
                        AliHLTConfigurationHandler* handler,
         */
        int CreateConfigurations(
                        AliHLTConfigurationHandler* handler,
+                       AliRawReader* rawReader=NULL,
                        AliRunLoader* runloader = NULL
                ) const;
 
                        AliRunLoader* runloader = NULL
                ) const;
 
@@ -45,7 +46,8 @@ public:
         * @param runloader  [in] AliRoot runloader
         * @return string containing the top configurations separated by blanks.
         */
         * @param runloader  [in] AliRoot runloader
         * @return string containing the top configurations separated by blanks.
         */
-       const char* GetLocalRecConfigurations(AliRunLoader* runloader = NULL) const;
+       const char* GetReconstructionChains(AliRawReader* rawReader=NULL,
+                                           AliRunLoader* runloader = NULL) const;
 
        /**
         * Component libraries which the configurations of this agent depend on.
 
        /**
         * Component libraries which the configurations of this agent depend on.
index b8e5b9799602b7b045de6d4dc890104d46af3bfc..3f9b041d7cdcf94d494919e2f399624ff84ea3f3 100644 (file)
@@ -58,6 +58,7 @@ AliHLTAgentSample::~AliHLTAgentSample()
 }
 
 int AliHLTAgentSample::CreateConfigurations(AliHLTConfigurationHandler* handler,
 }
 
 int AliHLTAgentSample::CreateConfigurations(AliHLTConfigurationHandler* handler,
+                                           AliRawReader* rawReader,
                                            AliRunLoader* runloader) const
 {
   // see header file for class documentation
                                            AliRunLoader* runloader) const
 {
   // see header file for class documentation
@@ -91,7 +92,8 @@ int AliHLTAgentSample::CreateConfigurations(AliHLTConfigurationHandler* handler,
   return 0;
 }
 
   return 0;
 }
 
-const char* AliHLTAgentSample::GetLocalRecConfigurations(AliRunLoader* runloader) const
+const char* AliHLTAgentSample::GetReconstructionChains(AliRawReader* rawReader,
+                                                      AliRunLoader* runloader) const
 {
   // see header file for class documentation
   return "sample-sink1 sample-offsnk";
 {
   // see header file for class documentation
   return "sample-sink1 sample-offsnk";
index 6c4879d57c28a5ce5084d9649e84a4f07153dd27..f3310e08d762708767bd0951e1d6f4f4c2e27a91 100644 (file)
@@ -30,7 +30,7 @@
  *   ...
  *   handler->CreateConfiguration("my-analysis-chain"  , "FileWriter", "my-processor" , "my arguments");
  *   </pre>
  *   ...
  *   handler->CreateConfiguration("my-analysis-chain"  , "FileWriter", "my-processor" , "my arguments");
  *   </pre>
- * - @ref GetLocalRecConfigurations <br>
+ * - @ref GetReconstructionChains <br>
  *   returns a string of blank separated configurations to be run during
  *   local event reconstruction.
  *   <pre>
  *   returns a string of blank separated configurations to be run during
  *   local event reconstruction.
  *   <pre>
@@ -38,7 +38,8 @@
  *   </pre>
  * - @ref GetRequiredComponentLibraries <br>
  *   returns a string of blank separated libraries which have to be loaded
  *   </pre>
  * - @ref GetRequiredComponentLibraries <br>
  *   returns a string of blank separated libraries which have to be loaded
- *   in addition
+ *   in addition in order to load all required components. <br>
+ *   @note Not the right place for library dependencies.
  *   <pre>
  *   return "libAliHLTUtil.so";
  *   </pre>
  *   <pre>
  *   return "libAliHLTUtil.so";
  *   </pre>
@@ -66,11 +67,13 @@ class AliHLTAgentSample : public AliHLTModuleAgent {
    * AliHLTConfigurationHandler. The agent can adapt the configurations
    * to be registered to the current AliRoot setup by checking the
    * runloader.
    * AliHLTConfigurationHandler. The agent can adapt the configurations
    * to be registered to the current AliRoot setup by checking the
    * runloader.
-   * @param handler      the configuration handler
-   * @param runloader    AliRoot runloader
+   * @param handler   [in] the configuration handler
+   * @param rawReader [in] AliRoot RawReader instance 
+   * @param runloader [in] AliRoot runloader
    * @return neg. error code if failed
    */
   int CreateConfigurations(AliHLTConfigurationHandler* handler,
    * @return neg. error code if failed
    */
   int CreateConfigurations(AliHLTConfigurationHandler* handler,
+                          AliRawReader* rawReader=NULL,
                           AliRunLoader* runloader=NULL) const;
 
   /**
                           AliRunLoader* runloader=NULL) const;
 
   /**
@@ -79,10 +82,12 @@ class AliHLTAgentSample : public AliHLTModuleAgent {
    * 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.
    * 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  [in] AliRoot runloader
+   * @param rawReader [in] AliRoot RawReader instance 
+   * @param runloader [in] AliRoot runloader
    * @return string containing the top configurations separated by blanks
    */
    * @return string containing the top configurations separated by blanks
    */
-  const char* GetLocalRecConfigurations(AliRunLoader* runloader=NULL) const;
+  const char* GetReconstructionChains(AliRawReader* rawReader=NULL,
+                                     AliRunLoader* runloader=NULL) const;
 
   /**
    * Component libraries which the configurations of this agent depend on.
 
   /**
    * Component libraries which the configurations of this agent depend on.
index 4b1afe4f1dd3ccd988720d10ec68ebc73eebbb55..ce2c7cdb628dac69321e3beebf9e397dc13017bc 100644 (file)
@@ -46,6 +46,7 @@ AliHLTTPCAgent::~AliHLTTPCAgent()
 }
 
 int AliHLTTPCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
 }
 
 int AliHLTTPCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
+                                        AliRawReader* /*rawReader*/,
                                         AliRunLoader* /*runloader*/) const
 {
   // see header file for class documentation
                                         AliRunLoader* /*runloader*/) const
 {
   // see header file for class documentation
@@ -94,7 +95,8 @@ int AliHLTTPCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
   return 0;
 }
 
   return 0;
 }
 
-const char* AliHLTTPCAgent::GetLocalRecConfigurations(AliRunLoader* /*runloader*/) const
+const char* AliHLTTPCAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
+                                                   AliRunLoader* /*runloader*/) const
 {
   // see header file for class documentation
   return NULL;
 {
   // see header file for class documentation
   return NULL;
index af07b83e719c03d9fc43de56cc7dcdd5785224a8..402b119db45dbf807e699bf01ba2b39e1003e1fc 100644 (file)
@@ -39,6 +39,7 @@ class AliHLTTPCAgent : public AliHLTModuleAgent {
    * @return neg. error code if failed
    */
   int CreateConfigurations(AliHLTConfigurationHandler* handler,
    * @return neg. error code if failed
    */
   int CreateConfigurations(AliHLTConfigurationHandler* handler,
+                          AliRawReader* rawReader=NULL,
                           AliRunLoader* runloader=NULL) const;
 
   /**
                           AliRunLoader* runloader=NULL) const;
 
   /**
@@ -50,7 +51,8 @@ class AliHLTTPCAgent : public AliHLTModuleAgent {
    * @param runloader    AliRoot runloader
    * @return number of configurations, neg. error code if failed
    */
    * @param runloader    AliRoot runloader
    * @return number of configurations, neg. error code if failed
    */
-  const char* GetLocalRecConfigurations(AliRunLoader* runloader=NULL) const;
+  const char* GetReconstructionChains(AliRawReader* rawReader=NULL,
+                                     AliRunLoader* runloader=NULL) const;
 
   /**
    * Component libraries which the configurations of this agent depend on.
 
   /**
    * Component libraries which the configurations of this agent depend on.
index f7a148506d71893fc27fbd32beba103a209cf174..a808ec9e2d890a6bbf1bba328006c265cc62d32e 100644 (file)
@@ -40,7 +40,13 @@ AliHLTReconstructor::AliHLTReconstructor()
 AliHLTReconstructor::~AliHLTReconstructor()
 { 
   //destructor
 AliHLTReconstructor::~AliHLTReconstructor()
 { 
   //destructor
+
   if (fpSystem) {
   if (fpSystem) {
+    AliDebug(0, Form("delete HLT system: status %#x", fpSystem->GetStatusFlags()));
+    if (fpSystem->CheckStatus(AliHLTSystem::kReady)) {
+      // send specific 'event' to execute the stop sequence
+      fpSystem->Reconstruct(0, NULL, NULL);
+    }
     delete fpSystem;
   }
   fpSystem=NULL;
     delete fpSystem;
   }
   fpSystem=NULL;
index cc1cb1072cf9fa5e018b5ea2e6f29aee0b3fd781..82d018869276d14028c980395548c94ca7ddab92 100644 (file)
@@ -117,6 +117,8 @@ int AliHLTSimulation::Run(AliRunLoader* pRunLoader)
     return -EFAULT;
   }
   if ((iResult=fpSystem->Reconstruct(nEvents, pRunLoader, NULL))>=0) {
     return -EFAULT;
   }
   if ((iResult=fpSystem->Reconstruct(nEvents, pRunLoader, NULL))>=0) {
+    // send specific 'event' to execute the stop sequence
+    fpSystem->Reconstruct(0, NULL, NULL);
   }
   return iResult;
 }
   }
   return iResult;
 }