Skip to content

Commit beb99e8

Browse files
author
Wiktor Pierozak
committed
Renamed amplitude cut parameter to ageing post proc task. Changed implementaion of finding amplitude maximum above cut
1 parent e8f61fb commit beb99e8

2 files changed

Lines changed: 5 additions & 20 deletions

File tree

Modules/FIT/FT0/include/FT0/AgingLaserPostProcTask.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ class AgingLaserPostProcTask final : public quality_control::postprocessing::Pos
6666
double mFracWindowB = 0.25; ///< high fractional window parameter b
6767

6868
/// Amplitude cut
69-
double mAmplitudeCut = 1;
70-
69+
int mDetectorAmpCut = 1;
70+
const int mAmplLimit = 4096;
7171
std::unique_ptr<TH1F> mAmpVsChNormWeightedMeanA;
7272
std::unique_ptr<TH1F> mAmpVsChNormWeightedMeanC;
7373
std::unique_ptr<TH1F> mAmpVsChNormWeightedMeanAfterLastCorrA;

Modules/FIT/FT0/src/AgingLaserPostProcTask.cxx

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void AgingLaserPostProcTask::configure(const boost::property_tree::ptree& cfg)
4545
mAgingLaserPath = o2::quality_control_modules::common::getFromConfig<std::string>(mCustomParameters, "agingLaserTaskPath", mAgingLaserPath);
4646
mAgingLaserPostProcPath = o2::quality_control_modules::common::getFromConfig<std::string>(mCustomParameters, "agingLaserPostProcPath", mAgingLaserPostProcPath);
4747

48-
mAmplitudeCut = o2::quality_control_modules::common::getFromConfig<double>(mCustomParameters, "agingLaserPostProcAmplitudeCut", mAmplitudeCut);
48+
mDetectorAmpCut = o2::quality_control_modules::common::getFromConfig<double>(mCustomParameters, "detectorAmpCut", mDetectorAmpCut);
4949

5050
mDetectorChIDs.resize(208);
5151
std::iota(mDetectorChIDs.begin(), mDetectorChIDs.end(), 0);
@@ -251,24 +251,9 @@ void AgingLaserPostProcTask::update(Trigger t, framework::ServiceRegistryRef srv
251251
auto h1 = std::unique_ptr<TH1>(h2AmpPerChannel->ProjectionY(
252252
Form("proj_%d", chId), chId + 1, chId + 1));
253253

254-
int binMax = -1;
255-
double maxEntries = 0;
256-
for(int bin = 1; bin <= h1->GetNbinsX(); bin++) {
257-
double x = h1->GetBinCenter(bin);
258-
if(x < mAmplitudeCut) {
259-
continue;
260-
}
261-
if(h1->GetBinContent(bin) > maxEntries) {
262-
binMax = bin;
263-
maxEntries = h1->GetBinContent(bin);
264-
}
265-
}
266-
if(binMax == -1) {
267-
ILOG(Warning) << "No data in channel " << chId;
268-
return;
269-
}
270-
271254
// global maximum
255+
h1->GetXaxis()->SetRangeUser(mDetectorAmpCut, mAmplLimit);
256+
const int binMax = h1->GetMaximumBin();
272257
const double xMax = h1->GetBinCenter(binMax);
273258
const double winLo = TMath::Max(0., (1. - mFracWindowA) * xMax);
274259
const double winHi = (1. + mFracWindowB) * xMax;

0 commit comments

Comments
 (0)