From e8aa43afb54900a6bd1c25c5b113d1c5fd65e189 Mon Sep 17 00:00:00 2001 From: Nicolas Strangmann Date: Sun, 6 Jul 2025 20:33:43 +0200 Subject: [PATCH] [PWGJE/EMCal] Add temp calib qa and mc energy shift to correction task --- PWGJE/TableProducer/emcalCorrectionTask.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/PWGJE/TableProducer/emcalCorrectionTask.cxx b/PWGJE/TableProducer/emcalCorrectionTask.cxx index c46d5e1ebcd..d6eabd1bb0d 100644 --- a/PWGJE/TableProducer/emcalCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalCorrectionTask.cxx @@ -117,6 +117,7 @@ struct EmcalCorrectionTask { Configurable applyTempCalib{"applyTempCalib", false, "Switch to turn on Temperature calibration."}; Configurable pathTempCalibCCDB{"pathTempCalibCCDB", "Users/j/jokonig/EMCalTempCalibParams", "Path in the ccdb where slope and intercept for each cell are stored"}; // change to official path as soon as it is available Configurable useTempCalibMean{"useTempCalibMean", false, "Switch to turn on Temperature mean calculation instead of median."}; + Configurable mcCellEnergyShift{"mcCellEnergyShift", 1., "Relative shift of the MC cell energy. 1.1 for 10% shift to higher mass, etc. Only applied to MC."}; Configurable mcCellEnergyResolutionBroadening{"mcCellEnergyResolutionBroadening", 0., "Relative widening of the MC cell energy resolution. 0 for no widening, 0.1 for 10% widening, etc. Only applied to MC."}; // Require EMCAL cells (CALO type 1) @@ -252,6 +253,7 @@ struct EmcalCorrectionTask { mHistManager.add("hCellEtaPhi", "hCellEtaPhi", O2HistType::kTH2F, {etaAxis, phiAxis}); mHistManager.add("hHGCellTimeEnergy", "hCellTime", O2HistType::kTH2F, {{300, -30, 30}, cellEnergyBins}); // Cell time vs energy for high gain cells (low energies) mHistManager.add("hLGCellTimeEnergy", "hCellTime", O2HistType::kTH2F, {{300, -30, 30}, cellEnergyBins}); // Cell time vs energy for low gain cells (high energies) + mHistManager.add("hTempCalibCorrection", "hTempCalibCorrection", O2HistType::kTH1F, {{5000, 0.5, 1.5}}); // NOTE: Reversed column and row because it's more natural for presentation. mHistManager.add("hCellRowCol", "hCellRowCol;Column;Row", O2HistType::kTH2D, {{96, -0.5, 95.5}, {208, -0.5, 207.5}}); mHistManager.add("hClusterE", "hClusterE", O2HistType::kTH1D, {energyAxis}); @@ -362,7 +364,9 @@ struct EmcalCorrectionTask { amplitude *= getAbsCellScale(cell.cellNumber()); } if (applyTempCalib) { - amplitude *= mTempCalibExtractor->getGainCalibFactor(static_cast(cell.cellNumber())); + float tempCalibFactor = mTempCalibExtractor->getGainCalibFactor(static_cast(cell.cellNumber())); + amplitude *= tempCalibFactor; + mHistManager.fill(HIST("hTempCalibCorrection"), tempCalibFactor); } cellsBC.emplace_back(cell.cellNumber(), amplitude, @@ -489,6 +493,9 @@ struct EmcalCorrectionTask { if (static_cast(hasShaperCorrection) && emcal::intToChannelType(cell.cellType()) == emcal::ChannelType_t::LOW_GAIN) { // Apply shaper correction to LG cells amplitude = o2::emcal::NonlinearityHandler::evaluateShaperCorrectionCellEnergy(amplitude); } + if (mcCellEnergyShift != 1.) { + amplitude *= mcCellEnergyShift; // Fine tune the MC cell energy + } if (mcCellEnergyResolutionBroadening != 0.) { amplitude *= (1. + normalgaus(rdgen) * mcCellEnergyResolutionBroadening); // Fine tune the MC cell energy resolution } @@ -612,7 +619,9 @@ struct EmcalCorrectionTask { amplitude = o2::emcal::NonlinearityHandler::evaluateShaperCorrectionCellEnergy(amplitude); } if (applyTempCalib) { - amplitude *= mTempCalibExtractor->getGainCalibFactor(static_cast(cell.cellNumber())); + float tempCalibFactor = mTempCalibExtractor->getGainCalibFactor(static_cast(cell.cellNumber())); + amplitude *= tempCalibFactor; + mHistManager.fill(HIST("hTempCalibCorrection"), tempCalibFactor); } cellsBC.emplace_back(cell.cellNumber(), amplitude,