]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliRawReaderDateOnline.cxx
Use the DATE monitor lib in addition to the normal offline trigger selection.
[u/mrichter/AliRoot.git] / RAW / AliRawReaderDateOnline.cxx
index 6a6c247e130fcea757ef43f73d1348d1722cf892..7cd49a37c88ce7cc1a19f438adba5cf80a43390d 100644 (file)
@@ -121,11 +121,13 @@ Bool_t AliRawReaderDateOnline::NextEvent()
     if (eventT==END_OF_RUN) {
       AliInfo("EOR event detected");
       Reset();
+      free(fEvent);
       fEvent = NULL;
       return kFALSE;
     }
     
     if (!IsEventSelected()) {
+      free(fEvent);
       continue;
     }
 
@@ -160,3 +162,28 @@ AliRawReaderDateOnline::~AliRawReaderDateOnline()
   if (fEvent) free(fEvent);
 #endif
 }
+
+void AliRawReaderDateOnline::SelectEvents(Int_t type,
+  ULong64_t triggerMask,
+  const char *triggerExpr)
+{
+  // Select event by using DATE monitoring
+  // library
+#ifdef ALI_DATE
+  const Char_t* table[]  = {"ALL", "no", "*", "*",
+                           "PHY", "all","*", "*",
+                           NULL, NULL, NULL, NULL};
+  TString trSelection;
+  for (Int_t i = 0; i < 50; i++) {
+    if (triggerMask & (1ull << i)) {
+       if (!trSelection.IsNull()) trSelection += "+";
+       trSelection += Form("%d",i+1);
+    }
+  }
+  table[7] = trSelection.Data();
+
+  monitorDeclareTableExtended(const_cast<char**>(table));
+  
+#endif
+  AliRawReader::SelectEvents(type,triggerMask,triggerExpr);
+}