Re: Draw ves Project

From: Rene Brun <brun_at_pcroot.cern.ch>
Date: Wed, 8 Jun 2005 13:21:00 +0200 (MEST)


Jean-Eric,

The automatic histogram produced by the first query has 100 channels ranging from 0 to 110. This explains the difference with your second histogram ranging from 0 to 100.
In your first query, you can force the binning replacing the line

   tree->Draw("zp","(pdg==211)&&(zp<100)&&(0<zp)"); by

   tree->Draw("zp>>hfirst(100,0,100)","(pdg==211)&&(zp<100)&&(0<zp)");

Rene Brun

On
Wed, 8 Jun 2005, Jean-Eric Campagne wrote:

> Cher Rene,
>
> I am using ROOT 4.04/02 31may05
>
> I have put on the Web <http://opera.web.lal.in2p3.fr/temporaire/>
> the file Pb.tgz
>
> There are a pb.C macro and the (quite large) ROOT File with the TTree.
>
> Jean-Eric
>
>
> --On mercredi 8 juin 2005 12:09 +0200 Rene Brun <brun_at_pcroot.cern.ch> wrote:
>
>> Jean-Eric,
>>
>> I cannot reproduce this problem.
>> Note that TTree::Project calls TTree::Draw. So, I do not see why the
>> output should be different.
>> Please:
>> -tell us which version of ROOT?
>> -send the shortest possible script with a file repducing your problem
>>
>> Rene Brun
>>
>> On Wed, 8 Jun 2005, Jean-Eric Campagne wrote:
>>
>>> Dear developpers
>>>
>>> I have done the following
>>> 1) open a ROOT file with a TTree which contains "zp" and "pdg" as
>>> variables 2) do the tree drawing
>>> tree->Draw("zp","pdg==211")
>>> Then just to show for student an other possibility
>>> 3) create a TH1D* h1 with ("h1","z prod of pi+",100,0,100)
>>> 4) project the tree on h1 as followed
>>> tree->Project(h1->GetName(),"zp","pdg==211")
>>> 5) draw the result
>>> h1->Draw("SAME")
>>>
>>> To my great surprise the 2 plots does not fit each other (see pb.ps
>>> attached), and this is not just bin to bin fluctuation
>>> Have you an idea?
>>> Regards
>>> Jean-Eric
>>>
>>>
>>> ........................................................................
>>> ... .LAL - IN2P3 - CNRS
>>> .LAL - B.P 34 - 91898 Orsay Cedex - France
>>> .Piece 108
>>> .Tel +33 (0)1 64 46 84 29
>>> .Fax +33 (0)1 64 46 83 97
>>> ........................................................................
>>> ...
>>>
>>>
>
>
>
> ...........................................................................
> .LAL - IN2P3 - CNRS
> .LAL - B.P 34 - 91898 Orsay Cedex - France
> .Piece 108
> .Tel +33 (0)1 64 46 84 29
> .Fax +33 (0)1 64 46 83 97
> ...........................................................................
>
>
Received on Wed Jun 08 2005 - 13:21:05 MEST

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