Re: Next tree problem.

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Nov 12 1998 - 17:57:55 MET


Henk Uijterwaal (RIPE-NCC) wrote:
> 
> So, I finally managed to get my program to fill a root tree running
> (thanks to everybody who replied)... but... how do I access the data
> that I've put in my root file.
> 
> I started with what I though was the obvious thing:
> 
> root [0] TFile f = new TFile ("Output.root");
> root [1] tree->MakeCode("");
> Warning in <TLeafObject::Streamer>: Cannot find class:Delay
> 
> Then tried to execute tree.C  but this also complain that it cannot find
> the delay class.
> 
> I also tried the example event from $ROOTSYS/test/
> (http://root.cern.ch/root/html/examples/eventa.cxx.html)  (interactively)
> with pretty much the same effect:
> 
> root [0]  gROOT->Reset();
> root [1]    TFile f("Event.root");
> root [2]   TTree *T = (TTree*)f.Get("T");
> Warning in <TBranchClones::Streamer>: Unknow class: Track. Cannot read
> BranchClones: fTracks
> Warning in <TLeafObject::Streamer>: Cannot find class:Event
> root [3] Event *event = new Event();
> Error: No symbol Event in current scope  FILE:/tmp/16206daa LINE:1
> Error: No symbol Event in current scope  FILE:/tmp/16206daa LINE:1
> Error: type Event not defined FILE:/tmp/16206daa LINE:1
> Warning: Undeclared symbol Event*event. Automatic variable allocated
> FILE:/tmp/16206daa LINE:1
> *** Interpreter error recovered ***
> root [4]
> 
> This must be something stupid but what?
> 

Henk,
I suggest you read the HOWTO at URL:
  http://root.cern.ch/root/HowtoReadTree.html

If you have access to your classes, you do not need to use
TTree::MakeCode. You can use directly your classes.
We give examples of analysis macros in $ROOTSYS/test/eventa.cxx
and eventb.cxx

TTree::MakeCode generates a skeleton analysis function that does
not require your classes, unless one branch is one of your classes.
I introduced recently in 2.00/13 TTree::MakeClass that I strongly
recommend instead of TTree::MakeCode.
The Analysis of a Root tree can be done with
  - the Root browser itself. This is nice if you want quickly
    histogram predefined leaves of a branch.
  - TTree::Draw
  - Your own function where you loop yourself on the events

Rene Brun



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