Skip to content

Commit f98960a

Browse files
maciaccoalibuild
andauthored
[ALICE3] TF3: double number of TDC pairs + add RO column masking (#15981)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent adf79c9 commit f98960a

3 files changed

Lines changed: 36 additions & 12 deletions

File tree

‎Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/Chip.h‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,19 @@ class Chip
7878

7979
/// Resize the vector of tdc states
8080
void resizeTDCStates(int const size) { mTDCStates.resize(size); }
81-
std::vector<std::array<double, 2>>& getTDCStates() { return mTDCStates; }
81+
std::vector<std::array<double, 4>>& getTDCStates() { return mTDCStates; }
82+
83+
void resizeMaskStates(int const size) { mMaskStates.resize(size); }
84+
std::vector<double>& getMaskStates() { return mMaskStates; }
8285

8386
void addDigit(UShort_t row, UShort_t col, Int_t charge, double time, ULong64_t bc, Int_t tdc, o2::MCCompLabel label);
8487

8588
protected:
8689
Int_t mChipIndex = -1; ///< Chip ID
8790
bool mDisabled = false; ///< Flag to indicate if the chip is disabled (e.g. due to dead channels)
8891
std::map<DigitKey, o2::iotof::LabeledDigit> mDigits; ///< Map of fired digits, possibly in multiple frames
89-
std::vector<std::array<double, 2>> mTDCStates; ///< Vector of the last times the TDC pairs went busy
92+
std::vector<std::array<double, 4>> mTDCStates; ///< Vector of the last times the TDC pairs went busy
93+
std::vector<double> mMaskStates; ///< Vector of the last time the RO column was masked
9094

9195
ClassDefNV(Chip, 1);
9296
};

‎Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/DPLDigitizerParam.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ struct DPLDigitizerParam : public o2::conf::ConfigurableParamHelper<DPLDigitizer
3838
int responseMatrixSize = 1; ///< size of the response matrix (odd number)
3939

4040
int nColsPerGroup = 4; ///< number of pixel columns grouped into a readout column
41-
double tdcBusyTime = 3000.; ///< tdc pair bsuy time (default 3 us)
41+
double tdcBusyTime = 3300.; ///< tdc pair bsuy time (default 3.3 us)
42+
double maskWindow = 100.; ///< RO column masking time (default 100 ns)
4243

4344
std::string noiseFilePath{}; ///< optional noise masks file path. FIXME to be removed once switch to CCDBFetcher
4445

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

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "IOTOFSimulation/DPLDigitizerParam.h"
2121
#include "DetectorsRaw/HBFUtils.h"
2222
#include "CCDB/BasicCCDBManager.h"
23+
#include "CommonConstants/MathConstants.h"
2324

2425
#include <TCollection.h>
2526
#include <TFile.h>
@@ -63,8 +64,14 @@ void Digitizer::init()
6364
// initialize the vector of TDC states
6465
mChips[i].resizeTDCStates(nReadOutCols);
6566
for (auto& tdcStates : mChips[i].getTDCStates()) {
66-
tdcStates[0] = -999.f;
67-
tdcStates[1] = -999.f;
67+
for (int iT = 0; iT < 4; ++iT) {
68+
tdcStates[iT] = -o2::constants::math::VeryBig;
69+
}
70+
}
71+
// initialize the vector of mask states
72+
mChips[i].resizeMaskStates(nReadOutCols);
73+
for (auto& maskStates : mChips[i].getMaskStates()) {
74+
maskStates = -o2::constants::math::VeryBig;
6875
}
6976
}
7077

@@ -426,6 +433,7 @@ void Digitizer::fillOutputContainer()
426433

427434
auto& chipDigits = chip.getDigits();
428435
auto& tdcStates = chip.getTDCStates();
436+
auto& maskStates = chip.getMaskStates();
429437

430438
for (const auto& [key, digit] : chipDigits) {
431439

@@ -435,15 +443,26 @@ void Digitizer::fillOutputContainer()
435443

436444
const int colInGroup = digit.getColumn() / digitizerParams.nColsPerGroup;
437445
const double digitTime = digit.getTime();
438-
if (digitTime - tdcStates[colInGroup][0] < digitizerParams.tdcBusyTime && digitTime - tdcStates[colInGroup][1] < digitizerParams.tdcBusyTime) {
439-
// TODO: improve labels treatment if multiple hits cross the same pixel during
440-
continue; // both tdc pairs are busy
441-
} else if (digitTime - tdcStates[colInGroup][0] > digitizerParams.tdcBusyTime) {
442-
tdcStates[colInGroup][0] = digitTime;
443-
} else if (digitTime - tdcStates[colInGroup][1] > digitizerParams.tdcBusyTime) {
444-
tdcStates[colInGroup][1] = digitTime;
446+
447+
if (digitTime - maskStates[colInGroup] < digitizerParams.maskWindow) {
448+
continue; // the RO column is still masked
445449
}
446450

451+
int available = -1;
452+
for (int iT = 0; iT < 4; ++iT) {
453+
if (digitTime - tdcStates[colInGroup][iT] > digitizerParams.tdcBusyTime) {
454+
available = iT;
455+
break;
456+
}
457+
}
458+
459+
if (available == -1) {
460+
continue; // all tdc pairs are busy
461+
}
462+
463+
tdcStates[colInGroup][available] = digitTime;
464+
maskStates[colInGroup] = digitTime;
465+
447466
int digitID = mDigits->size();
448467
mDigits->emplace_back(digit.getChipIndex(), digit.getRow(), digit.getColumn(), digit.getCharge(), digit.getTime(), digit.getBc(), digit.getTdc());
449468
if (mMCLabels) {

0 commit comments

Comments
 (0)