#include "AliMUONRegHeader.h"
#include "AliMUONLocalStruct.h"
#include "AliMUONDDLTrigger.h"
+#include "AliMUONLogger.h"
#include "AliLog.h"
fDDLTrigger(new AliMUONDDLTrigger()),
fRegHeader(new AliMUONRegHeader()),
fLocalStruct(new AliMUONLocalStruct()),
+ fLog(new AliMUONLogger(1000)),
fDarcEoWErrors(0),
fGlobalEoWErrors(0),
fRegEoWErrors(0),
- fLocalEoWErrors(0)
+ fLocalEoWErrors(0),
+ fWarnings(kTRUE)
{
///
/// create an object to read MUON raw digits
delete fDDLTrigger;
delete fLocalStruct;
delete fRegHeader;
+ delete fLog;
}
if (buffer[index++] != darcHeader->GetEndOfDarc()) {
- AliWarning(Form("Wrong end of Darc word %x instead of %x\n",
- buffer[index-1], darcHeader->GetEndOfDarc()));
+ const Char_t* msg = Form("Wrong end of Darc word %x instead of %x\n",
+ buffer[index-1], darcHeader->GetEndOfDarc());
+ if (fWarnings) AliWarning(msg);
+ AddErrorMessage(msg);
fDarcEoWErrors++;
}
// 4 words of global board input + Global board output
if (buffer[index++] != darcHeader->GetEndOfGlobal()) {
- AliWarning(Form("Wrong end of Global word %x instead of %x\n",
- buffer[index-1], darcHeader->GetEndOfGlobal()));
+ const Char_t* msg = Form("Wrong end of Global word %x instead of %x\n",
+ buffer[index-1], darcHeader->GetEndOfGlobal());
+ if (fWarnings) AliWarning(msg);
+ AddErrorMessage(msg);
fGlobalEoWErrors++;
}
// 8 regional boards
if (buffer[index++] != fRegHeader->GetEndOfReg()) {
- AliWarning(Form("Wrong end of Reg word %x instead of %x\n",
- buffer[index-1], fRegHeader->GetEndOfReg()));
+ const Char_t* msg = Form("Wrong end of Regional word %x instead of %x\n",
+ buffer[index-1], fRegHeader->GetEndOfReg());
+ if (fWarnings) AliWarning(msg);
+ AddErrorMessage(msg);
fRegEoWErrors++;
}
// 16 local cards per regional board
if (buffer[index++] != fLocalStruct->GetEndOfLocal()) {
- AliWarning(Form("Wrong end of local word %x instead of %x\n",
- buffer[index-1], fLocalStruct->GetEndOfLocal()));
+ const Char_t* msg = Form("Wrong end of Local word %x instead of %x\n",
+ buffer[index-1], fLocalStruct->GetEndOfLocal());
+
+ if (fWarnings) AliWarning(msg);
+ AddErrorMessage(msg);
fLocalEoWErrors++;
}
// fill only if card notified
if (loc > 16) loc = 16;
fMaxLoc = loc;
}
+
+//______________________________________________________
+void AliMUONPayloadTrigger::AddErrorMessage(const Char_t* msg)
+{
+/// adding message to logger
+
+ TString tmp(msg);
+
+ Int_t pos = tmp.First("\n");
+ tmp[pos] = 0;
+
+ fLog->Log(tmp.Data());
+}
+
class AliMUONDDLTrigger;
class AliMUONLocalStruct;
class AliMUONRegHeader;
+class AliMUONLogger;
+class AliMUONLogger;
class AliMUONPayloadTrigger: public TObject {
public :
/// Get number of end of local word errors
Int_t GetLocalEoWErrors() const {return fLocalEoWErrors;}
-
+ /// Get Error logger
+ AliMUONLogger* GetErrorLogger() const {return fLog;}
+
+ /// set warnings flag
+ void DisableWarnings() {fWarnings = kFALSE;}
+
private :
/// Not implemented
AliMUONPayloadTrigger(const AliMUONPayloadTrigger& stream);
/// Not implemented
AliMUONPayloadTrigger& operator = (const AliMUONPayloadTrigger& stream);
+ void AddErrorMessage(const Char_t* msg);
+
Int_t fMaxReg; ///< maximum number of regional cards in DATE file
Int_t fMaxLoc; ///< maximum number of local cards in DATE file
AliMUONRegHeader* fRegHeader; //!< pointer for regional structure
AliMUONLocalStruct* fLocalStruct; //!< pointer to local structure
+ AliMUONLogger* fLog; //!< Map of errors msg;
Int_t fDarcEoWErrors; //!< number of end of DARC word errors;
Int_t fGlobalEoWErrors; //!< number of end of global word errors;
Int_t fRegEoWErrors; //!< number of end of regional word errors;
Int_t fLocalEoWErrors; //!< number of end of local word errors;
-
+ Bool_t fWarnings; //!< flag to enable/disable warnings
ClassDef(AliMUONPayloadTrigger, 2) // base class for reading MUON trigger rawdata
};