|
| 1 | +diff --git a/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/Chip.h b/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/Chip.h |
| 2 | +index 1849907d6e..a692fa2a5b 100644 |
| 3 | +--- a/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/Chip.h |
| 4 | ++++ b/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/Chip.h |
| 5 | +@@ -78,7 +78,10 @@ class Chip |
| 6 | + |
| 7 | + /// Resize the vector of tdc states |
| 8 | + void resizeTDCStates(int const size) { mTDCStates.resize(size); } |
| 9 | +- std::vector<std::array<double, 2>>& getTDCStates() { return mTDCStates; } |
| 10 | ++ std::vector<std::array<double, 4>>& getTDCStates() { return mTDCStates; } |
| 11 | ++ |
| 12 | ++ void resizeMaskStates(int const size) { mMaskStates.resize(size); } |
| 13 | ++ std::vector<double>& getMaskStates() { return mMaskStates; } |
| 14 | + |
| 15 | + void addDigit(UShort_t row, UShort_t col, Int_t charge, double time, ULong64_t bc, Int_t tdc, o2::MCCompLabel label); |
| 16 | + |
| 17 | +@@ -86,7 +89,8 @@ class Chip |
| 18 | + Int_t mChipIndex = -1; ///< Chip ID |
| 19 | + bool mDisabled = false; ///< Flag to indicate if the chip is disabled (e.g. due to dead channels) |
| 20 | + std::map<DigitKey, o2::iotof::LabeledDigit> mDigits; ///< Map of fired digits, possibly in multiple frames |
| 21 | +- std::vector<std::array<double, 2>> mTDCStates; ///< Vector of the last times the TDC pairs went busy |
| 22 | ++ std::vector<std::array<double, 4>> mTDCStates; ///< Vector of the last times the TDC pairs went busy |
| 23 | ++ std::vector<double> mMaskStates; ///< Vector of the last time the RO column was masked |
| 24 | + |
| 25 | + ClassDefNV(Chip, 1); |
| 26 | + }; |
| 27 | +diff --git a/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/DPLDigitizerParam.h b/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/DPLDigitizerParam.h |
| 28 | +index 48c873d86d..520ac14265 100644 |
| 29 | +--- a/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/DPLDigitizerParam.h |
| 30 | ++++ b/Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/DPLDigitizerParam.h |
| 31 | +@@ -47,7 +47,8 @@ struct DPLDigitizerParam : public o2::conf::ConfigurableParamHelper<DPLDigitizer |
| 32 | + int responseMatrixSize = 1; ///< size of the response matrix (odd number) |
| 33 | + |
| 34 | + int nColsPerGroup = 4; ///< number of pixel columns grouped into a readout column |
| 35 | +- double tdcBusyTime = 3000.; ///< tdc pair bsuy time (default 3 us) |
| 36 | ++ double tdcBusyTime = 3300.; ///< tdc pair bsuy time (default 3.3 us) |
| 37 | ++ double maskWindow = 100.; ///< RO column masking time (default 100 ns) |
| 38 | + |
| 39 | + std::string noiseFilePath{}; ///< optional noise masks file path. FIXME to be removed once switch to CCDBFetcher |
| 40 | + |
| 41 | +diff --git a/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx b/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx |
| 42 | +index a7adbb9b24..38b9c27611 100644 |
| 43 | +--- a/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx |
| 44 | ++++ b/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx |
| 45 | +@@ -63,8 +63,14 @@ void Digitizer::init() |
| 46 | + // initialize the vector of TDC states |
| 47 | + mChips[i].resizeTDCStates(nReadOutCols); |
| 48 | + for (auto& tdcStates : mChips[i].getTDCStates()) { |
| 49 | +- tdcStates[0] = -999.f; |
| 50 | +- tdcStates[1] = -999.f; |
| 51 | ++ for (int iT{0}; iT < 4; ++iT) { |
| 52 | ++ tdcStates[iT] = -999.f; |
| 53 | ++ } |
| 54 | ++ } |
| 55 | ++ // initialize the vector of mask states |
| 56 | ++ mChips[i].resizeMaskStates(nReadOutCols); |
| 57 | ++ for (auto& maskStates: mChips[i].getMaskStates()) { |
| 58 | ++ maskStates = -999.f; |
| 59 | + } |
| 60 | + } |
| 61 | + |
| 62 | +@@ -497,6 +503,7 @@ void Digitizer::fillOutputContainer() |
| 63 | + |
| 64 | + auto& chipDigits = chip.getDigits(); |
| 65 | + auto& tdcStates = chip.getTDCStates(); |
| 66 | ++ auto& maskStates = chip.getMaskStates(); |
| 67 | + |
| 68 | + for (const auto& [key, digit] : chipDigits) { |
| 69 | + |
| 70 | +@@ -506,15 +513,26 @@ void Digitizer::fillOutputContainer() |
| 71 | + |
| 72 | + const int colInGroup = digit.getColumn() / digitizerParams.nColsPerGroup; |
| 73 | + const double digitTime = digit.getTime(); |
| 74 | +- if (digitTime - tdcStates[colInGroup][0] < digitizerParams.tdcBusyTime && digitTime - tdcStates[colInGroup][1] < digitizerParams.tdcBusyTime) { |
| 75 | +- // TODO: improve labels treatment if multiple hits cross the same pixel during |
| 76 | +- continue; // both tdc pairs are busy |
| 77 | +- } else if (digitTime - tdcStates[colInGroup][0] > digitizerParams.tdcBusyTime) { |
| 78 | +- tdcStates[colInGroup][0] = digitTime; |
| 79 | +- } else if (digitTime - tdcStates[colInGroup][1] > digitizerParams.tdcBusyTime) { |
| 80 | +- tdcStates[colInGroup][1] = digitTime; |
| 81 | ++ |
| 82 | ++ if (digitTime - maskStates[colInGroup] < digitizerParams.maskWindow) { |
| 83 | ++ continue; // the RO column is still masked |
| 84 | + } |
| 85 | + |
| 86 | ++ int available = -1; |
| 87 | ++ for (int iT{0}; iT < 4; ++iT) { |
| 88 | ++ if (digitTime - tdcStates[colInGroup][iT] > digitizerParams.tdcBusyTime) { |
| 89 | ++ available = iT; |
| 90 | ++ break; |
| 91 | ++ } |
| 92 | ++ } |
| 93 | ++ |
| 94 | ++ if (available == -1) { |
| 95 | ++ continue; // all tdc pairs are busy |
| 96 | ++ } |
| 97 | ++ |
| 98 | ++ tdcStates[colInGroup][available] = digitTime; |
| 99 | ++ maskStates[colInGroup] = digitTime; |
| 100 | ++ |
| 101 | + int digitID = mDigits->size(); |
| 102 | + mDigits->emplace_back(digit.getChipIndex(), digit.getRow(), digit.getColumn(), digit.getCharge(), digit.getTime(), digit.getBc(), digit.getTdc()); |
| 103 | + if (mMCLabels) { |
0 commit comments