Re: TTree::Draw and variable bin histograms

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Tue, 7 Sep 2010 13:15:57 -0500


  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.
>
Received on Tue Sep 07 2010 - 20:16:04 CEST

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