#include "AliRawDataErrorLog.h"
+#include <Riostream.h>
+
ClassImp(AliRawDataErrorLog)
//_____________________________________________________________________________
fEventNumber(-1),
fDdlID(-1),
fErrorLevel(AliRawDataErrorLog::kMinor),
- fErrorCode(0)
+ fErrorCode(0),
+ fCount(0)
{
// Default constructor
}
fEventNumber(eventNumber),
fDdlID(ddlId),
fErrorLevel(errorLevel),
- fErrorCode(errorCode)
+ fErrorCode(errorCode),
+ fCount(1)
{
// Constructor that specifies
// the event number, ddl id, error type and
fEventNumber(source.fEventNumber),
fDdlID(source.fDdlID),
fErrorLevel(source.fErrorLevel),
- fErrorCode(source.fErrorCode)
+ fErrorCode(source.fErrorCode),
+ fCount(source.fCount)
{
// Copy constructor
}
fDdlID = source.GetDdlID();
fErrorLevel = source.GetErrorLevel();
fErrorCode = source.GetErrorCode();
+ fCount = source.GetCount();
}
return *this;
}
+void AliRawDataErrorLog::Copy(TObject &obj) const {
+
+ // this overwrites the virtual TOBject::Copy()
+ // to allow run time copying without casting
+ // in AliESDEvent
+
+ if(this==&obj)return;
+ AliRawDataErrorLog *robj = dynamic_cast<AliRawDataErrorLog*>(&obj);
+ if(!robj)return; // not an AliRawDataErrorLog
+ *robj = *this;
+
+}
+
//_____________________________________________________________________________
Int_t AliRawDataErrorLog::Compare(const TObject *obj) const
{
else
return ((fEventNumber > eventNumber) ? 1 : -1);
}
+
+//_____________________________________________________________________________
+const char*
+AliRawDataErrorLog::GetErrorLevelAsString() const
+{
+ switch ( GetErrorLevel() )
+ {
+ case kMinor:
+ return "MINOR";
+ break;
+ case kMajor:
+ return "MAJOR";
+ break;
+ case kFatal:
+ return "FATAL";
+ break;
+ default:
+ return "INVALID";
+ break;
+ }
+
+}
+
+//_____________________________________________________________________________
+void
+AliRawDataErrorLog::Print(Option_t*) const
+{
+ cout << Form("EventNumber %10d DdlID %5d ErrorLevel %10s ErrorCode %4d Occurence %5d",
+ GetEventNumber(),GetDdlID(),
+ GetErrorLevelAsString(),
+ GetErrorCode(),
+ GetCount()) << endl;
+ cout << " " << GetMessage() << endl;
+}