SDD raw data treatment: same format for real and simulated data
[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"
15
16class AliRawReader;
17
18
19class AliITSRawStreamSDD: public AliITSRawStream {
20 public :
21 AliITSRawStreamSDD(AliRawReader* rawReader);
22 virtual ~AliITSRawStreamSDD() {};
23
24 virtual Bool_t Next();
25
1ba0280f 26 virtual Int_t GetAnode() const {return fCoord1;}
27 virtual Int_t GetTime() const {return fCoord2;}
28 virtual Int_t GetChannel() const {return fChannel;}
a97b3678 29 virtual Int_t ReadJitter() const {return 0;}
30 virtual Int_t GetCarlosId() const {return fCarlosId;}
31 virtual void SetLowCarlosThreshold(Int_t th, Int_t i)
32 {fLowThreshold[i]=th;}
1ba0280f 33 static Int_t GetModuleNumber(UInt_t iDDL, UInt_t iModule)
34 {return fgkDDLModuleMap[iDDL][iModule];}
a97b3678 35 virtual void Reset();
2906f4c2 36
a97b3678 37 enum {kDDLsNumber = 24}; // number of DDLs in SDD
38 enum {kModulesPerDDL = 12}; // number of modules in each DDL
2906f4c2 39
1ba0280f 40
41 protected:
42 static const Int_t fgkDDLModuleMap[kDDLsNumber][kModulesPerDDL]; // mapping DDL/module -> module number
43
44 virtual UInt_t ReadBits();
45 virtual Int_t DecompAmbra(Int_t value) const;
2906f4c2 46
38300302 47 static const UInt_t fgkCodeLength[8]; //code length
2906f4c2 48
49 UInt_t fData; // data read for file
a97b3678 50 Int_t fSkip[kDDLsNumber];// number of skipped words
51 Int_t fCarlosId; // carlos ID
52 Int_t fEventId; // event ID from header
1ba0280f 53 Int_t fChannel; // current channel
54 Int_t fJitter; // jitter between L0 and pascal stop (x25ns)
a97b3678 55 ULong64_t fChannelData[kModulesPerDDL][2];// packed data for the 2 channels
56 UInt_t fLastBit[kModulesPerDDL][2]; // last filled bit in fChannelData
57 UInt_t fChannelCode[kModulesPerDDL][2];// current channel code
58 Bool_t fReadCode[kModulesPerDDL][2]; // next bits are code or data
59 UInt_t fReadBits[kModulesPerDDL][2]; // number of bits to read
1ba0280f 60 Int_t fLowThreshold[2]; // low Carlos threshold
a97b3678 61 Int_t fNCarlos; // number of Carlos
62 Int_t fNfifo0; // fifo n. 0
63 Int_t fNfifo1; // fifo n. 1
64 Int_t fNfifo2; // fifo n. 2
65 Int_t fNfifo3; // fifo n. 3
66 Int_t fTimeBin[kModulesPerDDL][2]; // current timebin [ncarlos][nchannels]
67 Int_t fAnode[kModulesPerDDL][2]; // current anode [ncarlos][nchannels]
68 Int_t fDDL; //current ddl number
69
70 ClassDef(AliITSRawStreamSDD, 2) // class for reading ITS SDD raw digits
2906f4c2 71};
72
73#endif