OCDB calib data: removal of gain values. Will be put in a separate OCDB entry as...
[u/mrichter/AliRoot.git] / VZERO / AliVZEROCalibData.cxx
CommitLineData
3191f471 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/* $Id: AliVZEROCalibData.cxx, */
17
18/////////////////////////////////////////////////////////////////////////////
19// //
20// class for VZERO calibration //
21// //
22/////////////////////////////////////////////////////////////////////////////
23
706506da 24#include <TMath.h>
d5deaaa5 25#include <TObjString.h>
26#include <TMap.h>
706506da 27
d5deaaa5 28#include "AliDCSValue.h"
3191f471 29#include "AliVZEROCalibData.h"
32c24147 30#include "AliVZERODataDCS.h"
31#include "AliLog.h"
3191f471 32
33ClassImp(AliVZEROCalibData)
34
35//________________________________________________________________
36AliVZEROCalibData::AliVZEROCalibData()
37{
2f09013f 38 // default constructor
39
40 for(int t=0; t<64; t++) {
41 fMeanHV[t] = 100.0;
42 fWidthHV[t] = 0.0;
992e9cba 43 fTimeOffset[t] = 5.0;
2f09013f 44 fTimeGain[t] = 1.0;
45 fDeadChannel[t]= kFALSE;
6e2c3e87 46 fDiscriThr[t] = 2.5;
2f09013f 47 }
48 for(int t=0; t<128; t++) {
49 fPedestal[t] = 0.0;
50 fSigma[t] = 0.0;
51 fADCmean[t] = 0.0;
52 fADCsigma[t] = 0.0;
2f09013f 53 }
54 for(int i=0; i<kNCIUBoards ;i++) {
55 fTimeResolution[i] = 25./256.; // Default time resolution
56 fWidthResolution[i] = 25./64.; // Default time width resolution
32cd3fdc 57 fMatchWindow[i] = 4;
58 fSearchWindow[i] = 16;
59 fTriggerCountOffset[i] = 3247;
60 fRollOver[i] = 3563;
2f09013f 61 }
d5deaaa5 62
3191f471 63}
64
a3c86e1f 65//________________________________________________________________
66void AliVZEROCalibData::Reset()
67{
d7a5c700 68 // reset
a3c86e1f 69}
70
3191f471 71//________________________________________________________________
72AliVZEROCalibData::AliVZEROCalibData(const char* name)
73{
32c24147 74 // Constructor
2f09013f 75 TString namst = "Calib_";
76 namst += name;
77 SetName(namst.Data());
78 SetTitle(namst.Data());
79 for(int t=0; t<64; t++) {
80 fMeanHV[t] = 100.0;
81 fWidthHV[t] = 0.0;
992e9cba 82 fTimeOffset[t] = 5.0;
2f09013f 83 fTimeGain[t] = 1.0;
84 fDeadChannel[t]= kFALSE;
6e2c3e87 85 fDiscriThr[t] = 2.5;
2f09013f 86 }
87 for(int t=0; t<128; t++) {
88 fPedestal[t] = 0.0;
89 fSigma[t] = 0.0;
90 fADCmean[t] = 0.0;
91 fADCsigma[t] = 0.0;
2f09013f 92 }
93 for(int i=0; i<kNCIUBoards ;i++) {
94 fTimeResolution[i] = 25./256.; // Default time resolution in ns / channel
95 fWidthResolution[i] = 25./64.; // Default time width resolution in ns / channel
32cd3fdc 96 fMatchWindow[i] = 4;
97 fSearchWindow[i] = 16;
98 fTriggerCountOffset[i] = 3247;
99 fRollOver[i] = 3563;
2f09013f 100 }
3191f471 101
102}
103
104//________________________________________________________________
105AliVZEROCalibData::AliVZEROCalibData(const AliVZEROCalibData& calibda) :
106 TNamed(calibda)
107{
108// copy constructor
109
110 SetName(calibda.GetName());
111 SetTitle(calibda.GetName());
112
fae0e0c0 113 for(int t=0; t<128; t++) {
3191f471 114 fPedestal[t] = calibda.GetPedestal(t);
fae0e0c0 115 fSigma[t] = calibda.GetSigma(t);
2a25ea57 116 fADCmean[t] = calibda.GetADCmean(t);
4e2652e8 117 fADCsigma[t] = calibda.GetADCsigma(t); }
fae0e0c0 118
119 for(int t=0; t<64; t++) {
d7a5c700 120 fMeanHV[t] = calibda.GetMeanHV(t);
2a25ea57 121 fWidthHV[t] = calibda.GetWidthHV(t);
122 fTimeOffset[t] = calibda.GetTimeOffset(t);
d5deaaa5 123 fTimeGain[t] = calibda.GetTimeGain(t);
2f09013f 124 fDeadChannel[t] = calibda.IsChannelDead(t);
6e2c3e87 125 fDiscriThr[t] = calibda.GetDiscriThr(t);
d5deaaa5 126 }
127
2f09013f 128 for(int i=0; i<kNCIUBoards ;i++) {
129 fTimeResolution[i] = calibda.GetTimeResolution(i);
130 fWidthResolution[i] = calibda.GetWidthResolution(i);
32cd3fdc 131 fMatchWindow[i] = calibda.GetMatchWindow(i);
132 fSearchWindow[i] = calibda.GetSearchWindow(i);
133 fTriggerCountOffset[i] = calibda.GetTriggerCountOffset(i);
134 fRollOver[i] = calibda.GetRollOver(i);
2f09013f 135 }
3191f471 136
137}
138
139//________________________________________________________________
140AliVZEROCalibData &AliVZEROCalibData::operator =(const AliVZEROCalibData& calibda)
141{
142// assignment operator
143
144 SetName(calibda.GetName());
145 SetTitle(calibda.GetName());
146
fae0e0c0 147 for(int t=0; t<128; t++) {
3191f471 148 fPedestal[t] = calibda.GetPedestal(t);
fae0e0c0 149 fSigma[t] = calibda.GetSigma(t);
2a25ea57 150 fADCmean[t] = calibda.GetADCmean(t);
4e2652e8 151 fADCsigma[t] = calibda.GetADCsigma(t); }
fae0e0c0 152
2a25ea57 153 for(int t=0; t<64; t++) {
d7a5c700 154 fMeanHV[t] = calibda.GetMeanHV(t);
2a25ea57 155 fWidthHV[t] = calibda.GetWidthHV(t);
156 fTimeOffset[t] = calibda.GetTimeOffset(t);
d5deaaa5 157 fTimeGain[t] = calibda.GetTimeGain(t);
2f09013f 158 fDeadChannel[t] = calibda.IsChannelDead(t);
6e2c3e87 159 fDiscriThr[t] = calibda.GetDiscriThr(t);
d5deaaa5 160 }
2f09013f 161 for(int i=0; i<kNCIUBoards ;i++) {
162 fTimeResolution[i] = calibda.GetTimeResolution(i);
163 fWidthResolution[i] = calibda.GetWidthResolution(i);
32cd3fdc 164 fMatchWindow[i] = calibda.GetMatchWindow(i);
165 fSearchWindow[i] = calibda.GetSearchWindow(i);
166 fTriggerCountOffset[i] = calibda.GetTriggerCountOffset(i);
167 fRollOver[i] = calibda.GetRollOver(i);
2f09013f 168 }
2a25ea57 169
3191f471 170 return *this;
171
172}
173
174//________________________________________________________________
175AliVZEROCalibData::~AliVZEROCalibData()
176{
d7a5c700 177 // destructor
3191f471 178}
d5deaaa5 179//_____________________________________________________________________________
180void AliVZEROCalibData::FillDCSData(AliVZERODataDCS * data){
181 // Set all parameters from the data get by the shuttle
182 TMap * params = data->GetFEEParameters();
183 TIter iter(params);
184 TObjString* aliasName;
185
186 while (( aliasName = (TObjString*) iter.Next() )) {
187 AliDCSValue* aValue = (AliDCSValue*) params->GetValue(aliasName);
5978520a 188 Int_t val;
d5deaaa5 189 if(aValue) {
692e31a4 190 val = aValue->GetUInt();
5978520a 191 AliInfo(Form("%s : %d",aliasName->String().Data(), val));
d5deaaa5 192 SetParameter(aliasName->String(),val);
193 }
194 }
195
196 SetMeanHV(data->GetMeanHV());
197 SetWidthHV(data->GetWidthHV());
198 SetDeadMap(data->GetDeadMap());
199
200}
201//_____________________________________________________________________________
5978520a 202void AliVZEROCalibData::SetParameter(TString name, Int_t val){
d5deaaa5 203 // Set given parameter
204
205 Int_t iBoard = -1;
57c7500a 206 Int_t iChannel = -1;
d5deaaa5 207
208 TSeqCollection* nameSplit = name.Tokenize("/");
209 TObjString * boardName = (TObjString *)nameSplit->At(2);
210 sscanf(boardName->String().Data(),"CIU%d",&iBoard);
57c7500a 211
212 TString paramName = ((TObjString *)nameSplit->At(3))->String();
213 Char_t channel[2] ; channel[1] = '\0';
214 channel[0] = paramName[paramName.Sizeof()-2];
215 sscanf(channel,"%d",&iChannel);
d5deaaa5 216
4bc15c46 217 if(name.Contains("TimeResolution")) SetTimeResolution((UShort_t) val,iBoard);
218 else if(name.Contains("WidthResolution")) SetWidthResolution((UShort_t) val,iBoard);
32cd3fdc 219 else if(name.Contains("MatchWindow")) SetMatchWindow((UInt_t) val,iBoard);
220 else if(name.Contains("SearchWindow")) SetSearchWindow((UInt_t) val,iBoard);
221 else if(name.Contains("TriggerCountOffset")) SetTriggerCountOffset((UInt_t) val,iBoard);
222 else if(name.Contains("RollOver")) SetRollOver((UInt_t) val,iBoard);
57c7500a 223 else if(name.Contains("DelayHit")) SetTimeOffset(0.01*(Float_t)val,8*iBoard+(iChannel-1));
6e2c3e87 224 else if(name.Contains("DiscriThr")) SetDiscriThr(((Float_t)val-2040.)/112.,8*iBoard+(iChannel-1));
d5deaaa5 225 else AliError(Form("No Setter found for FEE parameter : %s",name.Data()));
226}
3191f471 227
3191f471 228//________________________________________________________________
32c24147 229void AliVZEROCalibData::SetPedestal(const Float_t* Pedestal)
3191f471 230{
fae0e0c0 231 if(Pedestal) for(int t=0; t<128; t++) fPedestal[t] = Pedestal[t];
232 else for(int t=0; t<128; t++) fPedestal[t] = 0.0;
233}
234
235//________________________________________________________________
32c24147 236void AliVZEROCalibData::SetSigma(const Float_t* Sigma)
fae0e0c0 237{
238 if(Sigma) for(int t=0; t<128; t++) fSigma[t] = Sigma[t];
239 else for(int t=0; t<128; t++) fSigma[t] = 0.0;
3191f471 240}
241
242//________________________________________________________________
32c24147 243void AliVZEROCalibData::SetADCmean(const Float_t* ADCmean)
3191f471 244{
2a25ea57 245 if(ADCmean) for(int t=0; t<128; t++) fADCmean[t] = ADCmean[t];
246 else for(int t=0; t<128; t++) fADCmean[t] = 0.0;
3191f471 247}
248
40b6a179 249//________________________________________________________________
32c24147 250void AliVZEROCalibData::SetADCsigma(const Float_t* ADCsigma)
40b6a179 251{
252 if(ADCsigma) for(int t=0; t<128; t++) fADCsigma[t] = ADCsigma[t];
253 else for(int t=0; t<128; t++) fADCsigma[t] = 0.0;
254}
255
fae0e0c0 256//________________________________________________________________
32c24147 257void AliVZEROCalibData::SetMeanHV(const Float_t* MeanHV)
fae0e0c0 258{
2a25ea57 259 if(MeanHV) for(int t=0; t<64; t++) fMeanHV[t] = MeanHV[t];
260 else for(int t=0; t<64; t++) fMeanHV[t] = 0.0;
fae0e0c0 261}
262
263//________________________________________________________________
32c24147 264void AliVZEROCalibData::SetWidthHV(const Float_t* WidthHV)
fae0e0c0 265{
2a25ea57 266 if(WidthHV) for(int t=0; t<64; t++) fWidthHV[t] = WidthHV[t];
267 else for(int t=0; t<64; t++) fWidthHV[t] = 0.0;
fae0e0c0 268}
d7a5c700 269
7495d2be 270//________________________________________________________________
32c24147 271void AliVZEROCalibData::SetDeadMap(const Bool_t* deadMap)
7495d2be 272{
273 if(deadMap) for(int t=0; t<64; t++) fDeadChannel[t] = deadMap[t];
274 else for(int t=0; t<64; t++) fDeadChannel[t] = kFALSE;
275}
276
57c7500a 277//________________________________________________________________
278void AliVZEROCalibData::SetTimeOffset(Float_t val, Int_t channel)
279{
280 if((channel>=0) && (channel<64)){
281 fTimeOffset[channel]=val;
a70d760d 282 AliInfo(Form("Time offset for channel %d set to %f",channel,fTimeOffset[channel]));
57c7500a 283 }
284 else
285 AliError(Form("Channel %d is not valid",channel));
286}
287
d7a5c700 288//________________________________________________________________
32c24147 289void AliVZEROCalibData::SetTimeOffset(const Float_t* TimeOffset)
d7a5c700 290{
2a25ea57 291 if(TimeOffset) for(int t=0; t<64; t++) fTimeOffset[t] = TimeOffset[t];
992e9cba 292 else for(int t=0; t<64; t++) fTimeOffset[t] = 5.0;
d7a5c700 293}
2a25ea57 294
295//________________________________________________________________
32c24147 296void AliVZEROCalibData::SetTimeGain(const Float_t* TimeGain)
2a25ea57 297{
298 if(TimeGain) for(int t=0; t<64; t++) fTimeGain[t] = TimeGain[t];
299 else for(int t=0; t<64; t++) fTimeGain[t] = 0.0;
300}
301
706506da 302//_____________________________________________________________________________
303Float_t AliVZEROCalibData::GetMIPperADC(Int_t channel) const {
304
305 // Computes the MIP conversion factor - MIP per ADC channel -
306 // Argument passed is the PM number (aliroot numbering)
307
32c24147 308 Float_t p0[64] = {
706506da 309 7.094891, 7.124938, 7.089708, 7.098169, 7.094482, 7.147250, 7.170978, 7.183392,
310 7.145760, 7.148096, 7.153840, 7.143544, 7.186069, 7.194580, 7.203516, 7.195176,
311 7.188333, 7.198607, 7.209412, 7.226565, 7.221695, 7.205132, 7.191238, 7.227724,
11b348f3 312 7.232810, 7.252655, 7.230309, 7.140891, 7.273518, 7.242969, 7.252859, 7.252655,
706506da 313 7.026802, 7.079913, 7.134147, 7.092387, 7.079561, 7.072848, 7.123192, 7.003141,
314 7.024667, 7.124784, 7.123442, 7.129744, 7.110671, 7.143031, 7.139439, 7.178109,
315 7.247803, 7.139396, 7.293809, 7.094454, 6.992198, 7.206448, 7.244765, 7.056197,
316 7.263595, 7.138569, 7.089582, 7.215683, 7.266183, 7.165123, 7.243276, 7.235135 };
32c24147 317 Float_t p1[64] = {
706506da 318 0.135569, 0.146405, 0.142425, 0.144278, 0.142307, 0.141648, 0.128477, 0.138239,
319 0.144173, 0.143419, 0.143572, 0.144482, 0.138024, 0.136542, 0.135955, 0.138537,
320 0.148521, 0.141999, 0.139627, 0.130014, 0.134970, 0.135635, 0.139094, 0.140634,
11b348f3 321 0.137971, 0.142080, 0.142793, 0.136054, 0.142778, 0.146045, 0.139133, 0.142080,
706506da 322 0.144121, 0.142311, 0.136564, 0.142686, 0.138792, 0.166285, 0.136387, 0.155391,
323 0.176082, 0.140408, 0.164738, 0.144270, 0.142766, 0.147486, 0.141951, 0.138012,
324 0.132394, 0.142849, 0.140477, 0.144592, 0.141558, 0.157646, 0.143758, 0.173385,
325 0.146489, 0.143279, 0.145230, 0.147203, 0.147333, 0.144979, 0.148597, 0.138985 };
326
327 // High Voltage retrieval from Calibration Data Base:
32c24147 328 Float_t hv = fMeanHV[channel];
329 Float_t mip = -1;
330 if (hv>0)
331 mip = 0.6/TMath::Exp((TMath::Log(hv) - p0[channel] )/p1[channel]);
332 return mip;
706506da 333
334}
4e2652e8 335
336//________________________________________________________________
337Float_t AliVZEROCalibData::GetGain(Int_t channel) const
338{
339 // Computes the PM gain factors
340 // Argument passed is the PM number (aliroot numbering)
341 Float_t a[64] = {-39.68,-35.83,-36.92,-36.42,-37.02,-37.50,-43.05,-39.39,
342 -36.62,-36.93,-37.30,-36.46,-39.51,-40.32,-39.92,-39.20,
343 -35.39,-37.95,-38.85,-42.76,-40.68,-40.32,-39.00,-37.36,
344 -39.64,-38.86,-37.59,-39.59,-37.97,-36.32,-38.88,-41.35,
345 -36.01,-36.82,-39.48,-36.86,-38.22,-32.55,-39.44,-35.08,
346 -29.91,-37.88,-33.25,-36.49,-37.25,-35.89,-40.31,-39.15,
347 -41.71,-37.07,-38.94,-36.04,-36.62,-32.96,-36.99,-30.71,
348 -36.66,-37.23,-35.98,-36.56,-35.64,-36.97,-35.88,-38.78};
349 Float_t b[64] = { 7.40, 6.83, 7.02, 6.94, 7.03, 7.04, 7.79, 7.27,
350 6.92, 6.96, 7.01, 6.90, 7.28, 7.38, 7.33, 7.23,
351 6.71, 7.05, 7.17, 7.69, 7.41, 7.38, 7.21, 7.11,
352 7.26, 7.12, 6.98, 7.35, 6.99, 6.79, 7.13, 7.58,
353 6.95, 7.01, 7.33, 7.01, 7.21, 6.01, 7.34, 6.44,
354 5.68, 7.12, 6.07, 6.92, 7.04, 6.82, 7.04, 7.24,
355 7.53, 6.99, 7.10, 6.89, 7.07, 6.35, 6.88, 5.77,
356 6.81, 7.01, 6.89, 6.84, 6.68, 6.95, 6.73, 7.14};
357
358 // High Voltage retrieval from Calibration Data Base:
359 Float_t hv = fMeanHV[channel];
360 Float_t gain = 0;
361 if (hv>0)
362 gain = TMath::Exp(a[channel]+b[channel]*TMath::Log(hv));
363 return gain;
364}
365
d5deaaa5 366//________________________________________________________________
367void AliVZEROCalibData::SetTimeResolution(UShort_t *resols){
368 // Set Time Resolution of the TDC
369 if(resols) for(int t=0; t<kNCIUBoards; t++) SetTimeResolution(resols[t],t);
4bc15c46 370 else AliError("Time Resolution not defined.");
d5deaaa5 371
372}
373//________________________________________________________________
374void AliVZEROCalibData::SetTimeResolution(UShort_t resol, Int_t board)
375{
376 // Set Time Resolution of the TDC
4bc15c46 377 if((board>=0) && (board<kNCIUBoards)) {
d5deaaa5 378 switch(resol){
379 case 0:
380 fTimeResolution[board] = 25./256.;
381 break;
382 case 1:
383 fTimeResolution[board] = 25./128.;
384 break;
385 case 2:
386 fTimeResolution[board] = 25./64.;
387 break;
388 case 3:
389 fTimeResolution[board] = 25./32.;
390 break;
391 case 4:
392 fTimeResolution[board] = 25./16.;
393 break;
394 case 5:
395 fTimeResolution[board] = 25./8.;
396 break;
397 case 6:
398 fTimeResolution[board] = 6.25;
399 break;
400 case 7:
401 fTimeResolution[board] = 12.5;
402 break;
403 }
4bc15c46 404 AliInfo(Form("Time Resolution of board %d set to %f",board,fTimeResolution[board]));
d5deaaa5 405 } else AliError(Form("Board %d is not valid",board));
406}
407//________________________________________________________________
408void AliVZEROCalibData::SetWidthResolution(UShort_t *resols){
409 // Set Time Width Resolution of the TDC
410 if(resols) for(int t=0; t<kNCIUBoards; t++) SetWidthResolution(resols[t],t);
4bc15c46 411 else AliError("Width Resolution not defined.");
d5deaaa5 412
413}
414//________________________________________________________________
415void AliVZEROCalibData::SetWidthResolution(UShort_t resol, Int_t board)
416{
417 // Set Time Width Resolution of the TDC
4bc15c46 418 if((board>=0) && (board<kNCIUBoards)){
d5deaaa5 419 switch(resol){
420 case 0:
421 fWidthResolution[board] = 25./256.;
422 break;
423 case 1:
424 fWidthResolution[board] = 25./128.;
425 break;
426 case 2:
427 fWidthResolution[board] = 25./64.;
428 break;
429 case 3:
430 fWidthResolution[board] = 25./32.;
431 break;
432 case 4:
433 fWidthResolution[board] = 25./16.;
434 break;
435 case 5:
436 fWidthResolution[board] = 25./8.;
437 break;
438 case 6:
439 fWidthResolution[board] = 6.25;
440 break;
441 case 7:
442 fWidthResolution[board] = 12.5;
443 break;
444 case 8:
445 fWidthResolution[board] = 25.;
446 break;
447 case 9:
448 fWidthResolution[board] = 50.;
449 break;
450 case 10:
451 fWidthResolution[board] = 100.;
452 break;
453 case 11:
454 fWidthResolution[board] = 200.;
455 break;
456 case 12:
457 fWidthResolution[board] = 400.;
458 break;
459 case 13:
460 fWidthResolution[board] = 800.;
461 break;
462
463 }
4bc15c46 464 AliInfo(Form("Width Resolution of board %d set to %f",board,fWidthResolution[board]));
d5deaaa5 465 }else AliError(Form("Board %d is not valid",board));
466}
706506da 467
32cd3fdc 468//________________________________________________________________
469void AliVZEROCalibData::SetMatchWindow(UInt_t *windows)
470{
471 // Set Match window of the HPTDC
472 // The units are 25ns
473 if(windows) for(Int_t b=0; b<kNCIUBoards; b++) SetMatchWindow(windows[b],b);
474 else AliError("Match windows not defined.");
475}
476
477//________________________________________________________________
478void AliVZEROCalibData::SetMatchWindow(UInt_t window, Int_t board)
479{
480 // Set Match window of the HPTDC
481 // The units are 25ns
482 if((board>=0) && (board<kNCIUBoards)){
483 fMatchWindow[board] = window;
484 AliInfo(Form("Match window of board %d set to %d",board,fMatchWindow[board]));
485 }
486 else
487 AliError(Form("Board %d is not valid",board));
488}
489
490//________________________________________________________________
491void AliVZEROCalibData::SetSearchWindow(UInt_t *windows)
492{
493 // Set Search window of the HPTDC
494 // The units are 25ns
495 if(windows) for(Int_t b=0; b<kNCIUBoards; b++) SetSearchWindow(windows[b],b);
496 else AliError("Search windows not defined.");
497}
498
499//________________________________________________________________
500void AliVZEROCalibData::SetSearchWindow(UInt_t window, Int_t board)
501{
502 // Set Search window of the HPTDC
503 // The units are 25ns
504 if((board>=0) && (board<kNCIUBoards)){
505 fSearchWindow[board] = window;
506 AliInfo(Form("Search window of board %d set to %d",board,fSearchWindow[board]));
507 }
508 else
509 AliError(Form("Board %d is not valid",board));
510}
511
512//________________________________________________________________
513void AliVZEROCalibData::SetTriggerCountOffset(UInt_t *offsets)
514{
515 // Set trigger-count offset of the HPTDC
516 // The units are 25ns
517 if(offsets) for(Int_t b=0; b<kNCIUBoards; b++) SetTriggerCountOffset(offsets[b],b);
518 else AliError("Trigger count offsets not defined.");
519}
520
521//________________________________________________________________
522void AliVZEROCalibData::SetTriggerCountOffset(UInt_t offset, Int_t board)
523{
524 // Set trigger-count offsets of the HPTDC
525 // The units are 25ns
526 if((board>=0) && (board<kNCIUBoards)){
527 fTriggerCountOffset[board] = offset;
528 AliInfo(Form("Trigger-count offset of board %d set to %d",board,fTriggerCountOffset[board]));
529 }
530 else
531 AliError(Form("Board %d is not valid",board));
532}
533
534//________________________________________________________________
535void AliVZEROCalibData::SetRollOver(UInt_t *offsets)
536{
537 // Set Roll-over of the HPTDC
538 // The units are 25ns
539 if(offsets) for(Int_t b=0; b<kNCIUBoards; b++) SetRollOver(offsets[b],b);
540 else AliError("Roll-over offsets not defined.");
541}
542
543//________________________________________________________________
544void AliVZEROCalibData::SetRollOver(UInt_t offset, Int_t board)
545{
546 // Set Roll-over of the HPTDC
547 // The units are 25ns
548 if((board>=0) && (board<kNCIUBoards)){
549 fRollOver[board] = offset;
550 AliInfo(Form("Roll-over offset of board %d set to %d",board,fRollOver[board]));
551 }
552 else
553 AliError(Form("Board %d is not valid",board));
554}
6e2c3e87 555
556//________________________________________________________________
557void AliVZEROCalibData::SetDiscriThr(Float_t thr, Int_t channel)
558{
559 // Set the TDC discriminator
560 // threshold values expressed in units of ADC
561 if((channel>=0) && (channel<64)){
562 if (thr > 0) {
563 fDiscriThr[channel]=thr;
564 AliInfo(Form("Discriminator threshold for channel %d set to %f",channel,fDiscriThr[channel]));
565 }
566 else {
567 AliWarning(Form("Ignore wrong threshold value (%f) for channel %d !",thr,channel));
568 }
569 }
570 else
571 AliError(Form("Channel %d is not valid",channel));
572}
573
574//________________________________________________________________
575void AliVZEROCalibData::SetDiscriThr(const Float_t* thresholds)
576{
577 // Set the TDC discriminator
578 // threshold values expressed in units of ADC
579 if(thresholds) for(int t=0; t<64; t++) fDiscriThr[t] = thresholds[t];
580 else for(int t=0; t<64; t++) fDiscriThr[t] = 2.5;
581}