From 850ccf0aadb48d556775d43fee87949904720afc Mon Sep 17 00:00:00 2001 From: Nicolas Strangmann Date: Mon, 18 Nov 2024 16:24:50 +0100 Subject: [PATCH 1/4] [PWGJE]Add offline time calibration for data in EMCalCorrectionTask --- PWGJE/TableProducer/emcalCorrectionTask.cxx | 26 ++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/PWGJE/TableProducer/emcalCorrectionTask.cxx b/PWGJE/TableProducer/emcalCorrectionTask.cxx index 968e7b86e8c..a9ff96a925e 100644 --- a/PWGJE/TableProducer/emcalCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalCorrectionTask.cxx @@ -87,7 +87,7 @@ struct EmcalCorrectionTask { Configurable exoticCellInCrossMinAmplitude{"exoticCellInCrossMinAmplitude", 0.1, "Minimum energy of cells in cross, if lower not considered in cross"}; Configurable useWeightExotic{"useWeightExotic", false, "States if weights should be used for exotic cell cut"}; Configurable isMC{"isMC", false, "States if run over MC"}; - Configurable applyCellTimeShift{"applyCellTimeShift", 0, "apply shift to the cell time; 0 = off; 1 = const shift; 2 = eta-dependent shift"}; + Configurable applyCellTimeShift{"applyCellTimeShift", 0, "apply shift to the cell time for data and MC; 0 = off; 1 = const shift; 2 = eta-dependent shift; data shifted by log function when != 0"}; // Require EMCAL cells (CALO type 1) Filter emccellfilter = aod::calo::caloType == selectedCellType; @@ -264,7 +264,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()); } @@ -383,7 +383,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()); @@ -485,7 +485,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()); } @@ -790,9 +790,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 @@ -810,7 +811,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; + } } } }; From 35b8d44e75037859f138d498cc42db89034d06c9 Mon Sep 17 00:00:00 2001 From: Nicolas Strangmann Date: Mon, 18 Nov 2024 16:32:44 +0100 Subject: [PATCH 2/4] Add includes for MegaLinter --- PWGJE/TableProducer/emcalCorrectionTask.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PWGJE/TableProducer/emcalCorrectionTask.cxx b/PWGJE/TableProducer/emcalCorrectionTask.cxx index a9ff96a925e..9e785b35acd 100644 --- a/PWGJE/TableProducer/emcalCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalCorrectionTask.cxx @@ -19,6 +19,9 @@ #include #include #include +#include +#include +#include #include "CCDB/BasicCCDBManager.h" #include "Framework/runDataProcessing.h" From e03f048b1d14a48a72e7845e760b303620b6fbd7 Mon Sep 17 00:00:00 2001 From: Nicolas Strangmann Date: Mon, 18 Nov 2024 17:09:27 +0100 Subject: [PATCH 3/4] Refine configuration help --- PWGJE/TableProducer/emcalCorrectionTask.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGJE/TableProducer/emcalCorrectionTask.cxx b/PWGJE/TableProducer/emcalCorrectionTask.cxx index 9e785b35acd..0fa45d8022c 100644 --- a/PWGJE/TableProducer/emcalCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalCorrectionTask.cxx @@ -1,3 +1,4 @@ +PWGJE/TableProducer/emcalCorrectionTask.cxx // Copyright 2019-2020 CERN and copyright holders of ALICE O2. // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. // All rights not expressly granted are reserved. @@ -90,7 +91,7 @@ struct EmcalCorrectionTask { Configurable exoticCellInCrossMinAmplitude{"exoticCellInCrossMinAmplitude", 0.1, "Minimum energy of cells in cross, if lower not considered in cross"}; Configurable useWeightExotic{"useWeightExotic", false, "States if weights should be used for exotic cell cut"}; Configurable isMC{"isMC", false, "States if run over MC"}; - Configurable applyCellTimeShift{"applyCellTimeShift", 0, "apply shift to the cell time for data and MC; 0 = off; 1 = const shift; 2 = eta-dependent shift; data shifted by log function when != 0"}; + Configurable 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; From b5d3760d634ea1fbe96775499ec2c669dd043cc0 Mon Sep 17 00:00:00 2001 From: Nicolas Strangmann Date: Mon, 18 Nov 2024 17:12:26 +0100 Subject: [PATCH 4/4] Fix mistake in first line --- PWGJE/TableProducer/emcalCorrectionTask.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGJE/TableProducer/emcalCorrectionTask.cxx b/PWGJE/TableProducer/emcalCorrectionTask.cxx index 0fa45d8022c..111841890c8 100644 --- a/PWGJE/TableProducer/emcalCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalCorrectionTask.cxx @@ -1,4 +1,3 @@ -PWGJE/TableProducer/emcalCorrectionTask.cxx // Copyright 2019-2020 CERN and copyright holders of ALICE O2. // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. // All rights not expressly granted are reserved.