From 0ce6748eae75860efd588d6a0844aa03f83734be Mon Sep 17 00:00:00 2001 From: wiechula Date: Thu, 9 Nov 2023 00:54:43 +0100 Subject: [PATCH] Fix TimeGain calibration application: limit to fit range --- .../TPC/include/DataFormatsTPC/CalibdEdxCorrection.h | 8 +++++++- .../TPC/calibration/include/TPCCalibration/CalibdEdx.h | 7 +++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/DataFormats/Detectors/TPC/include/DataFormatsTPC/CalibdEdxCorrection.h b/DataFormats/Detectors/TPC/include/DataFormatsTPC/CalibdEdxCorrection.h index eb9fd33c27476..4225faf8437c4 100644 --- a/DataFormats/Detectors/TPC/include/DataFormatsTPC/CalibdEdxCorrection.h +++ b/DataFormats/Detectors/TPC/include/DataFormatsTPC/CalibdEdxCorrection.h @@ -30,6 +30,11 @@ namespace o2::tpc { +namespace conf_dedx_corr +{ +GPUconstexpr() float TglScale[4] = {1.9, 1.5, 1.22, 1.02}; ///< Max Tgl values for each ROC type +} + class CalibdEdxCorrection { public: @@ -54,7 +59,8 @@ class CalibdEdxCorrection return 1; } - tgl = o2::gpu::CAMath::Abs(tgl); + // limit to the fit range in the respective region + tgl = o2::gpu::CAMath::Min(conf_dedx_corr::TglScale[stack.type], o2::gpu::CAMath::Abs(tgl)); auto p = mParams[stackIndex(stack, charge)]; float result = p[0]; // Tgl part diff --git a/Detectors/TPC/calibration/include/TPCCalibration/CalibdEdx.h b/Detectors/TPC/calibration/include/TPCCalibration/CalibdEdx.h index 54b9d6f98ee35..b07d00c132175 100644 --- a/Detectors/TPC/calibration/include/TPCCalibration/CalibdEdx.h +++ b/Detectors/TPC/calibration/include/TPCCalibration/CalibdEdx.h @@ -136,11 +136,10 @@ class CalibdEdx /// Save the histograms to a TTree. void writeTTree(std::string_view fileName) const; - constexpr static float MipScale = 1.0 / 50.0; ///< Inverse of target dE/dx value for MIPs - constexpr static std::array TglScale{1.9, 1.5, 1.22, 1.02}; ///< Max Tgl values for each ROC type + constexpr static float MipScale = 1.0 / 50.0; ///< Inverse of target dE/dx value for MIPs - constexpr static float scaleTgl(float tgl, GEMstack roc) { return tgl / CalibdEdx::TglScale[roc]; } - constexpr static float recoverTgl(float scaledTgl, GEMstack roc) { return scaledTgl * CalibdEdx::TglScale[roc]; } + constexpr static float scaleTgl(float tgl, GEMstack rocType) { return tgl / conf_dedx_corr::TglScale[rocType]; } + constexpr static float recoverTgl(float scaledTgl, GEMstack rocType) { return scaledTgl * conf_dedx_corr::TglScale[rocType]; } private: bool mFitSnp{};