Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions PWGJE/TableProducer/emcalCorrectionTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
#include <memory>
#include <unordered_map>
#include <cmath>
#include <string>
#include <tuple>
#include <vector>

#include "CCDB/BasicCCDBManager.h"
#include "Framework/runDataProcessing.h"
Expand Down Expand Up @@ -87,7 +90,7 @@ struct EmcalCorrectionTask {
Configurable<float> exoticCellInCrossMinAmplitude{"exoticCellInCrossMinAmplitude", 0.1, "Minimum energy of cells in cross, if lower not considered in cross"};
Configurable<bool> useWeightExotic{"useWeightExotic", false, "States if weights should be used for exotic cell cut"};
Configurable<bool> isMC{"isMC", false, "States if run over MC"};
Configurable<int> applyCellTimeShift{"applyCellTimeShift", 0, "apply shift to the cell time; 0 = off; 1 = const shift; 2 = eta-dependent shift"};
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"};

// Require EMCAL cells (CALO type 1)
Filter emccellfilter = aod::calo::caloType == selectedCellType;
Expand Down Expand Up @@ -264,7 +267,7 @@ struct EmcalCorrectionTask {
}
cellsBC.emplace_back(cell.cellNumber(),
amplitude,
cell.time() + getCellTimeShift(cell.cellNumber()),
cell.time() + getCellTimeShift(cell.cellNumber(), amplitude),
o2::emcal::intToChannelType(cell.cellType()));
cellIndicesBC.emplace_back(cell.globalIndex());
}
Expand Down Expand Up @@ -383,7 +386,7 @@ struct EmcalCorrectionTask {
}
cellsBC.emplace_back(cell.cellNumber(),
amplitude,
cell.time() + getCellTimeShift(cell.cellNumber()),
cell.time() + getCellTimeShift(cell.cellNumber(), amplitude),
o2::emcal::intToChannelType(cell.cellType()));
cellIndicesBC.emplace_back(cell.globalIndex());
cellLabels.emplace_back(cell.mcParticleIds(), cell.amplitudeA());
Expand Down Expand Up @@ -485,7 +488,7 @@ struct EmcalCorrectionTask {
for (auto& cell : cellsInBC) {
cellsBC.emplace_back(cell.cellNumber(),
cell.amplitude(),
cell.time() + getCellTimeShift(cell.cellNumber()),
cell.time() + getCellTimeShift(cell.cellNumber(), cell.amplitude()),
o2::emcal::intToChannelType(cell.cellType()));
cellIndicesBC.emplace_back(cell.globalIndex());
}
Expand Down Expand Up @@ -790,9 +793,10 @@ struct EmcalCorrectionTask {
}
}

// Apply shift of the cell time
// 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))
float getCellTimeShift(const int16_t cellID)
// Apply shift of the cell time in data and MC
// 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)
// In data this is done to correct for the time walk effect
float getCellTimeShift(const int16_t cellID, const float cellEnergy)
{
if (isMC) {
if (applyCellTimeShift == 1) { // constant shift
Expand All @@ -810,7 +814,16 @@ struct EmcalCorrectionTask {
return 0.f;
}
} else { // data
return 0.f;
if (applyCellTimeShift != 0) {
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
return 0.f;
else if (cellEnergy < 4.) // Low energy regime
return (0.57284 + 0.82194 * TMath::Log(1.30651 * cellEnergy)); // Parameters extracted from LHC22o (pp), but also usable for other periods
else // High energy regime
return (-0.05858 + 1.50593 * TMath::Log(0.97591 * cellEnergy)); // Parameters extracted from LHC22o (pp), but also usable for other periods
} else { // Dont apply cell time shift if applyCellTimeShift == 0
return 0.f;
}
}
}
};
Expand Down