From 9fc249d9d98fdc3f8110a9c05176f152411e72b6 Mon Sep 17 00:00:00 2001 From: cvetan Date: Mon, 5 Feb 2007 14:14:33 +0000 Subject: [PATCH] Code error is added to the raw data error log class --- RAW/AliRawReader.cxx | 6 ++++-- RAW/AliRawReader.h | 15 ++++++++++++++- STEER/AliRawDataErrorLog.cxx | 15 ++++++++++----- STEER/AliRawDataErrorLog.h | 24 +++++++++++++----------- 4 files changed, 41 insertions(+), 19 deletions(-) diff --git a/RAW/AliRawReader.cxx b/RAW/AliRawReader.cxx index 8294b3a1fb6..9fc30ef6d2e 100644 --- a/RAW/AliRawReader.cxx +++ b/RAW/AliRawReader.cxx @@ -457,7 +457,8 @@ void AliRawReader::DumpData(Int_t limit) } while (ReadHeader()); } -void AliRawReader::AddErrorLog(AliRawDataErrorLog::ERawDataErrorType type, +void AliRawReader::AddErrorLog(AliRawDataErrorLog::ERawDataErrorLevel level, + Int_t code, const char *message) { // Add a raw data error message to the list @@ -475,6 +476,7 @@ void AliRawReader::AddErrorLog(AliRawDataErrorLog::ERawDataErrorType type, new (fErrorLogs[fErrorLogs.GetEntriesFast()]) AliRawDataErrorLog(fEventNumber, ddlId, - type, + level, + code, message); } diff --git a/RAW/AliRawReader.h b/RAW/AliRawReader.h index 6072b7f2694..b70645257da 100644 --- a/RAW/AliRawReader.h +++ b/RAW/AliRawReader.h @@ -109,8 +109,21 @@ class AliRawReader: public TObject { void DumpData(Int_t limit = -1); - void AddErrorLog(AliRawDataErrorLog::ERawDataErrorType type, + void AddErrorLog(AliRawDataErrorLog::ERawDataErrorLevel level, + Int_t code, const char *message = NULL); + void AddMinorErrorLog(Int_t code, + const char *message = NULL) { + return AddErrorLog(AliRawDataErrorLog::kMinor,code,message); + } + void AddMajorErrorLog(Int_t code, + const char *message = NULL) { + return AddErrorLog(AliRawDataErrorLog::kMajor,code,message); + } + void AddFatalErrorLog(Int_t code, + const char *message = NULL) { + return AddErrorLog(AliRawDataErrorLog::kFatal,code,message); + } Int_t GetNumberOfErrorLogs() const { return fErrorLogs.GetEntriesFast(); } AliRawDataErrorLog *GetErrorLog(Int_t i) const { return (AliRawDataErrorLog *)fErrorLogs.UncheckedAt(i); diff --git a/STEER/AliRawDataErrorLog.cxx b/STEER/AliRawDataErrorLog.cxx index 8f06f05b528..3fedca3eedd 100644 --- a/STEER/AliRawDataErrorLog.cxx +++ b/STEER/AliRawDataErrorLog.cxx @@ -37,19 +37,22 @@ AliRawDataErrorLog::AliRawDataErrorLog() : TNamed(), fEventNumber(-1), fDdlID(-1), - fErrorType(AliRawDataErrorLog::kNone) + fErrorLevel(AliRawDataErrorLog::kMinor), + fErrorCode(0) { // Default constructor } //_____________________________________________________________________________ AliRawDataErrorLog::AliRawDataErrorLog(Int_t eventNumber, Int_t ddlId, - ERawDataErrorType errorType, + ERawDataErrorLevel errorLevel, + Int_t errorCode, const char *message) : TNamed(message,""), fEventNumber(eventNumber), fDdlID(ddlId), - fErrorType(errorType) + fErrorLevel(errorLevel), + fErrorCode(errorCode) { // Constructor that specifies // the event number, ddl id, error type and @@ -61,7 +64,8 @@ AliRawDataErrorLog::AliRawDataErrorLog(const AliRawDataErrorLog & source) : TNamed(source), fEventNumber(source.fEventNumber), fDdlID(source.fDdlID), - fErrorType(source.fErrorType) + fErrorLevel(source.fErrorLevel), + fErrorCode(source.fErrorCode) { // Copy constructor } @@ -75,7 +79,8 @@ AliRawDataErrorLog & AliRawDataErrorLog::operator=(const AliRawDataErrorLog &sou fEventNumber = source.GetEventNumber(); fDdlID = source.GetDdlID(); - fErrorType = source.GetErrorType(); + fErrorLevel = source.GetErrorLevel(); + fErrorCode = source.GetErrorCode(); } return *this; } diff --git a/STEER/AliRawDataErrorLog.h b/STEER/AliRawDataErrorLog.h index c9b425f80e2..330c3a28d8e 100644 --- a/STEER/AliRawDataErrorLog.h +++ b/STEER/AliRawDataErrorLog.h @@ -24,8 +24,7 @@ class AliRawDataErrorLog: public TNamed { public: - enum ERawDataErrorType { - kNone = 0, + enum ERawDataErrorLevel { kMinor = 1, kMajor = 2, kFatal = 3 @@ -33,27 +32,30 @@ class AliRawDataErrorLog: public TNamed { AliRawDataErrorLog(); AliRawDataErrorLog(Int_t eventNumber, Int_t ddlId, - ERawDataErrorType errorType, + ERawDataErrorLevel errorLevel, + Int_t errorCode, const char *message = NULL); AliRawDataErrorLog(const AliRawDataErrorLog & source); AliRawDataErrorLog & operator=(const AliRawDataErrorLog & source); virtual ~AliRawDataErrorLog() {}; - Int_t GetEventNumber() const { return fEventNumber; } - Int_t GetDdlID() const { return fDdlID; } - ERawDataErrorType GetErrorType() const { return fErrorType; } - const char * GetMessage() const { return fName.Data(); } + Int_t GetEventNumber() const { return fEventNumber; } + Int_t GetDdlID() const { return fDdlID; } + ERawDataErrorLevel GetErrorLevel() const { return fErrorLevel; } + Int_t GetErrorCode() const { return fErrorCode; } + const char * GetMessage() const { return fName.Data(); } Bool_t IsSortable() const {return kTRUE;} Int_t Compare(const TObject* obj) const; private: - Int_t fEventNumber; // Event number as it appears in the input raw-data file - Int_t fDdlID; // ID of the DLL in which the error occured - ERawDataErrorType fErrorType; // Type of the raw data error + Int_t fEventNumber; // Event number as it appears in the input raw-data file + Int_t fDdlID; // ID of the DLL in which the error occured + ERawDataErrorLevel fErrorLevel; // Level of the raw data error + Int_t fErrorCode; // Code of the raw data error (detector-specific) - ClassDef(AliRawDataErrorLog, 1) + ClassDef(AliRawDataErrorLog, 2) }; #endif -- 2.43.0