@@ -346,13 +346,11 @@ double Digitizer::smearTime(double time, const float x, const float y) const
346346 // Apply Gaussian smearing to simulate detector time resolution
347347 const auto & digitizerParams = o2::iotof::DPLDigitizerParam::Instance ();
348348
349- float resolutionScaling = 1 .;
350- if (mResolutionMap ) {
351- const float minimumResolution = mResolutionMap ->GetMinimum ();
352- int bin = mResolutionMap ->FindBin (x * o2::iotof::Digitizer::cm2um, y * o2::iotof::Digitizer::cm2um);
353- resolutionScaling = minimumResolution > 0 . ? mResolutionMap ->GetBinContent (bin) / minimumResolution : 1 .;
354- LOG (debug) << " Time resolution map check: x=" << x * o2::iotof::Digitizer::cm2um << " , y=" << y * o2::iotof::Digitizer::cm2um << " , bin=" << bin << " , resolution=" << minimumResolution;
355- LOG (debug) << " Time resolution scaling: " << resolutionScaling;
349+ float resolution = digitizerParams.timeResolution ;
350+ if (mScaledResolutionMap ) {
351+ int bin = mScaledResolutionMap ->FindBin (x * o2::iotof::Digitizer::cm2um, y * o2::iotof::Digitizer::cm2um);
352+ resolution = mScaledResolutionMap ->GetBinContent (bin);
353+ LOG (debug) << " Time resolution map check: x=" << x * o2::iotof::Digitizer::cm2um << " , y=" << y * o2::iotof::Digitizer::cm2um << " , bin=" << bin << " , resolution=" << resolution;
356354 }
357355 float timeOfArrivalOffset = 0 .;
358356 if (mTimeOfArrivalMap ) {
@@ -362,7 +360,7 @@ double Digitizer::smearTime(double time, const float x, const float y) const
362360 }
363361
364362 if (digitizerParams.timeResolution > 0 ) {
365- return time + gRandom ->Gaus (timeOfArrivalOffset, digitizerParams. timeResolution * resolutionScaling );
363+ return time + gRandom ->Gaus (timeOfArrivalOffset, resolution );
366364 }
367365 return time;
368366}
@@ -448,14 +446,14 @@ void Digitizer::prepareScaledResolutionMap()
448446 return ;
449447 }
450448
451- mResolutionScalingMap = dynamic_cast <TH2D *>(mResolutionMap ->Clone (" hScaledResolutionMap" ));
452- mResolutionScalingMap ->SetDirectory (nullptr ); // Detach from file to avoid deletion when file is closed
449+ mScaledResolutionMap = dynamic_cast <TH2D *>(mResolutionMap ->Clone (" hScaledResolutionMap" ));
450+ mScaledResolutionMap ->SetDirectory (nullptr ); // Detach from file to avoid deletion when file is closed
453451
454- for (int binX = 1 ; binX <= mResolutionScalingMap ->GetNbinsX (); ++binX) {
455- for (int binY = 1 ; binY <= mResolutionScalingMap ->GetNbinsY (); ++binY) {
456- float originalValue = mResolutionScalingMap ->GetBinContent (binX, binY);
452+ for (int binX = 1 ; binX <= mScaledResolutionMap ->GetNbinsX (); ++binX) {
453+ for (int binY = 1 ; binY <= mScaledResolutionMap ->GetNbinsY (); ++binY) {
454+ float originalValue = mScaledResolutionMap ->GetBinContent (binX, binY);
457455 float scalingValue = originalValue / minimumResolution;
458- mResolutionScalingMap ->SetBinContent (binX, binY, scalingValue * nominalTimeResolution);
456+ mScaledResolutionMap ->SetBinContent (binX, binY, scalingValue * nominalTimeResolution);
459457 }
460458 }
461459}
@@ -555,7 +553,7 @@ void Digitizer::registerDigits(Chip& chip, uint32_t roFrame, double time, int nR
555553 int tdc = int ((time - nbc * o2::constants::lhc::LHCBunchSpacingNS) / digitizerParams.tdcBin );
556554 nbc += mEventTime .toLong ();
557555
558- double absoluteTime = tdc * digitizerParams.tdcBin * 1 . e - 9 + nbc * o2::constants::lhc::LHCBunchSpacingNS;
556+ double absoluteTime = tdc * digitizerParams.tdcBin + nbc * o2::constants::lhc::LHCBunchSpacingNS;
559557
560558 auto key = o2::iotof::Digit::getOrderingKey (nbc, tdc, row, col);
561559 o2::iotof::LabeledDigit* existingDigit = chip.findDigit (key);
0 commit comments