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