Skip to content

Commit

Permalink
Revert back to chi-square fit
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed Jan 24, 2024
1 parent bb52510 commit 1d1ae88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DQMServices/Components/plugins/DQMGenericClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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, "QNRL SERIAL");
h->FitSlicesY(&fgaus, 0, -1, 0, "QNR SERIAL");
string name(h->GetName());
h0 = (TH1*)gDirectory->Get((name + "_0").c_str());
h1 = (TH1*)gDirectory->Get((name + "_1").c_str());
Expand Down Expand Up @@ -1162,7 +1162,7 @@ void DQMGenericClient::limitedFit(MonitorElement* srcME, MonitorElement* meanME,
//To avoid DQMGenericClient maintains state between fit calls
fitFcn->SetParameters(histoY->Integral(), histoY->GetMean(), histoY->GetRMS());

histoY->Fit(fitFcn, "QR0L SERIAL", "", x1, x2);
histoY->Fit(fitFcn, "QR0 SERIAL", "", x1, x2);

// histoY->Fit(fitFcn->GetName(),"RME");
double* par = fitFcn->GetParameters();
Expand Down
4 changes: 2 additions & 2 deletions Validation/RecoParticleFlow/plugins/PFJetDQMPostProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ void PFJetDQMPostProcessor::fitResponse(TH1F* hreso,
TF1* fg = new TF1("mygaus", "gaus", fitlow, fithigh);
TF1* fg2 = new TF1("fg2", "TMath::Gaus(x,[0],[1],true)*[2]", fitlow, fithigh);

hreso->Fit("mygaus", "RQNL");
hreso->Fit("mygaus", "RQN");

fg2->SetParameter(0, fg->GetParameter(1));
fg2->SetParameter(1, fg->GetParameter(2));
Expand All @@ -416,7 +416,7 @@ void PFJetDQMPostProcessor::fitResponse(TH1F* hreso,
// (3) and number of bins (100)
fg2->FixParameter(2, ngenjet * 3. / 100.);

hreso->Fit("fg2", "RQNL");
hreso->Fit("fg2", "RQN");

fitlow = fg2->GetParameter(0) - 1.5 * fg2->GetParameter(1);
fitlow = TMath::Max(recoptcut / ptlow, fitlow);
Expand Down

0 comments on commit 1d1ae88

Please sign in to comment.