]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Combine same consequtive raw-data reading errors into one error
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 16 Apr 2007 14:33:41 +0000 (14:33 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 16 Apr 2007 14:33:41 +0000 (14:33 +0000)
RAW/AliRawReader.cxx
RAW/AliRawReader.h
STEER/AliRawDataErrorLog.cxx
STEER/AliRawDataErrorLog.h

index 9fc30ef6d2eaff804ff5697ba634b5747284287f..c244221bf9036c48476bb57aed13f361a0b05907 100644 (file)
@@ -143,6 +143,7 @@ AliRawReader::~AliRawReader()
   // initialized
   if (fEquipmentIdsIn) delete fEquipmentIdsIn;
   if (fEquipmentIdsOut) delete fEquipmentIdsOut;
+  fErrorLogs.Delete();
 }
 
 Int_t AliRawReader::GetMappedEquipmentId() const
@@ -473,10 +474,27 @@ void AliRawReader::AddErrorLog(AliRawDataErrorLog::ERawDataErrorLevel level,
     return;
   }
 
-  new (fErrorLogs[fErrorLogs.GetEntriesFast()])
-    AliRawDataErrorLog(fEventNumber,
-                      ddlId,
-                      level,
-                      code,
-                      message);
+  Int_t prevEventNumber = -1;
+  Int_t prevDdlId = -1;
+  Int_t prevErrorCode = -1;
+  AliRawDataErrorLog *prevLog = (AliRawDataErrorLog *)fErrorLogs.Last();
+  if (prevLog) {
+    prevEventNumber = prevLog->GetEventNumber();
+    prevDdlId       = prevLog->GetDdlID();
+    prevErrorCode   = prevLog->GetErrorCode();
+  }
+
+  if ((prevEventNumber != fEventNumber) ||
+      (prevDdlId != ddlId) ||
+      (prevErrorCode != code)) {
+    new (fErrorLogs[fErrorLogs.GetEntriesFast()])
+      AliRawDataErrorLog(fEventNumber,
+                        ddlId,
+                        level,
+                        code,
+                        message);
+  }
+  else
+    if (prevLog) prevLog->AddCount();
+
 }
index b70645257daacb1748ea2f2ae2800b70ea8e8e9c..d3e41d74a26a70d0443cd26f628d4bcf4c4a8d36 100644 (file)
@@ -125,6 +125,7 @@ class AliRawReader: public TObject {
       return AddErrorLog(AliRawDataErrorLog::kFatal,code,message);
     }
     Int_t            GetNumberOfErrorLogs() const { return fErrorLogs.GetEntriesFast(); }
+    const TClonesArray &GetAllErrorLogs() const { return fErrorLogs; }
     AliRawDataErrorLog *GetErrorLog(Int_t i) const {
       return (AliRawDataErrorLog *)fErrorLogs.UncheckedAt(i);
     }
index 3fedca3eeddb24d75527a09937d07f7bbb5a815b..95a40ae9ae32affdccf4e82c373d642f8d13fcc9 100644 (file)
@@ -38,7 +38,8 @@ AliRawDataErrorLog::AliRawDataErrorLog() :
   fEventNumber(-1),
   fDdlID(-1),
   fErrorLevel(AliRawDataErrorLog::kMinor),
-  fErrorCode(0)
+  fErrorCode(0),
+  fCount(0)
 {
   // Default constructor
 }
@@ -52,7 +53,8 @@ AliRawDataErrorLog::AliRawDataErrorLog(Int_t eventNumber, Int_t ddlId,
   fEventNumber(eventNumber),
   fDdlID(ddlId),
   fErrorLevel(errorLevel),
-  fErrorCode(errorCode)
+  fErrorCode(errorCode),
+  fCount(1)
 {
   // Constructor that specifies
   // the event number, ddl id, error type and
@@ -65,7 +67,8 @@ AliRawDataErrorLog::AliRawDataErrorLog(const AliRawDataErrorLog & source) :
   fEventNumber(source.fEventNumber),
   fDdlID(source.fDdlID),
   fErrorLevel(source.fErrorLevel),
-  fErrorCode(source.fErrorCode)
+  fErrorCode(source.fErrorCode),
+  fCount(source.fCount)
 {
   // Copy constructor
 }
@@ -81,6 +84,7 @@ AliRawDataErrorLog & AliRawDataErrorLog::operator=(const AliRawDataErrorLog &sou
     fDdlID       = source.GetDdlID();
     fErrorLevel  = source.GetErrorLevel();
     fErrorCode   = source.GetErrorCode();
+    fCount       = source.GetCount();
   }
   return *this;
 }
index 330c3a28d8e04f95959602dfc2f632cbb875d3a0..495973362a9675add73a3c2f827734c58caa8168 100644 (file)
@@ -44,18 +44,22 @@ class AliRawDataErrorLog: public TNamed {
   ERawDataErrorLevel GetErrorLevel()  const { return fErrorLevel; }
   Int_t              GetErrorCode()   const { return fErrorCode; }
   const char *       GetMessage()     const { return fName.Data(); }
+  Int_t              GetCount()       const { return fCount; }
 
   Bool_t            IsSortable() const {return kTRUE;}
   Int_t             Compare(const TObject* obj) const;
 
+  void               AddCount() { fCount++; }
+
  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
   ERawDataErrorLevel fErrorLevel;  // Level of the raw data error
   Int_t              fErrorCode;   // Code of the raw data error (detector-specific)
+  Int_t              fCount;       // Counter of identical errors (occurances)
 
-  ClassDef(AliRawDataErrorLog, 2)
+  ClassDef(AliRawDataErrorLog, 3)
 };
 
 #endif