Question

I'm a modest graduate student in a high energy particle physics department. With an unfounded distaste for C/C++ and a founded love of python, I have resorted to python for my data analysis so far (just the easy stuff) and am about to attempt backing python scripts against ROOT libraries and, particularly, utilize MINUIT for some parameter minimization.

As well as asking if anyone has any tips for the installation and usage of these, I wondered if it was worth it to even attempt it or just to slip into the "norm" of using C/C++, or if things like pyminuit are usable. Or do you think I could wrap entire C/C++ scripts into python code to make use of my existing self-written analysis methods (I have no wrapper experience as of yet). Sorry for the vagueness; I'm headed into a great unknown that far outweighs my current experience.

Was it helpful?

Solution

You are aware of pyROOT, right?

Never tried it myself, so I don't know how it might stack up against your needs.

OTHER TIPS

It's probably worth checking out rootpy. Maybe not totally mature yet, but it's a step in the right direction.

Yes, rootpy is built on top of PyROOT, but with some additional features:

  • it emphasizes a pythonic interface and hides some of the ugliness of ROOT;
  • it integrates with matlibplot, which has a larger development community, and a greater presence on SO, not to mention better looking plots;
  • it allows conversion to HDF5 files, which will allow you to share data with people who can't take the time to install the monolithic ROOT package.

Unfortunately, as long as you're working with something built on top of CINT (which PyROOT is), you'll still have to deal with one of the ugliest parts of ROOT.


The other option, if you're sick of fumbling with PyROOT, is to use one of the packages that converts ROOT directly to HDF5

I wrote a minuit wrapper a while back(In my sample of 1 experience, ROOT's minuit seems more robust than pyminuit and I like ROOT Minuit output more)

https://github.com/piti118/RTMinuit

With numpy root file reading capability

https://github.com/piti118/root_numpy

And not so polished fitting library and toy generation etc. based on RTMinuit and numpy

https://github.com/piti118/dist_fit

Tutorials and help are all given in the package

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top