]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSRawStreamSDD.h
Fix problem in simulated raw data + code cleanup (F.Prino)
[u/mrichter/AliRoot.git] / ITS / AliITSRawStreamSDD.h
1 #ifndef ALIITSRAWSTREAMSDD_H
2 #define ALIITSRAWSTREAMSDD_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 class provides access to ITS SDD digits in raw data 
11 /// (default=simulated data).
12 ///////////////////////////////////////////////////////////////////////////////
13
14 #include "AliITSRawStream.h"
15
16 class AliRawReader;
17
18
19 class AliITSRawStreamSDD: public AliITSRawStream {
20   public :
21     AliITSRawStreamSDD(AliRawReader* rawReader);
22     virtual ~AliITSRawStreamSDD() {};
23
24     virtual Bool_t   Next();
25
26     virtual Int_t    GetAnode() const {return fCoord1;}
27     virtual Int_t    GetTime() const {return fCoord2;}
28     virtual Int_t    GetChannel() const {return fChannel;}
29     virtual Int_t    ReadJitter() const {return 0;}
30     virtual Int_t    GetCarlosId() const {return fCarlosId;}
31
32     virtual void     SetLowCarlosThreshold(Int_t th, Int_t i) 
33       {fLowThreshold[i]=th;}
34     virtual void     SetNCarlos(Int_t nC=12){fNCarlos=nC;}
35     static  Int_t    GetModuleNumber(UInt_t iDDL, UInt_t iModule)
36                      {return fgkDDLModuleMap[iDDL][iModule];}
37     virtual void     Reset(); 
38     virtual Bool_t   ResetSkip(Int_t ddln); 
39
40     enum {kDDLsNumber = 24};      // number of DDLs in SDD
41     enum {kModulesPerDDL = 12};   // number of modules in each DDL 
42     enum {kCarlosWords = 12};      // number of FIFOCARLOS Words
43     enum {kFifoWords =  4};      // number of FIFO Words
44     enum ESDDRawStreamError { 
45       kDataError = 1,
46       kDataFormatErr = 2
47     };
48   protected:
49     static const Int_t fgkDDLModuleMap[kDDLsNumber][kModulesPerDDL]; //  mapping DDL/module -> module number
50
51     virtual UInt_t   ReadBits();
52     virtual Int_t    DecompAmbra(Int_t value) const;
53
54     static const UInt_t fgkCodeLength[8]; //code length
55
56     UInt_t           fData;         // data read for file
57     Int_t            fSkip[kDDLsNumber];// number of skipped words
58     Int_t            fCarlosId;     // carlos ID
59     Int_t            fEventId;      // event ID from header
60     Int_t            fChannel;      // current channel
61     Int_t            fJitter;          // jitter between L0 and pascal stop (x25ns)
62     ULong64_t        fChannelData[kModulesPerDDL][2];// packed data for the 2 channels
63     UInt_t           fLastBit[kModulesPerDDL][2];    // last filled bit in fChannelData
64     UInt_t           fChannelCode[kModulesPerDDL][2];// current channel code
65     Bool_t           fReadCode[kModulesPerDDL][2];   // next bits are code or data
66     UInt_t           fReadBits[kModulesPerDDL][2];   // number of bits to read
67     Int_t            fLowThreshold[2]; // low Carlos threshold
68     Int_t            fNCarlos;         // number of Carlos 
69     Int_t            fNfifo[kFifoWords];
70     Int_t            fTimeBin[kModulesPerDDL][2];  // current timebin [ncarlos][nchannels]
71     Int_t            fAnode[kModulesPerDDL][2]; // current anode [ncarlos][nchannels]
72     Int_t            fDDL;        //current ddl number
73     UInt_t           fICarlosWord[kCarlosWords];
74     UInt_t           fIFifoWord[kFifoWords];
75     Int_t            fICountFoot[kModulesPerDDL];
76     Int_t            fEndWords;//number of 3f1f1f1f
77     Int_t            fResetSkip; //if it is 0, the ResetSkip Funcion is called
78     ClassDef(AliITSRawStreamSDD, 7) // class for reading ITS SDD raw digits
79 };
80
81 #endif