From ca6cee23eb21fc7f7d891e53dbb7ae2d1406ba9b Mon Sep 17 00:00:00 2001 From: ivana Date: Sat, 27 Oct 2007 08:14:41 +0000 Subject: [PATCH] Improved error handling (Laurent) --- MUON/AliMUONPreprocessor.h | 3 +++ MUON/AliMUONTriggerIO.cxx | 2 +- MUON/AliMUONTriggerSubprocessor.cxx | 40 ++++++++++++++++++++++++----- 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/MUON/AliMUONPreprocessor.h b/MUON/AliMUONPreprocessor.h index f0bdfe0f539..dc51b1ac366 100644 --- a/MUON/AliMUONPreprocessor.h +++ b/MUON/AliMUONPreprocessor.h @@ -54,6 +54,9 @@ public: /// Whether we can be used (e.g. whether we were properly initialized) Bool_t IsValid() const { return fIsValid; } + /// Mark as invalid + void Invalidate() { fIsValid = kFALSE; } + protected: AliMUONPreprocessor(const char* detName, AliShuttleInterface* shuttle); virtual ~AliMUONPreprocessor(); diff --git a/MUON/AliMUONTriggerIO.cxx b/MUON/AliMUONTriggerIO.cxx index 94f369d2916..faca3d3d42b 100644 --- a/MUON/AliMUONTriggerIO.cxx +++ b/MUON/AliMUONTriggerIO.cxx @@ -318,7 +318,7 @@ AliMUONTriggerIO::ReadLUT(const char* lutFileToRead, AliMUONTriggerLut& lut) FILE* flut = fopen(gSystem->ExpandPathName(lutFileToRead),"rb"); if (!flut) { - AliError(Form("Could not create output LUT file %s",lutFileToRead)); + AliError(Form("Could not read LUT file %s",lutFileToRead)); return kFALSE; } diff --git a/MUON/AliMUONTriggerSubprocessor.cxx b/MUON/AliMUONTriggerSubprocessor.cxx index 6bc32de67cd..a0b74aed6ae 100644 --- a/MUON/AliMUONTriggerSubprocessor.cxx +++ b/MUON/AliMUONTriggerSubprocessor.cxx @@ -87,13 +87,42 @@ AliMUONTriggerSubprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTi { /// When starting a new run, reads in the trigger online files. + // First thing to do (after cleanup, that is), is to check whether the DA + // was alive or not. If it was, it should have put the "MtgCurrent.dat" file + // on the FXS. + // + + Bool_t da(kTRUE); + + TString current(gSystem->ExpandPathName(GetFileName("CURRENT").Data())); + + if ( current == "" ) + { + Master()->Log("CURRENT file not specified"); + da = kFALSE; + } + + if ( gSystem->AccessPathName(current.Data(),kFileExists) ) // mind the strange return value convention of that method ! + { + Master()->Log(Form("%s is not there !",current.Data())); + da = kFALSE; + } + + if (!da) + { + Master()->Log("FATAL ERROR : DA does not seem to have been run !!!"); + Master()->Invalidate(); + return; + } + + delete fRegionalMasks; fRegionalMasks = 0x0; + delete fLocalMasks; fLocalMasks = 0x0; + delete fGlobalMasks; fGlobalMasks = 0x0; + delete fLUT; fLUT = 0x0; + Master()->Log(Form("Reading trigger masks for Run %d startTime %ld endTime %ld", run,startTime,endTime)); - delete fRegionalMasks; - delete fLocalMasks; - delete fGlobalMasks; - fRegionalMasks = new AliMUON1DArray(16); fLocalMasks = new AliMUON1DArray(AliMpConstants::NofLocalBoards()+1); fGlobalMasks = 0x0; // new AliMUONCalibParamNI(1,16,1,0,0); @@ -116,13 +145,12 @@ AliMUONTriggerSubprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTi fGlobalMasks = 0x0; } - delete fLUT; fLUT = new AliMUONTriggerLut; Master()->Log(Form("Reading trigger LUT for Run %d startTime %ld endTime %ld", run,startTime,endTime)); - tio.ReadLUT(GetFileName("LUT").Data(),*fLUT); + ok = tio.ReadLUT(GetFileName("LUT").Data(),*fLUT); if (!ok) { -- 2.43.0