defining the default simulation chain for the libAliHLTTrigger, inclusing the
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 1 Jul 2009 22:54:59 +0000 (22:54 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 1 Jul 2009 22:54:59 +0000 (22:54 +0000)
global trigger, chain is not yet enabled, but can be run by setting the options
simulator.SetRunHLT("libAliHLTTrigger.so chains=GLOBAL-Trigger");

HLT/trigger/AliHLTTriggerAgent.cxx
HLT/trigger/AliHLTTriggerAgent.h

index 2b8e68c..0e52934 100644 (file)
 
 #include <cassert>
 #include "AliHLTTriggerAgent.h"
+#include "TObjString.h"
+#include "TObjArray.h"
 
 // header files of library components
 #include "AliHLTEventSummaryProducerComponent.h"
 #include "AliHLTRunSummaryProducerComponent.h"
+#include "AliHLTTriggerBarrelMultiplicity.h"
+#include "AliHLTTriggerBarrelCosmic.h"
 #include "AliHLTGlobalTriggerComponent.h"
 
 /** global instance for agent registration */
@@ -58,9 +62,84 @@ int AliHLTTriggerAgent::RegisterComponents(AliHLTComponentHandler* pHandler) con
   assert(pHandler);
   if (!pHandler) return -EINVAL;
   pHandler->AddComponent(new AliHLTGlobalTriggerComponent);
+  pHandler->AddComponent(new AliHLTTriggerBarrelMultiplicity);
+  pHandler->AddComponent(new AliHLTTriggerBarrelCosmic);
   return 0;
 }
 
+int AliHLTTriggerAgent::CreateConfigurations(AliHLTConfigurationHandler* pHandler,
+                                           AliRawReader* /*rawReader*/,
+                                           AliRunLoader* /*runloader*/) const
+{
+  // see header file for class documentation
+  if (!pHandler) return -EINVAL;
+
+  TString triggerInputs;
+  TString triggerOutputs;
+  TString configurationId;
+  /////////////////////////////////////////////////////////////////////////////////////
+  //
+  // a central barrel charged particle multiplicity trigger
+  configurationId="TRIGGER-Barrel-Multiplicity";
+
+  // define the inputsfor the BarrelMultiplicityTrigger
+  triggerInputs="GLOBAL-esd-converter";
+
+  // check for the availibility
+  TObjArray* pTokens=triggerInputs.Tokenize(" ");
+  triggerInputs="";
+  if (pTokens) {
+    for (int n=0; n<pTokens->GetEntriesFast(); n++) {
+      TString module=((TObjString*)pTokens->At(n))->GetString();
+      if (pHandler->FindConfiguration(module.Data())) {
+       triggerInputs+=module;
+       triggerInputs+=" ";
+      }
+    }
+    delete pTokens;
+  }
+
+  if (triggerInputs.Length()>0) {
+    HLTInfo("Configuring inputs for %s: %s", configurationId.Data(), triggerInputs.Data());
+    pHandler->CreateConfiguration(configurationId.Data(), "BarrelMultiplicityTrigger", triggerInputs.Data(), "");
+    if (triggerOutputs.Length()>0) triggerOutputs+=" ";
+    triggerOutputs+=configurationId;
+  } else {
+    HLTWarning("No inputs for %s found, skipping component", configurationId.Data());
+  }
+
+  /////////////////////////////////////////////////////////////////////////////////////
+  //
+  // the global trigger component
+  configurationId="GLOBAL-Trigger";
+  HLTInfo("setting inputs for %s: %s", configurationId.Data(), triggerOutputs.IsNull()?"none":triggerOutputs.Data());
+  pHandler->CreateConfiguration(configurationId.Data(), "HLTGlobalTrigger", triggerOutputs.Data(), "");
+  
+  return 0;
+}
+
+const char* AliHLTTriggerAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
+                                                   AliRunLoader* runloader) const
+{
+  // see header file for class documentation
+  if (runloader) {
+    // reconstruction chains for AliRoot simulation
+    // Note: run loader is only available while running embedded into
+    // AliRoot simulation
+
+    // currently disabled due to a problem compiling the runtime trigger library
+    //return "GLOBAL-Trigger";
+  }
+  return NULL;
+}
+
+const char* AliHLTTriggerAgent::GetRequiredComponentLibraries() const
+{
+  // see header file for class documentation
+
+  return "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so libAliHLTITS.so libAliHLTGlobal.so";
+}
+
 int AliHLTTriggerAgent::GetHandlerDescription(AliHLTComponentDataType dt,
                                           AliHLTUInt32_t /*spec*/,
                                          AliHLTOUTHandlerDesc& desc) const
index 2d69f7a..9034b8b 100644 (file)
@@ -34,6 +34,42 @@ class AliHLTTriggerAgent : public AliHLTModuleAgent {
 
   int RegisterComponents(AliHLTComponentHandler* pHandler) const;
 
+  /**
+   * Inherited from AliHLTModuleAgent
+   * 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.
+   * @param handler      the configuration handler
+   * @param rawReader    AliRawReader instance
+   * @param runloader    AliRoot runloader
+   * @return neg. error code if failed
+   */
+  int CreateConfigurations(AliHLTConfigurationHandler* handler,
+                          AliRawReader* rawReader=NULL,
+                          AliRunLoader* runloader=NULL) const;
+
+  /**
+   * Inherited from AliHLTModuleAgent
+   * Get the top configurations belonging to this module.
+   * 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 rawReader    AliRawReader instance
+   * @param runloader    AliRoot runloader
+   * @return number of configurations, neg. error code if failed
+   */
+  const char* GetReconstructionChains(AliRawReader* rawReader=NULL,
+                                     AliRunLoader* runloader=NULL) const;
+
+  /**
+   * Inherited from AliHLTModuleAgent
+   * Component libraries which the configurations of this agent depend on.
+   * @return list of component libraries as a blank-separated string.
+   */
+  const char* GetRequiredComponentLibraries() const;
+
   int GetHandlerDescription(AliHLTComponentDataType dt,
                            AliHLTUInt32_t spec,
                            AliHLTOUTHandlerDesc& desc) const;