]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliRawDataErrorLog.cxx
Keep track of missing DCS points in DDL maps (flagged by 'x')
[u/mrichter/AliRoot.git] / STEER / AliRawDataErrorLog.cxx
index 8f06f05b52852a0e899473165cec2ad3f550a586..83b72cffe26195e9922e72b0e23ca6a4c2909380 100644 (file)
@@ -30,6 +30,8 @@
 
 #include "AliRawDataErrorLog.h"
 
+#include <Riostream.h>
+
 ClassImp(AliRawDataErrorLog)
 
 //_____________________________________________________________________________
@@ -37,19 +39,24 @@ AliRawDataErrorLog::AliRawDataErrorLog() :
   TNamed(),
   fEventNumber(-1),
   fDdlID(-1),
-  fErrorType(AliRawDataErrorLog::kNone)
+  fErrorLevel(AliRawDataErrorLog::kMinor),
+  fErrorCode(0),
+  fCount(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),
+  fCount(1)
 {
   // Constructor that specifies
   // the event number, ddl id, error type and
@@ -61,7 +68,9 @@ AliRawDataErrorLog::AliRawDataErrorLog(const AliRawDataErrorLog & source) :
   TNamed(source),
   fEventNumber(source.fEventNumber),
   fDdlID(source.fDdlID),
-  fErrorType(source.fErrorType)
+  fErrorLevel(source.fErrorLevel),
+  fErrorCode(source.fErrorCode),
+  fCount(source.fCount)
 {
   // Copy constructor
 }
@@ -75,11 +84,26 @@ AliRawDataErrorLog & AliRawDataErrorLog::operator=(const AliRawDataErrorLog &sou
 
     fEventNumber = source.GetEventNumber();
     fDdlID       = source.GetDdlID();
-    fErrorType   = source.GetErrorType();
+    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
 {
@@ -99,3 +123,37 @@ 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;
+}