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>
37 ClassImp(AliRawDataErrorLog)
39 //_____________________________________________________________________________
40 AliRawDataErrorLog::AliRawDataErrorLog() :
44 fErrorLevel(AliRawDataErrorLog::kMinor),
48 // Default constructor
51 //_____________________________________________________________________________
52 AliRawDataErrorLog::AliRawDataErrorLog(Int_t eventNumber, Int_t ddlId,
53 ERawDataErrorLevel errorLevel,
55 const char *message) :
57 fEventNumber(eventNumber),
59 fErrorLevel(errorLevel),
60 fErrorCode(errorCode),
63 // Constructor that specifies
64 // the event number, ddl id, error type and
65 // custom message related to the error
68 //___________________________________________________________________________
69 AliRawDataErrorLog::AliRawDataErrorLog(const AliRawDataErrorLog & source) :
71 fEventNumber(source.fEventNumber),
72 fDdlID(source.fDdlID),
73 fErrorLevel(source.fErrorLevel),
74 fErrorCode(source.fErrorCode),
80 //___________________________________________________________________________
81 AliRawDataErrorLog & AliRawDataErrorLog::operator=(const AliRawDataErrorLog &source)
83 // assignment operator
84 if (this != &source) {
85 TNamed::operator=(source);
87 fEventNumber = source.GetEventNumber();
88 fDdlID = source.GetDdlID();
89 fErrorLevel = source.GetErrorLevel();
90 fErrorCode = source.GetErrorCode();
91 fCount = source.GetCount();
96 void AliRawDataErrorLog::Copy(TObject &obj) const {
98 // this overwrites the virtual TOBject::Copy()
99 // to allow run time copying without casting
102 if(this==&obj)return;
103 AliRawDataErrorLog *robj = dynamic_cast<AliRawDataErrorLog*>(&obj);
104 if(!robj)return; // not an AliRawDataErrorLog
109 //_____________________________________________________________________________
110 Int_t AliRawDataErrorLog::Compare(const TObject *obj) const
112 // Compare the event numbers and DDL IDs
113 // of two error log objects.
114 // Used in the sorting of raw data error logs
115 // during the raw data reading and reconstruction
116 Int_t eventNumber = ((AliRawDataErrorLog*)obj)->GetEventNumber();
117 Int_t ddlID = ((AliRawDataErrorLog*)obj)->GetDdlID();
119 if (fEventNumber == eventNumber) {
123 return ((fDdlID > ddlID) ? 1 : -1);
126 return ((fEventNumber > eventNumber) ? 1 : -1);
129 //_____________________________________________________________________________
131 AliRawDataErrorLog::GetErrorLevelAsString() const
133 switch ( GetErrorLevel() )
151 //_____________________________________________________________________________
153 AliRawDataErrorLog::Print(Option_t*) const
155 cout << Form("EventNumber %10d DdlID %5d ErrorLevel %10s ErrorCode %4d Occurence %5d",
156 GetEventNumber(),GetDdlID(),
157 GetErrorLevelAsString(),
160 cout << " " << GetMessage() << endl;