Re: TTree::Draw and variable bin histograms

From: suvayu ali <fatkasuvayu_at_gmail.com>
Date: Tue, 7 Sep 2010 12:12:31 -0700


Thanks Philippe, I think I understand now where I was going wrong! :)

On 7 September 2010 11:15, Philippe Canal <pcanal_at_fnal.gov> wrote:
>  Hi,
>
> When the line:
>
>  h_all_datasets[0]->SetNameTitle("oldtest1", "properly binned 1st fn :
> test1");
>
> is executed the histogram is __renamed__ as requested and thus the line:
>
>  funnyTree->Draw( "var2>>test1"); // This doesn't
>
> can not find any existing histogram whose name is 'test1'.   Hence
> TTree::Draw
> creates a new one with the default options.
>
> Cheers,
> Philippe.
>
>
>
>
> On 9/4/10 2:39 PM, Suvayu Ali wrote:
>>
>> Hi everyone,
>>
>> I wanted to use TTree::Draw() to make histograms with variable bins. When
>> I declare separate histograms for different Draw commands, I get what I'm
>> trying to achieve.
>>
>> But when I try to reuse one histogram, subsequent Draw commands don't
>> respect the original variable binning and draws with a default linear
>> binning with a 100 bins.
>>
>> How can I achieve this?
>>
>> PS: I need to reuse the histogram as my real use case is in a macro where
>> a method loops over multiple TNtuples in a root file and gives me histograms
>> one after another, which I put on a stack.
>>
>

-- 
Suvayu

Open source is the future. It sets us free.
Received on Tue Sep 07 2010 - 21:23:54 CEST

This archive was generated by hypermail 2.2.0 : Tue Sep 07 2010 - 23:50:01 CEST