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