added reference mult
[u/mrichter/AliRoot.git] / VZERO / AliVZEROReconstructor.cxx
CommitLineData
b0d2c2d3 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$ */
17
18///////////////////////////////////////////////////////////////////////////////
19/// //
20/// class for VZERO reconstruction //
21/// //
22///////////////////////////////////////////////////////////////////////////////
23
b44c933e 24#include <TH1F.h>
25#include <TF1.h>
b6fd9c4a 26#include <TParameter.h>
b44c933e 27
35b120ff 28#include "AliRunLoader.h"
2eb38194 29#include "AliRawReader.h"
fe0adf2a 30#include "AliGRPObject.h"
31#include "AliCDBManager.h"
32#include "AliCDBStorage.h"
33#include "AliCDBEntry.h"
b0d2c2d3 34#include "AliVZEROReconstructor.h"
2eb38194 35#include "AliVZERORawStream.h"
b44c933e 36#include "AliVZEROConst.h"
b14e6eb4 37#include "AliESDEvent.h"
a055ee24 38#include "AliVZEROTriggerMask.h"
b090e6a3 39#include "AliESDfriend.h"
40#include "AliESDVZEROfriend.h"
fad64858 41#include "AliVZEROdigit.h"
e58b4e66 42#include "AliVZEROCalibData.h"
75b6bc77 43#include "AliRunInfo.h"
b44c933e 44#include "AliCTPTimeParams.h"
b0d2c2d3 45
b0d2c2d3 46ClassImp(AliVZEROReconstructor)
47
ce7090f5 48//_____________________________________________________________________________
cb2228e6 49AliVZEROReconstructor:: AliVZEROReconstructor(): AliReconstructor(),
fe0adf2a 50 fESDVZERO(0x0),
51 fESD(0x0),
52 fESDVZEROfriend(0x0),
b44c933e 53 fCalibData(NULL),
54 fTimeSlewing(NULL),
fe0adf2a 55 fCollisionMode(0),
dbf24214 56 fBeamEnergy(0.),
57 fDigitsArray(0)
ce7090f5 58{
59 // Default constructor
ce7090f5 60 // Get calibration data
61
b44c933e 62 fCalibData = GetCalibData();
63
64 AliCDBEntry *entry = AliCDBManager::Instance()->Get("GRP/CTP/CTPtiming");
65 if (!entry) AliFatal("CTP timing parameters are not found in OCDB !");
66 AliCTPTimeParams *ctpParams = (AliCTPTimeParams*)entry->GetObject();
67 Float_t l1Delay = (Float_t)ctpParams->GetDelayL1L0()*25.0;
68
69 AliCDBEntry *entry2 = AliCDBManager::Instance()->Get("VZERO/Calib/TimeDelays");
70 if (!entry2) AliFatal("VZERO time delays are not found in OCDB !");
71 TH1F *delays = (TH1F*)entry2->GetObject();
72
73 AliCDBEntry *entry3 = AliCDBManager::Instance()->Get("VZERO/Calib/TimeSlewing");
74 if (!entry3) AliFatal("VZERO time slewing function is not found in OCDB !");
75 fTimeSlewing = (TF1*)entry3->GetObject();
76
77 for(Int_t i = 0 ; i < 64; ++i) {
78 Int_t board = AliVZEROCalibData::GetBoardNumber(i);
79 fTimeOffset[i] = (((Float_t)fCalibData->GetTriggerCountOffset(board)-
80 (Float_t)fCalibData->GetRollOver(board))*25.0+
81 fCalibData->GetTimeOffset(i)+
82 l1Delay+
83 delays->GetBinContent(i+1)+
84 kV0Offset);
85 }
ce7090f5 86}
87
88
89//_____________________________________________________________________________
90AliVZEROReconstructor& AliVZEROReconstructor::operator =
91 (const AliVZEROReconstructor& /*reconstructor*/)
92{
93// assignment operator
94
95 Fatal("operator =", "assignment operator not implemented");
96 return *this;
97}
98
99//_____________________________________________________________________________
100AliVZEROReconstructor::~AliVZEROReconstructor()
101{
102// destructor
44b6212f 103
b090e6a3 104 delete fESDVZERO;
105 delete fESDVZEROfriend;
dbf24214 106 delete fDigitsArray;
35b120ff 107}
108
109//_____________________________________________________________________________
d76c31f4 110void AliVZEROReconstructor::Init()
35b120ff 111{
ef314913 112// initializer
ce7090f5 113
35b120ff 114 fESDVZERO = new AliESDVZERO;
b090e6a3 115 fESDVZEROfriend = new AliESDVZEROfriend;
fe0adf2a 116
117 GetCollisionMode(); // fCollisionMode =1 for Pb-Pb simulated data
35b120ff 118}
119
120//______________________________________________________________________
2e0ee64a 121void AliVZEROReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const
35b120ff 122{
75b6bc77 123// converts RAW to digits
ef314913 124
2e0ee64a 125 if (!digitsTree) {
126 AliError("No digits tree!");
127 return;
128 }
35b120ff 129
dbf24214 130 if (!fDigitsArray)
131 fDigitsArray = new TClonesArray("AliVZEROdigit", 64);
132 digitsTree->Branch("VZERODigit", &fDigitsArray);
2e0ee64a 133
b090e6a3 134 fESDVZEROfriend->Reset();
135
2e0ee64a 136 rawReader->Reset();
137 AliVZERORawStream rawStream(rawReader);
75b6bc77 138 if (rawStream.Next()) {
139 Float_t adc[64];
6c115a32 140 Float_t time[64], width[64];
75b6bc77 141 Bool_t BBFlag[64], BGFlag[64], integrator[64];
b6fd9c4a 142 Short_t chargeADC[64][21];
9d62c464 143 for(Int_t i=0; i<64; i++) {
75b6bc77 144 Int_t j = rawStream.GetOfflineChannel(i);
145 adc[j] = 0.0;
146 time[j] = 0.0;
147 width[j] = 0.0;
148 BBFlag[j] = kFALSE;
149 BGFlag[j] = kFALSE;
150 integrator[j] = kFALSE;
151 // Search for the maximum charge in the train of 21 LHC clocks
152 // regardless of the integrator which has been operated:
153 Float_t maxadc = 0;
154 Int_t imax = -1;
155 Float_t adcPedSub[21];
156 for(Int_t iClock=0; iClock<21; iClock++){
b6fd9c4a 157 chargeADC[j][iClock] = (Short_t)rawStream.GetPedestal(i,iClock);
75b6bc77 158 Bool_t iIntegrator = rawStream.GetIntegratorFlag(i,iClock);
159 Int_t k = j+64*iIntegrator;
160 adcPedSub[iClock] = rawStream.GetPedestal(i,iClock) - fCalibData->GetPedestal(k);
161 if(adcPedSub[iClock] <= GetRecoParam()->GetNSigmaPed()*fCalibData->GetSigma(k)) {
162 adcPedSub[iClock] = 0;
163 continue;
164 }
165 if(iClock < GetRecoParam()->GetStartClock() || iClock > GetRecoParam()->GetEndClock()) continue;
166 if(adcPedSub[iClock] > maxadc) {
167 maxadc = adcPedSub[iClock];
168 imax = iClock;
169 }
170 }
171
172 AliDebug(2,Form("Channel %d (online), %d (offline)",i,j));
173 if (imax != -1) {
174 Int_t start = imax - GetRecoParam()->GetNPreClocks();
175 if (start < 0) start = 0;
176 Int_t end = imax + GetRecoParam()->GetNPostClocks();
177 if (end > 20) end = 20;
178 for(Int_t iClock = start; iClock <= end; iClock++) {
f93f97bb 179 if (iClock >= imax) {
180 BBFlag[j] |= rawStream.GetBBFlag(i,iClock);
181 BGFlag[j] |= rawStream.GetBGFlag(i,iClock);
182 }
75b6bc77 183 if (iClock == imax)
184 adc[j] += rawStream.GetPedestal(i,iClock);
185 else
186 adc[j] += adcPedSub[iClock];
187
188 AliDebug(2,Form("clock = %d adc = %f",iClock,rawStream.GetPedestal(i,iClock)));
189 }
190 // Convert i (FEE channel numbering) to j (aliroot channel numbering)
191
75b6bc77 192 integrator[j] = rawStream.GetIntegratorFlag(i,imax);
193 }
b090e6a3 194
82dae5d9 195 Int_t board = j / 8;
196 time[j] = rawStream.GetTime(i)/ (25./256.) * fCalibData->GetTimeResolution(board);
197 width[j] = rawStream.GetWidth(i) / 0.4 * fCalibData->GetWidthResolution(board);
198
b090e6a3 199 // Filling the esd friend object
200 fESDVZEROfriend->SetBBScalers(j,rawStream.GetBBScalers(i));
201 fESDVZEROfriend->SetBGScalers(j,rawStream.GetBGScalers(i));
202 for (Int_t iBunch = 0; iBunch < AliESDVZEROfriend::kNBunches; iBunch++) {
db0db003 203 fESDVZEROfriend->SetChargeMB(j,iBunch,rawStream.GetChargeMB(i,iBunch));
204 fESDVZEROfriend->SetIntMBFlag(j,iBunch,rawStream.GetIntMBFlag(i,iBunch));
205 fESDVZEROfriend->SetBBMBFlag(j,iBunch,rawStream.GetBBMBFlag(i,iBunch));
206 fESDVZEROfriend->SetBGMBFlag(j,iBunch,rawStream.GetBGMBFlag(i,iBunch));
b090e6a3 207 }
208 for (Int_t iEv = 0; iEv < AliESDVZEROfriend::kNEvOfInt; iEv++) {
db0db003 209 fESDVZEROfriend->SetPedestal(j,iEv,rawStream.GetPedestal(i,iEv));
210 fESDVZEROfriend->SetIntegratorFlag(j,iEv,rawStream.GetIntegratorFlag(i,iEv));
211 fESDVZEROfriend->SetBBFlag(j,iEv,rawStream.GetBBFlag(i,iEv));
212 fESDVZEROfriend->SetBGFlag(j,iEv,rawStream.GetBGFlag(i,iEv));
b090e6a3 213 }
e58b4e66 214 fESDVZEROfriend->SetTime(j,time[j]);
215 fESDVZEROfriend->SetWidth(j,width[j]);
9d62c464 216 }
b090e6a3 217
218 // Filling the esd friend object
219 fESDVZEROfriend->SetTriggerInputs(rawStream.GetTriggerInputs());
220 fESDVZEROfriend->SetTriggerInputsMask(rawStream.GetTriggerInputsMask());
221
222 for(Int_t iScaler = 0; iScaler < AliESDVZEROfriend::kNScalers; iScaler++)
db0db003 223 fESDVZEROfriend->SetTriggerScalers(iScaler,rawStream.GetTriggerScalers(iScaler));
b090e6a3 224
db0db003 225 for(Int_t iBunch = 0; iBunch < AliESDVZEROfriend::kNBunches; iBunch++)
226 fESDVZEROfriend->SetBunchNumbersMB(iBunch,rawStream.GetBunchNumbersMB(iBunch));
b090e6a3 227
228
b6fd9c4a 229 Int_t aBBflagsV0A = 0;
230 Int_t aBBflagsV0C = 0;
231 Int_t aBGflagsV0A = 0;
232 Int_t aBGflagsV0C = 0;
233
9d62c464 234 // Channels(aliroot numbering) will be ordered in the tree
235 for(Int_t iChannel = 0; iChannel < 64; iChannel++) {
b6fd9c4a 236 if(iChannel<32) {
237 if (BBFlag[iChannel]) aBBflagsV0C |= (1 << iChannel);
238 if (BGFlag[iChannel]) aBGflagsV0C |= (1 << iChannel);
239 } else {
240 if (BBFlag[iChannel]) aBBflagsV0A |= (1 << (iChannel-32));
241 if (BGFlag[iChannel]) aBGflagsV0A |= (1 << (iChannel-32));
242 }
7495d2be 243 if(fCalibData->IsChannelDead(iChannel)){
244 adc[iChannel] = (Float_t) kInvalidADC;
245 time[iChannel] = (Float_t) kInvalidTime;
246 }
75b6bc77 247 if (adc[iChannel] > 0)
dbf24214 248 new ((*fDigitsArray)[fDigitsArray->GetEntriesFast()])
d0502ab2 249 AliVZEROdigit(iChannel, adc[iChannel], time[iChannel],
b6fd9c4a 250 width[iChannel],integrator[iChannel],
251 chargeADC[iChannel]);
7495d2be 252
f0ff6fad 253 }
b6fd9c4a 254
255 // Store the BB and BG flags in the digits tree (user info)
256 digitsTree->GetUserInfo()->Add(new TParameter<int>("BBflagsV0A",aBBflagsV0A));
257 digitsTree->GetUserInfo()->Add(new TParameter<int>("BBflagsV0C",aBBflagsV0C));
258 digitsTree->GetUserInfo()->Add(new TParameter<int>("BGflagsV0A",aBGflagsV0A));
259 digitsTree->GetUserInfo()->Add(new TParameter<int>("BGflagsV0C",aBGflagsV0C));
260
f0ff6fad 261 digitsTree->Fill();
2e0ee64a 262 }
dbf24214 263
264 fDigitsArray->Clear();
2e0ee64a 265}
266
267//______________________________________________________________________
268void AliVZEROReconstructor::FillESD(TTree* digitsTree, TTree* /*clustersTree*/,
b14e6eb4 269 AliESDEvent* esd) const
2e0ee64a 270{
75b6bc77 271// fills multiplicities to the ESD - pedestal is now subtracted
fe0adf2a 272
2e0ee64a 273 if (!digitsTree) {
fe0adf2a 274 AliError("No digits tree!");
275 return;
2e0ee64a 276 }
a055ee24 277
2e0ee64a 278 TBranch* digitBranch = digitsTree->GetBranch("VZERODigit");
dbf24214 279 digitBranch->SetAddress(&fDigitsArray);
35b120ff 280
44b6212f 281 Float_t mult[64];
db0db003 282 Float_t adc[64];
283 Float_t time[64];
284 Float_t width[64];
b6fd9c4a 285 Bool_t aBBflag[64];
286 Bool_t aBGflag[64];
d0502ab2 287
35b120ff 288 for (Int_t i=0; i<64; i++){
db0db003 289 adc[i] = 0.0;
d0502ab2 290 mult[i] = 0.0;
b44c933e 291 time[i] = kInvalidTime;
db0db003 292 width[i] = 0.0;
b6fd9c4a 293 aBBflag[i] = kFALSE;
294 aBGflag[i] = kFALSE;
a055ee24 295 }
35b120ff 296
b6fd9c4a 297 Int_t aBBflagsV0A = 0;
298 Int_t aBBflagsV0C = 0;
299 Int_t aBGflagsV0A = 0;
300 Int_t aBGflagsV0C = 0;
301
302 if (digitsTree->GetUserInfo()->FindObject("BBflagsV0A")) {
303 aBBflagsV0A = ((TParameter<int>*)digitsTree->GetUserInfo()->FindObject("BBflagsV0A"))->GetVal();
304 }
305 else
306 AliWarning("V0A beam-beam flags not found in digits tree UserInfo! The flags will not be written to the raw-data stream!");
307
308 if (digitsTree->GetUserInfo()->FindObject("BBflagsV0C")) {
309 aBBflagsV0C = ((TParameter<int>*)digitsTree->GetUserInfo()->FindObject("BBflagsV0C"))->GetVal();
310 }
311 else
312 AliWarning("V0C beam-beam flags not found in digits tree UserInfo! The flags will not be written to the raw-data stream!");
313
314 if (digitsTree->GetUserInfo()->FindObject("BGflagsV0A")) {
315 aBGflagsV0A = ((TParameter<int>*)digitsTree->GetUserInfo()->FindObject("BGflagsV0A"))->GetVal();
316 }
317 else
318 AliWarning("V0A beam-gas flags not found in digits tree UserInfo! The flags will not be written to the raw-data stream!");
319
320 if (digitsTree->GetUserInfo()->FindObject("BGflagsV0C")) {
321 aBGflagsV0C = ((TParameter<int>*)digitsTree->GetUserInfo()->FindObject("BGflagsV0C"))->GetVal();
322 }
323 else
324 AliWarning("V0C beam-gas flags not found in digits tree UserInfo! The flags will not be written to the raw-data stream!");
325
326
2e0ee64a 327 Int_t nEntries = (Int_t)digitsTree->GetEntries();
35b120ff 328 for (Int_t e=0; e<nEntries; e++) {
2e0ee64a 329 digitsTree->GetEvent(e);
35b120ff 330
dbf24214 331 Int_t nDigits = fDigitsArray->GetEntriesFast();
35b120ff 332
333 for (Int_t d=0; d<nDigits; d++) {
dbf24214 334 AliVZEROdigit* digit = (AliVZEROdigit*) fDigitsArray->At(d);
63627899 335 Int_t pmNumber = digit->PMNumber();
336 // Pedestal retrieval and suppression:
75b6bc77 337 Bool_t integrator = digit->Integrator();
f93f97bb 338 Int_t k = pmNumber+64*integrator;
339 Float_t pedestal = fCalibData->GetPedestal(k);
db0db003 340 adc[pmNumber] = digit->ADC() - pedestal;
b44c933e 341 time[pmNumber] = CorrectLeadingTime(pmNumber,digit->Time(),adc[pmNumber]);
db0db003 342 width[pmNumber] = digit->Width();
b6fd9c4a 343 if(pmNumber < 32) {
344 aBBflag[pmNumber] = (aBBflagsV0C >> pmNumber) & 0x1;
345 aBGflag[pmNumber] = (aBGflagsV0C >> pmNumber) & 0x1;
346 }
347 else {
348 aBBflag[pmNumber] = (aBBflagsV0A >> (pmNumber-32)) & 0x1;
349 aBGflag[pmNumber] = (aBGflagsV0A >> (pmNumber-32)) & 0x1;
350 }
351
352 if (adc[pmNumber] > 0) AliDebug(1,Form("PM = %d ADC = %f TDC %f Int %d (%d %d %d %d %d) %f %f %f %f %d %d",pmNumber, adc[pmNumber],digit->Time(),
353 integrator,
354 digit->ChargeADC(8),digit->ChargeADC(9),digit->ChargeADC(10),
355 digit->ChargeADC(11),digit->ChargeADC(12),
356 fCalibData->GetPedestal(pmNumber),fCalibData->GetSigma(pmNumber),
357 fCalibData->GetPedestal(pmNumber+64),fCalibData->GetSigma(pmNumber+64),
358 aBBflag[pmNumber],aBGflag[pmNumber]));
75b6bc77 359
75b6bc77 360 if(adc[pmNumber] > (fCalibData->GetPedestal(k) + GetRecoParam()->GetNSigmaPed()*fCalibData->GetSigma(k))) {
361 mult[pmNumber] += adc[pmNumber]*fCalibData->GetMIPperADC(pmNumber);
fe0adf2a 362 }
35b120ff 363 } // end of loop over digits
35b120ff 364 } // end of loop over events in digits tree
6c6d6114 365
b44c933e 366 fESDVZERO->SetBit(AliESDVZERO::kCorrectedLeadingTime,kTRUE);
6c6d6114 367 fESDVZERO->SetMultiplicity(mult);
28fdf12c 368 fESDVZERO->SetADC(adc);
369 fESDVZERO->SetTime(time);
d0502ab2 370 fESDVZERO->SetWidth(width);
b6fd9c4a 371 fESDVZERO->SetBBFlag(aBBflag);
372 fESDVZERO->SetBGFlag(aBGflag);
a055ee24 373
b44c933e 374 // now fill the V0 decision and channel flags
375 {
376 AliVZEROTriggerMask triggerMask;
377 triggerMask.FillMasks(fESDVZERO, fCalibData, fTimeSlewing);
378 }
a055ee24 379
2e0ee64a 380 if (esd) {
44b6212f 381 AliDebug(1, Form("Writing VZERO data to ESD tree"));
382 esd->SetVZEROData(fESDVZERO);
2e0ee64a 383 }
b090e6a3 384
385 if (esd) {
fe0adf2a 386 AliESDfriend *fr = (AliESDfriend*)esd->FindListObject("AliESDfriend");
387 if (fr) {
388 AliDebug(1, Form("Writing VZERO friend data to ESD tree"));
389 fr->SetVZEROfriend(fESDVZEROfriend);
b090e6a3 390 }
391 }
dbf24214 392
393 fDigitsArray->Clear();
35b120ff 394}
395
ce7090f5 396//_____________________________________________________________________________
397AliCDBStorage* AliVZEROReconstructor::SetStorage(const char *uri)
398{
ef314913 399// Sets the storage
400
ce7090f5 401 Bool_t deleteManager = kFALSE;
402
403 AliCDBManager *manager = AliCDBManager::Instance();
404 AliCDBStorage *defstorage = manager->GetDefaultStorage();
405
406 if(!defstorage || !(defstorage->Contains("VZERO"))){
407 AliWarning("No default storage set or default storage doesn't contain VZERO!");
408 manager->SetDefaultStorage(uri);
409 deleteManager = kTRUE;
410 }
411
412 AliCDBStorage *storage = manager->GetDefaultStorage();
413
414 if(deleteManager){
44b6212f 415 AliCDBManager::Instance()->UnsetDefaultStorage();
416 defstorage = 0; // the storage is killed by AliCDBManager::Instance()->Destroy()
ce7090f5 417 }
418
419 return storage;
420}
421
fe0adf2a 422//____________________________________________________________________________
423void AliVZEROReconstructor::GetCollisionMode()
424{
75b6bc77 425 // Retrieval of collision mode
fe0adf2a 426
75b6bc77 427 TString beamType = GetRunInfo()->GetBeamType();
fe0adf2a 428 if(beamType==AliGRPObject::GetInvalidString()){
75b6bc77 429 AliError("VZERO cannot retrieve beam type");
fe0adf2a 430 return;
431 }
432
75b6bc77 433 if( (beamType.CompareTo("P-P") ==0) || (beamType.CompareTo("p-p") ==0) ){
434 fCollisionMode=0;
435 }
436 else if( (beamType.CompareTo("Pb-Pb") ==0) || (beamType.CompareTo("A-A") ==0) ){
437 fCollisionMode=1;
fe0adf2a 438 }
fe0adf2a 439
75b6bc77 440 fBeamEnergy = GetRunInfo()->GetBeamEnergy();
fe0adf2a 441 if(fBeamEnergy==AliGRPObject::GetInvalidFloat()) {
75b6bc77 442 AliError("Missing value for the beam energy ! Using 0");
fe0adf2a 443 fBeamEnergy = 0.;
444 }
445
75b6bc77 446 AliDebug(1,Form("\n ++++++ Beam type and collision mode retrieved as %s %d @ %1.3f GeV ++++++\n\n",beamType.Data(), fCollisionMode, fBeamEnergy));
fe0adf2a 447
448}
449
ce7090f5 450//_____________________________________________________________________________
451AliVZEROCalibData* AliVZEROReconstructor::GetCalibData() const
452{
ef314913 453 // Gets calibration object for VZERO set
ce7090f5 454
c0b82b5a 455 AliCDBManager *man = AliCDBManager::Instance();
ce7090f5 456
c0b82b5a 457 AliCDBEntry *entry=0;
458
459 entry = man->Get("VZERO/Calib/Data");
460
c0b82b5a 461 AliVZEROCalibData *calibdata = 0;
462
463 if (entry) calibdata = (AliVZEROCalibData*) entry->GetObject();
94a600a1 464 if (!calibdata) AliFatal("No calibration data from calibration database !");
ce7090f5 465
466 return calibdata;
467}
44b6212f 468
b44c933e 469Float_t AliVZEROReconstructor::CorrectLeadingTime(Int_t i, Float_t time, Float_t adc) const
470{
471 // Correct the leading time
472 // for slewing effect and
473 // misalignment of the channels
474 if (time < 1e-6) return kInvalidTime;
475
476 // Channel alignment and general offset subtraction
477 if (i < 32) time -= kV0CDelayCables;
478 time -= fTimeOffset[i];
479
480 // In case of pathological signals
481 if (adc < 1e-6) return time;
482
483 // Slewing correction
484 Float_t thr = fCalibData->GetDiscriThr(i);
485 time -= fTimeSlewing->Eval(adc/thr);
486
487 return time;
488}