]> git.uio.no Git - u/mrichter/AliRoot.git/blob - AD/AliADCalibData.cxx
Central flags to digit and change of CIU position
[u/mrichter/AliRoot.git] / AD / AliADCalibData.cxx
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: AliADCalibData.cxx,                                            */
17
18 #include <TMath.h>
19 #include <TObjString.h>
20 #include <TMap.h>
21 #include <TH1F.h>
22 #include <TH2F.h>
23
24 #include "AliDCSValue.h"
25 #include "AliCDBManager.h"
26 #include "AliCDBEntry.h"
27 #include "AliADDataDCS.h"
28 #include "AliADCalibData.h"
29 #include "AliADConst.h"
30 #include "AliLog.h"
31
32 ClassImp(AliADCalibData)
33
34
35 //________________________________________________________________
36 AliADCalibData::AliADCalibData():
37   fLightYields(NULL),
38   fPMGainsA(NULL),
39   fPMGainsB(NULL)
40 {
41   // default constructor
42   
43     for(int t=0; t<16; t++) {
44         fMeanHV[t]      = 100.0;
45         fWidthHV[t]     = 0.0; 
46         fTimeOffset[t]  = 0.0;
47         fTimeGain[t]    = 1.0;
48         fDeadChannel[t]= kFALSE;
49         fDiscriThr[t]  = 2.5;
50     }
51     for(int t=0; t<32; t++) {
52         fPedestal[t]    = 0.0;     
53         fSigma[t]       = 100.0;        
54         fADCmean[t]     = 0.0;      
55         fADCsigma[t]    = 0.0;
56     }
57     for(int i=0; i<kNCIUBoards ;i++) {
58         fTimeResolution[i]  = 25./256.;     // Default time resolution
59         fWidthResolution[i] = 25./64.;     // Default time width resolution
60         fMatchWindow[i] = 4;
61         fSearchWindow[i] = 16;
62         fTriggerCountOffset[i] = 3247;
63         fRollOver[i] = 3563;
64     }
65
66 }
67 //________________________________________________________________
68 void AliADCalibData::Reset()
69 {
70   
71 }
72
73 //________________________________________________________________
74 AliADCalibData::AliADCalibData(const char* name) :
75   fLightYields(NULL),
76   fPMGainsA(NULL),
77   fPMGainsB(NULL)
78 {
79   // Constructor
80    TString namst = "Calib_";
81    namst += name;
82    SetName(namst.Data());
83    SetTitle(namst.Data());
84    for(int t=0; t<16; t++) {
85        fMeanHV[t]      = 100.0;
86        fWidthHV[t]     = 0.0; 
87        fTimeOffset[t]  = 5.0;
88        fTimeGain[t]    = 1.0;
89        fDeadChannel[t]= kFALSE;
90        fDiscriThr[t]  = 2.5;
91     }
92    for(int t=0; t<32; t++) {
93        fPedestal[t]    = 0.0;     
94        fSigma[t]       = 0.0;        
95        fADCmean[t]     = 0.0;      
96        fADCsigma[t]    = 0.0;
97    }
98    for(int i=0; i<kNCIUBoards ;i++) {
99        fTimeResolution[i]  = 25./256.;    // Default time resolution in ns / channel
100        fWidthResolution[i] = 25./64.;     // Default time width resolution in ns / channel
101        fMatchWindow[i] = 4;
102        fSearchWindow[i] = 16;
103        fTriggerCountOffset[i] = 3247;
104        fRollOver[i] = 3563;
105    }
106 }
107
108 //________________________________________________________________
109 AliADCalibData::AliADCalibData(const AliADCalibData& calibda) :
110   TNamed(calibda),
111   fLightYields(NULL),
112   fPMGainsA(NULL),
113   fPMGainsB(NULL)
114 {
115 // copy constructor
116
117   SetName(calibda.GetName());
118   SetTitle(calibda.GetName());
119   
120   for(int t=0; t<32; t++) { 
121       fPedestal[t] = calibda.GetPedestal(t);
122       fSigma[t]    = calibda.GetSigma(t);
123       fADCmean[t]  = calibda.GetADCmean(t);
124       fADCsigma[t] = calibda.GetADCsigma(t); }
125       
126   for(int t=0; t<16; t++) { 
127       fMeanHV[t]       = calibda.GetMeanHV(t);
128       fWidthHV[t]      = calibda.GetWidthHV(t);        
129       fTimeOffset[t]   = calibda.GetTimeOffset(t);
130       fTimeGain[t]     = calibda.GetTimeGain(t); 
131       fDeadChannel[t]  = calibda.IsChannelDead(t);
132       fDiscriThr[t]    = calibda.GetDiscriThr(t);
133   }  
134   
135   for(int i=0; i<kNCIUBoards ;i++) {
136       fTimeResolution[i]  = calibda.GetTimeResolution(i);
137       fWidthResolution[i] = calibda.GetWidthResolution(i);        
138       fMatchWindow[i] = calibda.GetMatchWindow(i);
139       fSearchWindow[i] = calibda.GetSearchWindow(i);
140       fTriggerCountOffset[i] = calibda.GetTriggerCountOffset(i);
141       fRollOver[i] = calibda.GetRollOver(i);
142   }
143   
144 }
145
146 //________________________________________________________________
147 AliADCalibData &AliADCalibData::operator =(const AliADCalibData& calibda)
148 {
149 // assignment operator
150
151   SetName(calibda.GetName());
152   SetTitle(calibda.GetName());
153   
154   for(int t=0; t<32; t++) {
155       fPedestal[t] = calibda.GetPedestal(t);
156       fSigma[t]    = calibda.GetSigma(t);
157       fADCmean[t]  = calibda.GetADCmean(t);
158       fADCsigma[t] = calibda.GetADCsigma(t); }
159       
160   for(int t=0; t<16; t++) {
161       fMeanHV[t]       = calibda.GetMeanHV(t);
162       fWidthHV[t]      = calibda.GetWidthHV(t);        
163       fTimeOffset[t]   = calibda.GetTimeOffset(t);
164       fTimeGain[t]     = calibda.GetTimeGain(t); 
165       fDeadChannel[t]  = calibda.IsChannelDead(t);
166       fDiscriThr[t]    = calibda.GetDiscriThr(t);
167   }   
168   for(int i=0; i<kNCIUBoards ;i++) {
169       fTimeResolution[i]  = calibda.GetTimeResolution(i);
170       fWidthResolution[i] = calibda.GetWidthResolution(i);        
171       fMatchWindow[i] = calibda.GetMatchWindow(i);
172       fSearchWindow[i] = calibda.GetSearchWindow(i);
173       fTriggerCountOffset[i] = calibda.GetTriggerCountOffset(i);
174       fRollOver[i] = calibda.GetRollOver(i);
175   }
176    
177   return *this;
178   
179 }
180
181 //________________________________________________________________
182 AliADCalibData::~AliADCalibData()
183 {
184   // destructor
185   if (fLightYields)
186     delete [] fLightYields;
187   if (fPMGainsA)
188     delete [] fPMGainsA;
189   if (fPMGainsB)
190     delete [] fPMGainsB;
191 }
192
193 //________________________________________________________________
194 Int_t AliADCalibData::GetBoardNumber(Int_t channel)
195 {
196   // Get FEE board number
197   // from offline channel index
198   if (channel >= 0 && channel < 8) return (0);
199   if (channel >=8 && channel < 16) return (1);
200
201   AliErrorClass(Form("Wrong channel index: %d",channel));
202   return -1;
203 }
204
205 //________________________________________________________________
206 Float_t AliADCalibData::GetLightYields(Int_t channel)
207 {
208   // Get the light yield efficiency
209   // for a given channel
210   if (!fLightYields) InitLightYields();
211
212   if (channel >= 0 && channel < 16) {
213     return fLightYields[channel];
214   }
215
216   AliError(Form("Wrong channel index: %d",channel));
217   return 0;
218 }
219
220 //________________________________________________________________
221 void  AliADCalibData::InitLightYields()
222 {
223   // Initialize the light yield factors
224   // Read from a separate OCDB entry
225   if (fLightYields) return;
226
227   AliCDBEntry *entry = AliCDBManager::Instance()->Get("VZERO/Calib/LightYields");
228   if (!entry) AliFatal("AD light yields are not found in OCDB !");
229   TH1F *yields = (TH1F*)entry->GetObject();
230
231   fLightYields = new Float_t[16];
232   for(Int_t i = 0 ; i < 16; ++i) {
233     fLightYields[i] = yields->GetBinContent(i+1);
234   }
235 }
236
237 //________________________________________________________________
238 void  AliADCalibData::InitPMGains()
239 {
240   // Initialize the PM gain factors
241   // Read from a separate OCDB entry
242   if (fPMGainsA) return;
243
244   AliCDBEntry *entry = AliCDBManager::Instance()->Get("VZERO/Calib/PMGains");
245   if (!entry) AliFatal("VZERO PM gains are not found in OCDB !");
246   TH2F *gains = (TH2F*)entry->GetObject();
247
248   fPMGainsA = new Float_t[16];
249   fPMGainsB = new Float_t[16];
250   for(Int_t i = 0 ; i < 16; ++i) {
251     fPMGainsA[i] = gains->GetBinContent(i+1,1);
252     fPMGainsB[i] = gains->GetBinContent(i+1,2);
253   }
254 }
255
256 //________________________________________________________________
257 Float_t AliADCalibData::GetGain(Int_t channel)
258 {
259   // Computes the PM gains
260   // Argument passed is the PM number (aliroot numbering)
261   if (!fPMGainsA) InitPMGains();
262
263   // High Voltage retrieval from Calibration Data Base:  
264   Float_t hv = fMeanHV[channel];
265   Float_t gain = 0;
266   if (hv>0)
267     gain = TMath::Exp(fPMGainsA[channel]+fPMGainsB[channel]*TMath::Log(hv));
268   return gain;
269 }
270
271 //________________________________________________________________
272 Float_t AliADCalibData::GetCalibDiscriThr(Int_t channel, Bool_t scaled)
273 {
274   // The method returns actual TDC discri threshold
275   // extracted from the data.
276   //
277   // In case scaled flag is set the threshold is scaled
278   // so that to get 4.0 for a FEE threshold of 4.0.
279   // In this way we avoid a change in the slewing correction
280   // for the entire 2010 p-p data.
281   //
282   // The method is to be moved to OCDB object.
283
284   Float_t thr = GetDiscriThr(channel);
285
286   Float_t calThr = 0;
287   if (thr <= 1.) 
288     calThr = 3.1;
289   else if (thr >= 2.)
290     calThr = (3.1+1.15*thr-1.7);
291   else
292     calThr = (3.1-0.3*thr+0.3*thr*thr);
293
294   if (scaled) calThr *= 4./(3.1+1.15*4.-1.7);
295
296   return calThr;
297 }
298 //_____________________________________________________________________________
299 void AliADCalibData::FillDCSData(AliADDataDCS * data){
300         // Set all parameters from the data get by the shuttle
301         TMap * params = data->GetFEEParameters();
302         TIter iter(params);     
303         TObjString* aliasName;
304         
305         while ((  aliasName = (TObjString*) iter.Next() ))  {
306                 AliDCSValue* aValue = (AliDCSValue*) params->GetValue(aliasName);
307                 Int_t val;
308                 if(aValue) {
309                         val = aValue->GetInt();
310                         AliInfo(Form("%s : %d",aliasName->String().Data(), val));
311                         SetParameter(aliasName->String(),val);
312                 }
313         }       
314         
315         SetMeanHV(data->GetMeanHV());
316         SetWidthHV(data->GetWidthHV());
317         SetDeadMap(data->GetDeadMap());
318
319 }
320 //_____________________________________________________________________________
321 void AliADCalibData::SetParameter(TString name, Int_t val){
322         // Set given parameter
323         
324         Int_t iBoard = -1;
325         Int_t iChannel = -1;
326
327         TSeqCollection* nameSplit = name.Tokenize("/");
328         TObjString * boardName = (TObjString *)nameSplit->At(2);
329         sscanf(boardName->String().Data(),"CIU%d",&iBoard);
330
331         TString paramName = ((TObjString *)nameSplit->At(3))->String();
332         Char_t channel[2] ; channel[1] = '\0';
333         channel[0] = paramName[paramName.Sizeof()-2];
334         sscanf(channel,"%d",&iChannel);
335                 
336         if(name.Contains("TimeResolution")) SetTimeResolution((UShort_t) val,iBoard);
337         else if(name.Contains("WidthResolution")) SetWidthResolution((UShort_t) val,iBoard);
338         else if(name.Contains("MatchWindow")) SetMatchWindow((UInt_t) val,iBoard);
339         else if(name.Contains("SearchWindow")) SetSearchWindow((UInt_t) val,iBoard);
340         else if(name.Contains("TriggerCountOffset")) SetTriggerCountOffset((UInt_t) val,iBoard);
341         else if(name.Contains("RollOver")) SetRollOver((UInt_t) val,iBoard);
342         else if(name.Contains("DelayHit")) SetTimeOffset(0.01*(Float_t)val,iBoard,(iChannel-1));
343         else if(name.Contains("DiscriThr")) SetDiscriThr(((Float_t)val-1040.)/112.,iBoard,(iChannel-1));
344         else AliError(Form("No Setter found for FEE parameter : %s",name.Data()));
345         //
346         delete nameSplit;
347 }
348
349 //________________________________________________________________
350 void AliADCalibData::SetPedestal(const Float_t* Pedestal)
351 {
352   if(Pedestal) for(int t=0; t<32; t++) fPedestal[t] = Pedestal[t];
353   else for(int t=0; t<32; t++) fPedestal[t] = 0.0;
354 }
355
356 //________________________________________________________________
357 void AliADCalibData::SetSigma(const Float_t* Sigma)
358 {
359   if(Sigma) for(int t=0; t<32; t++) fSigma[t] = Sigma[t];
360   else for(int t=0; t<32; t++) fSigma[t] = 0.0;
361 }
362
363 //________________________________________________________________
364 void AliADCalibData::SetADCmean(const Float_t* ADCmean) 
365 {
366   if(ADCmean) for(int t=0; t<32; t++) fADCmean[t] = ADCmean[t];
367   else for(int t=0; t<32; t++) fADCmean[t] = 0.0;
368 }
369
370 //________________________________________________________________
371 void AliADCalibData::SetADCsigma(const Float_t* ADCsigma) 
372 {
373   if(ADCsigma) for(int t=0; t<32; t++) fADCsigma[t] = ADCsigma[t];
374   else for(int t=0; t<32; t++) fADCsigma[t] = 0.0;
375 }
376
377 //________________________________________________________________
378 void AliADCalibData::SetMeanHV(const Float_t* MeanHV) 
379 {
380   if(MeanHV) for(int t=0; t<16; t++) fMeanHV[t] = MeanHV[t];
381   else for(int t=0; t<16; t++) fMeanHV[t] = 0.0;
382 }
383
384 //________________________________________________________________
385 void AliADCalibData::SetWidthHV(const Float_t* WidthHV) 
386 {
387   if(WidthHV) for(int t=0; t<16; t++) fWidthHV[t] = WidthHV[t];
388   else for(int t=0; t<16; t++) fWidthHV[t] = 0.0;
389 }
390
391 //________________________________________________________________
392 void AliADCalibData::SetDeadMap(const Bool_t* deadMap) 
393 {
394   if(deadMap) for(int t=0; t<16; t++) fDeadChannel[t] = deadMap[t];
395   else for(int t=0; t<16; t++) fDeadChannel[t] = kFALSE;
396 }
397
398 //________________________________________________________________
399 void AliADCalibData::SetTimeOffset(Float_t val, Int_t board, Int_t channel)
400 {
401   Int_t ch = AliADCalibData::GetOfflineChannelNumber(board,channel);
402   if(ch >= 0){
403     fTimeOffset[ch]=val;
404     AliInfo(Form("Time offset for channel %d set to %f",ch,fTimeOffset[ch]));
405   }
406   else
407     AliError("Board/Channel numbers are not valid");
408 }
409
410 //________________________________________________________________
411 void AliADCalibData::SetTimeOffset(const Float_t* TimeOffset) 
412 {
413   if(TimeOffset) for(int t=0; t<16; t++) fTimeOffset[t] = TimeOffset[t];
414   else for(int t=0; t<16; t++) fTimeOffset[t] = 5.0;
415 }
416 //________________________________________________________________
417 void AliADCalibData::SetTimeGain(const Float_t* TimeGain) 
418 {
419   if(TimeGain) for(int t=0; t<16; t++) fTimeGain[t] = TimeGain[t];
420   else for(int t=0; t<16; t++) fTimeGain[t] = 0.0;
421 }
422 //________________________________________________________________
423 void AliADCalibData::SetTimeResolution(UShort_t *resols){
424         // Set Time Resolution of the TDC
425         if(resols)  for(int t=0; t<kNCIUBoards; t++) SetTimeResolution(resols[t],t);
426         else AliError("Time Resolution not defined.");
427         
428 }
429 //________________________________________________________________
430 void AliADCalibData::SetTimeResolution(UShort_t resol, Int_t board)
431 {
432         // Set Time Resolution of the TDC
433         if((board>=0) && (board<kNCIUBoards)) {
434                 switch(resol){
435                         case 0:
436                                 fTimeResolution[board] = 25./256.;
437                                 break;
438                         case 1:
439                                 fTimeResolution[board] = 25./128.;
440                                 break;
441                         case 2:
442                                 fTimeResolution[board] = 25./64.;
443                                 break;
444                         case 3:
445                                 fTimeResolution[board] = 25./32.;
446                                 break;
447                         case 4:
448                                 fTimeResolution[board] = 25./16.;
449                                 break;
450                         case 5:
451                                 fTimeResolution[board] = 25./8.;
452                                 break;
453                         case 6:
454                                 fTimeResolution[board] = 6.25;
455                                 break;
456                         case 7:
457                                 fTimeResolution[board] = 12.5;
458                                 break;
459                 }
460                 AliInfo(Form("Time Resolution of board %d set to %f",board,fTimeResolution[board]));
461         } else AliError(Form("Board %d is not valid",board));
462 }
463 //________________________________________________________________
464 void AliADCalibData::SetWidthResolution(UShort_t *resols){
465         // Set Time Width Resolution of the TDC
466         if(resols)  for(int t=0; t<kNCIUBoards; t++) SetWidthResolution(resols[t],t);
467         else AliError("Width Resolution not defined.");
468         
469 }
470 //________________________________________________________________
471 void AliADCalibData::SetWidthResolution(UShort_t resol, Int_t board)
472 {
473         // Set Time Width Resolution of the TDC
474         if((board>=0) && (board<kNCIUBoards)){
475                 switch(resol){
476                         case 0:
477                                 fWidthResolution[board] = 25./256.;
478                                 break;
479                         case 1:
480                                 fWidthResolution[board] = 25./128.;
481                                 break;
482                         case 2:
483                                 fWidthResolution[board] = 25./64.;
484                                 break;
485                         case 3:
486                                 fWidthResolution[board] = 25./32.;
487                                 break;
488                         case 4:
489                                 fWidthResolution[board] = 25./16.;
490                                 break;
491                         case 5:
492                                 fWidthResolution[board] = 25./8.;
493                                 break;
494                         case 6:
495                                 fWidthResolution[board] = 6.25;
496                                 break;
497                         case 7:
498                                 fWidthResolution[board] = 12.5;
499                                 break;
500                         case 8:
501                                 fWidthResolution[board] = 25.;
502                                 break;
503                         case 9:
504                                 fWidthResolution[board] = 50.;
505                                 break;
506                         case 10:
507                                 fWidthResolution[board] = 100.;
508                                 break;
509                         case 11:
510                                 fWidthResolution[board] = 200.;
511                                 break;
512                         case 12:
513                                 fWidthResolution[board] = 400.;
514                                 break;
515                         case 13:
516                                 fWidthResolution[board] = 800.;
517                                 break;
518                                 
519                 }
520                 AliInfo(Form("Width Resolution of board %d set to %f",board,fWidthResolution[board]));
521         }else AliError(Form("Board %d is not valid",board));
522 }
523
524 //________________________________________________________________
525 void AliADCalibData::SetMatchWindow(UInt_t *windows)
526 {
527   // Set Match window of the HPTDC
528   // The units are 25ns
529   if(windows)  for(Int_t b=0; b<kNCIUBoards; b++) SetMatchWindow(windows[b],b);
530   else AliError("Match windows not defined.");
531 }
532
533 //________________________________________________________________
534 void AliADCalibData::SetMatchWindow(UInt_t window, Int_t board)
535 {
536   // Set Match window of the HPTDC
537   // The units are 25ns
538   if((board>=0) && (board<kNCIUBoards)){
539     fMatchWindow[board] = window;
540     AliInfo(Form("Match window of board %d set to %d",board,fMatchWindow[board]));
541   }
542   else
543     AliError(Form("Board %d is not valid",board));
544 }
545
546 //________________________________________________________________
547 void AliADCalibData::SetSearchWindow(UInt_t *windows)
548 {
549   // Set Search window of the HPTDC
550   // The units are 25ns
551   if(windows)  for(Int_t b=0; b<kNCIUBoards; b++) SetSearchWindow(windows[b],b);
552   else AliError("Search windows not defined.");
553 }
554
555 //________________________________________________________________
556 void  AliADCalibData::SetSearchWindow(UInt_t window, Int_t board)
557 {
558   // Set Search window of the HPTDC
559   // The units are 25ns
560   if((board>=0) && (board<kNCIUBoards)){
561     fSearchWindow[board] = window;
562     AliInfo(Form("Search window of board %d set to %d",board,fSearchWindow[board]));
563   }
564   else
565     AliError(Form("Board %d is not valid",board));
566 }
567
568 //________________________________________________________________
569 void AliADCalibData::SetTriggerCountOffset(UInt_t *offsets)
570 {
571   // Set trigger-count offset of the HPTDC
572   // The units are 25ns
573   if(offsets)  for(Int_t b=0; b<kNCIUBoards; b++) SetTriggerCountOffset(offsets[b],b);
574   else AliError("Trigger count offsets not defined.");
575 }
576
577 //________________________________________________________________
578 void AliADCalibData::SetTriggerCountOffset(UInt_t offset, Int_t board)
579 {
580   // Set trigger-count offsets of the HPTDC
581   // The units are 25ns
582   if((board>=0) && (board<kNCIUBoards)){
583     fTriggerCountOffset[board] = offset;
584     AliInfo(Form("Trigger-count offset of board %d set to %d",board,fTriggerCountOffset[board]));
585   }
586   else
587     AliError(Form("Board %d is not valid",board));
588 }
589
590 //________________________________________________________________
591 void AliADCalibData::SetRollOver(UInt_t *offsets)
592 {
593   // Set Roll-over of the HPTDC
594   // The units are 25ns
595   if(offsets)  for(Int_t b=0; b<kNCIUBoards; b++) SetRollOver(offsets[b],b);
596   else AliError("Roll-over offsets not defined.");
597 }
598
599 //________________________________________________________________
600 void AliADCalibData::SetRollOver(UInt_t offset, Int_t board)
601 {
602   // Set Roll-over of the HPTDC
603   // The units are 25ns
604   if((board>=0) && (board<kNCIUBoards)){
605     fRollOver[board] = offset;
606     AliInfo(Form("Roll-over offset of board %d set to %d",board,fRollOver[board]));
607   }
608   else
609     AliError(Form("Board %d is not valid",board));
610 }
611
612 //________________________________________________________________
613 void AliADCalibData::SetDiscriThr(Float_t thr, Int_t board, Int_t channel)
614 {
615   // Set the TDC discriminator
616   // threshold values expressed in units of ADC
617   Int_t ch = AliADCalibData::GetOfflineChannelNumber(board,channel);
618   if(ch >= 0){
619     if (thr > 0) {
620       fDiscriThr[ch]=thr;
621       AliInfo(Form("Discriminator threshold for channel %d set to %f",ch,fDiscriThr[ch]));
622     }
623     else {
624       AliWarning(Form("Ignore wrong threshold value (%f) for channel %d !",thr,ch));
625     }
626   }
627   else
628     AliError("Board/Channel numbers are not valid");
629 }
630
631 //________________________________________________________________
632 void AliADCalibData::SetDiscriThr(const Float_t* thresholds) 
633 {
634   // Set the TDC discriminator
635   // threshold values expressed in units of ADC
636   if(thresholds) for(int t=0; t<16; t++) fDiscriThr[t] = thresholds[t];
637   else for(int t=0; t<16; t++) fDiscriThr[t] = 2.5;
638 }
639
640 //________________________________________________________________
641 Int_t AliADCalibData::GetOfflineChannelNumber(Int_t board, Int_t channel)
642 {
643   // Get the offline channel number from
644   // the FEE board and channel indexes
645
646   if (board < 0 || board >= 2) {
647     AliErrorClass(Form("Wrong FEE board number: %d",board));
648     return -1;
649   }
650   if (channel < 0 || channel >= 8) {
651     AliErrorClass(Form("Wrong FEE channel number: %d",channel));
652     return -1;
653   }
654
655   Int_t offCh = (board+1)*channel;
656
657   return offCh;
658 }
659 //________________________________________________________________
660 Int_t AliADCalibData::GetFEEChannelNumber(Int_t channel)
661 {
662   // Get FEE channel number
663   // from offline channel index
664   if (channel >= 0 && channel < 16) return ((channel % 8));
665
666   AliErrorClass(Form("Wrong channel index: %d",channel));
667   return -1;
668 }
669
670
671