@@ -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