]> git.uio.no Git - u/mrichter/AliRoot.git/blame - RAW/AliAltroRawStreamOld.h
AliRoot version is added to the titles of the raw-data file, the tree inside and...
[u/mrichter/AliRoot.git] / RAW / AliAltroRawStreamOld.h
CommitLineData
5bbd01a6 1#ifndef ALIALTRORAWSTREAMOLD_H
2#define ALIALTRORAWSTREAMOLD_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6///////////////////////////////////////////////////////////////////////////////
7///
8/// This is a class for reading raw data digits in Altro format
9/// OLD RCU version
10/// The RCU trailer is just one 32-bit word
11/// The Common Data Header is 7 32-bit words and is skipped during
12/// the raw data reading.
13/// The raw data payload is little endian.
14///
15///////////////////////////////////////////////////////////////////////////////
16
17#include <TObject.h>
18
19class AliRawReader;
20
21class AliAltroRawStreamOld: public TObject {
22 public :
23 AliAltroRawStreamOld(AliRawReader* rawReader);
24 virtual ~AliAltroRawStreamOld();
25
26 virtual void Reset();
27 virtual Bool_t Next();
28
29 inline Int_t GetDDLNumber() const { return fDDLNumber; } // Provide current DDL number
30 inline Int_t GetPrevDDLNumber() const { return fPrevDDLNumber; }// Provide previous DDL number
31 inline Bool_t IsNewDDLNumber() const {return (fDDLNumber != fPrevDDLNumber);};
32 inline Int_t GetHWAddress() const { return fHWAddress; } // Provide current hardware address
33 inline Int_t GetPrevHWAddress() const { return fPrevHWAddress; } // Provide previous hardware address
34 inline Bool_t IsNewHWAddress() const {return (fHWAddress != fPrevHWAddress) || IsNewDDLNumber();};
35 inline Int_t GetTime() const { return fTime; } // Provide index of current time bin
36 inline Int_t GetPrevTime() const { return fPrevTime; } // Provide index of previous time bin
37 inline Bool_t IsNewTime() const {return (fTime != fPrevTime) || IsNewHWAddress();};
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
40
41 void SelectRawData(Int_t detId); // Select raw data for specific detector id
42
092c2f61 43 inline void SetNoAltroMapping(Bool_t flag) { fNoAltroMapping = flag; } // Specify whenever to use or not the altro mapping
44
5bbd01a6 45 protected:
46 AliAltroRawStreamOld(const AliAltroRawStreamOld& stream);
47 AliAltroRawStreamOld& operator = (const AliAltroRawStreamOld& stream);
48
49 Bool_t fNoAltroMapping; // temporary flag in case of no altro mapping is provided
50 Short_t fSegmentation[3]; // temporary container for the dummy trailer, to be removed
51
52 private :
53
54 UShort_t GetNextWord();
55 Bool_t ReadTrailer();
56 Bool_t ReadDummyTrailer();
57 void ReadBunch();
58 void ReadAmplitude();
59 Int_t GetPosition();
60
61 Int_t fDDLNumber; // index of current DDL number
62 Int_t fPrevDDLNumber;// index of current DDL number
63 Short_t fHWAddress; // current hardware address
64 Short_t fPrevHWAddress;// previous hardware address
65 Int_t fTime; // index of current time bin
66 Int_t fPrevTime; // index of previous time bin
67 Int_t fSignal; // signal in ADC counts
68 Int_t fTimeBunch; // total length of the current time bunch
69
70 AliRawReader* fRawReader; // object for reading the raw data
71
72
73 UChar_t* fData; // raw data
74
75 Int_t fPosition; // current (10 bit) position in fData
76 Int_t fCount; // counter of words to be read for current trailer
77 Int_t fBunchLength; // remaining number of signal bins in the current bunch
78
79 ClassDef(AliAltroRawStreamOld, 0) // base class for reading Altro raw digits
80};
81
82#endif