Skip to content

Commit 5492056

Browse files
committed
update readout: 4 tdcs + pixel masking
1 parent d0fec95 commit 5492056

3 files changed

Lines changed: 35 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
@@ -47,7 +47,8 @@ struct DPLDigitizerParam : public o2::conf::ConfigurableParamHelper<DPLDigitizer
4747
int responseMatrixSize = 1; ///< size of the response matrix (odd number)
4848

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

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

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

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,14 @@ void Digitizer::init()
6363
// initialize the vector of TDC states
6464
mChips[i].resizeTDCStates(nReadOutCols);
6565
for (auto& tdcStates : mChips[i].getTDCStates()) {
66-
tdcStates[0] = -999.f;
67-
tdcStates[1] = -999.f;
66+
for (int iT{0}; iT < 4; ++iT) {
67+
tdcStates[iT] = -999.f;
68+
}
69+
}
70+
// initialize the vector of mask states
71+
mChips[i].resizeMaskStates(nReadOutCols);
72+
for (auto& maskStates: mChips[i].getMaskStates()) {
73+
maskStates = -999.f;
6874
}
6975
}
7076

@@ -497,6 +503,7 @@ void Digitizer::fillOutputContainer()
497503

498504
auto& chipDigits = chip.getDigits();
499505
auto& tdcStates = chip.getTDCStates();
506+
auto& maskStates = chip.getMaskStates();
500507

501508
for (const auto& [key, digit] : chipDigits) {
502509

@@ -506,15 +513,26 @@ void Digitizer::fillOutputContainer()
506513

507514
const int colInGroup = digit.getColumn() / digitizerParams.nColsPerGroup;
508515
const double digitTime = digit.getTime();
509-
if (digitTime - tdcStates[colInGroup][0] < digitizerParams.tdcBusyTime && digitTime - tdcStates[colInGroup][1] < digitizerParams.tdcBusyTime) {
510-
// TODO: improve labels treatment if multiple hits cross the same pixel during
511-
continue; // both tdc pairs are busy
512-
} else if (digitTime - tdcStates[colInGroup][0] > digitizerParams.tdcBusyTime) {
513-
tdcStates[colInGroup][0] = digitTime;
514-
} else if (digitTime - tdcStates[colInGroup][1] > digitizerParams.tdcBusyTime) {
515-
tdcStates[colInGroup][1] = digitTime;
516+
517+
if (digitTime - maskStates[colInGroup] < digitizerParams.maskWindow) {
518+
continue; // the RO column is still masked
516519
}
517520

521+
int available = -1;
522+
for (int iT{0}; iT < 4; ++iT) {
523+
if (digitTime - tdcStates[colInGroup][iT] > digitizerParams.tdcBusyTime) {
524+
available = iT;
525+
break;
526+
}
527+
}
528+
529+
if (available == -1) {
530+
continue; // all tdc pairs are busy
531+
}
532+
533+
tdcStates[colInGroup][available] = digitTime;
534+
maskStates[colInGroup] = digitTime;
535+
518536
int digitID = mDigits->size();
519537
mDigits->emplace_back(digit.getChipIndex(), digit.getRow(), digit.getColumn(), digit.getCharge(), digit.getTime(), digit.getBc(), digit.getTdc());
520538
if (mMCLabels) {

0 commit comments

Comments
 (0)