ROOT version:6.24/06
Platform: lxplus7
Dear ROOT experts,
I encounter the following error when attempting to redefine existing pdfs in RooWorkspace.
The error message:
Error in <ROOT::Math::Fitter::SetFCN>: FCN function has zero parameters
python3: /home/conda/feedstock_root/build_artifacts/root_base_1654795774398/work/root-source/math/mathcore/inc/Fit/Fitter.h:385: const ROOT::Fit::FitResul
t& ROOT::Fit::Fitter::Result() const: Assertion `fResult.get()' failed.
*** Break *** abort
...(some segfault error messages)
Traceback (most recent call last):
File "/afs/cern.ch/work/h/hawu/private/b2dmumu/demo/recreate.py", line 77, in <module>
r = pdf.fitTo(data, ROOT.RooFit.Save(True))
File "/cvmfs/lhcbdev.cern.ch/conda/envs/default/2022-06-15_17-18/linux-64/lib/python3.9/site-packages/ROOT/_pythonization/_roofit/_rooabspdf.py", line0, in fitTo
return self._fitTo(*args, **kwargs)
TypeError: none of the 2 overloaded methods succeeded. Full details:
RooFitResult* RooAbsPdf::fitTo(RooAbsData& data, const RooCmdArg& arg1 = RooCmdArg::none(), const RooCmdArg& arg2 = RooCmdArg::none(), const RooCmdArgarg3 = RooCmdArg::none(), const RooCmdArg& arg4 = RooCmdArg::none(), const RooCmdArg& arg5 = RooCmdArg::none(), const RooCmdArg& arg6 = RooCmdArg::none( const RooCmdArg& arg7 = RooCmdArg::none(), const RooCmdArg& arg8 = RooCmdArg::none()) =>
AbortSignal: abort from C++; program state was reset
RooFitResult* RooAbsPdf::fitTo(RooAbsData& data, const RooLinkedList& cmdList) =>
TypeError: could not convert argument 2
I made the following minimal code example for you to reproduce the problem.
- The
create.py
file- create a new RooWorkspace
- import RooDataSet from RDataFrame
- define pdf model
- perform
fitTo
- save everything to a
.root
file.
- The
recreate.py
file- import RooWorkspace from that saved
.root
file - remove all vars, pdfs, formulas and objects
- define new pdf model
- perform
fitTo
→ where the error is triggered
- import RooWorkspace from that saved
Hopefully with attached files, you can reproduce my error by running
python3 create.py # -> should run successfully
python3 recreate.py # -> show the error above
PS. maybe redefining existing pdfs in RooWorkspace doesn’t require the removal of them in the first place. In RooWorkspace::factory, it seems to me that one can use the expression “EDIT:name” to redefine objects but with the given description in the webpage I don’t know how to do it.
create.py (1.1 KB)
recreate.py (1.6 KB)
demo.root (249.2 KB)