Skip to content

Commit 344730c

Browse files
nstrangmNicolas Strangmann
andauthored
[PWGJE,EMCAL-670] Add separate HG/LG cell time QC histos for time calib (#8769)
Co-authored-by: Nicolas Strangmann <nicolas.strangmann@.cern.ch>
1 parent fccfc7f commit 344730c

File tree

1 file changed

+29
-11
lines changed

1 file changed

+29
-11
lines changed

PWGJE/TableProducer/emcalCorrectionTask.cxx

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,15 @@ struct EmcalCorrectionTask {
183183

184184
LOG(debug) << "Completed init!";
185185

186+
// Define the cell energy binning
187+
std::vector<double> cellEnergyBins;
188+
for (int i = 0; i < 51; i++)
189+
cellEnergyBins.emplace_back(0.1 * (i - 0) + 0.0); // from 0 to 5 GeV/c, every 0.1 GeV
190+
for (int i = 51; i < 76; i++)
191+
cellEnergyBins.emplace_back(0.2 * (i - 51) + 5.2); // from 5.2 to 10.0 GeV, every 0.2 GeV
192+
for (int i = 76; i < 166; i++)
193+
cellEnergyBins.emplace_back(1. * (i - 76) + 11.); // from 11.0 to 100. GeV, every 1 GeV
194+
186195
// Setup QA hists.
187196
// NOTE: This is not comprehensive.
188197
using o2HistType = o2::framework::HistType;
@@ -195,7 +204,8 @@ struct EmcalCorrectionTask {
195204
mHistManager.add("hCellE", "hCellE", o2HistType::kTH1F, {energyAxis});
196205
mHistManager.add("hCellTowerID", "hCellTowerID", o2HistType::kTH1D, {{20000, 0, 20000}});
197206
mHistManager.add("hCellEtaPhi", "hCellEtaPhi", o2HistType::kTH2F, {etaAxis, phiAxis});
198-
mHistManager.add("hCellTimeEnergy", "hCellTime", o2HistType::kTH2F, {{300, -30, 30}, {200, 0., 20.}});
207+
mHistManager.add("hHGCellTimeEnergy", "hCellTime", o2HistType::kTH2F, {{300, -30, 30}, cellEnergyBins}); // Cell time vs energy for high gain cells (low energies)
208+
mHistManager.add("hLGCellTimeEnergy", "hCellTime", o2HistType::kTH2F, {{300, -30, 30}, cellEnergyBins}); // Cell time vs energy for low gain cells (high energies)
199209
// NOTE: Reversed column and row because it's more natural for presentation.
200210
mHistManager.add("hCellRowCol", "hCellRowCol;Column;Row", o2HistType::kTH2D, {{96, -0.5, 95.5}, {208, -0.5, 207.5}});
201211
mHistManager.add("hClusterE", "hClusterE", o2HistType::kTH1F, {energyAxis});
@@ -276,7 +286,7 @@ struct EmcalCorrectionTask {
276286
}
277287
cellsBC.emplace_back(cell.cellNumber(),
278288
amplitude,
279-
cell.time() + getCellTimeShift(cell.cellNumber(), amplitude),
289+
cell.time() + getCellTimeShift(cell.cellNumber(), amplitude, o2::emcal::intToChannelType(cell.cellType())),
280290
o2::emcal::intToChannelType(cell.cellType()));
281291
cellIndicesBC.emplace_back(cell.globalIndex());
282292
}
@@ -395,7 +405,7 @@ struct EmcalCorrectionTask {
395405
}
396406
cellsBC.emplace_back(cell.cellNumber(),
397407
amplitude,
398-
cell.time() + getCellTimeShift(cell.cellNumber(), amplitude),
408+
cell.time() + getCellTimeShift(cell.cellNumber(), amplitude, o2::emcal::intToChannelType(cell.cellType())),
399409
o2::emcal::intToChannelType(cell.cellType()));
400410
cellIndicesBC.emplace_back(cell.globalIndex());
401411
cellLabels.emplace_back(cell.mcParticleIds(), cell.amplitudeA());
@@ -497,7 +507,7 @@ struct EmcalCorrectionTask {
497507
for (auto& cell : cellsInBC) {
498508
cellsBC.emplace_back(cell.cellNumber(),
499509
cell.amplitude(),
500-
cell.time() + getCellTimeShift(cell.cellNumber(), cell.amplitude()),
510+
cell.time() + getCellTimeShift(cell.cellNumber(), cell.amplitude(), o2::emcal::intToChannelType(cell.cellType())),
501511
o2::emcal::intToChannelType(cell.cellType()));
502512
cellIndicesBC.emplace_back(cell.globalIndex());
503513
}
@@ -779,7 +789,10 @@ struct EmcalCorrectionTask {
779789
// For convenience, use the clusterizer stored geometry to get the eta-phi
780790
for (auto& cell : cellsBC) {
781791
mHistManager.fill(HIST("hCellE"), cell.getEnergy());
782-
mHistManager.fill(HIST("hCellTimeEnergy"), cell.getTimeStamp(), cell.getEnergy());
792+
if (cell.getLowGain())
793+
mHistManager.fill(HIST("hLGCellTimeEnergy"), cell.getTimeStamp(), cell.getEnergy());
794+
else if (cell.getHighGain())
795+
mHistManager.fill(HIST("hHGCellTimeEnergy"), cell.getTimeStamp(), cell.getEnergy());
783796
mHistManager.fill(HIST("hCellTowerID"), cell.getTower());
784797
auto res = mClusterizers.at(0)->getGeometry()->EtaPhiFromIndex(cell.getTower());
785798
mHistManager.fill(HIST("hCellEtaPhi"), std::get<0>(res), TVector2::Phi_0_2pi(std::get<1>(res)));
@@ -809,7 +822,7 @@ struct EmcalCorrectionTask {
809822
// Apply shift of the cell time in data and MC
810823
// In MC this has to be done to shift the cell time, which is not calibrated to 0 due to the flight time of the particles to the EMCal surface (~15ns)
811824
// In data this is done to correct for the time walk effect
812-
float getCellTimeShift(const int16_t cellID, const float cellEnergy)
825+
float getCellTimeShift(const int16_t cellID, const float cellEnergy, const o2::emcal::ChannelType_t cellType)
813826
{
814827
if (!applyCellTimeCorrection) {
815828
return 0.f;
@@ -825,13 +838,18 @@ struct EmcalCorrectionTask {
825838
// Also smear the time to account for the broader time resolution in data than in MC
826839
timesmear = normalgaus(rdgen) * (1.6 + 9.5 * TMath::Exp(-3. * cellEnergy)); // Parameters extracted from LHC22o (pp), but also usable for other periods
827840
} else { // data
828-
if (cellEnergy < 0.3) // Cells with tless than 300 MeV cannot be the leading cell in the cluster, so their time does not require precise calibration
841+
if (cellEnergy < 0.3) { // Cells with tless than 300 MeV cannot be the leading cell in the cluster, so their time does not require precise calibration
829842
timeshift = 0.;
830-
else if (cellEnergy < 4.) // Low energy regime
831-
timeshift = 0.57284 + 0.82194 * TMath::Log(1.30651 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods
832-
else // High energy regime
833-
timeshift = -0.05858 + 1.50593 * TMath::Log(0.97591 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods
843+
} else if (cellType == o2::emcal::ChannelType_t::HIGH_GAIN) { // High gain cells -> Low energies
844+
if (cellEnergy < 4.) // Low energy regime
845+
timeshift = 0.57284 + 0.82194 * TMath::Log(1.30651 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods
846+
else // Medium energy regime
847+
timeshift = -0.05858 + 1.50593 * TMath::Log(0.97591 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods
848+
} else if (cellType == o2::emcal::ChannelType_t::LOW_GAIN) { // Low gain cells -> High energies
849+
timeshift = -0.05858 + 1.50593 * TMath::Log(0.97591 * cellEnergy); // Parameters extracted from LHC22o (pp), will be updated by LHC24aj input
850+
}
834851
}
852+
835853
LOG(debug) << "Shift the cell time by " << timeshift << " + " << timesmear << " ns";
836854
return timeshift + timesmear;
837855
}

0 commit comments

Comments
 (0)