Re: gcut/projections inconsistancy

From: Rene Brun <brun_at_pcroot.cern.ch>
Date: Thu, 21 Apr 2005 22:56:48 +0200 (MEST)


Boris,

The two results are correct, but they cannot be exactly equal. Your histogram h1 is correct because it is generated from the ntuple points with the full precision.
cut->Integral(hh) takes all the bins for which the bin center fits within the cut (approximation). You can verify that if you increase the number of bins in hh, the two results will become closer.

Rene Brun

On
Thu, 21
Apr 2005, Boris Skorodumov wrote:

> I made updates from CVS. Still i see some inconsistancy:
>
> tree -> Draw("var1:var2 >> hh");
>
> now, i am making graphical cut with name cut via
>
> cut = (TCutG*)gPad->WaitPrimitive("CUTG","CutG"); cut->SetName("cut");
>
> later, i am making 1d histogram h1.
>
> tree -> Draw("var1:var2 >> h1","cut");
>
> now, the results:
>
> h1->Integral() and cut->Integral(hh) gives different results.
>
> thank you,
> Boris.
>
>
>
>
> --------------------------------------
> | Boris Skorodumov, Graduate Student |
> | Physics Department |
> | University of Notre Dame |
> | Indiana 46556, USA |
> | WWW: http://www.nd.edu/~bskorodo |
> --------------------------------------
>
>
>
>
> Rene Brun wrote:
>
> >Boris,
> >
> >Today we made a few changes with [cutg] in TH2::ProjectionX, etc.
> >Coul you try your problem with this version (CVS head).
> >If the problem is not fixed, please send a script.
> >
> >Rene Brun
> >
> >On Wed,
> >20 Apr 2005, Boris Skorodumov wrote:
> >
> >
> >
> >>dear rooters,
> >>
> >>imagine, i have tree with var de and e.
> >>i am making 2d histogram t->Draw("de:de+e >>hh") hh.
> >>hh has 422928 Entries.
> >>
> >>now i am creating two graphical cuts: cut1 and cut2 which do not have
> >>any common points.
> >>
> >>later, i am making two 1d histograms with cut1 and cut2
> >>
> >>hh->ProjectionX("a",-1,-1,"[cut1]"); a->Integral() gives 6070
> >>hh->ProjectionX("b",-1,-1,"[cut2]"); b->Integral() gives 1967
> >>
> >>later i am making other two 1d histograms:
> >>
> >>t->Draw("de:de+e >> h1","cut1");
> >>t->Draw("de:de+e >> h2","cut2");
> >>
> >>h1->Integral() gives me 5934
> >>h2->Integral() gives me 1936
> >>
> >>why that numbers are different from the a and b ?
> >>
> >>why the number of entries for a and b which is plotted in the canvas are
> >>422928 but not 6070 and 1967 while for h1 and h2 the number of entries
> >>are 5934 and 1936 which is consistent with h1->Integral() and
> >>h2->Integral() ?
> >>
> >>i was not able to combine cut1 and cut2:
> >>
> >>t->Draw("de:de+e >> h3","cut2 || cut1");
> >>h3->Integral() gives me 7870(5934+1936) which is correct.
> >>
> >>hh->ProjectionX("rr",-1,-1,"[cut1, cut2]") ignores second cut (cut2).
> >>according to http://root.cern.ch/root/html/TH2.html#TH2:ProjectionX that
> >>should work.
> >>
> >>
> >>thank you,
> >>boris.
> >>
> >>
> >>
> >>
> >
> >
> >
> >
>
Received on Thu Apr 21 2005 - 22:57:00 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:07 MET