Re: [ROOT] questions regarding how to normalize a histogram

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Aug 07 2003 - 14:27:37 MEST


Hi,

If you want to normalize your histogram to 1, do:
  Double_t scale = 1/h->Integral();
  h->Scale(scale);

If you want to normalize your histogram per entry and per unit of X 
axis, do
  Double_t scale = h->GetXaxis()->GetBinWidth(1)/(h->GetIntegral();
  h-Scale(scale);

Rene Brun

On Wed, 6 Aug 2003, anita 
sharma wrote:

> sir,
> I want to know about the command of normalizing
> histograms.I had gone through the manual, what i got
> is
> 
> Double_t scale = norm/h->Integral();
> hist->Scale(scale);
> 
> i want to know about the norm parameter.
> Actually i want to normalize a multiplicity
> histogram[1/N dN/d(eta)] 
> 
> will u please help me
> 
> 
> anita
> jammu university
> 
> 
> ________________________________________________________________________
> Send free SMS using the Yahoo! Messenger. Go to http://in.mobile.yahoo.com/new/pc/
> 



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:14 MET