From 7e1b92099ddaacf7d03d2560f9a6f62eea0f8db2 Mon Sep 17 00:00:00 2001 From: Wiktor Pierozak Date: Wed, 6 May 2026 15:53:21 +0200 Subject: [PATCH 1/5] Implemented amplitude cut --- .../FT0/include/FT0/AgingLaserPostProcTask.h | 5 ++++- .../FIT/FT0/src/AgingLaserPostProcTask.cxx | 22 +++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Modules/FIT/FT0/include/FT0/AgingLaserPostProcTask.h b/Modules/FIT/FT0/include/FT0/AgingLaserPostProcTask.h index c2a04c9b6e..304c6dd41d 100644 --- a/Modules/FIT/FT0/include/FT0/AgingLaserPostProcTask.h +++ b/Modules/FIT/FT0/include/FT0/AgingLaserPostProcTask.h @@ -65,6 +65,9 @@ class AgingLaserPostProcTask final : public quality_control::postprocessing::Pos double mFracWindowA = 0.25; ///< low fractional window parameter a double mFracWindowB = 0.25; ///< high fractional window parameter b + /// Amplitude cut + double mAmplitudeCut = 1; + std::unique_ptr mAmpVsChNormWeightedMeanA; std::unique_ptr mAmpVsChNormWeightedMeanC; std::unique_ptr mAmpVsChNormWeightedMeanAfterLastCorrA; @@ -77,4 +80,4 @@ class AgingLaserPostProcTask final : public quality_control::postprocessing::Pos } // namespace o2::quality_control_modules::ft0 -#endif // QC_MODULE_FT0_AGINGLASERPOSTPROC_H \ No newline at end of file +#endif // QC_MODULE_FT0_AGINGLASERPOSTPROC_H diff --git a/Modules/FIT/FT0/src/AgingLaserPostProcTask.cxx b/Modules/FIT/FT0/src/AgingLaserPostProcTask.cxx index c26db51335..a652a183a0 100644 --- a/Modules/FIT/FT0/src/AgingLaserPostProcTask.cxx +++ b/Modules/FIT/FT0/src/AgingLaserPostProcTask.cxx @@ -45,6 +45,8 @@ void AgingLaserPostProcTask::configure(const boost::property_tree::ptree& cfg) mAgingLaserPath = o2::quality_control_modules::common::getFromConfig(mCustomParameters, "agingLaserTaskPath", mAgingLaserPath); mAgingLaserPostProcPath = o2::quality_control_modules::common::getFromConfig(mCustomParameters, "agingLaserPostProcPath", mAgingLaserPostProcPath); + mAmplitudeCut = o2::quality_control_modules::common::getFromConfig(mCustomParameters, "agingLaserPostProcAmplitudeCut", mAmplitudeCut); + mDetectorChIDs.resize(208); std::iota(mDetectorChIDs.begin(), mDetectorChIDs.end(), 0); const std::string detSkip = @@ -248,9 +250,25 @@ void AgingLaserPostProcTask::update(Trigger t, framework::ServiceRegistryRef srv auto processChannel = [&](uint8_t chId) { auto h1 = std::unique_ptr(h2AmpPerChannel->ProjectionY( Form("proj_%d", chId), chId + 1, chId + 1)); + + int binMax = -1; + double maxEntries = 0; + for(int bin = 1; bin <= h1->GetNbinsX(); bin++) { + double x = h1->GetBinCenter(bin); + if(x < mAmplitudeCut) { + continue; + } + if(h1->GetBinContent(bin) > maxEntries) { + binMax = bin; + } + } + if(binMax == -1) { + ILOG(Warning) << "No data in channel " << chId; + return; + } // global maximum - const int binMax = h1->GetMaximumBin(); + //const int binMax = h1->GetMaximumBin(); const double xMax = h1->GetBinCenter(binMax); const double winLo = TMath::Max(0., (1. - mFracWindowA) * xMax); const double winHi = (1. + mFracWindowB) * xMax; @@ -304,4 +322,4 @@ void AgingLaserPostProcTask::finalize(Trigger, framework::ServiceRegistryRef) ILOG(Debug, Devel) << "finalize AgingLaserPostProcTask" << ENDM; } -} // namespace o2::quality_control_modules::ft0 \ No newline at end of file +} // namespace o2::quality_control_modules::ft0 From e8f61fb04358e6b736a27b6a4df07c023b673a26 Mon Sep 17 00:00:00 2001 From: Wiktor Pierozak Date: Thu, 7 May 2026 10:43:02 +0200 Subject: [PATCH 2/5] fix: added missing assigment of maxValue in loop that searches for max bin --- Modules/FIT/FT0/src/AgingLaserPostProcTask.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FIT/FT0/src/AgingLaserPostProcTask.cxx b/Modules/FIT/FT0/src/AgingLaserPostProcTask.cxx index a652a183a0..99c74749c9 100644 --- a/Modules/FIT/FT0/src/AgingLaserPostProcTask.cxx +++ b/Modules/FIT/FT0/src/AgingLaserPostProcTask.cxx @@ -260,6 +260,7 @@ void AgingLaserPostProcTask::update(Trigger t, framework::ServiceRegistryRef srv } if(h1->GetBinContent(bin) > maxEntries) { binMax = bin; + maxEntries = h1->GetBinContent(bin); } } if(binMax == -1) { @@ -268,7 +269,6 @@ void AgingLaserPostProcTask::update(Trigger t, framework::ServiceRegistryRef srv } // global maximum - //const int binMax = h1->GetMaximumBin(); const double xMax = h1->GetBinCenter(binMax); const double winLo = TMath::Max(0., (1. - mFracWindowA) * xMax); const double winHi = (1. + mFracWindowB) * xMax; From beb99e8fc5945785c21dafc5e3d89c02080e42ad Mon Sep 17 00:00:00 2001 From: Wiktor Pierozak Date: Wed, 20 May 2026 09:34:59 +0200 Subject: [PATCH 3/5] Renamed amplitude cut parameter to ageing post proc task. Changed implementaion of finding amplitude maximum above cut --- .../FT0/include/FT0/AgingLaserPostProcTask.h | 4 ++-- .../FIT/FT0/src/AgingLaserPostProcTask.cxx | 21 +++---------------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/Modules/FIT/FT0/include/FT0/AgingLaserPostProcTask.h b/Modules/FIT/FT0/include/FT0/AgingLaserPostProcTask.h index 304c6dd41d..63e7bc90f0 100644 --- a/Modules/FIT/FT0/include/FT0/AgingLaserPostProcTask.h +++ b/Modules/FIT/FT0/include/FT0/AgingLaserPostProcTask.h @@ -66,8 +66,8 @@ class AgingLaserPostProcTask final : public quality_control::postprocessing::Pos double mFracWindowB = 0.25; ///< high fractional window parameter b /// Amplitude cut - double mAmplitudeCut = 1; - + int mDetectorAmpCut = 1; + const int mAmplLimit = 4096; std::unique_ptr mAmpVsChNormWeightedMeanA; std::unique_ptr mAmpVsChNormWeightedMeanC; std::unique_ptr mAmpVsChNormWeightedMeanAfterLastCorrA; diff --git a/Modules/FIT/FT0/src/AgingLaserPostProcTask.cxx b/Modules/FIT/FT0/src/AgingLaserPostProcTask.cxx index 99c74749c9..a27e042159 100644 --- a/Modules/FIT/FT0/src/AgingLaserPostProcTask.cxx +++ b/Modules/FIT/FT0/src/AgingLaserPostProcTask.cxx @@ -45,7 +45,7 @@ void AgingLaserPostProcTask::configure(const boost::property_tree::ptree& cfg) mAgingLaserPath = o2::quality_control_modules::common::getFromConfig(mCustomParameters, "agingLaserTaskPath", mAgingLaserPath); mAgingLaserPostProcPath = o2::quality_control_modules::common::getFromConfig(mCustomParameters, "agingLaserPostProcPath", mAgingLaserPostProcPath); - mAmplitudeCut = o2::quality_control_modules::common::getFromConfig(mCustomParameters, "agingLaserPostProcAmplitudeCut", mAmplitudeCut); + mDetectorAmpCut = o2::quality_control_modules::common::getFromConfig(mCustomParameters, "detectorAmpCut", mDetectorAmpCut); mDetectorChIDs.resize(208); std::iota(mDetectorChIDs.begin(), mDetectorChIDs.end(), 0); @@ -251,24 +251,9 @@ void AgingLaserPostProcTask::update(Trigger t, framework::ServiceRegistryRef srv auto h1 = std::unique_ptr(h2AmpPerChannel->ProjectionY( Form("proj_%d", chId), chId + 1, chId + 1)); - int binMax = -1; - double maxEntries = 0; - for(int bin = 1; bin <= h1->GetNbinsX(); bin++) { - double x = h1->GetBinCenter(bin); - if(x < mAmplitudeCut) { - continue; - } - if(h1->GetBinContent(bin) > maxEntries) { - binMax = bin; - maxEntries = h1->GetBinContent(bin); - } - } - if(binMax == -1) { - ILOG(Warning) << "No data in channel " << chId; - return; - } - // global maximum + h1->GetXaxis()->SetRangeUser(mDetectorAmpCut, mAmplLimit); + const int binMax = h1->GetMaximumBin(); const double xMax = h1->GetBinCenter(binMax); const double winLo = TMath::Max(0., (1. - mFracWindowA) * xMax); const double winHi = (1. + mFracWindowB) * xMax; From 620a81e2d00c9f70931ba279fd45b4ddaba69e61 Mon Sep 17 00:00:00 2001 From: Wiktor Pierozak Date: Wed, 20 May 2026 15:04:23 +0200 Subject: [PATCH 4/5] Changed default amplitude cut to 0 in aging post proc --- Modules/FIT/FT0/include/FT0/AgingLaserPostProcTask.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FIT/FT0/include/FT0/AgingLaserPostProcTask.h b/Modules/FIT/FT0/include/FT0/AgingLaserPostProcTask.h index 63e7bc90f0..bc0960fb5a 100644 --- a/Modules/FIT/FT0/include/FT0/AgingLaserPostProcTask.h +++ b/Modules/FIT/FT0/include/FT0/AgingLaserPostProcTask.h @@ -66,7 +66,7 @@ class AgingLaserPostProcTask final : public quality_control::postprocessing::Pos double mFracWindowB = 0.25; ///< high fractional window parameter b /// Amplitude cut - int mDetectorAmpCut = 1; + int mDetectorAmpCut = 0; const int mAmplLimit = 4096; std::unique_ptr mAmpVsChNormWeightedMeanA; std::unique_ptr mAmpVsChNormWeightedMeanC; From 8aa00476b140b9de7e3121585efb1b69ecf5c25a Mon Sep 17 00:00:00 2001 From: Wiktor Pierozak Date: Thu, 21 May 2026 10:02:23 +0200 Subject: [PATCH 5/5] Removed white spaces --- Modules/FIT/FT0/src/AgingLaserPostProcTask.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/Modules/FIT/FT0/src/AgingLaserPostProcTask.cxx b/Modules/FIT/FT0/src/AgingLaserPostProcTask.cxx index a27e042159..ae7162b7db 100644 --- a/Modules/FIT/FT0/src/AgingLaserPostProcTask.cxx +++ b/Modules/FIT/FT0/src/AgingLaserPostProcTask.cxx @@ -250,7 +250,6 @@ void AgingLaserPostProcTask::update(Trigger t, framework::ServiceRegistryRef srv auto processChannel = [&](uint8_t chId) { auto h1 = std::unique_ptr(h2AmpPerChannel->ProjectionY( Form("proj_%d", chId), chId + 1, chId + 1)); - // global maximum h1->GetXaxis()->SetRangeUser(mDetectorAmpCut, mAmplLimit); const int binMax = h1->GetMaximumBin();