Separating run-dependent mapping data from data, which are not
[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"
e3a2b9c9 16#include "AliMUONVRawStreamTracker.h"
c0751163 17
18class AliRawReader;
19class AliMUONDDLTracker;
33434f31 20class AliMUONDspHeader;
21class AliMUONBusStruct;
22class AliMUONBlockHeader;
c0751163 23
e3a2b9c9 24class AliMUONRawStreamTracker: public AliMUONVRawStreamTracker {
c0751163 25 public :
26 AliMUONRawStreamTracker();
27 AliMUONRawStreamTracker(AliRawReader* rawReader);
c0751163 28 virtual ~AliMUONRawStreamTracker();
29
33434f31 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();
c0751163 51
dabf5427 52 /// Return maximum number of DDLs
53 Int_t GetMaxDDL() const {return fgkMaxDDL;}
71a2d3aa 54 /// Return maximum number of block per DDL in DATE file
313a427d 55 Int_t GetMaxBlock() const {return fPayload->GetMaxBlock();}
71a2d3aa 56 /// Return maximum number of Dsp per block in DATE file
313a427d 57 Int_t GetMaxDsp() const {return fPayload->GetMaxDsp();}
71a2d3aa 58 /// Return maximum number of Buspatch per Dsp in DATE file
313a427d 59 Int_t GetMaxBus() const {return fPayload->GetMaxBus();}
c0751163 60
61 // check input before assigment
c0751163 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
54e01c1c 71 /// Return pointer for DDL
72 AliMUONDDLTracker* GetDDLTracker() const {return fPayload->GetDDLTracker();}
73
dabf5427 74 /// Return number of DDL
75 Int_t GetDDL() const {return fDDL - 1;}
1c66abf3 76
77 /// Return current DDL index
78 Int_t GetCurentDDL() const {return fCurrentDDLIndex;}
dabf5427 79
54e01c1c 80 /// Return pointer for payload
81 AliMUONPayloadTracker* GetPayLoad() const {return fPayload;}
82
33434f31 83 /// Whether the iteration is finished or not
84 Bool_t IsDone() const;
85
3c7f5307 86 /// add error message into error logger
87 void AddErrorMessage();
dabf5427 88
89 /// Disable Warnings
90 void DisableWarnings() {fPayload->DisableWarnings();}
91
92 /// check error/Warning presence
93 Bool_t IsErrorMessage() const;
3c7f5307 94
7a0bb451 95 /// error numbers
96 enum rawStreamTrackerError {
97 kGlitchErr = 1, ///< glitch error
98 kPaddingWordErr = 2, ///< padding word error
99 kParityErr = 3 ///< parity error
100 };
101
9f5dcca3 102 private :
71a2d3aa 103 /// Not implemented
104 AliMUONRawStreamTracker(const AliMUONRawStreamTracker& stream);
105 /// Not implemented
106 AliMUONRawStreamTracker& operator = (const AliMUONRawStreamTracker& stream);
c0751163 107
33434f31 108 Bool_t GetNextDDL();
109 Bool_t GetNextBlockHeader();
110 Bool_t GetNextDspHeader();
111 Bool_t GetNextBusStruct();
c0751163 112
7a0bb451 113
33434f31 114 private:
dabf5427 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
33434f31 119 AliMUONBlockHeader* fCurrentBlockHeader; //!< for iterator: current block ptr
dabf5427 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
8a0dae7c 126 Int_t fDDL; //!< number of DDL
dabf5427 127 static const Int_t fgkMaxDDL; //!< maximum number of DDLs
128
129 ClassDef(AliMUONRawStreamTracker, 4) // base class for reading MUON raw digits
c0751163 130};
131
132#endif