Re: Projection of a histograms

From: Melinda Siciliano <mellybinda_at_gmail.com>
Date: Wed, 5 Mar 2008 18:25:29 +0100


Hi Rene and Lorenzo,

I tried as Rene suggested me and it works! Thanks a lot!!!!

May I ask you if when you put the new function in ROOT , could you tell me then the name of the function in the way to substite it in my gui?

Thanks,

Melinda

On Tue, Mar 4, 2008 at 5:24 PM, Rene Brun <Rene.Brun_at_cern.ch> wrote:

> Hi Melinda,
>
> The projection of the effective entries is currently not implemented.
> It is not too complex to obtain what you want if you have called Sumw2
> on your TH2 object.
> In this case, make the projection using TH2::ProjectionX (or Y) and
> compute the effective entries
> with a code looking like
> TH2 *h2; //your Th2 object where Sumw2 has been called before filling
> TH1D *px = h2->ProjectionX();
> Int_t nbins = px->GetXaxis()->GetNbins();
> for (Int_t bin=1;bin<=nbins;bin++) {
> double y = px->GetBinContent(bin);
> double e = px->GetBinError(bin);
> double effe = 0;
> if (e != 0) effe = y*y/e*e;
> px->SetBinContent(bin,effe);
> px->SetBinError(bin,0);
> }
>
> This could be an option when calling TH2::ProjectionX,Y.
> Lorenzo, could you implement this code in all Projection functions?
>
> Rene Brun
>
> Melinda Siciliano wrote:
> > Dear all,
> >
> > I have an 2D-histogram filled using the weight. I would like to ask
> > you if there a way to make the projection of the effective entries of
> > the histogram.
> >
> > Thanks,
> >
> > Melinda
>
>
Received on Wed Mar 05 2008 - 18:25:37 CET

This archive was generated by hypermail 2.2.0 : Mon Mar 10 2008 - 17:50:01 CET