]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSRawStreamSDD.h
Adding the new histograms filled for each mirror
[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 #include "AliITSDDLModuleMapSDD.h"
16
17 class AliRawReader;
18
19
20 class AliITSRawStreamSDD: public AliITSRawStream {
21   public :
22     AliITSRawStreamSDD(AliRawReader* rawReader);
23     AliITSRawStreamSDD(const AliITSRawStreamSDD& rs);
24     AliITSRawStreamSDD& operator=(const AliITSRawStreamSDD& rs);
25     virtual ~AliITSRawStreamSDD();
26
27     virtual Bool_t   Next();
28
29     virtual Int_t    GetAnode() const {return fCoord1;}
30     virtual Int_t    GetTime() const {return fCoord2;}
31     virtual Int_t    GetChannel() const {return fChannel;}
32     virtual Int_t    GetEightBitSignal() const {return fEightBitSignal;}
33     virtual Int_t    ReadJitter() const {return 0;}
34     virtual Int_t    GetCarlosId() const {return fCarlosId;}
35     virtual Int_t    GetEventId() const {return fEventId;}
36
37     virtual void     SetDecompressAmbra(Bool_t deco=kTRUE){
38       fDecompressAmbra=deco;
39     }
40     virtual void SetDDLModuleMap(AliITSDDLModuleMapSDD* ddlsdd){
41       if(!fDDLModuleMap) fDDLModuleMap=new AliITSDDLModuleMapSDD();
42       fDDLModuleMap->SetDDLMap(ddlsdd);}
43     virtual void     SetLowCarlosThreshold(Int_t th, Int_t i)
44       {fLowThreshold[i]=th;}
45     virtual void     SetZeroSuppLowThreshold(Int_t iMod, Int_t iSid, Int_t th) 
46       {fLowThresholdArray[iMod][iSid]=th;}
47     Int_t   GetModuleNumber(UInt_t iDDL, UInt_t iModule) const {
48       if(!fDDLModuleMap) return kSPDModules+1; // dummy module number if the DDL map is not set (case of DAs)
49       return fDDLModuleMap->GetModuleNumber(iDDL,iModule);
50     }
51     virtual void     Reset(); 
52
53     enum {kSDDModules = 260};      // number of SDD modules
54     enum {kSPDModules = 240};      // number of SPD modules (used as offset)
55     enum {kDDLsNumber = 24};       // number of DDLs in SDD
56     enum {kModulesPerDDL = 12};    // number of modules in each DDL 
57     enum {kCarlosWords = 12};      // number of FIFOCARLOS Words
58     enum {kFifoWords =  4};        // number of FIFO Words
59     enum ESDDRawStreamError { 
60       kDataError = 1,
61       kDataFormatErr = 2
62     };
63   protected:
64     virtual Bool_t   SkipHeaderWord(); 
65     virtual UInt_t   ReadBits();
66     virtual Int_t    DecompAmbra(Int_t value) const;
67
68     static const UInt_t fgkCodeLength[8]; //code length
69
70     AliITSDDLModuleMapSDD* fDDLModuleMap; // mapping DDL/module -> module number 
71     UInt_t           fData;         // data read for file
72     Int_t            fSkip[kDDLsNumber];// obsolete -- needed to compile AliITSRawStreamSDDv2
73     Int_t            fEventId;      // event ID from header
74     Int_t            fCarlosId;     // carlos ID
75     Int_t            fChannel;      // current channel
76     Int_t            fJitter;          // jitter between L0 and pascal stop (x25ns)
77     ULong64_t        fChannelData[kModulesPerDDL][2];// packed data for the 2 channels
78     UInt_t           fLastBit[kModulesPerDDL][2];    // last filled bit in fChannelData
79     UInt_t           fChannelCode[kModulesPerDDL][2];// current channel code
80     Bool_t           fReadCode[kModulesPerDDL][2];   // next bits are code or data
81     UInt_t           fReadBits[kModulesPerDDL][2];   // number of bits to read
82     Int_t            fLowThresholdArray[kSDDModules][2]; // array with low thresholds for all modules
83     Int_t            fLowThreshold[2];    // obsolete -- needed to compile AliITSRawStreamSDDv2
84     Int_t            fNfifo[kFifoWords];  // FIFO number
85     Int_t            fTimeBin[kModulesPerDDL][2];  // current timebin [ncarlos][nchannels]
86     Int_t            fAnode[kModulesPerDDL][2]; // current anode [ncarlos][nchannels]
87     UInt_t           fICarlosWord[kCarlosWords]; // Carlos words
88     UInt_t           fIFifoWord[kFifoWords];     // FIFO words
89     Int_t            fICountFoot[kModulesPerDDL]; // counter for carlos footer words
90     Int_t            fEightBitSignal;    // signal at 8 bit
91     Bool_t           fDecompressAmbra; //flag to switch off decompression
92
93     ClassDef(AliITSRawStreamSDD, 13) // class for reading ITS SDD raw digits
94 };
95
96 #endif