]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TOF/AliTOFDigitizer.cxx
Improving TClonesArray handling - using TClonesArray::Clear() instead of
[u/mrichter/AliRoot.git] / TOF / AliTOFDigitizer.cxx
CommitLineData
68861244 1/**************************************************************************
8e72349e 2 * Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights reserved. *
68861244 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
0e46b9ae 16//_________________________________________________________________________//
17// //
18// This is a TTask that makes TOF-Digits out of TOF-SDigits. //
19// The simulation of the detector is performed at sdigits level: //
20// during digitization the unique task is the sum of all sdigits in the //
21// same pad. //
22// Digits are written to TreeD in branch "TOF". //
23// //
24// -- Author : F. Pierella (Bologna University) pierella@bo.infn.it //
25// //
26//_________________________________________________________________________//
68861244 27
5c7c93fa 28//#include "Riostream.h"
55cb22a1 29
5c7c93fa 30//#include "TFile.h"
3a3ece53 31#include "TH1F.h"
32#include "TTree.h"
33#include "TRandom.h"
10056aa6 34#include "TObjArray.h"
68861244 35
d3c7bfac 36#include "AliLoader.h"
0e46b9ae 37#include "AliLog.h"
d3c7bfac 38#include "AliRunDigitizer.h"
0e46b9ae 39#include "AliRunLoader.h"
40#include "AliRun.h"
68861244 41
0e46b9ae 42#include "AliTOFcalib.h"
5c7c93fa 43//#include "AliTOFChannelOnline.h"
10056aa6 44#include "AliTOFChannelOffline.h"
55cb22a1 45#include "AliTOFDigitizer.h"
8e72349e 46#include "AliTOFdigit.h"
8e72349e 47#include "AliTOFHitMap.h"
10056aa6 48#include "AliTOFGeometry.h"
0e46b9ae 49#include "AliTOFSDigit.h"
50#include "AliTOF.h"
51
3a3ece53 52extern TDirectory *gDirectory;
5c7c93fa 53//extern TFile *gFile;
3a3ece53 54extern TRandom *gRandom;
55
56extern AliRun *gAlice;
57
58
68861244 59ClassImp(AliTOFDigitizer)
60
8e72349e 61//___________________________________________
655e379f 62 AliTOFDigitizer::AliTOFDigitizer() :
63 AliDigitizer(),
b24266ca 64 fDigits(new TClonesArray("AliTOFdigit",4000)),
65 fSDigitsArray(new TClonesArray("AliTOFSDigit",1000)),
8fc02d6f 66 fhitMap(0x0),
67 fCalib(new AliTOFcalib())
68861244 68{
8e72349e 69 // Default ctor - don't use it
8fc02d6f 70 InitDecalibration();
68861244 71}
72
8e72349e 73//___________________________________________
655e379f 74AliTOFDigitizer::AliTOFDigitizer(AliRunDigitizer* manager):
75 AliDigitizer(manager),
b24266ca 76 fDigits(new TClonesArray("AliTOFdigit",4000)),
77 fSDigitsArray(new TClonesArray("AliTOFSDigit",1000)),
8fc02d6f 78 fhitMap(0x0),
79 fCalib(new AliTOFcalib())
68861244 80{
340693af 81 //ctor with RunDigitizer
8fc02d6f 82 InitDecalibration();
68861244 83}
84
7aeeaf38 85//------------------------------------------------------------------------
655e379f 86AliTOFDigitizer::AliTOFDigitizer(const AliTOFDigitizer &source):
87 AliDigitizer(source),
8fc02d6f 88 fDigits(source.fDigits),
89 fSDigitsArray(source.fSDigitsArray),
90 fhitMap(source.fhitMap),
91 fCalib(source.fCalib)
7aeeaf38 92{
93 // copy constructor
7aeeaf38 94}
95
96//------------------------------------------------------------------------
97 AliTOFDigitizer& AliTOFDigitizer::operator=(const AliTOFDigitizer &source)
98{
99 // ass. op.
100 this->fDigits=source.fDigits;
101 this->fSDigitsArray=source.fSDigitsArray;
102 this->fhitMap=source.fhitMap;
8fc02d6f 103 this->fCalib=source.fCalib;
7aeeaf38 104 return *this;
105
106}
107
8e72349e 108//------------------------------------------------------------------------
68861244 109AliTOFDigitizer::~AliTOFDigitizer()
110{
8e72349e 111 // Destructor
8fc02d6f 112 delete fCalib;
b24266ca 113 if (fDigits){
114 fDigits->Delete();
115 delete fDigits;
116 fDigits=0x0;
117 }
118 if (fSDigitsArray){
119 fSDigitsArray->Delete();
120 delete fSDigitsArray;
121 fSDigitsArray=0x0;
122 }
68861244 123}
8e72349e 124
125//---------------------------------------------------------------------
126
d076c8d5 127void AliTOFDigitizer::Exec(Option_t* /*option*/)
68861244 128{
8e72349e 129 //
130 // Perform digitization and merging.
131 // The algorithm is the following:
132 // - a hitmap is created to check if a pad is already activated;
133 // - an sdigits container is created to collect all sdigits from
134 // different files;
135 // - sdigits are summed using the hitmap;
136 // - the sdigits container is used to create the array of AliTOFdigit.
137 //
68861244 138
d076c8d5 139 AliDebug(1, "");
68861244 140
68861244 141
8e72349e 142 // get the ptr to TOF detector
143 AliTOF * tof = (AliTOF *) gAlice->GetDetector("TOF") ;
68861244 144
8e72349e 145 //Make branches
146 char branchname[20];
147 sprintf (branchname, "%s", tof->GetName ());
88cb7938 148
149 AliRunLoader* outrl = AliRunLoader::GetRunLoader(fManager->GetOutputFolderName());
150 if (outrl == 0x0)
151 {
d076c8d5 152 AliError("Can not find Run Loader in output folder.");
88cb7938 153 return;
154 }
155
10056aa6 156 /*
d3c7bfac 157 outrl->CdGAFile();
158 TFile *in=(TFile*)gFile;
159 TDirectory *savedir=gDirectory;
160
10056aa6 161
162 //when fGeom was needed
163
d3c7bfac 164 if (!in->IsOpen()) {
165 AliWarning("Geometry file is not open default TOF geometry will be used");
10056aa6 166 fGeom = new AliTOFGeometry();
d3c7bfac 167 }
168 else {
169 in->cd();
55cb22a1 170 fGeom = (AliTOFGeometry*)in->Get("TOFgeometry");
d3c7bfac 171 }
10056aa6 172
d3c7bfac 173 savedir->cd();
10056aa6 174 */
88cb7938 175 AliLoader* outgime = outrl->GetLoader("TOFLoader");
176 if (outgime == 0x0)
177 {
d076c8d5 178 AliError("Can not get TOF Loader from Output Run Loader.");
88cb7938 179 return;
180 }
181
182 TTree* treeD = outgime->TreeD();
183 if (treeD == 0x0)
184 {
185 outgime->MakeTree("D");
186 treeD = outgime->TreeD();
187 }
8e72349e 188 //Make branch for digits (to be created in Init())
189 tof->MakeBranchInTree(treeD,branchname,&fDigits,4000);
190
191 // container for all summed sdigits (to be created in Init())
192 fSDigitsArray=new TClonesArray("AliTOFSDigit",1000);
68861244 193
8e72349e 194 // create hit map (to be created in Init())
10056aa6 195 fhitMap = new AliTOFHitMap(fSDigitsArray);
68861244 196
8e72349e 197 // Loop over files to digitize
198
199 for (Int_t inputFile=0; inputFile<fManager->GetNinputs();
200 inputFile++) {
201 ReadSDigit(inputFile);
88cb7938 202 }
8e72349e 203
204 // create digits
205 CreateDigits();
206
207 // free used memory for Hit Map in current event
208 delete fhitMap;
209 fSDigitsArray->Delete();
a5c70f8e 210 delete fSDigitsArray;
211
8e72349e 212 treeD->Fill();
213
88cb7938 214 outgime->WriteDigits("OVERWRITE");
215 outgime->UnloadDigits();
b24266ca 216 fDigits->Clear();
8e72349e 217
218}
219
220//---------------------------------------------------------------------
221
55cb22a1 222void AliTOFDigitizer::CreateDigits()
8e72349e 223{
224 // loop on sdigits container to fill the AliTOFdigit TClonesArray
225 // start digitizing all the collected sdigits
226
c7764ee9 227 Int_t ndump=0; // dump the first ndump created digits for each event
8e72349e 228
229 // get the total number of collected sdigits
230 Int_t ndig = fSDigitsArray->GetEntriesFast();
231
232 for (Int_t k = 0; k < ndig; k++) {
68861244 233
da3d3acd 234 Int_t vol[5]; // location for a digit
7e6dce66 235 for (Int_t i=0; i<5; i++) vol[i] = -1;
68861244 236
8e72349e 237 // Get the information for this digit
238 AliTOFSDigit *tofsdigit = (AliTOFSDigit *) fSDigitsArray->UncheckedAt(k);
68861244 239
8e72349e 240 Int_t nslot=tofsdigit->GetNDigits(); // get the number of slots
241 // for current sdigit
68861244 242
8e72349e 243 // TOF sdigit volumes (always the same for all slots)
da3d3acd 244 Int_t sector = tofsdigit->GetSector(); // range [0-17]
245 Int_t plate = tofsdigit->GetPlate(); // range [0- 4]
d3c7bfac 246 Int_t strip = tofsdigit->GetStrip(); // range [0-14/18/19]
da3d3acd 247 Int_t padz = tofsdigit->GetPadz(); // range [0- 1]
248 Int_t padx = tofsdigit->GetPadx(); // range [0-47]
68861244 249
8e72349e 250 vol[0] = sector;
251 vol[1] = plate;
252 vol[2] = strip;
253 vol[3] = padx;
254 vol[4] = padz;
68861244 255
8e72349e 256 //--------------------- QA section ----------------------
257 // in the while, I perform QA
7e6dce66 258 Bool_t isSDigitBad = (sector<0 || sector>17 || plate<0 || plate >4 || padz<0 || padz>1 || padx<0 || padx>47);
68861244 259
8e72349e 260 if (isSDigitBad) {
d3c7bfac 261 //AliFatal("strange sdigit found");
262 AliFatal(Form("strange sdigit found %3i %2i %2i %3i %3i", sector, plate, padz, padx, strip));
68861244 263 }
8e72349e 264 //-------------------------------------------------------
68861244 265
8e72349e 266 //------------------- Dump section ----------------------
267 if(k<ndump){
3a3ece53 268 AliInfo(Form("%2i-th | Sector %2i | Plate %1i | Strip %2i | PadZ %1i | PadX %2i ", k, sector, plate, strip, padz, padx));
269 AliInfo(Form("%2i-th", k));
270 AliInfo("----------------------------------------------------");
68861244 271 }
8e72349e 272 // ------------------------------------------------------
68861244 273
8e72349e 274 // start loop on number of slots for current sdigit
275 for (Int_t islot = 0; islot < nslot; islot++) {
bf33f8f0 276 Int_t digit[4] = {-1,-1,-1,-1}; // TOF digit variables
7aeeaf38 277 Int_t tracknum[AliTOFSDigit::kMAXDIGITS]; // contributing tracks for the current slot
8e72349e 278
bf33f8f0 279 Int_t tdc=tofsdigit->GetTdc(islot); digit[0]=tdc;
280 Int_t adc=tofsdigit->GetAdc(islot); digit[1]=adc;
8e72349e 281
282 tracknum[0]=tofsdigit->GetTrack(islot,0);
283 tracknum[1]=tofsdigit->GetTrack(islot,1);
284 tracknum[2]=tofsdigit->GetTrack(islot,2);
68861244 285
7f1e928b 286 // new with placement must be used
8e72349e 287 // adding a TOF digit for each slot
7f1e928b 288 TClonesArray &aDigits = *fDigits;
289 Int_t last=fDigits->GetEntriesFast();
290 new (aDigits[last]) AliTOFdigit(tracknum, vol, digit);
291
68861244 292 }
68861244 293
8e72349e 294 } // end loop on sdigits - end digitizing all collected sdigits
55cb22a1 295
296 //Insert Decalibration
10056aa6 297 AliInfo("in digitizer, create digits");
8fc02d6f 298 DecalibrateTOFSignal();
68861244 299}
8e72349e 300
301//---------------------------------------------------------------------
302
303void AliTOFDigitizer::ReadSDigit(Int_t inputFile )
68861244 304{
8e72349e 305 // Read sdigits for current event and inputFile;
306 // store them into the sdigits container
307 // and update the hit map
308 // SDigits from different files are assumed to
309 // be created with the same simulation parameters.
68861244 310
b24266ca 311 // creating the TClonesArray to store the digits
312 static TClonesArray sdigitsClonesArray("AliTOFSDigit", 1000);
313 sdigitsClonesArray.Clear();
314
8e72349e 315 // get the treeS from manager
88cb7938 316 AliRunLoader* rl = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(inputFile));
317 if (rl == 0x0)
318 {
d076c8d5 319 AliError(Form("Can not find Run Loader in input %d folder.",inputFile));
88cb7938 320 return;
321 }
322
323 AliLoader* gime = rl->GetLoader("TOFLoader");
324 if (gime == 0x0)
325 {
d076c8d5 326 AliError(Form("Can not get TOF Loader from Input %d Run Loader.",inputFile));
88cb7938 327 return;
328 }
329
330 TTree* currentTreeS=gime->TreeS();
331 if (currentTreeS == 0x0)
332 {
333 Int_t retval = gime->LoadSDigits();
334 if (retval)
335 {
d076c8d5 336 AliError(Form("Error occured while loading S. Digits for Input %d",inputFile));
88cb7938 337 return;
338 }
339 currentTreeS=gime->TreeS();
340 if (currentTreeS == 0x0)
341 {
d076c8d5 342 AliError(Form("Can not get S. Digits Tree for Input %d",inputFile));
88cb7938 343 return;
344 }
345 }
8e72349e 346 // get the branch TOF inside the treeS
b24266ca 347 TClonesArray * sdigitsDummyContainer=&sdigitsClonesArray;
8e72349e 348 // check if the branch exist
349 TBranch* tofBranch=currentTreeS->GetBranch("TOF");
350
351 if(!tofBranch){
d076c8d5 352 AliFatal(Form("TOF branch not found for input %d",inputFile));
8e72349e 353 }
68861244 354
8e72349e 355 tofBranch->SetAddress(&sdigitsDummyContainer);
68861244 356
8e72349e 357 Int_t nEntries = (Int_t)tofBranch->GetEntries();
358
359 // Loop through all entries in the tree
b020b05f 360 Int_t nbytes = 0;
8e72349e 361
362 for (Int_t iEntry = 0; iEntry < nEntries; iEntry++) {
68861244 363
8e72349e 364 // Import the tree
365 nbytes += tofBranch->GetEvent(iEntry);
68861244 366
8e72349e 367 // Get the number of sdigits
368 Int_t ndig = sdigitsDummyContainer->GetEntriesFast();
369
370 for (Int_t k=0; k<ndig; k++) {
371 AliTOFSDigit *tofSdigit= (AliTOFSDigit*) sdigitsDummyContainer->UncheckedAt(k);
372
da3d3acd 373 Int_t vol[5]; // location for a sdigit
7e6dce66 374 for (Int_t i=0; i<5; i++) vol[i] = -1;
da3d3acd 375
8e72349e 376 // check the sdigit volume
377 vol[0] = tofSdigit->GetSector();
378 vol[1] = tofSdigit->GetPlate();
379 vol[2] = tofSdigit->GetStrip();
380 vol[3] = tofSdigit->GetPadx();
381 vol[4] = tofSdigit->GetPadz();
382
383 if (fhitMap->TestHit(vol) != kEmpty) {
384 AliTOFSDigit *sdig = static_cast<AliTOFSDigit*>(fhitMap->GetHit(vol));
385 sdig->Update(tofSdigit);
386
387 } else {
388
389 CollectSDigit(tofSdigit); // collect the current sdigit
390 fhitMap->SetHit(vol); // update the hitmap for location vol
391
392 } // if (hitMap->TestHit(vol) != kEmpty)
393
394 } // for (Int_t k=0; k<ndig; k++)
395
396 } // end loop on entries
397
8e72349e 398}
399
400
401//_____________________________________________________________________________
402void AliTOFDigitizer::CollectSDigit(AliTOFSDigit * sdigit)
403{
404 //
7f1e928b 405 // Add a TOF sdigit in container
406 // new with placement must be used
407 TClonesArray &aSDigitsArray = *fSDigitsArray;
408 Int_t last=fSDigitsArray->GetEntriesFast();
409 // make a copy of the current sdigit and
410 // put it into tmp array
411 new (aSDigitsArray[last]) AliTOFSDigit(*sdigit);
68861244 412}
55cb22a1 413
414//_____________________________________________________________________________
8fc02d6f 415void AliTOFDigitizer::InitDecalibration() const {
8a7fda6f 416 //
417 //
418 //
419
8fc02d6f 420 fCalib->CreateCalArrays();
421 fCalib->ReadSimHistoFromCDB("TOF/Calib", -1); // use AliCDBManager's number
422 fCalib->ReadParOfflineFromCDB("TOF/Calib", -1); // use AliCDBManager's number
55cb22a1 423}
424//---------------------------------------------------------------------
8fc02d6f 425void AliTOFDigitizer::DecalibrateTOFSignal(){
55cb22a1 426
427 // Read Calibration parameters from the CDB
428
8fc02d6f 429 TObjArray * calOffline= fCalib->GetTOFCalArrayOffline();
55cb22a1 430
10056aa6 431 AliDebug(2,Form("Size of array for Offline Calibration = %i",calOffline->GetEntries()));
55cb22a1 432
433 // Initialize Quantities to Simulate ToT Spectra
434
8fc02d6f 435 TH1F * hToT= fCalib->GetTOFSimToT();
55cb22a1 436 Int_t nbins = hToT->GetNbinsX();
340693af 437 Float_t delta = hToT->GetBinWidth(1);
438 Float_t maxch = hToT->GetBinLowEdge(nbins)+delta;
55cb22a1 439 Float_t minch = hToT->GetBinLowEdge(1);
440 Float_t max=0,min=0; //maximum and minimum value of the distribution
441 Int_t maxbin=0,minbin=0; //maximum and minimum bin of the distribution
b97b1350 442
55cb22a1 443 for (Int_t ii=nbins; ii>0; ii--){
444 if (hToT->GetBinContent(ii)!= 0) {
340693af 445 max = maxch - (nbins-ii-1)*delta;
55cb22a1 446 maxbin = ii;
447 break;}
448 }
449 for (Int_t j=1; j<nbins; j++){
450 if (hToT->GetBinContent(j)!= 0) {
340693af 451 min = minch + (j-1)*delta;
55cb22a1 452 minbin = j;
453 break;}
454 }
b97b1350 455
340693af 456 Float_t maxToT=max;
457 Float_t minToT=min;
bf33f8f0 458
340693af 459 Float_t maxToTDistr=hToT->GetMaximum();
bf33f8f0 460
461 AliDebug (1, Form(" The minimum ToT = %f", minToT));
462 AliDebug (1, Form(" The maximum ToT = %f", maxToT));
463 AliDebug (1, Form(" The maximum peak in ToT = %f", maxToTDistr));
55cb22a1 464
55cb22a1 465 // Loop on TOF Digits
466
b97b1350 467 Bool_t isToTSimulated=kFALSE;
468 Bool_t misCalibPars=kFALSE;
469 if(hToT->GetEntries()>0)isToTSimulated=kTRUE;
10056aa6 470 Int_t ndigits = fDigits->GetEntriesFast();
55cb22a1 471 for (Int_t i=0;i<ndigits;i++){
472 AliTOFdigit * dig = (AliTOFdigit*)fDigits->At(i);
473 Int_t detId[5];
474 detId[0] = dig->GetSector();
475 detId[1] = dig->GetPlate();
476 detId[2] = dig->GetStrip();
477 detId[3] = dig->GetPadz();
478 detId[4] = dig->GetPadx();
b97b1350 479 dig->SetTdcND(dig->GetTdc()); // save the non decalibrated time
480 if(isToTSimulated){
481
482 //A realistic ToT Spectrum was found in input,
483 //decalibrated TOF Digits likely to be simulated....
484
10056aa6 485 Int_t index = AliTOFGeometry::GetIndex(detId); // The channel index
10056aa6 486 AliTOFChannelOffline *calChannelOffline = (AliTOFChannelOffline *)calOffline->At(index); //retrieve the info for time slewing
10056aa6 487 Double_t par[6]; // time slewing parameters
b97b1350 488
489 //check whether we actually ask for miscalibration
490
b97b1350 491 for (Int_t j = 0; j<6; j++){
10056aa6 492 par[j]=(Double_t)calChannelOffline->GetSlewPar(j);
b97b1350 493 if(par[j]!=0)misCalibPars=kTRUE;
494 }
40212801 495 AliDebug(2,Form(" Calib Pars = %f (0-th parameter for time slewing + time delay), %f, %f, %f, %f, %f ",par[0],par[1],par[2],par[3],par[4],par[5]));
496
b97b1350 497 // Now generate Realistic ToT distribution from TestBeam Data.
498 // Tot is in ns, assuming a Matching Window of 10 ns.
499
500 Float_t simToT = 0;
55cb22a1 501 Float_t trix = 0;
502 Float_t triy = 0;
72fb5d2e 503 Double_t timeCorr;
504 Double_t tToT;
340693af 505 while (simToT <= triy){
55cb22a1 506 trix = gRandom->Rndm(i);
507 triy = gRandom->Rndm(i);
340693af 508 trix = (maxToT-minToT)*trix + minToT;
509 triy = maxToTDistr*triy;
55cb22a1 510 Int_t binx=hToT->FindBin(trix);
340693af 511 simToT=hToT->GetBinContent(binx);
55cb22a1 512 }
b97b1350 513 // the generated ToT (ns)
72fb5d2e 514 tToT= (Double_t) trix; // to apply slewing we start from ns..
515 // transform TOF signal in ns
516 AliDebug(2,Form(" The Initial Time (counts): %i: ",dig->GetTdc()));
10056aa6 517 AliDebug(2,Form(" Time before miscalibration (ps) %e: ",dig->GetTdc()*(Double_t)AliTOFGeometry::TdcBinWidth()));
b97b1350 518 // add slewing effect
72fb5d2e 519 timeCorr=par[0] + tToT*(par[1] +tToT*(par[2] +tToT*(par[3] +tToT*(par[4] +tToT*par[5]))));
40212801 520 AliDebug(2,Form(" The Time slewing + delay (ns): %f: ",timeCorr));
b97b1350 521 // add global time shift
72fb5d2e 522 //convert to ps
54d4fb19 523 timeCorr*=1E3;
10056aa6 524 Double_t timeMis = (Double_t)(dig->GetTdc())*(Double_t)AliTOFGeometry::TdcBinWidth();
72fb5d2e 525 timeMis = timeMis+timeCorr;
526 AliDebug(2,Form(" The Miscalibrated time (ps): %e: ",timeMis));
527
528 // now update the digit info
529
530 Int_t tdcCorr= (Int_t)(timeMis/AliTOFGeometry::TdcBinWidth());
531 AliDebug(2,Form(" Final Time (counts): %i: ",tdcCorr));
bf33f8f0 532 // Setting Decalibrated Time signal (TDC counts)
72fb5d2e 533 dig->SetTdc(tdcCorr);
534 // Setting realistic ToT signal (TDC counts)
535 tToT*=1E3; //back to ps
536 Int_t tot=(Int_t)(tToT/AliTOFGeometry::ToTBinWidth());//(factor 1E3 as input ToT is in ns)
bf33f8f0 537 dig->SetToT(tot);
10056aa6 538 AliDebug(2,Form(" Final Time and ToT (counts): %i: , %i:",dig->GetTdc(),dig->GetToT()));
72fb5d2e 539 if(tdcCorr<0){
540 AliWarning (Form(" The bad Slewed Time(TDC counts)= %i ", tdcCorr));
bf33f8f0 541 AliWarning(Form(" The bad ToT (TDC counts)= %i ", tot));
542 }
55cb22a1 543 }
b97b1350 544 else{
545 // For Data with no Miscalibration, set ToT signal == Adc
bf33f8f0 546 dig->SetToT((Int_t)(dig->GetAdc()/AliTOFGeometry::ToTBinWidth())); //remove the factor 10^3 just to have a reasonable ToT range for raw data simulation even in the case of non-realistic ToT distribution (n.b. fAdc is practically an arbitrary quantity, and ToT has no impact on the TOF reco for non-miscalibrated digits)
55cb22a1 547 }
55cb22a1 548 }
549
b97b1350 550 if(!isToTSimulated){
ba795372 551 AliDebug(1,"Standard Production, no miscalibrated digits");
55cb22a1 552 }else{
b97b1350 553 if(!misCalibPars){
554 AliDebug(1,"Standard Production, no miscalibrated digits");
555 }
556 else {
557 AliDebug(1,"Simulating miscalibrated digits");
558 }
55cb22a1 559 }
55cb22a1 560 return;
561}
562