- Used AliMUONLogger for errors
[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
3c7f5307 86
87 /// add error message into error logger
88 void AddErrorMessage();
89
90 /// Enable error info logger
91 void EnabbleErrorLogger() {fEnableErrorLogger = kTRUE;}
92
7a0bb451 93 /// error numbers
94 enum rawStreamTrackerError {
95 kGlitchErr = 1, ///< glitch error
96 kPaddingWordErr = 2, ///< padding word error
97 kParityErr = 3 ///< parity error
98 };
99
9f5dcca3 100 private :
71a2d3aa 101 /// Not implemented
102 AliMUONRawStreamTracker(const AliMUONRawStreamTracker& stream);
103 /// Not implemented
104 AliMUONRawStreamTracker& operator = (const AliMUONRawStreamTracker& stream);
c0751163 105
33434f31 106 Bool_t GetNextDDL();
107 Bool_t GetNextBlockHeader();
108 Bool_t GetNextDspHeader();
109 Bool_t GetNextBusStruct();
c0751163 110
7a0bb451 111
33434f31 112 private:
113 AliRawReader* fRawReader; ///< object for reading the raw data
114 Int_t fDDL; ///< number of DDL
115 Int_t fMaxDDL; ///< maximum number of DDL in DATE file
313a427d 116 AliMUONPayloadTracker* fPayload; ///< pointer to payload decoder
33434f31 117
118 AliMUONDDLTracker* fCurrentDDL; //!< for iterator: current ddl ptr
119 Int_t fCurrentDDLIndex; //!< for iterator: current ddl index
120 AliMUONBlockHeader* fCurrentBlockHeader; //!< for iterator: current block ptr
121 Int_t fCurrentBlockHeaderIndex; //!< for iterator: current block index
122 AliMUONDspHeader* fCurrentDspHeader; //!< for iterator: current dsp ptr
123 Int_t fCurrentDspHeaderIndex; //!< for iterator: current dsp index
124 AliMUONBusStruct* fCurrentBusStruct; //!< for iterator: current bus ptr
125 Int_t fCurrentBusStructIndex; //!< for iterator: current bus index
126 Int_t fCurrentDataIndex; //!< for iterator: current data index
3c7f5307 127 Bool_t fEnableErrorLogger; //!< flag to enable the error info logger
33434f31 128
129 ClassDef(AliMUONRawStreamTracker, 3) // base class for reading MUON raw digits
c0751163 130};
131
132#endif