Re: TTree::Draw("???")

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Jan 05 1998 - 17:16:42 MET


William J. Deninger wrote:

> Hello,
>
> How do I Draw a "Run_number" histogram in a TTree if I have used the
> following to book it?  Is there a way similar to TNtuple, that being without
> needing to write a bunch of code to sort through the tree and book into a
> hist?
>
> class Event: public TObject
> {
>     EventHeader header;
> ......
> }
> class EventHeader : public TObject
> {
>     UInt_t Run_number;
> ......
> }
>
> {
> Event *event = new Event;
> TTree *t = new TTree("tree","example tree");
> tree->Branch("event","Event",&event,32000,0);
> for (Int_t i=0; i<100; i++)
>     {
>     event->Run_number = i;
>     t->Fill();
>     }
> }

In an interactive Root session, simply do:
    Root > tree->Draw("Run_number")

I also suggest, you look at the URL:
  http://root.cern.ch/root/HowtoReadTree.html

Rene Brun



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:29 MET