Skip to content

Commit 3d4ac64

Browse files
committed
allow calculation of 2D params in finalize() for pulse shape 2D scan
1 parent 2399476 commit 3d4ac64

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Detectors/ITSMFT/ITS/workflow/src/ThresholdCalibratorSpec.cxx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,7 @@ void ITSThresholdCalibrator::run(ProcessingContext& pc)
15161516
if (mPixelHits.count(chipID)) {
15171517
if (mPixelHits[chipID].count(row)) { // make sure the row exists
15181518
extractAndUpdate(chipID, row);
1519-
if (mScanType != 'r' || mLoopVal[ruIndex][row] == mMax) {
1519+
if (mScanType != 'p' && (mScanType != 'r' || mLoopVal[ruIndex][row] == mMax)) { // do not erase for scantype = p because in finalize() we have calculate2Dparams
15201520
mPixelHits[chipID].erase(row);
15211521
}
15221522
}
@@ -1901,11 +1901,15 @@ void ITSThresholdCalibrator::finalize()
19011901
if (mVerboseOutput) {
19021902
LOG(info) << "Extracting hits from pulse shape scan or vresetd scan, chip " << itchip->first;
19031903
}
1904-
auto itrow = this->mPixelHits[itchip->first].cbegin();
1905-
while (itrow != mPixelHits[itchip->first].cend()) { // in case there are multiple rows, for now it's 1 row
1906-
this->extractAndUpdate(itchip->first, itrow->first); // fill the tree - for mScanType = p and t, it is done already in run()
1907-
++itrow;
1904+
1905+
if (mScanType != 'p') { // done already in run()
1906+
auto itrow = this->mPixelHits[itchip->first].cbegin();
1907+
while (itrow != mPixelHits[itchip->first].cend()) { // in case there are multiple rows, for now it's 1 row
1908+
this->extractAndUpdate(itchip->first, itrow->first); // fill the tree - for mScanType = p, it is done already in run()
1909+
++itrow;
1910+
}
19081911
}
1912+
19091913
if (mCalculate2DParams && (mScanType == 'P' || mScanType == 'p')) {
19101914
this->addDatabaseEntry(itchip->first, name, mScanType == 'P' ? calculatePulseParams(itchip->first) : calculatePulseParams2D(itchip->first), false);
19111915
}

0 commit comments

Comments
 (0)