fix in calling of gaussian spread function
[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
d9ed1779 27 static UChar_t ReadBlockAttributes(AliRawReader* rawReader);
040d0012 28 static UInt_t ReadAMSamplFreqFromCDH(UChar_t cdhAttr){
29 if(cdhAttr&0x10) return 40;
30 else return 20;
31 }
d9ed1779 32 static AliITSRawStream* CreateRawStreamSDD(AliRawReader* rawReader, UChar_t attributes);
33 static AliITSRawStream* CreateRawStreamSDD(AliRawReader* rawReader);
34
2906f4c2 35 virtual Bool_t Next();
36
1ba0280f 37 virtual Int_t GetAnode() const {return fCoord1;}
38 virtual Int_t GetTime() const {return fCoord2;}
39 virtual Int_t GetChannel() const {return fChannel;}
6297cc01 40 virtual Int_t GetEightBitSignal() const {return fEightBitSignal;}
a97b3678 41 virtual Int_t GetCarlosId() const {return fCarlosId;}
979b5a5f 42 virtual Int_t GetEventId() const {return fEventId;}
e2662f55 43 virtual Int_t GetJitter() const {return fJitter;}
de075dae 44
5dfa68c5 45
6297cc01 46 virtual void SetDecompressAmbra(Bool_t deco=kTRUE){
47 fDecompressAmbra=deco;
48 }
720d923a 49 virtual void SetDDLModuleMap(AliITSDDLModuleMapSDD* ddlsdd){
50 if(!fDDLModuleMap) fDDLModuleMap=new AliITSDDLModuleMapSDD();
e2662f55 51 fDDLModuleMap->SetDDLMap(ddlsdd);
52 }
83ec5e27 53 virtual void SetZeroSuppLowThreshold(Int_t iMod, Int_t iSid, Int_t th)
54 {fLowThresholdArray[iMod][iSid]=th;}
979b5a5f 55 Int_t GetModuleNumber(UInt_t iDDL, UInt_t iModule) const {
720d923a 56 if(!fDDLModuleMap) return kSPDModules+1; // dummy module number if the DDL map is not set (case of DAs)
979b5a5f 57 return fDDLModuleMap->GetModuleNumber(iDDL,iModule);
58 }
a97b3678 59 virtual void Reset();
2906f4c2 60
83ec5e27 61 enum {kSDDModules = 260}; // number of SDD modules
62 enum {kSPDModules = 240}; // number of SPD modules (used as offset)
63 enum {kDDLsNumber = 24}; // number of DDLs in SDD
64 enum {kModulesPerDDL = 12}; // number of modules in each DDL
765a9f95 65 enum {kCarlosWords = 12}; // number of FIFOCARLOS Words
83ec5e27 66 enum {kFifoWords = 4}; // number of FIFO Words
765a9f95 67 enum ESDDRawStreamError {
39a7c5cc 68 kDataError = 1,
69 kDataFormatErr = 2
70 };
1ba0280f 71 protected:
83ec5e27 72 virtual Bool_t SkipHeaderWord();
1ba0280f 73 virtual UInt_t ReadBits();
74 virtual Int_t DecompAmbra(Int_t value) const;
2906f4c2 75
38300302 76 static const UInt_t fgkCodeLength[8]; //code length
2906f4c2 77
979b5a5f 78 AliITSDDLModuleMapSDD* fDDLModuleMap; // mapping DDL/module -> module number
2906f4c2 79 UInt_t fData; // data read for file
0cc008b8 80 Bool_t fResetSkip; // flag for end of DDL data
e2662f55 81
a97b3678 82 Int_t fEventId; // event ID from header
14dceddf 83 Int_t fCarlosId; // carlos ID
1ba0280f 84 Int_t fChannel; // current channel
85 Int_t fJitter; // jitter between L0 and pascal stop (x25ns)
a97b3678 86 ULong64_t fChannelData[kModulesPerDDL][2];// packed data for the 2 channels
87 UInt_t fLastBit[kModulesPerDDL][2]; // last filled bit in fChannelData
88 UInt_t fChannelCode[kModulesPerDDL][2];// current channel code
89 Bool_t fReadCode[kModulesPerDDL][2]; // next bits are code or data
90 UInt_t fReadBits[kModulesPerDDL][2]; // number of bits to read
83ec5e27 91 Int_t fLowThresholdArray[kSDDModules][2]; // array with low thresholds for all modules
e2662f55 92
14dceddf 93 Int_t fNfifo[kFifoWords]; // FIFO number
a97b3678 94 Int_t fTimeBin[kModulesPerDDL][2]; // current timebin [ncarlos][nchannels]
95 Int_t fAnode[kModulesPerDDL][2]; // current anode [ncarlos][nchannels]
14dceddf 96 UInt_t fICarlosWord[kCarlosWords]; // Carlos words
97 UInt_t fIFifoWord[kFifoWords]; // FIFO words
98 Int_t fICountFoot[kModulesPerDDL]; // counter for carlos footer words
6297cc01 99 Int_t fEightBitSignal; // signal at 8 bit
100 Bool_t fDecompressAmbra; //flag to switch off decompression
101
0cc008b8 102 ClassDef(AliITSRawStreamSDD, 14) // class for reading ITS SDD raw digits
2906f4c2 103};
104
105#endif