]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliRawDataErrorLog.cxx
Bug fix
[u/mrichter/AliRoot.git] / STEER / AliRawDataErrorLog.cxx
CommitLineData
72b6c6b6 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/////////////////////////////////////////////////////////////////////
17// Implementation of AliRawDataErrorLog class //
18// //
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 //
23// analysis. //
24// Further description of the methods and functionality are given //
25// inline. //
26// //
27// cvetan.cheshkov@cern.ch //
28// //
29/////////////////////////////////////////////////////////////////////
30
31#include "AliRawDataErrorLog.h"
32
33ClassImp(AliRawDataErrorLog)
34
35//_____________________________________________________________________________
36AliRawDataErrorLog::AliRawDataErrorLog() :
37 TNamed(),
38 fEventNumber(-1),
39 fDdlID(-1),
9fc249d9 40 fErrorLevel(AliRawDataErrorLog::kMinor),
41 fErrorCode(0)
72b6c6b6 42{
43 // Default constructor
44}
45
46//_____________________________________________________________________________
47AliRawDataErrorLog::AliRawDataErrorLog(Int_t eventNumber, Int_t ddlId,
9fc249d9 48 ERawDataErrorLevel errorLevel,
49 Int_t errorCode,
72b6c6b6 50 const char *message) :
51 TNamed(message,""),
52 fEventNumber(eventNumber),
53 fDdlID(ddlId),
9fc249d9 54 fErrorLevel(errorLevel),
55 fErrorCode(errorCode)
72b6c6b6 56{
57 // Constructor that specifies
58 // the event number, ddl id, error type and
59 // custom message related to the error
60}
61
62//___________________________________________________________________________
63AliRawDataErrorLog::AliRawDataErrorLog(const AliRawDataErrorLog & source) :
64 TNamed(source),
65 fEventNumber(source.fEventNumber),
66 fDdlID(source.fDdlID),
9fc249d9 67 fErrorLevel(source.fErrorLevel),
68 fErrorCode(source.fErrorCode)
72b6c6b6 69{
70 // Copy constructor
71}
72
73//___________________________________________________________________________
74AliRawDataErrorLog & AliRawDataErrorLog::operator=(const AliRawDataErrorLog &source)
75{
76 // assignment operator
77 if (this != &source) {
78 TNamed::operator=(source);
79
80 fEventNumber = source.GetEventNumber();
81 fDdlID = source.GetDdlID();
9fc249d9 82 fErrorLevel = source.GetErrorLevel();
83 fErrorCode = source.GetErrorCode();
72b6c6b6 84 }
85 return *this;
86}
87
88//_____________________________________________________________________________
89Int_t AliRawDataErrorLog::Compare(const TObject *obj) const
90{
91 // Compare the event numbers and DDL IDs
92 // of two error log objects.
93 // Used in the sorting of raw data error logs
94 // during the raw data reading and reconstruction
95 Int_t eventNumber = ((AliRawDataErrorLog*)obj)->GetEventNumber();
96 Int_t ddlID = ((AliRawDataErrorLog*)obj)->GetDdlID();
97
98 if (fEventNumber == eventNumber) {
99 if (fDdlID == ddlID)
100 return 0;
101 else
102 return ((fDdlID > ddlID) ? 1 : -1);
103 }
104 else
105 return ((fEventNumber > eventNumber) ? 1 : -1);
106}