Crrected versions of AliAltroBuffer, AliAltroMapping and AliTPCRawStream
[u/mrichter/AliRoot.git] / RAW / AliTPCRawStream.h
CommitLineData
f8aae377 1#ifndef ALITPCRAWSTREAM_H
2#define ALITPCRAWSTREAM_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
bea6b2a4 6/* $Id$ */
7
8///////////////////////////////////////////////////////////////////////////////
9///
10/// This class provides access to TPC digits in raw data.
11///
12///////////////////////////////////////////////////////////////////////////////
13
f8aae377 14#include <TObject.h>
f8aae377 15#include "AliTPCCompression.h"
16
42d20574 17class AliRawReader;
cc934096 18class AliAltroMapping;
42d20574 19
f8aae377 20
21class AliTPCRawStream: public TObject {
22 public :
23 AliTPCRawStream(AliRawReader* rawReader);
42d20574 24 AliTPCRawStream(const AliTPCRawStream& stream);
25 AliTPCRawStream& operator = (const AliTPCRawStream& stream);
f8aae377 26 virtual ~AliTPCRawStream();
a8ffd46b 27 void Reset();
f8aae377 28
29 virtual Bool_t Next();
30
a8ffd46b 31 inline Int_t GetSector() const {return fSector;};
32 inline Int_t GetPrevSector() const {return fPrevSector;};
33 inline Bool_t IsNewSector() const {return fSector != fPrevSector;};
34 inline Int_t GetRow() const {return fRow;};
35 inline Int_t GetPrevRow() const {return fPrevRow;};
36 inline Bool_t IsNewRow() const {return (fRow != fPrevRow) || IsNewSector();};
37 inline Int_t GetPad() const {return fPad;};
38 inline Int_t GetPrevPad() const {return fPrevPad;};
39 inline Bool_t IsNewPad() const {return (fPad != fPrevPad) || IsNewRow();};
40 inline Int_t GetTime() const {return fTime;};
41 inline Int_t GetSignal() const {return fSignal;};
f8aae377 42
43 protected :
42d20574 44 UShort_t Get10BitWord(UChar_t* buffer, Int_t position) const;
f8aae377 45
46 AliRawReader* fRawReader; // object for reading the raw data
47
48 AliTPCCompression fCompression; // object for decompression
42d20574 49 static const Int_t fgkNumTables = 5; // number of (de)compression tables
f8aae377 50 static AliTPCHNode** fgRootNode; // (de)compression tables
95e50ecd 51 static UInt_t** fgLUTDimension; // LUT for fast decompression
52 static AliTPCHNode***fgLUTNode; // LUT for fast decompression
f8aae377 53
42d20574 54 static const Int_t fgkDataMax = 10000000; // size of array for uncompressed raw data
f8aae377 55 UShort_t* fData; // uncompressed raw data
56 Int_t fDataSize; // actual size of the uncompressed raw data
57 Int_t fPosition; // current position in fData
58 Int_t fCount; // counter of words to be read for current trailer
59 Int_t fBunchLength; // remaining number of signal bins in the current bunch
42d20574 60 static const Int_t fgkOffset = 1; // offset of signal
f8aae377 61
62 Int_t fSector; // index of current sector
63 Int_t fPrevSector; // index of previous sector
64 Int_t fRow; // index of current row
65 Int_t fPrevRow; // index of previous row
66 Int_t fPad; // index of current pad
67 Int_t fPrevPad; // index of previous pad
68 Int_t fTime; // index of current time bin
69 Int_t fSignal; // signal in ADC counts
70
cc934096 71 AliAltroMapping *fMapping[6]; // Pointers to ALTRO mapping
72
f8aae377 73 ClassDef(AliTPCRawStream, 0) // base class for reading TPC raw digits
74};
75
76#endif