Line data Source code
1 : #ifndef ALIADCALIBDATA_H
2 : #define ALIADCALIBDATA_H
3 :
4 : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 : * See cxx source for full Copyright notice */
6 :
7 : #include "TNamed.h"
8 : #include "AliADConst.h"
9 :
10 : class AliADDataDCS;
11 :
12 :
13 : class AliADCalibData: public TNamed {
14 :
15 : public:
16 : AliADCalibData();
17 : AliADCalibData(const char* name);
18 :
19 : AliADCalibData(const AliADCalibData &calibda);
20 : AliADCalibData& operator= (const AliADCalibData &calibda);
21 : virtual ~AliADCalibData();
22 : void Reset();
23 : void PrintConfig();
24 : void PrintConfigShuttle();
25 : void FillDCSData(AliADDataDCS * data);
26 :
27 0 : Float_t GetPedestal(Int_t channel) const {return fPedestal[channel];}
28 0 : Float_t* GetPedestal() const {return (float*)fPedestal;}
29 0 : Float_t GetSigma(Int_t channel) const {return fSigma[channel];}
30 0 : Float_t* GetSigma() const {return (float*)fSigma;}
31 0 : Float_t GetADCmean(Int_t channel) const {return fADCmean[channel];}
32 0 : Float_t* GetADCmean() const {return (float*)fADCmean;}
33 0 : Float_t GetADCsigma(Int_t channel) const {return fADCsigma[channel];}
34 0 : Float_t* GetADCsigma() const {return (float*)fADCsigma;}
35 0 : Float_t GetMeanHV(Int_t channel) const {return fMeanHV[channel];}
36 0 : Float_t* GetMeanHV() const {return (float*)fMeanHV;}
37 0 : Float_t GetWidthHV(Int_t channel) const {return fWidthHV[channel];}
38 0 : Float_t* GetWidthHV() const {return (float*)fWidthHV;}
39 0 : Bool_t IsChannelDead(Int_t channel) const {return fDeadChannel[channel];}
40 0 : Bool_t* GetDeadMap() const {return (bool*)fDeadChannel;}
41 :
42 : Float_t GetGain(Int_t channel);
43 : Float_t GetADCperMIP(Int_t channel);
44 0 : Float_t GetTimeOffset(Int_t channel) const {return fTimeOffset[channel];}
45 0 : Float_t* GetTimeOffset() const {return (float*)fTimeOffset;}
46 0 : Float_t GetTimeGain(Int_t channel) const {return fTimeGain[channel];}
47 0 : Float_t* GetTimeGain() const {return (float*)fTimeGain;}
48 :
49 0 : Float_t* GetTimeResolution() const {return (Float_t*) fTimeResolution;};
50 0 : Float_t GetTimeResolution(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fTimeResolution[board]:0);};
51 :
52 0 : Float_t* GetWidthResolution() const {return (Float_t*) fWidthResolution;};
53 0 : Float_t GetWidthResolution(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fWidthResolution[board]:0);};
54 :
55 0 : const UInt_t* GetMatchWindow() const { return fMatchWindow; }
56 0 : UInt_t GetMatchWindow(Int_t board) const { return ((board>=0 && board<kNCIUBoards)?fMatchWindow[board]:0); }
57 0 : const UInt_t* GetSearchWindow() const { return fSearchWindow; }
58 0 : UInt_t GetSearchWindow(Int_t board) const { return ((board>=0 && board<kNCIUBoards)?fSearchWindow[board]:0); }
59 0 : const UInt_t* GetTriggerCountOffset() const { return fTriggerCountOffset; }
60 0 : UInt_t GetTriggerCountOffset(Int_t board) const { return ((board>=0 && board<kNCIUBoards)?fTriggerCountOffset[board]:0); }
61 0 : const UInt_t* GetRollOver() const { return fRollOver; }
62 0 : UInt_t GetRollOver(Int_t board) const { return ((board>=0 && board<kNCIUBoards)?fRollOver[board]:0); }
63 :
64 0 : Float_t GetDiscriThr(Int_t channel) const {return fDiscriThr[channel];}
65 0 : Float_t* GetDiscriThr() const {return (Float_t*)fDiscriThr;}
66 : Float_t GetCalibDiscriThr(Int_t channel);
67 :
68 0 : UShort_t * GetClk1Win1() const {return (UShort_t*)fClk1Win1;};
69 0 : UShort_t GetClk1Win1(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fClk1Win1[board]:0);};
70 0 : UShort_t * GetClk2Win1() const {return (UShort_t*)fClk2Win1;};
71 0 : UShort_t GetClk2Win1(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fClk2Win1[board]:0);};
72 :
73 0 : UShort_t * GetClk1Win2() const {return (UShort_t*)fClk1Win2;};
74 0 : UShort_t GetClk1Win2(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fClk1Win2[board]:0);};
75 0 : UShort_t * GetClk2Win2() const {return (UShort_t*)fClk2Win2;};
76 0 : UShort_t GetClk2Win2(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fClk2Win2[board]:0);};
77 :
78 0 : UShort_t * GetDelayClk1Win1() const {return (UShort_t*)fDelayClk1Win1;};
79 0 : UShort_t GetDelayClk1Win1(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fDelayClk1Win1[board]:0);};
80 0 : UShort_t * GetDelayClk2Win1() const {return (UShort_t*)fDelayClk2Win1;};
81 0 : UShort_t GetDelayClk2Win1(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fDelayClk2Win1[board]:0);};
82 :
83 0 : UShort_t * GetDelayClk1Win2() const {return (UShort_t*)fDelayClk1Win2;};
84 0 : UShort_t GetDelayClk1Win2(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fDelayClk1Win2[board]:0);};
85 0 : UShort_t * GetDelayClk2Win2() const {return (UShort_t*)fDelayClk2Win2;};
86 0 : UShort_t GetDelayClk2Win2(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fDelayClk2Win2[board]:0);};
87 :
88 0 : UShort_t * GetLatchWin1() const {return (UShort_t*)fLatchWin1;};
89 0 : UShort_t GetLatchWin1(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fLatchWin1[board]:0);};
90 0 : UShort_t * GetLatchWin2() const {return (UShort_t*)fLatchWin2;};
91 0 : UShort_t GetLatchWin2(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fLatchWin2[board]:0);};
92 :
93 0 : UShort_t * GetResetWin1() const {return (UShort_t*)fResetWin1;};
94 0 : UShort_t GetResetWin1(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fResetWin1[board]:0);};
95 0 : UShort_t * GetResetWin2() const {return (UShort_t*)fResetWin2;};
96 0 : UShort_t GetResetWin2(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fResetWin2[board]:0);};
97 :
98 0 : Bool_t * GetPedestalSubtraction() const {return (Bool_t*) fPedestalSubtraction;};
99 0 : Bool_t GetPedestalSubtraction(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fPedestalSubtraction[board]:0);};
100 :
101 0 : UShort_t GetBBAThreshold() const {return fBBAThreshold;};
102 0 : UShort_t GetBBCThreshold() const {return fBBCThreshold;};
103 :
104 0 : UShort_t GetBGAThreshold() const {return fBGAThreshold;};
105 0 : UShort_t GetBGCThreshold() const {return fBGCThreshold;};
106 :
107 0 : UShort_t GetBBAForBGThreshold() const {return fBBAForBGThreshold;};
108 0 : UShort_t GetBBCForBGThreshold() const {return fBBCForBGThreshold;};
109 :
110 0 : UShort_t GetMultADAThrLow() const {return fMultADAThrLow;};
111 0 : UShort_t GetMultADAThrHigh() const {return fMultADAThrHigh;};
112 :
113 0 : UShort_t GetMultADCThrLow() const {return fMultADCThrLow;};
114 0 : UShort_t GetMultADCThrHigh() const {return fMultADCThrHigh;};
115 :
116 0 : UShort_t GetTriggerSelected(Int_t output) const {return ((output>=0 && output<5)?fTriggerSelected[output]:0);};
117 :
118 : Bool_t GetEnableCharge(Int_t channel) const;
119 : Bool_t GetEnableTiming(Int_t channel) const;
120 : UShort_t GetOnlinePedestal(Int_t integrator, Int_t channel) const;
121 : UShort_t GetOnlinePedestalCut(Int_t integrator, Int_t channel) const;
122 :
123 :
124 : static Int_t GetBoardNumber(Int_t channel);
125 : static Int_t GetFEEChannelNumber(Int_t channel);
126 : static Int_t GetOfflineChannelNumber(Int_t board, Int_t channel);
127 :
128 : Float_t GetLightYields(Int_t channel);
129 :
130 0 : Float_t *GetPMGainsA() const { return fPMGainsA; }
131 0 : Float_t *GetPMGainsB() const { return fPMGainsB; }
132 :
133 0 : void SetPedestal(Float_t val, Int_t channel) {fPedestal[channel]=val;}
134 : void SetPedestal(const Float_t* Pedestal);
135 0 : void SetSigma(Float_t val, Int_t channel) {fSigma[channel]=val;}
136 : void SetSigma(const Float_t* Sigma);
137 0 : void SetADCmean(Float_t val, Int_t channel) {fADCmean[channel]=val;}
138 : void SetADCmean(const Float_t* ADCmean);
139 0 : void SetADCsigma(Float_t val, Int_t channel) {fADCsigma[channel]=val;}
140 : void SetADCsigma(const Float_t* ADCsigma);
141 0 : void SetMeanHV(Float_t val, Int_t channel) {fMeanHV[channel]=val;}
142 : void SetMeanHV(const Float_t* MeanHV);
143 0 : void SetWidthHV(Float_t val, Int_t channel) {fWidthHV[channel]=val;}
144 : void SetWidthHV(const Float_t* WidthHV);
145 0 : void SetDeadChannel(Bool_t val, Int_t channel) {fDeadChannel[channel]=val;}
146 : void SetDeadMap(const Bool_t* deadMap);
147 :
148 : void SetTimeOffset(Float_t val, Int_t board, Int_t channel);
149 : void SetTimeOffset(const Float_t* TimeOffset);
150 0 : void SetTimeGain(Float_t val, Int_t channel) {fTimeGain[channel]=val;}
151 : void SetTimeGain(const Float_t* TimeGain);
152 :
153 : void SetParameter(TString name, Int_t val);
154 : void SetTimeResolution(UShort_t *resols);
155 : void SetTimeResolution(UShort_t resol, Int_t board);
156 : void SetWidthResolution(UShort_t *resols);
157 : void SetWidthResolution(UShort_t resol, Int_t board);
158 :
159 : void SetMatchWindow(UInt_t *windows);
160 : void SetMatchWindow(UInt_t window, Int_t board);
161 : void SetSearchWindow(UInt_t *windows);
162 : void SetSearchWindow(UInt_t window, Int_t board);
163 : void SetTriggerCountOffset(UInt_t *offsets);
164 : void SetTriggerCountOffset(UInt_t offset, Int_t board);
165 : void SetRollOver(UInt_t *offsets);
166 : void SetRollOver(UInt_t offset, Int_t board);
167 :
168 : void SetDiscriThr(Float_t thr, Int_t board, Int_t channel);
169 : void SetDiscriThr(const Float_t* thresholds);
170 :
171 : void SetADCperMIP(Int_t nADCperMIP);
172 :
173 : void SetClk1Win1(UShort_t* clks);
174 : void SetClk1Win1(UShort_t clk, Int_t board);
175 : void SetClk2Win1(UShort_t* clks);
176 : void SetClk2Win1(UShort_t clk, Int_t board);
177 :
178 : void SetClk1Win2(UShort_t* clks);
179 : void SetClk1Win2(UShort_t clk, Int_t board);
180 : void SetClk2Win2(UShort_t* clks);
181 : void SetClk2Win2(UShort_t clk, Int_t board);
182 :
183 : void SetDelayClk1Win1(UShort_t* delays);
184 : void SetDelayClk1Win1(UShort_t delay, Int_t board);
185 : void SetDelayClk2Win1(UShort_t* delays);
186 : void SetDelayClk2Win1(UShort_t delay, Int_t board);
187 :
188 : void SetDelayClk1Win2(UShort_t* delays);
189 : void SetDelayClk1Win2(UShort_t delay, Int_t board);
190 : void SetDelayClk2Win2(UShort_t* delays);
191 : void SetDelayClk2Win2(UShort_t delay, Int_t board);
192 :
193 : void SetLatchWin1(UShort_t *latchs);
194 : void SetLatchWin1(UShort_t latch, Int_t board);
195 : void SetLatchWin2(UShort_t *latchs);
196 : void SetLatchWin2(UShort_t latch, Int_t board);
197 :
198 : void SetResetWin1(UShort_t *resets);
199 : void SetResetWin1(UShort_t reset, Int_t board);
200 : void SetResetWin2(UShort_t *resets);
201 : void SetResetWin2(UShort_t reset, Int_t board);
202 :
203 : void SetPedestalSubtraction(Bool_t *peds);
204 : void SetPedestalSubtraction(Bool_t ped, Int_t board);
205 :
206 0 : void SetBBAThreshold(UShort_t th) {fBBAThreshold = th;};
207 0 : void SetBBCThreshold(UShort_t th) {fBBCThreshold = th;};
208 :
209 0 : void SetBGAThreshold(UShort_t th) {fBGAThreshold = th;};
210 0 : void SetBGCThreshold(UShort_t th) {fBGCThreshold = th;};
211 :
212 0 : void SetBBAForBGThreshold(UShort_t th) {fBBAForBGThreshold = th;};
213 0 : void SetBBCForBGThreshold(UShort_t th) {fBBCForBGThreshold = th;};
214 :
215 :
216 0 : void SetMultADAThrLow(UShort_t th) {fMultADAThrLow = th;};
217 0 : void SetMultADAThrHigh(UShort_t th) {fMultADAThrHigh = th;};
218 :
219 0 : void SetMultADCThrLow(UShort_t th) {fMultADCThrLow = th;};
220 0 : void SetMultADCThrHigh(UShort_t th) {fMultADCThrHigh = th;};
221 :
222 : void SetTriggerSelected(UShort_t trigger, Int_t output);
223 :
224 : void SetEnableCharge(Bool_t val, Int_t board, Int_t channel);
225 : void SetEnableTiming(Bool_t val, Int_t board, Int_t channel);
226 : void SetEnableCharge(Bool_t val, Int_t channel);
227 : void SetEnableTiming(Bool_t val, Int_t channel);
228 : void SetOnlinePedestal(UShort_t val, Int_t integrator, Int_t board, Int_t channel);
229 : void SetOnlinePedestalCut(UShort_t val, Int_t integrator, Int_t board, Int_t channel);
230 : void SetOnlinePedestal(UShort_t val, Int_t integrator, Int_t channel);
231 : void SetOnlinePedestalCut(UShort_t val, Int_t integrator, Int_t channel);
232 :
233 : protected:
234 : void InitLightYields();
235 : void InitPMGains();
236 : void InitCalibThresholds();
237 : Bool_t IsClkValid(UShort_t clock) const;
238 :
239 : Float_t fPedestal[32]; // Mean pedestal values - used offline
240 : Float_t fSigma[32]; // Sigmas of pedestal peaks - used offline
241 : Float_t fADCmean[32]; // ADC mean values
242 : Float_t fADCsigma[32]; // ADC sigma values
243 : Float_t fMeanHV[16]; // Mean PMT HV needed to compute MIP value
244 : Float_t fWidthHV[16]; // Width of the PMT HV
245 :
246 : Float_t fTimeOffset[16]; // Time offsets of the TDC
247 : Float_t fTimeGain[16]; // Gain factors of the TDC
248 : Bool_t fDeadChannel[16]; // List of dead channels
249 : Float_t fTimeResolution[kNCIUBoards]; // Time Resolution of the TDC (ns / channel)
250 : Float_t fWidthResolution[kNCIUBoards]; // Time Width Resolution of the TDC (ns / channel)
251 :
252 : UInt_t fMatchWindow[kNCIUBoards]; // HPTDC matching window (25ns units)
253 : UInt_t fSearchWindow[kNCIUBoards];// HPTDC search window (25ns units)
254 : UInt_t fTriggerCountOffset[kNCIUBoards]; // HPTDC trigger count offset (25ns units)
255 : UInt_t fRollOver[kNCIUBoards]; // HPTDC roll-over (25ns units)
256 :
257 : UShort_t fClk1Win1[kNCIUBoards]; //Profil of the Clock 1 of the Window 1 (BB window)
258 : UShort_t fClk2Win1[kNCIUBoards]; //Profil of the Clock 2 of the Window 1 (BB window)
259 : UShort_t fClk1Win2[kNCIUBoards]; //Profil of the Clock 1 of the Window 2 (BG window)
260 : UShort_t fClk2Win2[kNCIUBoards]; //Profil of the Clock 2 of the Window 2 (BG window)
261 : UShort_t fDelayClk1Win1[kNCIUBoards]; // Delays of the Clock 1 of the Window 1 (BB window)
262 : UShort_t fDelayClk2Win1[kNCIUBoards]; // Delays of the Clock 2 of the Window 1 (BB window)
263 : UShort_t fDelayClk1Win2[kNCIUBoards]; // Delays of the Clock 1 of the Window 2 (BG window)
264 : UShort_t fDelayClk2Win2[kNCIUBoards]; // Delays of the Clock 2 of the Window 2 (BG window)
265 : UShort_t fLatchWin1[kNCIUBoards]; //Profil of the Clock of the Latch signal of Window 1 (BB window)
266 : UShort_t fLatchWin2[kNCIUBoards]; //Profil of the Clock of the Latch signal of Window 2 (BG window)
267 : UShort_t fResetWin1[kNCIUBoards]; //Profil of the Clock of the Reset signal of Window 1 (BB window)
268 : UShort_t fResetWin2[kNCIUBoards]; //Profil of the Clock of the Reset signal of Window 2 (BG window)
269 : Bool_t fPedestalSubtraction[kNCIUBoards]; // Flag to en(dis)able pedestal subtraction before centrality trigger calculation
270 : UShort_t fBBAThreshold; // Minimum bias Threshold in number of channel hit for ADA
271 : UShort_t fBBCThreshold; // Minimum bias Threshold in number of channel hit for ADC
272 : UShort_t fBGAThreshold; // Beam Gas Threshold in number of channel hit for ADA
273 : UShort_t fBGCThreshold; // Beam Gas Threshold in number of channel hit for ADC
274 : UShort_t fBBAForBGThreshold; // BBA threshold for Beam Gas triggers (i.e. BBA and BGC)
275 : UShort_t fBBCForBGThreshold; // BBC threshold for Beam Gas triggers (i.e. BBC and BGA)
276 : UShort_t fMultADAThrLow; // Threshold used for multiplicity triggers (i.e. MTA and MTC)
277 : UShort_t fMultADAThrHigh; // Threshold used for multiplicity triggers (i.e. MTA and MTC)
278 : UShort_t fMultADCThrLow; // Threshold used for multiplicity triggers (i.e. MTA and MTC)
279 : UShort_t fMultADCThrHigh; // Threshold used for multiplicity triggers (i.e. MTA and MTC)
280 : UShort_t fTriggerSelected[5]; // Triggers selected on the 5 outputs to CTP
281 : Bool_t fEnableCharge[16]; // Flag to know is a channel is participating to the Charge triggers
282 : Bool_t fEnableTiming[16]; // Flag to know is a channel is participating to the Timing triggers
283 : UShort_t fPedestalOdd[16]; // Pedestals for the Odd integrators
284 : UShort_t fPedestalEven[16]; // Pedestals for the Even integrators
285 : UShort_t fPedestalCutOdd[16]; // Pedestals Cut for the Odd integrators
286 : UShort_t fPedestalCutEven[16]; // Pedestals Cut for the Even integrators
287 :
288 : Float_t fDiscriThr[16]; // Discriminator thresholds
289 :
290 : Float_t *fLightYields; //! Light Yields channel by channel (read from separate OCDB entry)
291 : Float_t *fPMGainsA; //! PM gain factors channel by channel (read from separate OCDB entry)
292 : Float_t *fPMGainsB; //! PM gain factors channel by channel (read from separate OCDB entry)
293 : Float_t *fThrCalibA; //! Thereshold calibration parameters channel by channel (read from separate OCDB entry)
294 : Float_t *fThrCalibB; //! Thereshold calibration parameters channel by channel (read from separate OCDB entry)
295 :
296 16 : ClassDef(AliADCalibData,2) // AD Calibration data
297 : };
298 :
299 : #endif
300 :
|