]>
Commit | Line | Data |
---|---|---|
8309c1ab | 1 | #ifndef ALIZDCRAWSTREAM_H |
2 | #define ALIZDCRAWSTREAM_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 | ||
1ee299a5 | 8 | ////////////////////////////////////////////////// |
9 | // // | |
10 | // Class to provide access to ZDC raw data // | |
11 | // Author: Chiara Oppedisano // | |
12 | // // | |
13 | ////////////////////////////////////////////////// | |
8309c1ab | 14 | |
15 | #include <TObject.h> | |
16 | ||
17 | class AliRawReader; | |
1ee299a5 | 18 | class AliRawDataHeader; |
8309c1ab | 19 | |
20 | ||
21 | class AliZDCRawStream: public TObject { | |
22 | public : | |
cc2abffd | 23 | AliZDCRawStream(AliRawReader* rawReader); |
8309c1ab | 24 | virtual ~AliZDCRawStream(); |
8309c1ab | 25 | virtual Bool_t Next(); |
c93c022b | 26 | |
27 | virtual void ReadChMap(); | |
8309c1ab | 28 | |
1ee299a5 | 29 | virtual void ReadCDHHeader(); |
e42bdf10 | 30 | virtual void DecodeScaler(); |
8309c1ab | 31 | |
c93c022b | 32 | UInt_t GetRawBuffer() const {return fBuffer;} |
1ee299a5 | 33 | |
c93c022b | 34 | Int_t GetDeadfaceOffset() const {return fDeadfaceOffset;} |
35 | Int_t GetDeadbeefOffset() const {return fDeadbeefOffset;} | |
36 | Int_t GetDataOffset() const {return fDataOffset;} | |
37 | ||
38 | Int_t GetSector(Int_t i) const {return fSector[i];} | |
39 | Int_t GetModType() const {return fModType;} | |
40 | Int_t GetADCModule() const {return fADCModule;} | |
41 | Int_t GetADCNChannels() const {return fADCNChannels;} | |
42 | Int_t GetADCChannel() const {return fADCChannel;} | |
43 | Int_t GetADCValue() const {return fADCValue;} | |
44 | Int_t GetADCGain() const {return fADCGain;} | |
45 | ||
46 | Int_t GetCabledSignal() const {return fCabledSignal;} | |
47 | Int_t GetADCModFromMap(Int_t i) const {return fMapADC[i][0];} | |
48 | Int_t GetADCChFromMap(Int_t i) const {return fMapADC[i][1];} | |
49 | Int_t GetADCSignFromMap(Int_t i) const {return fMapADC[i][2];} | |
50 | Int_t GetDetectorFromMap(Int_t i) const {return fMapADC[i][3];} | |
51 | Int_t GetTowerFromMap(Int_t i) const {return fMapADC[i][4];} | |
52 | ||
53 | Bool_t IsDARCHeader() const {return fIsDARCHeader;} | |
54 | Bool_t IsChMapping() const {return fIsChMapping;} | |
55 | Bool_t IsADCDataWord() const {return fIsADCDataWord;} | |
56 | Bool_t IsADCHeader() const {return fIsADCHeader;} | |
57 | Bool_t IsADCEOB() const {return fIsADCEOB;} | |
e42bdf10 | 58 | |
59 | UInt_t GetScNWords() const {return fScNWords;} | |
60 | UInt_t GetScGeo() const {return fScGeo;} | |
61 | UInt_t GetScTS() const {return fScTS;} | |
62 | UInt_t GetTriggerNumber() const {return fScTriggerNumber;} | |
1ee299a5 | 63 | |
64 | void SetSector(Int_t i, Int_t val) {fSector[i] = val;} | |
65 | void SetMapADCMod(Int_t iraw, Int_t imod) {fMapADC[iraw][0]=imod;} | |
66 | void SetMapADCCh(Int_t iraw, Int_t ich) {fMapADC[iraw][1]=ich;} | |
67 | void SetMapADCSig(Int_t iraw, Int_t isig) {fMapADC[iraw][2]=isig;} | |
c93c022b | 68 | void SetMapDet(Int_t iraw, Int_t idet) {fMapADC[iraw][3]=idet;} |
69 | void SetMapTow(Int_t iraw, Int_t itow) {fMapADC[iraw][4]=itow;} | |
1ee299a5 | 70 | |
71 | enum EZDCRawStreamError{ | |
72 | kCDHError = 1, | |
73 | kDARCError = 2, | |
74 | kZDCDataError = 3, | |
c93c022b | 75 | kInvalidADCModule = 4}; |
1ee299a5 | 76 | |
77 | enum ZDCSignal{kNotConnected=0, kVoid=1, | |
78 | kZNAC=2, kZNA1=3, kZNA2=4, kZNA3=5, kZNA4=6, | |
79 | kZPAC=7, kZPA1=8, kZPA2=9, kZPA3=10, kZPA4=11, | |
80 | kZNCC=12, kZNC1=13, kZNC2=14, kZNC3=15, kZNC4=16, | |
81 | kZPCC=17, kZPC1=18, kZPC2=19, kZPC3=20, kZPC4=21, | |
82 | kZEM1=22, kZEM2=23, | |
83 | kZDCAMon=24, kZDCCMon=25, | |
84 | kZNACoot=26, kZNA1oot=27, kZNA2oot=28, kZNA3oot=29, kZNA4oot=30, | |
85 | kZPACoot=31, kZPA1oot=32, kZPA2oot=33, kZPA3oot=34, kZPA4oot=35, | |
86 | kZNCCoot=36, kZNC1oot=37, kZNC2oot=38, kZNC3oot=39, kZNC4oot=40, | |
87 | kZPCCoot=41, kZPC1oot=42, kZPC2oot=43, kZPC3oot=44, kZPC4oot=45, | |
88 | kZEM1oot=46, kZEM2oot=47, | |
89 | kZDCAMonoot=48, kZDCCMonoot=49}; | |
90 | ||
8309c1ab | 91 | private : |
92 | AliZDCRawStream(const AliZDCRawStream& stream); | |
93 | AliZDCRawStream& operator = (const AliZDCRawStream& stream); | |
94 | ||
1ee299a5 | 95 | AliRawReader* fRawReader; // object for reading the raw data |
8309c1ab | 96 | |
1ee299a5 | 97 | UInt_t fBuffer; // DARC header + ADC buffer |
98 | UInt_t fEvType; // Event type | |
99 | Int_t fPosition; // bit position in buffer data word | |
100 | ||
101 | Bool_t fIsCalib; // True when calibration run | |
102 | Bool_t fIsDARCHeader; // True when DARC header | |
103 | Bool_t fIsChMapping; // True when reading ch. mapping | |
104 | Bool_t fIsADCDataWord; // True when data word | |
105 | Bool_t fIsADCHeader; // True when ADC header | |
106 | Bool_t fIsADCEOB; // True when EOB | |
107 | ||
108 | // From CDH | |
109 | UInt_t fDARCEvBlockLenght; // DARC block length | |
110 | UInt_t fDARCBlockAttributes;// DARC block attributes | |
8309c1ab | 111 | |
1ee299a5 | 112 | Int_t fDeadfaceOffset; // deadface offset |
113 | Int_t fDeadbeefOffset; // deadbeef offset | |
114 | Int_t fDataOffset; // data offset | |
115 | ||
116 | // ADC signal | |
117 | Int_t fSector[2]; // [detector, sector] | |
118 | Int_t fModType; // Module type | |
119 | Int_t fADCModule; // ADC module | |
120 | Int_t fADCNChannels; // number of ADC ch. | |
121 | Int_t fADCChannel; // ADC channel | |
122 | Int_t fADCValue; // ADC channel | |
123 | Int_t fADCGain; // ADC gain (0=high range; 1=low range) | |
124 | ||
e42bdf10 | 125 | // Scaler |
126 | UInt_t fScNWords; // no. of words in scaler event | |
127 | UInt_t fScGeo; // scaler GEO address | |
128 | UInt_t fScTS; // ?!? | |
129 | UInt_t fScTriggerNumber; // no. of triggers | |
130 | Bool_t fIsScEventGood; // true if scaler event is good | |
131 | ||
1ee299a5 | 132 | // Channel mapping |
133 | Int_t fNConnCh; // current mapped ch. | |
134 | Int_t fCabledSignal; // physics signal (from enum) | |
c93c022b | 135 | Int_t fMapADC[48][5]; // ADC map for the current run |
1ee299a5 | 136 | |
e42bdf10 | 137 | ClassDef(AliZDCRawStream, 6) // class for reading ZDC raw digits |
8309c1ab | 138 | }; |
139 | ||
140 | #endif |