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