Increment the error counters & reset them (Christian)
[u/mrichter/AliRoot.git] / MUON / AliMUONRawStreamTracker.h
CommitLineData
c0751163 1#ifndef ALIMUONRAWSTREAMTRACKER_H
2#define ALIMUONRAWSTREAMTRACKER_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/*$Id$*/
7
be68bd50 8/// \ingroup raw
c0751163 9/// \class AliMUONRawStreamTracker
10/// \brief Class for reading MUON raw digits
11///
c4ee792d 12// Author: Christian Finck
c0751163 13
14#include <TObject.h>
313a427d 15#include "AliMUONPayloadTracker.h"
c0751163 16
17class AliRawReader;
18class AliMUONDDLTracker;
33434f31 19class AliMUONDspHeader;
20class AliMUONBusStruct;
21class AliMUONBlockHeader;
c0751163 22
23class AliMUONRawStreamTracker: public TObject {
24 public :
25 AliMUONRawStreamTracker();
26 AliMUONRawStreamTracker(AliRawReader* rawReader);
c0751163 27 virtual ~AliMUONRawStreamTracker();
28
33434f31 29 /// Initialize iterator
30 void First();
31
32 /// Returns current DDL object during iteration
33 AliMUONDDLTracker* CurrentDDL() const { return fCurrentDDL; }
34
35 /// Returns current BlockHeader object during iteration
36 AliMUONBlockHeader* CurrentBlockHeader() const { return fCurrentBlockHeader; }
37
38 /// Returns current DspHeader object during iteration
39 AliMUONDspHeader* CurrentDspHeader() const { return fCurrentDspHeader; }
40
41 /// Returns current BusStruct object during iteration
42 AliMUONBusStruct* CurrentBusStruct() const { return fCurrentBusStruct; }
43
44 /// Advance one step in the iteration. Returns false if finished.
45 virtual Bool_t Next(Int_t& busPatchId,
46 UShort_t& manuId, UChar_t& manuChannel,
47 UShort_t& adc);
48
49 virtual Bool_t NextDDL();
c0751163 50
71a2d3aa 51 /// Return maximum number of DDL in DATE file
c0751163 52 Int_t GetMaxDDL() const {return fMaxDDL;}
71a2d3aa 53 /// Return maximum number of block per DDL in DATE file
313a427d 54 Int_t GetMaxBlock() const {return fPayload->GetMaxBlock();}
71a2d3aa 55 /// Return maximum number of Dsp per block in DATE file
313a427d 56 Int_t GetMaxDsp() const {return fPayload->GetMaxDsp();}
71a2d3aa 57 /// Return maximum number of Buspatch per Dsp in DATE file
313a427d 58 Int_t GetMaxBus() const {return fPayload->GetMaxBus();}
c0751163 59
60 // check input before assigment
61 void SetMaxDDL(Int_t ddl);
62 void SetMaxBlock(Int_t blk);
63
71a2d3aa 64 /// Set maximum number of Dsp per block in DATE file
65 /// does not check, done via BusPatchManager
313a427d 66 void SetMaxDsp(Int_t dsp) {fPayload->SetMaxDsp(dsp);}
71a2d3aa 67 /// Set maximum number of Buspatch per Dsp in DATE file
68 /// does not check, done via BusPatchManager
313a427d 69 void SetMaxBus(Int_t bus) {fPayload->SetMaxBus(bus);}
c0751163 70
71a2d3aa 71 /// Set object for reading the raw data
c0751163 72 void SetReader(AliRawReader* rawReader) {fRawReader = rawReader;}
73
54e01c1c 74 /// Return pointer for DDL
75 AliMUONDDLTracker* GetDDLTracker() const {return fPayload->GetDDLTracker();}
76
77 /// Return pointer for payload
78 AliMUONPayloadTracker* GetPayLoad() const {return fPayload;}
79
71a2d3aa 80 /// Return number of DDL
54e01c1c 81 Int_t GetDDL() const {return fDDL - 1;}
c0751163 82
33434f31 83 /// Whether the iteration is finished or not
84 Bool_t IsDone() const;
85
9f5dcca3 86 private :
71a2d3aa 87 /// Not implemented
88 AliMUONRawStreamTracker(const AliMUONRawStreamTracker& stream);
89 /// Not implemented
90 AliMUONRawStreamTracker& operator = (const AliMUONRawStreamTracker& stream);
c0751163 91
33434f31 92 Bool_t GetNextDDL();
93 Bool_t GetNextBlockHeader();
94 Bool_t GetNextDspHeader();
95 Bool_t GetNextBusStruct();
c0751163 96
ea59383d 97 /// add error message into error logger
98 void AddErrorMessage();
99
100 /// error numbers
101 enum rawStreamTrackerError {
102 kGlitchErr = 1, ///< glitch error
103 kPaddingWordErr = 2, ///< padding word error
104 kParityErr = 3 ///< parity error
105 };
106
107
33434f31 108 private:
109 AliRawReader* fRawReader; ///< object for reading the raw data
110 Int_t fDDL; ///< number of DDL
111 Int_t fMaxDDL; ///< maximum number of DDL in DATE file
313a427d 112 AliMUONPayloadTracker* fPayload; ///< pointer to payload decoder
33434f31 113
114 AliMUONDDLTracker* fCurrentDDL; //!< for iterator: current ddl ptr
115 Int_t fCurrentDDLIndex; //!< for iterator: current ddl index
116 AliMUONBlockHeader* fCurrentBlockHeader; //!< for iterator: current block ptr
117 Int_t fCurrentBlockHeaderIndex; //!< for iterator: current block index
118 AliMUONDspHeader* fCurrentDspHeader; //!< for iterator: current dsp ptr
119 Int_t fCurrentDspHeaderIndex; //!< for iterator: current dsp index
120 AliMUONBusStruct* fCurrentBusStruct; //!< for iterator: current bus ptr
121 Int_t fCurrentBusStructIndex; //!< for iterator: current bus index
122 Int_t fCurrentDataIndex; //!< for iterator: current data index
123
124 ClassDef(AliMUONRawStreamTracker, 3) // base class for reading MUON raw digits
c0751163 125};
126
127#endif