1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 /////////////////////////////////////////////////////////////////////
17 // Implementation of AliRawDataErrorLog class //
19 // class AliRawDataErrorLog //
20 // This is a class for logging raw-data related errors. //
21 // It is used to record and retrieve of the errors //
22 // during the reading and reconstruction of raw-data and ESD //
24 // Further description of the methods and functionality are given //
27 // cvetan.cheshkov@cern.ch //
29 /////////////////////////////////////////////////////////////////////
31 #include "AliRawDataErrorLog.h"
33 #include <Riostream.h>
35 ClassImp(AliRawDataErrorLog)
37 //_____________________________________________________________________________
38 AliRawDataErrorLog::AliRawDataErrorLog() :
42 fErrorLevel(AliRawDataErrorLog::kMinor),
46 // Default constructor
49 //_____________________________________________________________________________
50 AliRawDataErrorLog::AliRawDataErrorLog(Int_t eventNumber, Int_t ddlId,
51 ERawDataErrorLevel errorLevel,
53 const char *message) :
55 fEventNumber(eventNumber),
57 fErrorLevel(errorLevel),
58 fErrorCode(errorCode),
61 // Constructor that specifies
62 // the event number, ddl id, error type and
63 // custom message related to the error
66 //___________________________________________________________________________
67 AliRawDataErrorLog::AliRawDataErrorLog(const AliRawDataErrorLog & source) :
69 fEventNumber(source.fEventNumber),
70 fDdlID(source.fDdlID),
71 fErrorLevel(source.fErrorLevel),
72 fErrorCode(source.fErrorCode),
78 //___________________________________________________________________________
79 AliRawDataErrorLog & AliRawDataErrorLog::operator=(const AliRawDataErrorLog &source)
81 // assignment operator
82 if (this != &source) {
83 TNamed::operator=(source);
85 fEventNumber = source.GetEventNumber();
86 fDdlID = source.GetDdlID();
87 fErrorLevel = source.GetErrorLevel();
88 fErrorCode = source.GetErrorCode();
89 fCount = source.GetCount();
94 //_____________________________________________________________________________
95 Int_t AliRawDataErrorLog::Compare(const TObject *obj) const
97 // Compare the event numbers and DDL IDs
98 // of two error log objects.
99 // Used in the sorting of raw data error logs
100 // during the raw data reading and reconstruction
101 Int_t eventNumber = ((AliRawDataErrorLog*)obj)->GetEventNumber();
102 Int_t ddlID = ((AliRawDataErrorLog*)obj)->GetDdlID();
104 if (fEventNumber == eventNumber) {
108 return ((fDdlID > ddlID) ? 1 : -1);
111 return ((fEventNumber > eventNumber) ? 1 : -1);
114 //_____________________________________________________________________________
116 AliRawDataErrorLog::GetErrorLevelAsString() const
118 switch ( GetErrorLevel() )
136 //_____________________________________________________________________________
138 AliRawDataErrorLog::Print(Option_t*) const
140 cout << Form("EventNumber %10d DdlID %5d ErrorLevel %10s ErrorCode %4d Occurence %5d",
141 GetEventNumber(),GetDdlID(),
142 GetErrorLevelAsString(),
145 cout << " " << GetMessage() << endl;