Skip to content

Commit abab0f5

Browse files
committed
use bc timing in digit ordering key
1 parent 70dafa0 commit abab0f5

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

Detectors/Upgrades/ALICE3/IOTOF/DataFormatsIOTOF/include/DataFormatsIOTOF/Digit.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#ifndef ALICEO2_IOTOF_DIGIT_H
2020
#define ALICEO2_IOTOF_DIGIT_H
2121

22+
#include "CommonConstants/LHCConstants.h"
2223
#include "SimulationDataFormat/MCCompLabel.h"
2324
#include "DataFormatsITSMFT/Digit.h"
2425

@@ -39,9 +40,11 @@ class Digit : public o2::itsmft::Digit
3940
ULong64_t getBc() const { return mBc; }
4041
Int_t getTdc() const { return mTdc; }
4142

42-
static UInt_t getOrderingKey(UShort_t chipindex, UShort_t row, UShort_t col)
43+
static ULong64_t getOrderingKey(ULong64_t bc, UShort_t row, UShort_t col)
4344
{
44-
return (static_cast<UInt_t>(chipindex) << 16) | (static_cast<UInt_t>(row) << 8) | static_cast<UInt_t>(col);
45+
uint32_t orbit = bc / o2::constants::lhc::LHCMaxBunches;
46+
uint16_t bunch = bc % o2::constants::lhc::LHCMaxBunches;
47+
return (static_cast<ULong64_t>(orbit) << 32) | (static_cast<UInt_t>(bunch) << 16) | (static_cast<UInt_t>(row) << 8) | static_cast<UInt_t>(col);
4548
}
4649

4750
private:

Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Chip.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ Chip::Chip(Int_t index)
3434
//_______________________________________________________________________
3535
void Chip::addDigit(UShort_t row, UShort_t col, Int_t charge, double time, ULong64_t bc, Int_t tdc, o2::MCCompLabel label)
3636
{
37-
ULong64_t key = Digit::getOrderingKey(mChipIndex, row, col);
37+
ULong64_t key = Digit::getOrderingKey(bc, row, col);
3838
mDigits.emplace(std::make_pair(key, LabeledDigit(mChipIndex, row, col, charge, time, bc, tdc, label)));
3939
}

Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ void Digitizer::registerDigits(Chip& chip, uint32_t roFrame, double time, int nR
357357
LOG(debug) << nbc << "\t" << tdc;
358358
double absoluteTime = tdc * digitizerParams.tdcBin * 1.e-9 + nbc * o2::constants::lhc::LHCBunchSpacingNS;
359359

360-
auto key = o2::iotof::Digit::getOrderingKey(chip.getChipIndex(), row, col);
360+
auto key = o2::iotof::Digit::getOrderingKey(nbc, row, col);
361361
o2::iotof::LabeledDigit* existingDigit = chip.findDigit(key);
362362
if (!existingDigit) {
363363
// No existing digit, create a new one

0 commit comments

Comments
 (0)