]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSRawStreamSPDErrorLog.h
- Protection added for null or empty input chains
[u/mrichter/AliRoot.git] / ITS / AliITSRawStreamSPDErrorLog.h
CommitLineData
10bb1a34 1#ifndef ALIITSRAWSTREAMSPDERRORLOG_H
2#define ALIITSRAWSTREAMSPDERRORLOG_H
3
4///////////////////////////////////////////////////////////////////////
5// Author: Henrik Tydesjo //
6// For easier handling of error messages from AliITSRawStreamSPD. //
7// The purpose of this class is to make possible the switch to the //
8// AliRoot raw data parsing routines in the onlinte monitoring //
9// programs, like SPD-MOOD, and still keep all the old functionality.//
10///////////////////////////////////////////////////////////////////////
11
12#include <TH1F.h>
13#include <TH2F.h>
14#include <TGraph.h>
15#include <TGText.h>
16
17class AliITSRawStreamSPDErrorLog : public TObject {
18
19 public:
20 AliITSRawStreamSPDErrorLog();
21 AliITSRawStreamSPDErrorLog(const AliITSRawStreamSPDErrorLog& logger);
22 AliITSRawStreamSPDErrorLog& operator=(const AliITSRawStreamSPDErrorLog& logger);
23 virtual ~AliITSRawStreamSPDErrorLog();
24
25 enum {kNrErrorCodes = 15};
26 enum {kTotal = 0};
27
28 void Reset();
29 void ProcessError(UInt_t errorCode, UInt_t eq, Int_t bytesRead, Int_t headersRead, const Char_t *errMess);
30 void AddMessage(const Char_t *errMess);
31 void SummarizeEvent(UInt_t eventNum);
32
33 UInt_t GetNrErrors(UInt_t errorCode, UInt_t eq);
34 UInt_t GetNrErrorsAllEq(UInt_t errorCode);
35 UInt_t GetNrErrorsTotal(UInt_t errorCode, UInt_t eq);
36 UInt_t GetNrErrorsTotalAllEq(UInt_t errorCode);
37
38 void SetPayloadSize(UInt_t eq, UInt_t size);
39 void SetByteOffset(UInt_t eq, Int_t size);
40 void SuppressErrorMessages(UInt_t errorCode, Bool_t suppr = kTRUE);
41 void SuppressErrorEq(UInt_t eq, Bool_t suppr = kTRUE);
42
43 static UInt_t GetNrErrorCodes(){return kNrErrorCodes;}
44
45 TGraph* GetConsErrEvent(UInt_t errorCode, UInt_t eq);
46 TH1F* GetConsErrType(UInt_t eq);
47 TH1F* GetConsErrFraction(UInt_t eq);
48 TH1F* GetConsErrPos(UInt_t errorCode, UInt_t eq);
49 TGText* GetText() {return fText;}
50
51
52 private:
53 Int_t fNErrors[kNrErrorCodes][20]; // number of errors for this event, for each code and eq
54 UInt_t fNEvents[20]; // number of events used, for each eq
55 UInt_t fPayloadSize[20]; // size of payload for this event, for each eq
56 Bool_t fPayloadSizeSet[20]; // was the payload size set for this eq?
57 UInt_t fErrEventCounter[kNrErrorCodes][20]; // event counter used when filling graph
58 Int_t fByteOffset[20]; // offset: how many bytes in the equipment header, for each eq
59 Bool_t fSuppressMess[kNrErrorCodes]; // do we suppress error messages for a specific error code?
60 Bool_t fSuppressEq[20]; // do we suppress error messages for a specific eq?
61
62 TGraph *fConsErrEvent[kNrErrorCodes][20]; // graphs to display number of errors found in each event
63 TH1F *fConsErrType[20]; // histogram of how many errors for each error code
64 TH1F *fConsErrFraction[20]; // histogram of rate of events with errors for each error code
65 TH1F *fConsErrPos[kNrErrorCodes][20]; // histogram of where in payload the errors occur
66
67 TGText *fText; // text buffer for all events analyzed so far
68 TGText *fTextTmp[20]; // text buffer for this event (defined error codes)
69 TGText *fTextTmpGeneral; // text buffer for this event (general errors)
70
71 void InitHistograms();
72 void DeleteHistograms() const;
73
74 ClassDef(AliITSRawStreamSPDErrorLog, 1);
75};
76
77#endif