From: Boris Skorodumov <bskorodo_at_nd.edu>

Date: Sun, 24 Apr 2005 13:37:39 -0500

Received on Sun Apr 24 2005 - 20:37:58 MEST

Date: Sun, 24 Apr 2005 13:37:39 -0500

Thank you Rene,

*1*.

*>Instaed of *

*> tree -> Draw("v1:v1 >> h1(bin,0,bin)");*

*>do*

*> tree -> Draw(Form("v1:v1 >> h1(%d,0,%d)",bin,bin));*

yes, this is working very nicely !

*2.*

I attached test.C showing problem with 2 cuts.

Boris.

| Boris Skorodumov, Graduate Student | | Physics Department | | University of Notre Dame | | Indiana 46556, USA | | WWW: http://www.nd.edu/~bskorodo | --------------------------------------

Rene Brun wrote:

*>Hi Boris,*

*>*

*>On Fri, 22 Apr 2005, Boris Skorodumov wrote:*

*>*

*> *

*>*

*>>Thank you Rene,*

*>>*

*>>I checked it ! The last question that left to be asked related to using *

*>>many cuts.*

*>>According to manual myhist->ProjectionX *

*>><http://root.cern.ch/root/html/TH2.html#TH2:ProjectionX>(" *

*>>",firstybin,lastybin,"[cutg1,cutg2]").*

*>>Would it be something wrong with "[cutg1,cutg2]" syntax ?*

*>> *

*>>*

*>*

*>Not as far as I know. As usual, sens a running script showing*

*>your problem.*

*>*

*> *

*>*

*>>And finally,*

*>>.............*

*>>Int_t bin = 2000;*

*>>tree -> Draw("v1:v1 >> h1(bin,0,bin)");*

*>> *

*>>*

*>*

*>Instaed of *

*> tree -> Draw("v1:v1 >> h1(bin,0,bin)");*

*>do*

*> tree -> Draw(Form("v1:v1 >> h1(%d,0,%d)",bin,bin));*

*>*

*>Rene Brun*

*>*

*>*

*> *

*>*

*>>.............*

*>>It turned out, that "bin" variable is not allowed to use.*

*>>*

*>>*

*>>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,*

*>>>*

*>>>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.*

*>>>>>>*

*>>>>>>*

*>>>>>> *

*>>>>>>*

*>>>>>> *

*>>>>>>*

*>>>>>> *

*>>>>>>*

*>>>>> *

*>>>>>*

*>>>>> *

*>>>>>*

*>>> *

*>>>*

*>>> *

*>>>*

*>*

*>*

*> *

*>*

- text/x-c++ attachment: test.C

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