From 72b6c6b674e9db0edcf090afed2f26c2cd942e29 Mon Sep 17 00:00:00 2001 From: cvetan Date: Fri, 19 Jan 2007 15:46:15 +0000 Subject: [PATCH] New class for storing and retrieving of the raw-data decoding errors --- STEER/AliRawDataErrorLog.cxx | 101 +++++++++++++++++++++++++++++++++++ STEER/AliRawDataErrorLog.h | 59 ++++++++++++++++++++ STEER/ESDLinkDef.h | 2 + STEER/libESD.pkg | 3 +- 4 files changed, 164 insertions(+), 1 deletion(-) create mode 100644 STEER/AliRawDataErrorLog.cxx create mode 100644 STEER/AliRawDataErrorLog.h diff --git a/STEER/AliRawDataErrorLog.cxx b/STEER/AliRawDataErrorLog.cxx new file mode 100644 index 00000000000..8f06f05b528 --- /dev/null +++ b/STEER/AliRawDataErrorLog.cxx @@ -0,0 +1,101 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +///////////////////////////////////////////////////////////////////// +// Implementation of AliRawDataErrorLog class // +// // +// class AliRawDataErrorLog // +// This is a class for logging raw-data related errors. // +// It is used to record and retrieve of the errors // +// during the reading and reconstruction of raw-data and ESD // +// analysis. // +// Further description of the methods and functionality are given // +// inline. // +// // +// cvetan.cheshkov@cern.ch // +// // +///////////////////////////////////////////////////////////////////// + +#include "AliRawDataErrorLog.h" + +ClassImp(AliRawDataErrorLog) + +//_____________________________________________________________________________ +AliRawDataErrorLog::AliRawDataErrorLog() : + TNamed(), + fEventNumber(-1), + fDdlID(-1), + fErrorType(AliRawDataErrorLog::kNone) +{ + // Default constructor +} + +//_____________________________________________________________________________ +AliRawDataErrorLog::AliRawDataErrorLog(Int_t eventNumber, Int_t ddlId, + ERawDataErrorType errorType, + const char *message) : + TNamed(message,""), + fEventNumber(eventNumber), + fDdlID(ddlId), + fErrorType(errorType) +{ + // Constructor that specifies + // the event number, ddl id, error type and + // custom message related to the error +} + +//___________________________________________________________________________ +AliRawDataErrorLog::AliRawDataErrorLog(const AliRawDataErrorLog & source) : + TNamed(source), + fEventNumber(source.fEventNumber), + fDdlID(source.fDdlID), + fErrorType(source.fErrorType) +{ + // Copy constructor +} + +//___________________________________________________________________________ +AliRawDataErrorLog & AliRawDataErrorLog::operator=(const AliRawDataErrorLog &source) +{ + // assignment operator + if (this != &source) { + TNamed::operator=(source); + + fEventNumber = source.GetEventNumber(); + fDdlID = source.GetDdlID(); + fErrorType = source.GetErrorType(); + } + return *this; +} + +//_____________________________________________________________________________ +Int_t AliRawDataErrorLog::Compare(const TObject *obj) const +{ + // Compare the event numbers and DDL IDs + // of two error log objects. + // Used in the sorting of raw data error logs + // during the raw data reading and reconstruction + Int_t eventNumber = ((AliRawDataErrorLog*)obj)->GetEventNumber(); + Int_t ddlID = ((AliRawDataErrorLog*)obj)->GetDdlID(); + + if (fEventNumber == eventNumber) { + if (fDdlID == ddlID) + return 0; + else + return ((fDdlID > ddlID) ? 1 : -1); + } + else + return ((fEventNumber > eventNumber) ? 1 : -1); +} diff --git a/STEER/AliRawDataErrorLog.h b/STEER/AliRawDataErrorLog.h new file mode 100644 index 00000000000..1ab66904fbe --- /dev/null +++ b/STEER/AliRawDataErrorLog.h @@ -0,0 +1,59 @@ +#ifndef ALIRAWDATAERRORLOG_H +#define ALIRAWDATAERRORLOG_H + +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +///////////////////////////////////////////////////////////////////// +// // +// class AliRawDataErrorLog // +// This is a class for logging raw-data related errors. // +// It is used to record and retrieve of the errors // +// during the reading and reconstruction of raw-data and ESD // +// analysis. // +// Further description of the methods and functionality are given // +// inline. // +// // +// cvetan.cheshkov@cern.ch // +// // +///////////////////////////////////////////////////////////////////// + +#include + +class AliRawDataErrorLog: public TNamed { + + public: + + enum ERawDataErrorType { + kNone = 0, + kMinor = 1, + kMajor = 2, + kFatal = 3, + }; + + AliRawDataErrorLog(); + AliRawDataErrorLog(Int_t eventNumber, Int_t ddlId, + ERawDataErrorType errorType, + const char *message = NULL); + AliRawDataErrorLog(const AliRawDataErrorLog & source); + AliRawDataErrorLog & operator=(const AliRawDataErrorLog & source); + virtual ~AliRawDataErrorLog() {}; + + Int_t GetEventNumber() const { return fEventNumber; } + Int_t GetDdlID() const { return fDdlID; } + ERawDataErrorType GetErrorType() const { return fErrorType; } + const char * GetMessage() const { return fName.Data(); } + + Bool_t IsSortable() const {return kTRUE;} + Int_t Compare(const TObject* obj) const; + + 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 + ERawDataErrorType fErrorType; // Type of the raw data error + + ClassDef(AliRawDataErrorLog, 1) +}; + +#endif diff --git a/STEER/ESDLinkDef.h b/STEER/ESDLinkDef.h index b6191be6b2f..cbcd421a328 100644 --- a/STEER/ESDLinkDef.h +++ b/STEER/ESDLinkDef.h @@ -59,6 +59,8 @@ #pragma link C++ class AliSelector+; +#pragma link C++ class AliRawDataErrorLog+; + #endif diff --git a/STEER/libESD.pkg b/STEER/libESD.pkg index d3ba31ceeda..ac3a83278bc 100644 --- a/STEER/libESD.pkg +++ b/STEER/libESD.pkg @@ -13,7 +13,8 @@ SRCS = AliESD.cxx AliESDfriend.cxx\ AliESDMultITS.cxx \ AliESDVZERO.cxx \ AliMultiplicity.cxx AliXMLCollection.cxx \ - AliSelector.cxx + AliSelector.cxx \ + AliRawDataErrorLog.cxx HDRS:= $(SRCS:.cxx=.h) -- 2.43.0