Home | News | Documentation | Download

Normalize with PyROOT

Hello everyone and thank you for your attention.
I am new using PyRoot and i am trying to normalize and histogram applied PyRoot, but i don’t fine information about thats process on internet. If you may be have information about how i can do it I would be very grateful for the help.

Regards

Carlos

Hi,
For normalising an histogram, look here (code is in C++):

If you want to do in Python you basically need to replace -> with . and construct the histogram like this: h1 = TH1D("h","a trial histogram", 100, -1.5, 1.5) instead of using new.
You can look at many Python tutorial we have (see for example ROOT: tutorials/hist/fillrandom.py File Reference).

Cheers

Lorenzo

Hi Moneta, thank you for your help and attention.
Regards