]> git.uio.no Git - u/mrichter/AliRoot.git/blame - RAW/AliAltroRawStream.h
o) making selector proof ready
[u/mrichter/AliRoot.git] / RAW / AliAltroRawStream.h
CommitLineData
3ea47630 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
16class AliRawReader;
17
3ea47630 18class AliAltroRawStream: public TObject {
19 public :
20 AliAltroRawStream(AliRawReader* rawReader);
21 virtual ~AliAltroRawStream();
22
3a291af4 23 virtual void Reset();
24 virtual Bool_t Next();
3ea47630 25
e7fd2555 26 inline Int_t GetDDLNumber() const { return fDDLNumber; } // Provide current DDL number
27 inline Int_t GetPrevDDLNumber() const { return fPrevDDLNumber; }// Provide previous DDL number
28 inline Bool_t IsNewDDLNumber() const {return (fDDLNumber != fPrevDDLNumber);};
3a291af4 29 inline Int_t GetHWAddress() const { return fHWAddress; } // Provide current hardware address
30 inline Int_t GetPrevHWAddress() const { return fPrevHWAddress; } // Provide previous hardware address
e7fd2555 31 inline Bool_t IsNewHWAddress() const {return (fHWAddress != fPrevHWAddress) || IsNewDDLNumber();};
3a291af4 32 inline Int_t GetTime() const { return fTime; } // Provide index of current time bin
e7fd2555 33 inline Int_t GetPrevTime() const { return fPrevTime; } // Provide index of previous time bin
34 inline Bool_t IsNewTime() const {return (fTime != fPrevTime) || IsNewHWAddress();};
3a291af4 35 inline Int_t GetSignal() const { return fSignal; } // Provide signal in ADC counts
36 inline Int_t GetTimeLength() const { return fTimeBunch; } // Provide total length of current time bunch
0ba5477a 37
e7fd2555 38 void SelectRawData(Int_t detId); // Select raw data for specific detector id
39
3ea47630 40 protected:
3a291af4 41 AliAltroRawStream(const AliAltroRawStream& stream);
42 AliAltroRawStream& operator = (const AliAltroRawStream& stream);
43
e7fd2555 44 Bool_t fNoAltroMapping; // temporary flag in case of no altro mapping is provided
45 Short_t fSegmentation[3]; // temporary container for the dummy trailer, to be removed
46
47 private :
3a291af4 48
e7fd2555 49 UShort_t GetNextWord();
50 Bool_t ReadTrailer();
51 Bool_t ReadDummyTrailer();
52 void ReadBunch();
53 void ReadAmplitude();
54 Int_t GetPosition();
55
56 Int_t fDDLNumber; // index of current DDL number
57 Int_t fPrevDDLNumber;// index of current DDL number
3a291af4 58 Short_t fHWAddress; // current hardware address
59 Short_t fPrevHWAddress;// previous hardware address
3ea47630 60 Int_t fTime; // index of current time bin
e7fd2555 61 Int_t fPrevTime; // index of previous time bin
3ea47630 62 Int_t fSignal; // signal in ADC counts
634692a1 63 Int_t fTimeBunch; // total length of the current time bunch
3ea47630 64
65 AliRawReader* fRawReader; // object for reading the raw data
66
3a291af4 67
e7fd2555 68 UChar_t* fData; // raw data
3ea47630 69
3ea47630 70 Int_t fPosition; // current (10 bit) position in fData
71 Int_t fCount; // counter of words to be read for current trailer
72 Int_t fBunchLength; // remaining number of signal bins in the current bunch
73
74 ClassDef(AliAltroRawStream, 0) // base class for reading Altro raw digits
75};
76
77#endif