Re: TTree::Draw histogram (not a bug)
Rene Brun (Rene.Brun@cern.ch)
Mon, 12 Jan 1998 18:30:17 +0100
> Hello,
>
> I just discovered a lethal bug in TTree::Draw, or at least what I think
> might be a bug. If it isn't, please let me know why the behavior is what it
> is.
>
> >From a TTree, I performed the following cuts. The resulting histogram is in
> the jpg file noted on each.
>
> tree->Draw("wires.time - paddle.time","(wires.time -paddle.time) >90 &&
> (wires.time -paddle.time)<180"); // see->h180.jpg
> tree->Draw("wires.time - paddle.time","(wires.time -paddle.time) >90 &&
> (wires.time -paddle.time)<181"); // see->h181.jpg
> tree->Draw("wires.time - paddle.time","(wires.time -paddle.time) >90 &&
> (wires.time -paddle.time)<189"); // see->h189.jpg
>
> You should note that the first histogram, with cuts [90, 180] the histogram
> looks fine. However, if one changes the cut to [90,181], very odd anomalies
> appear. The cut [90,189] is also included as an example of the bug.
> The wires.time and paddle.time are type unsigned integer.
>
> William J Deninger
This is not a bug.
You are histogramming integers. By default, Root creates an histogram
with 100 channels. If you change the cut, Root will automatically
change the upper limit for your histogram. The bin size will be different
for your 3 commands.
You can force Root to use a predefined histogram using >>
Root > myhist = new TH1F("myhist","title",200,0,200);
Root > tree->Draw("wires.time-paddle.time>>myhist","...cut")
Rene Brun