]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliRawDataErrorLog.cxx
Adding includes now needed by ROOT
[u/mrichter/AliRoot.git] / STEER / AliRawDataErrorLog.cxx
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
33 ClassImp(AliRawDataErrorLog)
34
35 //_____________________________________________________________________________
36 AliRawDataErrorLog::AliRawDataErrorLog() :
37   TNamed(),
38   fEventNumber(-1),
39   fDdlID(-1),
40   fErrorType(AliRawDataErrorLog::kNone)
41 {
42   // Default constructor
43 }
44
45 //_____________________________________________________________________________
46 AliRawDataErrorLog::AliRawDataErrorLog(Int_t eventNumber, Int_t ddlId,
47                                        ERawDataErrorType errorType,
48                                        const char *message) :
49   TNamed(message,""),
50   fEventNumber(eventNumber),
51   fDdlID(ddlId),
52   fErrorType(errorType)
53 {
54   // Constructor that specifies
55   // the event number, ddl id, error type and
56   // custom message related to the error
57 }
58
59 //___________________________________________________________________________
60 AliRawDataErrorLog::AliRawDataErrorLog(const AliRawDataErrorLog & source) :
61   TNamed(source),
62   fEventNumber(source.fEventNumber),
63   fDdlID(source.fDdlID),
64   fErrorType(source.fErrorType)
65 {
66   // Copy constructor
67 }
68
69 //___________________________________________________________________________
70 AliRawDataErrorLog & AliRawDataErrorLog::operator=(const AliRawDataErrorLog &source)
71 {
72   // assignment operator
73   if (this != &source) {
74     TNamed::operator=(source);
75
76     fEventNumber = source.GetEventNumber();
77     fDdlID       = source.GetDdlID();
78     fErrorType   = source.GetErrorType();
79   }
80   return *this;
81 }
82
83 //_____________________________________________________________________________
84 Int_t AliRawDataErrorLog::Compare(const TObject *obj) const
85 {
86   // Compare the event numbers and DDL IDs
87   // of two error log objects.
88   // Used in the sorting of raw data error logs
89   // during the raw data reading and reconstruction
90   Int_t eventNumber = ((AliRawDataErrorLog*)obj)->GetEventNumber();
91   Int_t ddlID = ((AliRawDataErrorLog*)obj)->GetDdlID();
92
93   if (fEventNumber == eventNumber) {
94     if (fDdlID == ddlID)
95       return 0;
96     else
97       return ((fDdlID > ddlID) ? 1 : -1);
98   }
99   else
100     return ((fEventNumber > eventNumber) ? 1 : -1);
101 }