Home | News | Documentation | Download

Simultaneous fit with 8 PDFs (using RooSimultaneous and RooDataSet)

Dear experts,
I need to perform a simultaneous fit on a binned data set with 8 bins.

I have adapted the example here ROOT: tutorials/roofit/rf501_simultaneouspdf.C Source File

and everything works fine up to 7 bins: I can create the combined data set and I can perform the fit with 7 PDFs.

When adding last data set to the combined data set, I break the RooDataSet constructor since it requires at most 11 arguments and I am providing 12.

This is the error message I get:

fit_signal_sim.C:536:16: error: no matching constructor for initialization of ‘RooDataSet’
…comb_data(“comb_data”, “combined data”, RooArgSet(m), Index(sample), Import(“bin_1”, mass_bin_1), Import(“bin_2”, mass_bin_2), Import(“bin_3”, mass_bin_3), Import(“bin_4”, mass_bin_4), Import(“bin_5”, mass_bin_5), Import(“bin_6”, mass_bin_6), Import(“bin_7”, mass_bin_7), Import(“bin_8”, mass_bin_8));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/root-6.22.08/x86_64-redhat-linux-gnu/include/RooDataSet.h:49:3: note: candidate constructor not viable: requires at most 11 arguments, but 12 were provided
RooDataSet(const char* name, const char* title, const RooArgSet& vars, const RooCmdArg& arg1, const RooCmdArg& arg2=RooCmdArg(),
^
/builddir/build/BUILD/root-6.22.08/x86_64-redhat-linux-gnu/include/RooDataSet.h:156:3: note: candidate constructor not viable: requires at most 10 arguments, but 12 were provided
RooDataSet(const char *name, const char *title, RooDataSet *ntuple,
^
/builddir/build/BUILD/root-6.22.08/x86_64-redhat-linux-gnu/include/RooDataSet.h:54:3: note: candidate constructor not viable: requires at most 6 arguments, but 12 were provided
RooDataSet(const char *name, const char *title, RooDataSet *data, const RooArgSet& vars,
^
/builddir/build/BUILD/root-6.22.08/x86_64-redhat-linux-gnu/include/RooDataSet.h:56:3: note: candidate constructor not viable: requires at most 6 arguments, but 12 were provided
RooDataSet(const char *name, const char *title, RooDataSet *data, const RooArgSet& vars,
^
/builddir/build/BUILD/root-6.22.08/x86_64-redhat-linux-gnu/include/RooDataSet.h:61:3: note: candidate constructor not viable: requires at most 6 arguments, but 12 were provided
RooDataSet(const char *name, const char *title, TTree *tree, const RooArgSet& vars,
^
/builddir/build/BUILD/root-6.22.08/x86_64-redhat-linux-gnu/include/RooDataSet.h:63:3: note: candidate constructor not viable: requires at most 6 arguments, but 12 were provided
RooDataSet(const char *name, const char *title, TTree *tree, const RooArgSet& vars,
^
/builddir/build/BUILD/root-6.22.08/x86_64-redhat-linux-gnu/include/RooDataSet.h:46:3: note: candidate constructor not viable: requires at most 4 arguments, but 12 were provided
RooDataSet(const char name, const char title, const RooArgSet& vars, const char wgtVarName=0) ;
^
/builddir/build/BUILD/root-6.22.08/x86_64-redhat-linux-gnu/include/RooDataSet.h:67:3: note: candidate constructor not viable: requires at most 2 arguments, but 12 were provided
RooDataSet(RooDataSet const & other, const char
newname=0) ;
^
/builddir/build/BUILD/root-6.22.08/x86_64-redhat-linux-gnu/include/RooDataSet.h:43:3: note: candidate constructor not viable: requires 0 arguments, but 12 were provided
RooDataSet() ;

My question is: what is the correct approach for binned fit with more than 7 bins?

Thank you

Hi @Petruccs,

for many imports like this, you can group them together in a std::map<string,RooDataSet*> and pass it to the Import(map<string,RooDataSet*>&) command argument (see RooDataSet::RooDataSet documentation).

1 Like

Thanks for the quick answer!
Your suggestion solved my issue, I marked the post as “solution”.