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