]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/trigger/AliHLTTriggerAgent.cxx
Fixing problems with AliHLTGlobalTriggerComponent and failing test: testGlobalTrigger...
[u/mrichter/AliRoot.git] / HLT / trigger / AliHLTTriggerAgent.cxx
index c9f9102969a5e6a62d3b45067264ebda6b322ead..f26efc1e59322186d4a65bd21a9460e9475b95a2 100644 (file)
 #include "AliHLTEventSummaryProducerComponent.h"
 #include "AliHLTRunSummaryProducerComponent.h"
 #include "AliHLTTriggerBarrelMultiplicity.h"
+#include "AliHLTD0Trigger.h"
+#include "AliHLTTriggerITSMultiplicity.h"
+#include "AliHLTTriggerBarrelGeomMultiplicity.h"
 #include "AliHLTTriggerBarrelCosmic.h"
 #include "AliHLTGlobalTriggerComponent.h"
+#include "AliHLTTriggerPhosClusterEnergy.h"
+#include "AliHLTTriggerPhosMip.h"
+#include "AliHLTTriggerTrdClusterMultiplicity.h"
+#include "AliHLTTriggerGammaConversion.h"
+#include "AliHLTMuonSpectroTriggerComponent.h"
 
 /** global instance for agent registration */
 AliHLTTriggerAgent gAliHLTTriggerAgent;
@@ -68,7 +76,15 @@ int AliHLTTriggerAgent::RegisterComponents(AliHLTComponentHandler* pHandler) con
   if (!pHandler) return -EINVAL;
   pHandler->AddComponent(new AliHLTGlobalTriggerComponent);
   pHandler->AddComponent(new AliHLTTriggerBarrelMultiplicity);
+  pHandler->AddComponent(new AliHLTTriggerITSMultiplicity);
+  pHandler->AddComponent(new AliHLTD0Trigger);
+  pHandler->AddComponent(new AliHLTTriggerBarrelGeomMultiplicity);
   pHandler->AddComponent(new AliHLTTriggerBarrelCosmic);
+  pHandler->AddComponent(new AliHLTTriggerPhosClusterEnergy); 
+  pHandler->AddComponent(new AliHLTTriggerPhosMip); 
+  pHandler->AddComponent(new AliHLTTriggerTrdClusterMultiplicity);
+  pHandler->AddComponent(new AliHLTTriggerGammaConversion);
+  pHandler->AddComponent(new AliHLTMuonSpectroTriggerComponent);
   return 0;
 }
 
@@ -112,6 +128,30 @@ int AliHLTTriggerAgent::CreateConfigurations(AliHLTConfigurationHandler* pHandle
   } else {
     HLTWarning("No inputs for %s found, skipping component", configurationId.Data());
   }
+  
+  /////////////////////////////////////////////////////////////////////////////////////
+  // The muon spectrometer trigger
+  configurationId = "TRIGGER-Muon-Spectrometer";
+
+  // define the inputsfor the muon spectrometer trigger.
+  if (pHandler->FindConfiguration("dHLT-sim-fromRaw")) {
+    triggerInputs = "dHLT-sim-fromRaw";
+  }
+  else if (pHandler->FindConfiguration("dHLT-sim")) {
+    triggerInputs = "dHLT-sim";
+  }
+  else if (pHandler->FindConfiguration("dHLT-sim-fromMC")) {
+    triggerInputs = "dHLT-sim-fromMC";
+  }
+
+  if (triggerInputs.Length() > 0) {
+    HLTInfo("Configuring inputs for %s: %s", configurationId.Data(), triggerInputs.Data());
+    pHandler->CreateConfiguration(configurationId.Data(), "MuonSpectroTrigger", triggerInputs.Data(), "-makestats");
+    if (triggerOutputs.Length() > 0) triggerOutputs += " ";
+    triggerOutputs += configurationId;
+  } else {
+    HLTWarning("No inputs for %s found, skipping component.", configurationId.Data());
+  }
 
   /////////////////////////////////////////////////////////////////////////////////////
   //
@@ -142,7 +182,7 @@ const char* AliHLTTriggerAgent::GetRequiredComponentLibraries() const
 {
   // see header file for class documentation
 
-  return "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so libAliHLTITS.so libAliHLTGlobal.so";
+  return "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so libAliHLTITS.so libAliHLTGlobal.so libAliHLTMUON.so";
 }
 
 int AliHLTTriggerAgent::GetHandlerDescription(AliHLTComponentDataType dt,
@@ -238,9 +278,10 @@ int AliHLTTriggerAgent::AliHLTTriggerDecisionHandler::ProcessData(AliHLTOUT* pDa
   if (iResult>=0) {
     TObject* pObject=pData->GetDataObject();
     if (pObject) {
-      AliHLTTriggerDecision* pDecission=dynamic_cast<AliHLTTriggerDecision*>(pObject);
-      if (pDecission) {
+      AliHLTTriggerDecision* pDecision=dynamic_cast<AliHLTTriggerDecision*>(pObject);
+      if (pDecision) {
        //pDecision->Print();
+       HLTDebug("extracted %s", pDecision->GetName());
        if (!fESD) {
          // create the ESD container, but without std content
          fESD = new AliESDEvent;
@@ -248,7 +289,14 @@ int AliHLTTriggerAgent::AliHLTTriggerDecisionHandler::ProcessData(AliHLTOUT* pDa
        if (!fpData) fpData=new TArrayC;
        if (fESD && fpData) {
          fESD->Reset();
-         fESD->AddObject(pObject->Clone());
+         TObject* pESDObject=fESD->FindListObject("HLTGlobalTrigger");
+         if (pESDObject) {
+           // copy the content to the already existing object
+           pObject->Copy(*pESDObject);
+         } else {
+           // add a new object
+           fESD->AddObject(pObject->Clone());
+         }
          AliHLTMessage* pMsg=AliHLTMessage::Stream(fESD);
          if (pMsg) {
            if (!pMsg->CompBuffer()) {