]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fixing problems with AliHLTGlobalTriggerComponent and failing test: testGlobalTrigger...
authoraszostak <aszostak@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 18 Nov 2009 14:17:44 +0000 (14:17 +0000)
committeraszostak <aszostak@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 18 Nov 2009 14:17:44 +0000 (14:17 +0000)
HLT/trigger/AliHLTGlobalTriggerComponent.cxx
HLT/trigger/AliHLTGlobalTriggerComponent.h
HLT/trigger/AliHLTTrigger.h
HLT/trigger/test/testGlobalTriggerComponent.C
HLT/trigger/test/testMuonSpectroTrigger.C

index f78003fe678c390ef22b20e59f4afdff396b6e02..938c4422d9bf3b08d4201ce1bd7626e6c59ded39 100644 (file)
@@ -79,7 +79,8 @@ AliHLTGlobalTriggerComponent::AliHLTGlobalTriggerComponent() :
        fIncludePaths(TObjString::Class()),
        fIncludeFiles(TObjString::Class()),
        fLibStateAtLoad(),
-       fBits(0)
+       fBits(0),
+       fDataEventsOnly(true)
 {
   // Default constructor.
   
@@ -129,6 +130,7 @@ Int_t AliHLTGlobalTriggerComponent::DoInit(int argc, const char** argv)
   fIncludePaths.Clear();
   fIncludeFiles.Clear();
   SetBit(kIncludeInput);
+  fDataEventsOnly = true;
   
   for (int i = 0; i < argc; i++)
   {
@@ -260,7 +262,13 @@ Int_t AliHLTGlobalTriggerComponent::DoInit(int argc, const char** argv)
       }
       continue;
     }
-        
+
+    if (strcmp(argv[i], "-process-all-events") == 0)
+    {
+      fDataEventsOnly = false;
+      continue;
+    }
+    
     HLTError("Unknown option '%s'.", argv[i]);
     return -EINVAL;
   } // for loop
@@ -372,7 +380,11 @@ int AliHLTGlobalTriggerComponent::DoTrigger()
   AliHLTUInt32_t eventType=0;
   if (!IsDataEvent(&eventType)) {
     if (eventType==gkAliEventTypeEndOfRun) PrintStatistics(fTrigger, kHLTLogImportant, 0);
-    return 0;
+    if (fDataEventsOnly)
+    {
+      IgnoreEvent();
+      return 0;
+    }
   }
 
   // Copy the trigger counters in case we need to set them back to their original
index 33421d47fbdc6b1fdec5f2b250d9097db68634a9..c8d8cfb832b117fea36ab34048d96608a79e7456 100644 (file)
@@ -67,6 +67,9 @@ class AliHLTGlobalTrigger;
  *      Steer adding of input objects to the global HLT trigger decision.
  *      Options: none - include nothing, short - include a short TNames array,
  *               objects - include objects, by default on
+ * \li -process-all-events <br>
+ *      Indicates that all events should be processed with the global trigger logic and
+ *      not just the data events. The default is not to process just the data events.
  *
  * <h2>Configuration:</h2>
  * Configured from CDB but can be overridden with the -config argument.
@@ -292,6 +295,7 @@ class AliHLTGlobalTriggerComponent : public AliHLTTrigger
   TClonesArray fIncludeFiles; //! Files specified by the -include command line option.
   TString fLibStateAtLoad; //! This stores the loaded libraries just before we tell CINT to load the interpreted file.
   AliHLTUInt32_t fBits; //! Status bits
+  bool fDataEventsOnly; //! Flag indicating if only data events are processed with trigger logic.
 
   static const char* fgkTriggerMenuCDBPath; //! The path string to read the trigger menu from the CDB.
   
index 75648ba47486b7a65c65033d873fe20a60542217..33414780fbb4672db706057319b19e7acff86151 100644 (file)
@@ -167,6 +167,12 @@ class AliHLTTrigger : public AliHLTProcessor
       AliHLTUInt32_t spec = kAliHLTVoidDataSpec
     );
   
+  /**
+   * This method allows one to completely ignore an event. The DoEvent method will
+   * not even generate a false trigger decision if this method is called.
+   */
+  void IgnoreEvent(bool value = true) { fDecisionMade = value; }
+  
   /**
    * Method for finding out the result of the last call to TriggerEvent.
    * \returns the error code for the last call to TriggerEvent.
index b4bc00185a2fcb5f8ffb502b72cdc41ffd5f27ea..47809a52838eb325ad4925f2ff4594d6584b2986 100644 (file)
@@ -68,6 +68,7 @@ void GenerateInputData()
        {
                gSystem->Load("libAliHLTUtil.so");
                gSystem->Load("libAliHLTTRD.so");
+               gSystem->Load("libAliHLTMUON.so");
                gSystem->Load("libAliHLTTrigger.so");
                loadedLibs = true;
        }
@@ -145,6 +146,7 @@ void GenerateInputData()
        if (loadedLibs)
        {
                gSystem->Unload("libAliHLTTrigger.so");
+               gSystem->Unload("libAliHLTMUON.so");
                gSystem->Unload("libAliHLTTRD.so");
                gSystem->Unload("libAliHLTUtil.so");
        }
@@ -165,14 +167,16 @@ void GenerateInputData()
  */
 void RunTrigger(int config = 0, bool usecint = false, bool debug = false, int numOfEvents = 8, const char* customClass = NULL)
 {
-       AliHLTSystem gHLTSystem;
-       gHLTSystem.LoadComponentLibraries("libAliHLTUtil.so");
-       gHLTSystem.LoadComponentLibraries("libAliHLTTRD.so");
-       gHLTSystem.LoadComponentLibraries("libAliHLTTrigger.so");
+       AliHLTSystem sys;
+       sys.ScanOptions("ECS=CTP_TRIGGER_CLASS=00:TRIGGER-ALL:00-01-02-03-04-05-06-07-08-09-10-11-12-13-14-15-16-17");
+       sys.LoadComponentLibraries("libAliHLTUtil.so");
+       sys.LoadComponentLibraries("libAliHLTTRD.so");
+       sys.LoadComponentLibraries("libAliHLTMUON.so");
+       sys.LoadComponentLibraries("libAliHLTTrigger.so");
        if (debug)
        {
                AliLog::SetGlobalLogLevel(AliLog::kMaxType);
-               gHLTSystem.SetGlobalLoggingLevel(kHLTLogAll);
+               sys.SetGlobalLoggingLevel(kHLTLogAll);
        }
        
        TString cmdline = "-datatype ROOTTOBJ 'HLT ' ";
@@ -183,7 +187,8 @@ void RunTrigger(int config = 0, bool usecint = false, bool debug = false, int nu
        }
        AliHLTConfiguration pub("pub", "ROOTFilePublisher", NULL, cmdline.Data());
        
-       cmdline = Form("-config TriggerConfig.C(%d) -includepath $ALICE_ROOT/include -includepath $ALICE_ROOT/HLT/BASE"
+       cmdline = Form("-config $ALICE_ROOT/HLT/trigger/test/TriggerConfig.C(%d)"
+               " -includepath $ALICE_ROOT/include -includepath $ALICE_ROOT/HLT/BASE"
                " -includepath $ALICE_ROOT/HLT/trigger -include AliHLTEventSummary.h",
                config
                );
@@ -194,8 +199,12 @@ void RunTrigger(int config = 0, bool usecint = false, bool debug = false, int nu
        
        AliHLTConfiguration sink("sink", "ROOTFileWriter", "proc", "-datafile testOutputFile.root -concatenate-events");
        
-       gHLTSystem.BuildTaskList("sink");
-       gHLTSystem.Run(numOfEvents);
+       sys.BuildTaskList("sink");
+       sys.Run(
+               numOfEvents,
+               1,  // Stop chain at end of run.
+               0x1 // Active CTP trigger mask.
+       );
 }
 
 /**
@@ -217,10 +226,11 @@ void CallRunTrigger(
                        "aliroot %s <<EOF\n"
                        "gSystem->Load(\"libAliHLTUtil.so\");\n"
                        "gSystem->Load(\"libAliHLTTRD.so\");\n"
+                       "gSystem->Load(\"libAliHLTMUON.so\");\n"
                        "gSystem->Load(\"libAliHLTTrigger.so\");\n"
                        "gSystem->SetIncludePath(\"-I${ALICE_ROOT}/include"
                        " -I${ALICE_ROOT}/HLT/BASE -I${ALICE_ROOT}/HLT/trigger\");\n"
-                       ".L testGlobalTriggerComponent.C+\n"
+                       ".L $ALICE_ROOT/HLT/trigger/test/testGlobalTriggerComponent.C+\n"
                        "RunTrigger(%d,%d,%d,%d,%s);\n"
                        "EOF\n",
                        redirection,
@@ -274,7 +284,7 @@ bool Check(
                     << "): The domain does not match the expected value for event "
                     << eventNum << ". Got:" << endl;
                decision->TriggerDomain().Print();
-               cout << "but expected:" << endl;
+               cerr << "but expected:" << endl;
                expectedDomain.Print();
                return false;
        }
@@ -723,14 +733,8 @@ bool testGlobalTriggerComponent(int configVersion = -1, const char* customClass
 
 int main(int /*argc*/, const char** /*argv*/)
 {
-       const char* cpCmd1 = "if test ! -f TriggerConfig.C ; then cp $ALICE_ROOT/HLT/trigger/test/TriggerConfig.C ./; exit 1; fi";
-       const char* cpCmd2 = "if test ! -f testGlobalTriggerComponent.C ; then cp $ALICE_ROOT/HLT/trigger/test/testGlobalTriggerComponent.C ./; exit 1; fi";
-       bool copiedFile1 = gSystem->Exec(cpCmd1) != 0;
-       bool copiedFile2 = gSystem->Exec(cpCmd2) != 0;
        bool resultOk = testGlobalTriggerComponent();
        if (not resultOk) return 1;
-       if (copiedFile1) gSystem->Exec("rm TriggerConfig.C");
-       if (copiedFile2) gSystem->Exec("rm testGlobalTriggerComponent.C");
        return 0;
 }
 
index 808f5af7b23ee446d77e762ec77a64a1e9fbb8d6..151f27baab7ea45c46988660a705b86c7f0247ad 100644 (file)
@@ -403,7 +403,7 @@ bool testMuonSpectroTrigger(bool debug = false)
        if (! CheckResults()) return false;
        
        // Cleanup all temporary files generated.
-       gSystem->Exec("rm -f testMuonTriggerOutputFile.root test*DecisionInputFile*.root");
+       gSystem->Exec("rm -f testMuonTriggerOutputFile.root test*DecisionInputFile*.dat");
        return true;
 }