]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMDRawStream.h
New RAW I/O. I rolled my own, because I wasn't happy with the old
[u/mrichter/AliRoot.git] / FMD / AliFMDRawStream.h
CommitLineData
4347b38f 1#ifndef ALIFMDRAWSTREAM_H
2#define ALIFMDRAWSTREAM_H
0d0e6995 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
4 * reserved.
5 *
6 * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
7 *
8 * See cxx source for full Copyright notice
9 */
4347b38f 10#ifndef ALIALTRORAWSTREAM_H
11# include <AliAltroRawStream.h>
12#endif
13
14
15// TPC to FMD translations
16//
17// TPC FMD
18// ----------+-----------
19// pad+time | strip
20// row | sector
21// sector | ring
22//
23class AliFMDRawStream : public AliAltroRawStream
24{
4347b38f 25public:
e802be3e 26 AliFMDRawStream(AliRawReader* reader, UShort_t sampleRate=0);
088f8e79 27 virtual ~AliFMDRawStream() {}
4347b38f 28
29 Short_t Sector() const { return fRow; }
30 Char_t Ring() const { return (fSector == 0 ? 'I' : 'O'); }
31 Short_t Strip() const { return fPad + fTime / fSampleRate; }
e802be3e 32 Short_t Sample() const { return fTime % fSampleRate; }
4347b38f 33 Short_t PrevSector() const { return fPrevRow; }
34 Char_t PrevRing() const { return (fPrevSector == 0 ? 'I' : 'O'); }
35 Short_t PrevStrip() const { return fPrevPad + fPrevTime/fSampleRate; }
e802be3e 36
4347b38f 37 Bool_t IsNewRing() const { return (fSector != fPrevSector); }
38 Bool_t IsNewSector() const { return (fRow != fPrevRow) || IsNewRing(); }
39 Bool_t IsNewStrip() const { return(Strip() != PrevStrip())||IsNewSector();}
40
e802be3e 41 Short_t Count() const { return fSignal; }
42 Short_t SampleRate() const { return fSampleRate; }
4347b38f 43
1e8f773e 44 virtual Bool_t Next();
45 virtual Bool_t ReadChannel(UInt_t& addr, UInt_t& len, UShort_t* data);
46 virtual Bool_t DumpData();
47protected:
48 virtual Int_t ReadIntoBuffer();
49 virtual Int_t ReadTrailer(UInt_t& head, UInt_t& len);
50 virtual Int_t ReadFillWords(UInt_t len);
51 virtual Int_t ReadBunch(UShort_t* data);
52 virtual UShort_t Get10BitWord();
e802be3e 53
1e8f773e 54 UShort_t fSampleRate; // # of ALTRO samples per VA1_ALICE clock
55 Int_t fPrevTime; // Last time bin
56 Bool_t fExplicitSampleRate; // True if the sample rate was set externally
57 Int_t fPos;
58 Int_t fCur;
59 UChar_t* fRead;
4347b38f 60 ClassDef(AliFMDRawStream, 0) // Read raw FMD Altro data
61};
62
63#endif
0d0e6995 64//____________________________________________________________________
65//
66// Local Variables:
67// mode: C++
68// End:
69//
70// EOF
71//