]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONRawStreamTracker.h
Monalisa configuration added: host and table name
[u/mrichter/AliRoot.git] / MUON / AliMUONRawStreamTracker.h
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 "AliMUONRawStream.h"
17
18 class AliRawReader;
19 class AliMUONDDLTracker;
20 class AliMUONDspHeader;
21 class AliMUONBusStruct;
22 class AliMUONBlockHeader;
23
24 class AliMUONRawStreamTracker: public AliMUONRawStream {
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 pointer for payload
78     AliMUONPayloadTracker*  GetPayLoad()    const {return fPayload;}
79
80     /// Whether the iteration is finished or not
81     Bool_t IsDone() const;
82
83     /// add error message into error logger
84     void AddErrorMessage();
85     
86     /// Disable Warnings
87     void DisableWarnings() {fPayload->DisableWarnings();}
88     
89     /// check error/Warning presence
90     Bool_t IsErrorMessage() const;
91
92     /// error numbers
93     enum rawStreamTrackerError {
94       kGlitchErr      = 1, ///< glitch error 
95       kPaddingWordErr = 2, ///< padding word error
96       kParityErr      = 3  ///< parity error
97     };
98
99   private :
100     /// Not implemented
101     AliMUONRawStreamTracker(const AliMUONRawStreamTracker& stream);
102     /// Not implemented
103     AliMUONRawStreamTracker& operator = (const AliMUONRawStreamTracker& stream);
104
105     Bool_t GetNextDDL();
106     Bool_t GetNextBlockHeader();
107     Bool_t GetNextDspHeader();
108     Bool_t GetNextBusStruct();
109
110  
111  private:
112
113     AliMUONPayloadTracker* fPayload;         ///< pointer to payload decoder
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     Int_t  fDDL;                             //!< number of DDL    
124     static const Int_t  fgkMaxDDL;           //!< maximum number of DDLs
125
126     ClassDef(AliMUONRawStreamTracker, 4)    // base class for reading MUON raw digits
127 };
128
129 #endif