31 Streamer* debugStream =
nullptr;
33 mStreamer.setStreamer(
"debug_digits",
"UPDATE");
34 debugStream = &mStreamer;
38 const auto digitizationMode = eleParam.DigiMode;
39 int nProcessedTimeBins = 0;
40 TimeBin timeBin = (isContinuous) ? mFirstTimeBin : 0;
49 const CalPad* padParams[3] = {
nullptr,
nullptr,
nullptr};
51 if (eleParam.doIonTailPerPad) {
53 if (itSettings.padITCorrFile.size()) {
54 cdb.setFEEParamsFromFile(itSettings.padITCorrFile);
56 padParams[0] = &cdb.getITFraction();
57 padParams[1] = &cdb.getITExpLambda();
59 if (eleParam.doCommonModePerPad) {
60 padParams[2] = &cdb.getCMkValues();
63 const bool needsPrevDigArray = eleParam.doIonTail || eleParam.doIonTailPerPad || eleParam.doSaturationTail;
64 const bool needsEmptyTimeBins = needsPrevDigArray || eleParam.doNoiseEmptyPads;
67 if (needsPrevDigArray && !mPrevDigArr) {
68 mPrevDigArr = std::make_unique<DigitTime::PrevDigitInfoArray>();
73 if (eleParam.applyDeadMap) {
74 deadMap = &cdb.getDeadChannelMap();
77 static bool reportedSettings =
false;
78 if (!reportedSettings) {
81 LOGP(info,
"Using dead map with {} masked pads", deadMap->
getSum<
int>());
83 reportedSettings =
true;
86 for (
auto&
time : mTimeBins) {
89 if (!((nProcessedTimeBins + mFirstTimeBin < eventTimeBin) || !isContinuous || finalFlush)) {
93 if (!isContinuous && timeBin > mTmaxTriggered) {
98 if (needsEmptyTimeBins && !
time) {
102 if (maxTimeBinForTimeFrame != -1 && timeBin >= maxTimeBinForTimeFrame) {
103 LOG(warn) <<
"Timebin going beyond timeframe limit .. truncating flush " << timeBin;
110 switch (digitizationMode) {
136 const auto& feeConfig = cdb.getFEEConfig();
137 if (feeConfig.isCMCEnabled()) {
147 ++nProcessedTimeBins;
151 if (nProcessedTimeBins > 0) {
152 mFirstTimeBin += nProcessedTimeBins;
153 while (nProcessedTimeBins--) {
154 auto popped = mTimeBins.front();
155 mTimeBins.pop_front();
167 eleParam.doIonTail, eleParam.doIonTailPerPad, eleParam.doCommonModePerPad, eleParam.doSaturationTail, eleParam.doNoiseEmptyPads, eleParam.applyDeadMap, eleParam.commonModeCoupling, (
int)eleParam.DigiMode);
void fillOutputContainer(std::vector< Digit > &output, dataformats::MCTruthContainer< MCCompLabel > &mcTruth, std::vector< CommonMode > &commonModeOutput, const Sector §or, TimeBin timeBin, PrevDigitInfoArray *prevTime=nullptr, Streamer *debugStream=nullptr, const CalPad *itParams[2]=nullptr, const CalDet< bool > *deadMap=nullptr)