Re: [ROOT] weighting hisotgrammes in certain bins

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Jul 03 2003 - 09:16:08 MEST


Hi Emily,

You have two possibilities:
 - make a TH1 histogram hw with your weights and do myhisto.Multiply(hw)
 - loop explicitly on the bins, multiplying the bins in the range by a weight
   for (int i=from;i<to;i++) {
      double c = myhisto.GetBinContent(i)*weight;
      myhisto.SetBinContent(c);
   }

Rene Brun
     
Emily Nurse wrote:
> 
> Hi,
> Is it possible to weight a histogram in certain bins only?
> I don't want to do this when filling the histogram.
> I extract the histogram from a root file then re-draw itand I'd like to
> make a correction to some bins only.
> Thanks,
> Emily.



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