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 */
8 ///////////////////////////////////////////////////////////////////////////////
10 /// This is a base class for reading raw data digits in Altro format
12 ///////////////////////////////////////////////////////////////////////////////
18 class AliAltroRawStream: public TObject {
20 AliAltroRawStream(AliRawReader* rawReader);
21 virtual ~AliAltroRawStream();
24 virtual Bool_t Next();
26 inline Int_t GetSector() const { return fSector; } // Provide index of current sector
27 inline Int_t GetPrevSector() const { return fPrevSector; } // Provide index of previous sector
28 inline Bool_t IsNewSector() const {return fSector != fPrevSector;};
29 inline Int_t GetRow() const { return fRow; } // Provide index of current row
30 inline Int_t GetPrevRow() const { return fPrevRow; } // Provide index of previous row
31 inline Bool_t IsNewRow() const {return (fRow != fPrevRow) || IsNewSector();};
32 inline Int_t GetPad() const { return fPad; } // Provide index of current pad
33 inline Int_t GetPrevPad() const { return fPrevPad; } // Provide index of previous pad
34 inline Bool_t IsNewPad() const {return (fPad != fPrevPad) || IsNewRow();};
35 inline Int_t GetHWAddress() const { return fHWAddress; } // Provide current hardware address
36 inline Int_t GetPrevHWAddress() const { return fPrevHWAddress; } // Provide previous hardware address
37 inline Int_t GetTime() const { return fTime; } // Provide index of current time bin
38 inline Int_t GetSignal() const { return fSignal; } // Provide signal in ADC counts
39 inline Int_t GetTimeLength() const { return fTimeBunch; } // Provide total length of current time bunch
42 AliAltroRawStream(const AliAltroRawStream& stream);
43 AliAltroRawStream& operator = (const AliAltroRawStream& stream);
45 virtual void ApplyAltroMapping() { fSector = fRow = fPad = -1; }
47 Int_t fSector; // index of current sector
48 Int_t fPrevSector; // index of previous sector
49 Int_t fRow; // index of current row
50 Int_t fPrevRow; // index of previous row
51 Int_t fPad; // index of current pad
52 Int_t fPrevPad; // index of previous pad
53 Short_t fHWAddress; // current hardware address
54 Short_t fPrevHWAddress;// previous hardware address
55 Int_t fTime; // index of current time bin
56 Int_t fSignal; // signal in ADC counts
57 Int_t fTimeBunch; // total length of the current time bunch
59 AliRawReader* fRawReader; // object for reading the raw data
61 UChar_t* fData; // raw data
63 Bool_t fNoAltroMapping; // temporary flag in case of no altro mapping is provided
67 UShort_t GetNextWord();
69 Bool_t ReadDummyTrailer();
74 Int_t fPosition; // current (10 bit) position in fData
75 Int_t fCount; // counter of words to be read for current trailer
76 Int_t fBunchLength; // remaining number of signal bins in the current bunch
78 ClassDef(AliAltroRawStream, 0) // base class for reading Altro raw digits