Normalize a histogram

For normalising an histogram you have two option:

  1. Normalize like histogram describe a probability density function :
histo->Scale( 1./histo->Integral(),"WIDTH");
  1. Normalize to a probability distribution. Sum of histogram content is equal to 1:
histo->Scale( 1./histo->Integral());

See also https://root.cern.ch/doc/master/classTH1.html#add929909dcb3745f6a52e9ae0860bfbd

Note that when scaling an histogram , the histogram has error different than sqrt(N) and by default it is plotted with the errors. If you don’t want to plot with errors, you need to add the “HIST” option to
TH1::Draw

Lorenzo

1 Like