@@ -123,12 +123,11 @@ void Digitizer::processHit(const o2::itsmft::Hit& hit, int evID, int srcID)
123123
124124 // Get hit time and apply smearing
125125 // Hit time is in seconds, convert to ns and add event time
126- double hitTime = hit.GetTime () * sec2ns; // convert to ns
127- double eventTimeNS = mEventTime .getTimeNS (); // event time since orbit 0
126+ double hitTime = hit.GetTime () * sec2ns; // convert to ns
127+ double eventTimeNS = mEventTime .getTimeNS (); // event time since orbit 0
128128 double eventTimeInBC = mEventTime .getTimeOffsetWrtBC ();
129- // double absoluteTime = hitTime + eventTimeNS; // absolute time
130- double absoluteTime = hitTime + eventTimeInBC; // absolute time
131- double smearedTime = smearTime (absoluteTime); // apply detector resolution
129+ double hitTimeWrtBC = hitTime + eventTimeInBC; // absolute time
130+ double smearedTime = smearTime (hitTimeWrtBC); // apply detector resolution
132131
133132 if (chipID < 0 || chipID >= mGeometry ->getSize () || mGeometry ->getSize () < 1 ) {
134133 LOG (debug) << " Invalid detector ID: " << chipID << " , geometry size: " << mGeometry ->getSize ();
@@ -356,12 +355,13 @@ void Digitizer::registerDigits(Chip& chip, uint32_t roFrame, double time, int nR
356355 nbc += mEventTime .toLong ();
357356
358357 LOG (debug) << nbc << " \t " << tdc;
358+ double absoluteTime = tdc * digitizerParams.tdcBin * 1 .e -9 + nbc * o2::constants::lhc::LHCBunchSpacingNS;
359359
360360 auto key = o2::iotof::Digit::getOrderingKey (chip.getChipIndex (), row, col);
361361 o2::iotof::LabeledDigit* existingDigit = chip.findDigit (key);
362362 if (!existingDigit) {
363363 // No existing digit, create a new one
364- chip.addDigit (row, col, nElectrons, time , nbc, tdc, label);
364+ chip.addDigit (row, col, nElectrons, absoluteTime , nbc, tdc, label);
365365 } else {
366366 // Digit already exists, update charge and labels
367367 const int storedCharge = existingDigit->getCharge ();
0 commit comments