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