]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSRawStreamSPDErrorLog.h
Bug fix (G. Luparello)
[u/mrichter/AliRoot.git] / ITS / AliITSRawStreamSPDErrorLog.h
CommitLineData
10bb1a34 1#ifndef ALIITSRAWSTREAMSPDERRORLOG_H
2#define ALIITSRAWSTREAMSPDERRORLOG_H
3
54a5b3aa 4/* $Id$ */
5
10bb1a34 6///////////////////////////////////////////////////////////////////////
7// Author: Henrik Tydesjo //
8// For easier handling of error messages from AliITSRawStreamSPD. //
9// The purpose of this class is to make possible the switch to the //
10// AliRoot raw data parsing routines in the onlinte monitoring //
11// programs, like SPD-MOOD, and still keep all the old functionality.//
12///////////////////////////////////////////////////////////////////////
13
14#include <TH1F.h>
15#include <TH2F.h>
16#include <TGraph.h>
17#include <TGText.h>
18
19class AliITSRawStreamSPDErrorLog : public TObject {
20
21 public:
22 AliITSRawStreamSPDErrorLog();
23 AliITSRawStreamSPDErrorLog(const AliITSRawStreamSPDErrorLog& logger);
24 AliITSRawStreamSPDErrorLog& operator=(const AliITSRawStreamSPDErrorLog& logger);
25 virtual ~AliITSRawStreamSPDErrorLog();
26
de12e454 27 enum {kNrErrorCodes = 21};
10bb1a34 28 enum {kTotal = 0};
29
30 void Reset();
31 void ProcessError(UInt_t errorCode, UInt_t eq, Int_t bytesRead, Int_t headersRead, const Char_t *errMess);
32 void AddMessage(const Char_t *errMess);
b457135f 33
34 void ResetEvent();
35 void ProcessEvent(UInt_t eventNum);
36 void AddErrorMessagesFromCurrentEvent(UInt_t eventNum);
10bb1a34 37 void SummarizeEvent(UInt_t eventNum);
38
39 UInt_t GetNrErrors(UInt_t errorCode, UInt_t eq);
40 UInt_t GetNrErrorsAllEq(UInt_t errorCode);
41 UInt_t GetNrErrorsTotal(UInt_t errorCode, UInt_t eq);
42 UInt_t GetNrErrorsTotalAllEq(UInt_t errorCode);
43
10bb1a34 44 void SetByteOffset(UInt_t eq, Int_t size);
45 void SuppressErrorMessages(UInt_t errorCode, Bool_t suppr = kTRUE);
46 void SuppressErrorEq(UInt_t eq, Bool_t suppr = kTRUE);
47
48 static UInt_t GetNrErrorCodes(){return kNrErrorCodes;}
49
50 TGraph* GetConsErrEvent(UInt_t errorCode, UInt_t eq);
478d804c 51 TGraph* GetConsErrPos(UInt_t errorCode, UInt_t eq);
10bb1a34 52 TH1F* GetConsErrType(UInt_t eq);
54a5b3aa 53 TH1F* GetConsErrFraction(UInt_t eq); // NB!!! Take care of deleting returned object later
54 TH1F* GetConsErrFractionUnScaled(UInt_t eq);
10bb1a34 55 TGText* GetText() {return fText;}
b457135f 56 TGText* GetTextThisEvent(UInt_t eq) {if (eq<20) return fTextTmp[eq]; else return NULL;}
57 TGText* GetTextGeneralThisEvent() {return fTextTmpGeneral;}
10bb1a34 58
b457135f 59 UInt_t GetEventErrPosCounter(UInt_t errorCode, UInt_t eq);
60 UInt_t GetEventErrPos(UInt_t index, UInt_t errorCode, UInt_t eq);
10bb1a34 61
62 private:
63 Int_t fNErrors[kNrErrorCodes][20]; // number of errors for this event, for each code and eq
b457135f 64 Int_t fNErrorsTotal[kNrErrorCodes][20]; // number of errors for all events, for each code and eq
10bb1a34 65 UInt_t fNEvents[20]; // number of events used, for each eq
10bb1a34 66 UInt_t fErrEventCounter[kNrErrorCodes][20]; // event counter used when filling graph
478d804c 67 UInt_t fErrPosCounter[kNrErrorCodes][20]; // event counter used when filling graph
68 UInt_t fErrPosTMPCounter[kNrErrorCodes][20]; // event counter used when filling graph
10bb1a34 69 Int_t fByteOffset[20]; // offset: how many bytes in the equipment header, for each eq
70 Bool_t fSuppressMess[kNrErrorCodes]; // do we suppress error messages for a specific error code?
71 Bool_t fSuppressEq[20]; // do we suppress error messages for a specific eq?
72
73 TGraph *fConsErrEvent[kNrErrorCodes][20]; // graphs to display number of errors found in each event
478d804c 74 TGraph *fConsErrPos[kNrErrorCodes][20]; // graphs to display number of bytes read for each error and event
75 TGraph *fConsErrPosTMP[kNrErrorCodes][20]; // temporary, to fill tgraph above for event
10bb1a34 76 TH1F *fConsErrType[20]; // histogram of how many errors for each error code
77 TH1F *fConsErrFraction[20]; // histogram of rate of events with errors for each error code
10bb1a34 78
79 TGText *fText; // text buffer for all events analyzed so far
80 TGText *fTextTmp[20]; // text buffer for this event (defined error codes)
81 TGText *fTextTmpGeneral; // text buffer for this event (general errors)
82
83 void InitHistograms();
71abf6b7 84 void DeleteHistograms() ;
10bb1a34 85
478d804c 86 ClassDef(AliITSRawStreamSPDErrorLog, 2);
10bb1a34 87};
88
89#endif
de12e454 90