X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=RAW%2FAliRawReaderDateOnline.cxx;h=72662e39297bf152de5ea4762f5be625df941379;hb=950ce3fb4f267df5e56eab293650ab725ec65e14;hp=7cd49a37c88ce7cc1a19f438adba5cf80a43390d;hpb=20e6c4f44f51cbad386fffb7ed2c24ab257d0a69;p=u%2Fmrichter%2FAliRoot.git diff --git a/RAW/AliRawReaderDateOnline.cxx b/RAW/AliRawReaderDateOnline.cxx index 7cd49a37c88..72662e39297 100644 --- a/RAW/AliRawReaderDateOnline.cxx +++ b/RAW/AliRawReaderDateOnline.cxx @@ -27,6 +27,7 @@ /// /// Cvetan Cheshkov 1/04/2008 /////////////////////////////////////////////////////////////////////////////// +#include #include "AliRawReaderDateOnline.h" #include "AliLog.h" @@ -44,7 +45,8 @@ AliRawReaderDateOnline::AliRawReaderDateOnline( const char* /* filename */ #endif ) : - AliRawReaderDate((void*)NULL) + AliRawReaderDate((void*)NULL), + fStop(kFALSE) { // Constructor @@ -74,7 +76,15 @@ AliRawReaderDateOnline::AliRawReaderDateOnline( /* define wait event timeout - 1s max */ monitorSetNowait(); monitorSetNoWaitNetworkTimeout(1000); - + + const Char_t* table[] = {"ALL", "few", "*", "*", + "EOR", "yes","*", "*", + NULL, NULL, NULL, NULL}; + monitorDeclareTableExtended(const_cast(table)); + + // install SIGUSR1 handler to allow clean end-of-events loop + gSystem->AddSignalHandler(new AliRawReaderDateIntHandler(this)); + #else Fatal("AliRawReaderDateOnline", "this class was compiled without DATE"); #endif @@ -87,6 +97,14 @@ Bool_t AliRawReaderDateOnline::NextEvent() #ifdef ALI_DATE + // Stop on SIGUSR1 + if (fStop) { + AliInfo("Raw-data reading stopped by SIGUSR1"); + if (fEvent) free(fEvent); + fEvent = NULL; + return kFALSE; + } + // Event already loaded no need take a new one if (AliRawReaderDate::NextEvent()) return kTRUE; @@ -128,6 +146,7 @@ Bool_t AliRawReaderDateOnline::NextEvent() if (!IsEventSelected()) { free(fEvent); + fEvent = NULL; continue; } @@ -171,19 +190,29 @@ void AliRawReaderDateOnline::SelectEvents(Int_t type, // library #ifdef ALI_DATE const Char_t* table[] = {"ALL", "no", "*", "*", - "PHY", "all","*", "*", - NULL, NULL, NULL, NULL}; + "PHY", "yes","*", "*", + "EOR", "yes","*", "*", + 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); + if (!trSelection.IsNull()) trSelection += "&"; + trSelection += Form("%d",i); } } table[7] = trSelection.Data(); + monitorLogout(); monitorDeclareTableExtended(const_cast(table)); #endif AliRawReader::SelectEvents(type,triggerMask,triggerExpr); } + +//______________________________________________________________________________ +void AliRawReaderDateOnline::Stop() +{ + // Stop the event loop (called on SIGUSR1) + + fStop = kTRUE; +}