]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliRawReaderDateOnline.cxx
TRD nSigma OADB related new codes and modifications and OADB root file -- Xianguo Lu
[u/mrichter/AliRoot.git] / RAW / AliRawReaderDateOnline.cxx
index 40b8319307c17fee050066b87bb399dab1530dc5..c0eaf534f0eef59a0a6a76aad668765d460af1c4 100644 (file)
@@ -28,7 +28,7 @@
 /// Cvetan Cheshkov 1/04/2008
 ///////////////////////////////////////////////////////////////////////////////
 #include <TSystem.h>
-
+#include <cstdlib>
 #include "AliRawReaderDateOnline.h"
 #include "AliLog.h"
 #ifdef ALI_DATE
 
 ClassImp(AliRawReaderDateOnline)
 
+Bool_t AliRawReaderDateOnline::fgNoSleep = kTRUE;
+
 AliRawReaderDateOnline::AliRawReaderDateOnline(
 #ifdef ALI_DATE
-                                  const char* filename
+                                    const char* filename
 #else
-                                  const char* /* filename */
+                                    const char* /* filename */
 #endif
-                                  ) :
+                                  , const Char_t** customTable) :
   AliRawReaderDate((void*)NULL),
+  fTable(customTable),
   fStop(kFALSE)
 {
 
@@ -77,11 +80,21 @@ AliRawReaderDateOnline::AliRawReaderDateOnline(
   monitorSetNowait();
   monitorSetNoWaitNetworkTimeout(1000);
 
-  const Char_t* table[]  = {"ALL", "few", "*", "*",
-                            "EOR", "yes","*", "*",
-                            NULL, NULL, NULL, NULL};
-  monitorDeclareTableExtended(const_cast<char**>(table));
-
+  if (!fTable) {
+    const Char_t* table[]  = {"ALL", "few", "*", "*",
+                             "EOR", "yes","*", "*",
+                             NULL, NULL, NULL, NULL};
+    monitorDeclareTableExtended(const_cast<char**>(table));
+  }
+  else {
+    AliInfo("Custom monitoring table:");
+    Int_t index = 0;
+    while (fTable[index] != NULL) {
+      AliInfo(Form("%s %s %s %s",fTable[index],fTable[index+1],fTable[index+2],fTable[index+3]));
+      index += 4;
+    }
+    monitorDeclareTableExtended(const_cast<char**>(fTable));
+  }
   // install SIGUSR1 handler to allow clean end-of-events loop
   gSystem->AddSignalHandler(new AliRawReaderDateIntHandler(this));
 
@@ -131,6 +144,7 @@ Bool_t AliRawReaderDateOnline::NextEvent()
     
     /* retry if got no event */
     if (fEvent==NULL) {
+      if (fgNoSleep) gSystem->ProcessEvents();
       continue;
     }
     
@@ -147,6 +161,7 @@ Bool_t AliRawReaderDateOnline::NextEvent()
     if (!IsEventSelected()) {
       free(fEvent);
       fEvent = NULL;
+      if (fgNoSleep) gSystem->ProcessEvents();
       continue;
     }
 
@@ -197,7 +212,7 @@ void AliRawReaderDateOnline::SelectEvents(Int_t type,
   for (Int_t i = 0; i < 50; i++) {
     if (triggerMask & (1ull << i)) {
        if (!trSelection.IsNull()) trSelection += "&";
-       trSelection += Form("%d",i+1);
+       trSelection += Form("%d",i);
     }
   }
   table[7] = trSelection.Data();