root-project / root

The official repository for ROOT: analyzing, storing and visualizing big data, scientifically

Home Page:https://root.cern

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[RF] Translate all RooFit tutorials to Python

guitargeek opened this issue · comments

Allmost all RooFit tutorials are translated to Python now.

There are just a few missing:

rf212_plottingInRanges_blinding.C
rf408_RDataFrameToRooFit.C
rf514_RooCustomizer.C
rf612_recoverFromInvalidParameters.C
rf709_BarlowBeeston.C

@Harshalzzzzzzz, can you please take a look if they can be translated and if they give us any ideas what we still need to pythonize? Thanks!

Thanks @Harshalzzzzzzz for translating the remaining tutorials! After PR #8584, we are only missing a translation now for rf408_RDataFrameToRooFit this one can't be translated yet because of a std::string vs C-style string issue, but after merging #8614 it will be possible to translate it.

Just one thing to keep in mind when translating the RDataFrameCode: In Python, one should not specify any template parameters to Book, otherwise it won't work. for example this C++ code:

 // Method 2:
 // We first declare the RooDataHistMaker
 RooDataHistHelper rdhMaker{"datahist",  // Name
     "Title of data hist",                 // Title
    RooArgSet(x, y)                       // Variables in this dataset
 };

 // Then, we move it into the RDataFrame action:
auto rooDataHist = dd.Book<double, double>(std::move(rdhMaker), {"x", "y"});

...becomes this in Python:

rdhMaker = ROOT.RooDataSetHelper("dataset","Title of dataset", ROOT.RooArgSet(x, y))
rooDataHist = dd.Book(ROOT.std.move(rdhMaker), ("x", "y"))