Skip to content

Commit 80801b9

Browse files
nstrangmNicolas Strangmann
andauthored
[PWGJE] [PWGJE]Add offline time calibration for data in EMCalCorrectionTask (#8513)
Co-authored-by: Nicolas Strangmann <nicolas.strangmann@.cern.ch>
1 parent c940d60 commit 80801b9

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

PWGJE/TableProducer/emcalCorrectionTask.cxx

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
#include <memory>
2020
#include <unordered_map>
2121
#include <cmath>
22+
#include <string>
23+
#include <tuple>
24+
#include <vector>
2225

2326
#include "CCDB/BasicCCDBManager.h"
2427
#include "Framework/runDataProcessing.h"
@@ -87,7 +90,7 @@ struct EmcalCorrectionTask {
8790
Configurable<float> exoticCellInCrossMinAmplitude{"exoticCellInCrossMinAmplitude", 0.1, "Minimum energy of cells in cross, if lower not considered in cross"};
8891
Configurable<bool> useWeightExotic{"useWeightExotic", false, "States if weights should be used for exotic cell cut"};
8992
Configurable<bool> isMC{"isMC", false, "States if run over MC"};
90-
Configurable<int> applyCellTimeShift{"applyCellTimeShift", 0, "apply shift to the cell time; 0 = off; 1 = const shift; 2 = eta-dependent shift"};
93+
Configurable<int> applyCellTimeShift{"applyCellTimeShift", 0, "apply shift to the cell time for data and MC; For data: 0 = off; non-zero = log function extracted from data - For MC: 0 = off; 1 = const shift; 2 = eta-dependent shift"};
9194

9295
// Require EMCAL cells (CALO type 1)
9396
Filter emccellfilter = aod::calo::caloType == selectedCellType;
@@ -264,7 +267,7 @@ struct EmcalCorrectionTask {
264267
}
265268
cellsBC.emplace_back(cell.cellNumber(),
266269
amplitude,
267-
cell.time() + getCellTimeShift(cell.cellNumber()),
270+
cell.time() + getCellTimeShift(cell.cellNumber(), amplitude),
268271
o2::emcal::intToChannelType(cell.cellType()));
269272
cellIndicesBC.emplace_back(cell.globalIndex());
270273
}
@@ -383,7 +386,7 @@ struct EmcalCorrectionTask {
383386
}
384387
cellsBC.emplace_back(cell.cellNumber(),
385388
amplitude,
386-
cell.time() + getCellTimeShift(cell.cellNumber()),
389+
cell.time() + getCellTimeShift(cell.cellNumber(), amplitude),
387390
o2::emcal::intToChannelType(cell.cellType()));
388391
cellIndicesBC.emplace_back(cell.globalIndex());
389392
cellLabels.emplace_back(cell.mcParticleIds(), cell.amplitudeA());
@@ -485,7 +488,7 @@ struct EmcalCorrectionTask {
485488
for (auto& cell : cellsInBC) {
486489
cellsBC.emplace_back(cell.cellNumber(),
487490
cell.amplitude(),
488-
cell.time() + getCellTimeShift(cell.cellNumber()),
491+
cell.time() + getCellTimeShift(cell.cellNumber(), cell.amplitude()),
489492
o2::emcal::intToChannelType(cell.cellType()));
490493
cellIndicesBC.emplace_back(cell.globalIndex());
491494
}
@@ -790,9 +793,10 @@ struct EmcalCorrectionTask {
790793
}
791794
}
792795

793-
// Apply shift of the cell time
794-
// This has to be done to shift the cell time in MC (which is not calibrated to 0 due to the flight time of the particles to the EMCal surface (~15ns))
795-
float getCellTimeShift(const int16_t cellID)
796+
// Apply shift of the cell time in data and MC
797+
// 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)
798+
// In data this is done to correct for the time walk effect
799+
float getCellTimeShift(const int16_t cellID, const float cellEnergy)
796800
{
797801
if (isMC) {
798802
if (applyCellTimeShift == 1) { // constant shift
@@ -810,7 +814,16 @@ struct EmcalCorrectionTask {
810814
return 0.f;
811815
}
812816
} else { // data
813-
return 0.f;
817+
if (applyCellTimeShift != 0) {
818+
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
819+
return 0.f;
820+
else if (cellEnergy < 4.) // Low energy regime
821+
return (0.57284 + 0.82194 * TMath::Log(1.30651 * cellEnergy)); // Parameters extracted from LHC22o (pp), but also usable for other periods
822+
else // High energy regime
823+
return (-0.05858 + 1.50593 * TMath::Log(0.97591 * cellEnergy)); // Parameters extracted from LHC22o (pp), but also usable for other periods
824+
} else { // Dont apply cell time shift if applyCellTimeShift == 0
825+
return 0.f;
826+
}
814827
}
815828
}
816829
};

0 commit comments

Comments
 (0)