7765ca40 |
1 | #ifndef ALIITSRAWSTREAMSDDCOMPRESSED_H |
2 | #define ALIITSRAWSTREAMSDDCOMPRESSED_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 | // Class to decode compressed SDD Raw Data format // |
11 | // Origin: F.Prino, Torino, prino@to.infn.it // |
12 | // // |
13 | /////////////////////////////////////////////////////////////////// |
14 | |
15 | #include "AliITSRawStream.h" |
16 | #include "AliITSDDLModuleMapSDD.h" |
17 | |
18 | class AliRawReader; |
19 | |
20 | |
21 | class AliITSRawStreamSDDCompressed: public AliITSRawStream { |
22 | public : |
23 | AliITSRawStreamSDDCompressed(AliRawReader* rawReader); |
24 | AliITSRawStreamSDDCompressed(const AliITSRawStreamSDDCompressed& rs); |
25 | AliITSRawStreamSDDCompressed& operator=(const AliITSRawStreamSDDCompressed& rs); |
26 | virtual ~AliITSRawStreamSDDCompressed(); |
27 | |
28 | virtual Bool_t Next(); |
29 | |
30 | virtual Int_t GetAnode() const {return fCoord1;} |
31 | virtual Int_t GetTime() const {return fCoord2;} |
32 | virtual Int_t GetChannel() const {return fChannel;} |
e2662f55 |
33 | virtual Int_t GetJitter() const {return fJitter;} |
7765ca40 |
34 | virtual Int_t GetCarlosId() const {return fCarlosId;} |
80510bc2 |
35 | virtual UInt_t GetDataWord() const {return fData;} |
7765ca40 |
36 | |
294a1728 |
37 | virtual void SetADCEncoded(Bool_t fl=kTRUE){ |
38 | fADCEncoded=fl; |
39 | } |
720d923a |
40 | virtual void SetDDLModuleMap(AliITSDDLModuleMapSDD* ddlsdd){ |
41 | if(!fDDLModuleMap) fDDLModuleMap=new AliITSDDLModuleMapSDD(); |
42 | fDDLModuleMap->SetDDLMap(ddlsdd); |
43 | } |
7765ca40 |
44 | virtual void SetZeroSuppLowThreshold(Int_t iMod, Int_t iSid, Int_t th) |
45 | {fLowThresholdArray[iMod][iSid]=th;} |
46 | Int_t GetModuleNumber(UInt_t iDDL, UInt_t iModule) const { |
720d923a |
47 | if(!fDDLModuleMap) return kSPDModules+1; // dummy module number if the DDL map is not set (case of DAs) |
7765ca40 |
48 | return fDDLModuleMap->GetModuleNumber(iDDL,iModule); |
49 | } |
50 | |
51 | enum {kSDDModules = 260}; // number of SDD modules |
52 | enum {kSPDModules = 240}; // number of SPD modules (used as offset) |
53 | enum {kDDLsNumber = 24}; // number of DDLs in SDD |
54 | enum {kModulesPerDDL = 12}; // number of modules in each DDL |
55 | enum {kCarlosWords = 12}; // number of FIFOCARLOS Words |
56 | enum {kFifoWords = 4}; // number of FIFO Words |
57 | enum ESDDRawStreamError { |
58 | kDataError = 1, |
59 | kDataFormatErr = 2 |
60 | }; |
61 | protected: |
62 | |
6297cc01 |
63 | virtual Int_t DecompAmbra(Int_t value) const; |
7765ca40 |
64 | AliITSDDLModuleMapSDD* fDDLModuleMap; // mapping DDL/module -> module number |
65 | UInt_t fData; // data read for file |
66 | Int_t fCarlosId; // carlos ID |
67 | Int_t fChannel; // current channel |
68 | Int_t fJitter; // jitter between L0 and pascal stop (x25ns) |
69 | Int_t fLowThresholdArray[kSDDModules][2]; // array with low thresholds for all modules |
70 | |
294a1728 |
71 | Int_t fDDL; // current ddl number |
72 | Bool_t fADCEncoded; // flag for data format |
73 | // kTRUE -> ADC encoded in 5+3 bits |
74 | // kFALSE -> ADC decoded (8 bits) |
7765ca40 |
75 | |
294a1728 |
76 | ClassDef(AliITSRawStreamSDDCompressed, 2) // class for reading ITS SDD raw digits |
7765ca40 |
77 | }; |
78 | |
79 | #endif |