]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RAW/AliAltroRawStream.h
Coding violations fixed
[u/mrichter/AliRoot.git] / RAW / AliAltroRawStream.h
1 #ifndef ALIALTRORAWSTREAM_H
2 #define ALIALTRORAWSTREAM_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 ///////////////////////////////////////////////////////////////////////////////
9 ///
10 /// This is a base class for reading raw data digits in Altro format
11 ///
12 ///////////////////////////////////////////////////////////////////////////////
13
14 #include <TObject.h>
15
16 class AliRawReader;
17
18 class AliAltroRawStream: public TObject {
19   public :
20     AliAltroRawStream(AliRawReader* rawReader);
21     virtual ~AliAltroRawStream();
22
23     virtual void             Reset();
24     virtual Bool_t           Next();
25
26     Int_t GetDDLNumber()  const { return fDDLNumber; }  // Provide current DDL number
27     Int_t GetPrevDDLNumber() const { return fPrevDDLNumber; }// Provide previous DDL number
28     Bool_t  IsNewDDLNumber() const {return (fDDLNumber != fPrevDDLNumber);};
29     Int_t GetRCUId()      const { return fRCUId; }      // Provide current RCU identifier
30     Int_t GetPrevRCUId()  const { return fPrevRCUId; }  // Provide previous RCU identifier
31     Bool_t  IsNewRCUId() const {return (fRCUId != fPrevRCUId);};
32     Int_t GetHWAddress()  const { return fHWAddress; }  // Provide current hardware address
33     Int_t GetPrevHWAddress() const { return fPrevHWAddress; }  // Provide previous hardware address
34     Bool_t  IsNewHWAddress() const {return (fHWAddress != fPrevHWAddress) || IsNewDDLNumber();};
35     Int_t GetTime()       const { return fTime; }       // Provide index of current time bin
36     Int_t GetPrevTime()   const { return fPrevTime; }   // Provide index of previous time bin
37     Bool_t  IsNewTime()   const {return (fTime != fPrevTime) || IsNewHWAddress();};
38     Int_t GetSignal()     const { return fSignal; }     // Provide signal in ADC counts
39     Int_t GetTimeLength() const { return fTimeBunch; }  // Provide total length of current time bunch
40
41     Bool_t  GetRCUTrailerData(UChar_t*& data) const;              // Provide a pointer to RCU trailer
42     Int_t   GetRCUTrailerSize() const { return fRCUTrailerSize; } // Provide size of RCU trailer
43
44     void SelectRawData(Int_t detId);                           // Select raw data for specific detector id
45
46   protected:
47     AliAltroRawStream(const AliAltroRawStream& stream);
48     AliAltroRawStream& operator = (const AliAltroRawStream& stream);
49
50     Bool_t           fNoAltroMapping;  // temporary flag in case of no altro mapping is provided
51     Short_t          fSegmentation[3]; // temporary container for the dummy trailer, to be removed
52
53   private :
54
55     UShort_t         GetNextWord();
56     Bool_t           ReadTrailer();
57     Bool_t           ReadDummyTrailer();
58     void             ReadBunch();
59     void             ReadAmplitude();
60     Int_t            GetPosition();
61     UInt_t           Get32bitWord(Int_t &index);
62
63     Int_t            fDDLNumber;    // index of current DDL number
64     Int_t            fPrevDDLNumber;// index of previous DDL number
65     Int_t            fRCUId;        // current RCU identifier
66     Int_t            fPrevRCUId;    // previous RCU identifier
67     Short_t          fHWAddress;    // current hardware address
68     Short_t          fPrevHWAddress;// previous hardware address
69     Int_t            fTime;         // index of current time bin
70     Int_t            fPrevTime;     // index of previous time bin
71     Int_t            fSignal;       // signal in ADC counts
72     Int_t            fTimeBunch;    // total length of the current time bunch
73
74     AliRawReader*    fRawReader;    // object for reading the raw data
75
76
77     UChar_t*         fData;         // raw data
78
79     Int_t            fPosition;     // current (10 bit) position in fData
80     Int_t            fCount;        // counter of words to be read for current trailer
81     Int_t            fBunchLength;  // remaining number of signal bins in the current bunch
82
83     UChar_t*         fRCUTrailerData; // pointer to RCU trailer data
84     Int_t            fRCUTrailerSize; // size of RCU trailer data in bytes
85
86     ClassDef(AliAltroRawStream, 0)  // base class for reading Altro raw digits
87 };
88
89 #endif