AddAlignableVolumes: local to tracking CS transformation matrices creates for each
[u/mrichter/AliRoot.git] / ITS / AliITSRawStreamSPD.h
CommitLineData
2906f4c2 1#ifndef ALIITSRAWSTREAMSPD_H
2#define ALIITSRAWSTREAMSPD_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 SPD digits in raw data.
11///
12///////////////////////////////////////////////////////////////////////////////
13
14#include "AliITSRawStream.h"
15
16
17class AliITSRawStreamSPD: public AliITSRawStream {
18 public :
19 AliITSRawStreamSPD(AliRawReader* rawReader);
20 virtual ~AliITSRawStreamSPD() {};
21
22 virtual Bool_t Next();
c42b9ed0 23 virtual Bool_t ReadCalibHeader();
2906f4c2 24
c42b9ed0 25 // the 2 methods below are equivalent to AliITSRawStream::GetCoord1 and GetCoord2
26 // together with the AliITSRawStream::GetModuleID these are the "offline" coordinates
27 Int_t GetColumn() const {return fCoord1;};
28 Int_t GetRow() const {return fCoord2;};
29
30 // together with the AliRawReader::GetDDLID() these are the "online" coordinates
31 UShort_t GetHalfStaveNr() const {return fHalfStaveNr;}
32 UShort_t GetChipAddr() const {return fChipAddr;}
33 Int_t GetChipCol() const {return fCol;};
34 Int_t GetChipRow() const {return fRow;};
35
36 // module mapping, iModule = halfStaveNr*2+chipAddr/5
37 static Int_t GetModuleNumber(UInt_t iDDL, UInt_t iModule) {return fgkDDLModuleMap[iDDL][iModule];}
38
39 Bool_t GetHalfStavePresent(UInt_t hs);
40
41 // use the methods below to extract the information from the calibration header
42 UInt_t GetHrouterNr() const {return (fCalHeadWord[0] & 0x0000003f);}
43 Bool_t GetHhalfStaveScanned(UInt_t hs) const;
44 UInt_t GetHtype() const {return (Int_t)((fCalHeadWord[1]) & 0x000000ff);}
45 Bool_t GetHdataFormat() const {return (Bool_t)(((fCalHeadWord[1]) & 0x00000100)>>8);}
46 UInt_t GetHtriggers() const {return fCalHeadWord[2];}
47 Bool_t GetHchipPresent(UInt_t hs, UInt_t chip) const;
48 UInt_t GetHdacStart() const {return ((fCalHeadWord[5]>>24) & 0x000000ff);}
49 UInt_t GetHdacEnd() const {return ((fCalHeadWord[5]>>16) & 0x000000ff);}
50 UInt_t GetHdacStep() const {return ((fCalHeadWord[5]>>8) & 0x000000ff);}
51 UInt_t GetHdacId() const {return ((fCalHeadWord[5]) & 0x000000ff);}
52 UInt_t GetHrowStart() const {return (UInt_t) ((fCalHeadWord[6]>>24) & 0x000000ff);}
53 UInt_t GetHrowEnd() const {return (UInt_t) ((fCalHeadWord[6]>>16) & 0x000000ff);}
54 UInt_t GetHrowValue() const {return (UInt_t) ((fCalHeadWord[6]>> 8) & 0x000000ff);}
55 UInt_t GetHdacValue() const {return (Int_t) ((fCalHeadWord[6]) & 0x000000ff);}
56 UInt_t GetHdacHigh(UInt_t hs) const;
57 UInt_t GetHdacLow(UInt_t hs) const;
58 UInt_t GetHTPAmp(UInt_t hs) const;
2906f4c2 59
2906f4c2 60 enum {kDDLsNumber = 20}; // number of DDLs in SPD
61 enum {kModulesPerDDL = 12}; // number of modules in each DDL
c42b9ed0 62 enum {kCalHeadLenMax = 16}; // maximum number of calib header words
2906f4c2 63
64 private :
65 static const Int_t fgkDDLModuleMap[kDDLsNumber][kModulesPerDDL]; // mapping DDL/module -> module number
66
c42b9ed0 67 Bool_t ReadNextShort();
68 Bool_t ReadNextInt();
69 void NewEvent();
70
71 Int_t fEventNumber; // chip event counter
72 UShort_t fChipAddr; // chip nr
73 UShort_t fHalfStaveNr; // half stave nr
74 UInt_t fCol; // chip column nr
75 UInt_t fRow; // chip row nr
76 UInt_t fCalHeadWord[kCalHeadLenMax]; // calibration header words
2906f4c2 77
c42b9ed0 78 UShort_t fData; // 16 bit data word read
79 UInt_t fOffset; // offset for cell column
80 UInt_t fHitCount; // counter of hits
72600597 81 UChar_t fDataChar1, fDataChar2, fDataChar3, fDataChar4; // temps part of a 32bit word
c42b9ed0 82 Bool_t fFirstWord; // keeps track of which of the two 16bit words out of the 32bit word to read when ReadNextShort is called
83 Bool_t fCalHeadRead[20]; // calibration header read flags (reset at new event)
84 UInt_t fPrevEventId; // previous event id (needed to know if there is a new event)
72600597 85
2906f4c2 86 ClassDef(AliITSRawStreamSPD, 0) // class for reading ITS SPD raw digits
87};
88
89#endif