Skip to content

[RF] Handling of the negative values in RooChebychev causes fit divergence #12452

@Bilokin

Description

@Bilokin
  • [V ] Checked for duplicates

Describe the bug

The second-order RooChebyshev class produces negative values for certain parameter range around c1=-0.5 and c2=-0.55.
These negative values are then handled differently in different versions of ROOT
chebtest_6 2004
chebtest_6 2406

Expected behavior

A preferred solution would be to set negative values to 0 as in ROOT 6.20, because setting them to +inf is causing the fits to diverge.
Is it possible to avoid the negative values in RooChebychev in the first place?

To Reproduce

The code which produces the plots above:

import ROOT
canvas = ROOT.TCanvas("cv1", "cv1", 700, 500)
#ROOT.__version__ = '6.20/04'  # Earlier pyROOT implementations have no __version__
mass = ROOT.RooRealVar("KS_M", "m(#pi^{+}#pi^{-}) GeV/c^{2}", 0.47, 0.53)
frame = mass.frame(ROOT.RooFit.Bins(100), ROOT.RooFit.Title(ROOT.__version__))
c1 = ROOT.RooRealVar("c1", " 1st cheb parameter",-0.5, -1, 1)
c2 = ROOT.RooRealVar("c2", " 2nd cheb parameter", -0.55, -1, 1)
bkg = ROOT.RooChebychev("bkg", "Chebyshev Polynomial", mass, ROOT.RooArgList(c1, c2))
bkg.plotOn(frame)
canvas.cd()
frame.Draw()
canvas.Draw()
canvas.Update()
canvas.SaveAs(f'pdf/chebtest_{ROOT.__version__.replace("/","")}.png')
input()

Setup

I used 6.20 and 6.24 ROOT versions on Ubuntu 18.04.

Additional context

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions