Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RF] Translate RooStats tutorials to Python #8758

Open
16 of 33 tasks
guitargeek opened this issue Jul 27, 2021 · 7 comments
Open
16 of 33 tasks

[RF] Translate RooStats tutorials to Python #8758

guitargeek opened this issue Jul 27, 2021 · 7 comments
Assignees
Labels
fixathon This issue can be tackled at a ROOT fixathon good first issue improvement in:RooFit/RooStats

Comments

@guitargeek
Copy link
Contributor

guitargeek commented Jul 27, 2021

After the translations of the RooFit tutorials to pyROOT were completed (see #8523), a next step is to translate also the RooStats tutorials to pyROOT.

The RooStats tutorials can be found in the tutorials/roostats directory. Right now, none of the tutorials are translated to Python yet. For a start, one could start with the translation of the very popular StandardHypoTestInvDemo tutorial, which explains the widely used AsymptoticCalculator and HypoTestInverter classes.

Any new Python tutorials should be formatted with black:

black --line-length=120 <tutorial file>.py

Here is the list of all the RooStats tutorials and whether they have already been translated:

  • FourBinInstructional.C
  • HybridInstructional.C
  • HybridStandardForm.C
  • IntervalExamples.C
  • ModelInspector.C
  • MultivariateGaussianTest.C
  • OneSidedFrequentistUpperLimitWithBands.C
  • rs101_limitexample.C
  • rs102_hypotestwithshapes.C
  • rs301_splot.C
  • rs302_JeffreysPriorDemo.C
  • rs401c_FeldmanCousins.C
  • rs401d_FeldmanCousins.C
  • rs601_HLFactoryexample.C
  • rs602_HLFactoryCombinationexample.C
  • rs603_HLFactoryElaborateExample.C
  • rs701_BayesianCalculator.C
  • rs_bernsteinCorrection.C
  • rs_numberCountingCombination.C
  • rs_numbercountingutils.C
  • StandardBayesianMCMCDemo.C
  • StandardBayesianNumericalDemo.C
  • StandardFeldmanCousinsDemo.C
  • StandardFrequentistDiscovery.C
  • StandardHistFactoryPlotsWithCategories.C
  • StandardHypoTestDemo.C
  • StandardHypoTestInvDemo.C
  • StandardProfileInspectorDemo.C
  • StandardProfileLikelihoodDemo.C
  • StandardTestStatDistributionDemo.C
  • TestNonCentral.C
  • TwoSidedFrequentistUpperLimitWithBands.C
  • Zbi_Zgamma.C
@guitargeek guitargeek changed the title Translate RooStats tutorials to Python [RF] Translate RooStats tutorials to Python Jul 27, 2021
@virenvarma007
Copy link

Hello @guitargeek @couet , I'd like to contribute to this repository. Can you guide me in going about this issue?

@virenvarma007
Copy link

Sir I'm having a little issue with setting up the code can you help out? @guitargeek @couet

@guitargeek
Copy link
Contributor Author

Hi @virenvarma007, thanks for reaching out to us about this issue!

Fortunately, you don't necessarily have to compile and set up ROOT yourself to work on this issue :) All you need it a working ROOT installation on your system. Which Linux distribution are you using? Most likely root is available as a package for your distribution, for example on Ubuntu you can just do sudo apt install root to install it. For more information on how to install ROOT also on different platforms, please take a look also at https://root.cern/install/.

Once you have ROOT installed, you can download one of the roostats tutorials that you want to translate (maybe pick a shorter one in the beginning, like rs101_limitexample. Remember you just need the tutorial file, not the whole ROOT repository.

To try out the tutorial, you can run it with the root interpreter by typing root rs101_limitexample.C in the command line. You will get a graph as a result. To translate the tutorial, you need to create a rs101_limitexample.py file where you exactly recreate the tutorial in pyROOT, such that one can run it with python rs101_limitexample.py and get the same graph than with the C++ version.

When you have translated your first tutorial, you can make a pull request here with the new python file in the same directory as the C++ tutorials.

You can find more information of ROOT and especially pyROOT for your usecase in the ROOT users manual: https://root.cern/manual/. If you have any questions that are not answered in this manual, please feel free to ask!

Good luck and thanks for your effort already!
Jonas

@virenvarma007
Copy link

Thanks you so much for the details Sir, I'm using Ubuntu 18.04 and I already have root installed in pc. I'll start with the tutorial and work on the Issue right away.

@virenvarma007
Copy link

Hello @guitargeek Sir, while Installing Root to my Ubuntu VM 18.04, during the building of the file "cmake --build . -- -j3" the build stops and shows this error every time at the 49% of the build. I have tried to start the process multiple times and even increase space in my Oracle VM but nothing seemed to work.

CMake Error at /home/viren/Root CERN/root/AFTERIMAGE-prefix/src/AFTERIMAGE-stamp/AFTERIMAGE-install-RelWithDebInfo.cmake:16 (message):
Command failed: 2

'/usr/bin/make' 'install'

See also

/home/viren/Root CERN/root/AFTERIMAGE-prefix/src/AFTERIMAGE-stamp/AFTERIMAGE-install-*.log

CMakeFiles/AFTERIMAGE.dir/build.make:73: recipe for target 'AFTERIMAGE-prefix/src/AFTERIMAGE-stamp/AFTERIMAGE-install' failed
make[2]: *** [AFTERIMAGE-prefix/src/AFTERIMAGE-stamp/AFTERIMAGE-install] Error 1
CMakeFiles/Makefile2:280: recipe for target 'CMakeFiles/AFTERIMAGE.dir/all' failed
make[1]: *** [CMakeFiles/AFTERIMAGE.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 49%] Built target move_artifacts
[ 49%] Built target clang-tblgen
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

@SunSummoner
Copy link

Hi @guitargeek @couet I am interested in contributing to this repository. Can you inform me about the process? Thank you.

@vepadulano vepadulano added the fixathon This issue can be tackled at a ROOT fixathon label Feb 5, 2024
@jolly-chen jolly-chen self-assigned this Feb 14, 2024
jolly-chen added a commit to jolly-chen/root that referenced this issue Feb 15, 2024
jolly-chen added a commit to jolly-chen/root that referenced this issue Feb 15, 2024
jolly-chen added a commit to jolly-chen/root that referenced this issue Feb 15, 2024
@jolly-chen
Copy link
Contributor

Hi @guitargeek, while working on this issue, I tried to create a script that could somewhat automate this process. Manual changes are still required, but hopefully using this could speed up the process a bit for the remaining tutorials.

CppToPyConverter.zip

guitargeek pushed a commit to jolly-chen/root that referenced this issue Mar 25, 2024
guitargeek added a commit that referenced this issue Mar 25, 2024
Contributes to  #8758

Co-authored-by: Jonas Rembser <jonas.rembser@cern.ch>
kristupaspranc pushed a commit to kristupaspranc/root that referenced this issue Apr 10, 2024
Contributes to  root-project#8758

Co-authored-by: Jonas Rembser <jonas.rembser@cern.ch>
lobis pushed a commit to lobis/root that referenced this issue Apr 10, 2024
Contributes to  root-project#8758

Co-authored-by: Jonas Rembser <jonas.rembser@cern.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixathon This issue can be tackled at a ROOT fixathon good first issue improvement in:RooFit/RooStats
Projects
Status: In progress
Development

No branches or pull requests

5 participants