Skip to content

Commit e8aa43a

Browse files
author
Nicolas Strangmann
committed
[PWGJE/EMCal] Add temp calib qa and mc energy shift to correction task
1 parent 0438000 commit e8aa43a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

PWGJE/TableProducer/emcalCorrectionTask.cxx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ struct EmcalCorrectionTask {
117117
Configurable<bool> applyTempCalib{"applyTempCalib", false, "Switch to turn on Temperature calibration."};
118118
Configurable<std::string> 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
119119
Configurable<bool> useTempCalibMean{"useTempCalibMean", false, "Switch to turn on Temperature mean calculation instead of median."};
120+
Configurable<float> mcCellEnergyShift{"mcCellEnergyShift", 1., "Relative shift of the MC cell energy. 1.1 for 10% shift to higher mass, etc. Only applied to MC."};
120121
Configurable<float> 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."};
121122

122123
// Require EMCAL cells (CALO type 1)
@@ -252,6 +253,7 @@ struct EmcalCorrectionTask {
252253
mHistManager.add("hCellEtaPhi", "hCellEtaPhi", O2HistType::kTH2F, {etaAxis, phiAxis});
253254
mHistManager.add("hHGCellTimeEnergy", "hCellTime", O2HistType::kTH2F, {{300, -30, 30}, cellEnergyBins}); // Cell time vs energy for high gain cells (low energies)
254255
mHistManager.add("hLGCellTimeEnergy", "hCellTime", O2HistType::kTH2F, {{300, -30, 30}, cellEnergyBins}); // Cell time vs energy for low gain cells (high energies)
256+
mHistManager.add("hTempCalibCorrection", "hTempCalibCorrection", O2HistType::kTH1F, {{5000, 0.5, 1.5}});
255257
// NOTE: Reversed column and row because it's more natural for presentation.
256258
mHistManager.add("hCellRowCol", "hCellRowCol;Column;Row", O2HistType::kTH2D, {{96, -0.5, 95.5}, {208, -0.5, 207.5}});
257259
mHistManager.add("hClusterE", "hClusterE", O2HistType::kTH1D, {energyAxis});
@@ -362,7 +364,9 @@ struct EmcalCorrectionTask {
362364
amplitude *= getAbsCellScale(cell.cellNumber());
363365
}
364366
if (applyTempCalib) {
365-
amplitude *= mTempCalibExtractor->getGainCalibFactor(static_cast<uint16_t>(cell.cellNumber()));
367+
float tempCalibFactor = mTempCalibExtractor->getGainCalibFactor(static_cast<uint16_t>(cell.cellNumber()));
368+
amplitude *= tempCalibFactor;
369+
mHistManager.fill(HIST("hTempCalibCorrection"), tempCalibFactor);
366370
}
367371
cellsBC.emplace_back(cell.cellNumber(),
368372
amplitude,
@@ -489,6 +493,9 @@ struct EmcalCorrectionTask {
489493
if (static_cast<bool>(hasShaperCorrection) && emcal::intToChannelType(cell.cellType()) == emcal::ChannelType_t::LOW_GAIN) { // Apply shaper correction to LG cells
490494
amplitude = o2::emcal::NonlinearityHandler::evaluateShaperCorrectionCellEnergy(amplitude);
491495
}
496+
if (mcCellEnergyShift != 1.) {
497+
amplitude *= mcCellEnergyShift; // Fine tune the MC cell energy
498+
}
492499
if (mcCellEnergyResolutionBroadening != 0.) {
493500
amplitude *= (1. + normalgaus(rdgen) * mcCellEnergyResolutionBroadening); // Fine tune the MC cell energy resolution
494501
}
@@ -612,7 +619,9 @@ struct EmcalCorrectionTask {
612619
amplitude = o2::emcal::NonlinearityHandler::evaluateShaperCorrectionCellEnergy(amplitude);
613620
}
614621
if (applyTempCalib) {
615-
amplitude *= mTempCalibExtractor->getGainCalibFactor(static_cast<uint16_t>(cell.cellNumber()));
622+
float tempCalibFactor = mTempCalibExtractor->getGainCalibFactor(static_cast<uint16_t>(cell.cellNumber()));
623+
amplitude *= tempCalibFactor;
624+
mHistManager.fill(HIST("hTempCalibCorrection"), tempCalibFactor);
616625
}
617626
cellsBC.emplace_back(cell.cellNumber(),
618627
amplitude,

0 commit comments

Comments
 (0)