From dfced23e12beb6b3451a5c93c73af6621b65fd4b Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Wed, 25 Oct 2023 00:15:11 +0200 Subject: [PATCH] Use likelihood fit instead of chi-square fit in DQMServices slice fits The DQM plots use the `TH2::FitSlicesY()` function to fit some Gaussians. However, some of the fits are failing. This was not resulting in errors so far, but with the switch to Minuit2 by default in ROOT 6.30 it will. The problem is that it uses chi-square fits to fit slices with many empty bins, which is not appropriate. Doing a likelihood fit with the `"l"` option is one way to fix the problem, because it can better deal with empty bins. Closes #42979. --- DQMServices/Components/plugins/DQMGenericClient.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DQMServices/Components/plugins/DQMGenericClient.cc b/DQMServices/Components/plugins/DQMGenericClient.cc index bd4999eebcf21..1d1fa290ea671 100644 --- a/DQMServices/Components/plugins/DQMGenericClient.cc +++ b/DQMServices/Components/plugins/DQMGenericClient.cc @@ -158,7 +158,7 @@ class FitSlicesYTool { // ... create your hists TH2F* h = me->getTH2F(); TF1 fgaus("fgaus", "gaus", h->GetYaxis()->GetXmin(), h->GetYaxis()->GetXmax(), TF1::EAddToList::kNo); - h->FitSlicesY(&fgaus, 0, -1, 0, "QNR SERIAL"); + h->FitSlicesY(&fgaus, 0, -1, 0, "QNRL SERIAL"); string name(h->GetName()); h0 = (TH1*)gDirectory->Get((name + "_0").c_str()); h1 = (TH1*)gDirectory->Get((name + "_1").c_str());