Several questions about TBrowser and what we can do with it

Hi,

I have a macro which perform a simple monte-carlo simulation. I write the generated events in a TTree called “EventNTuple” and created after a TFile is openned. This tree is filled in a loop and after the end of the loop, I use TTree::Write() to write the tree in the TFile.

In addition, I write also some histograms and functions, and a TGraph in the file.

When I open the browser, I get this :

My questions are:

  1. Why do I see two objects “EventNTuple” with “;2” and “;3” ? Does it mean that I write the tree twice in the file ? In general, what do these “;2” and “;3” mean ?
  2. When I double-click on the TGraph “likelihood;1”, I get an empty canvas. The object itself is correct since I can draw it using “TFile::Get()”. I tried to set default draw options in my rootrc file but it had no effect, and I didn’t find any other solution in the forum. Is there any way to get the plot directly from the browser ?
  3. I don’t understand how to use cuts with the TreeViewer. Is there any documentation on this particular point ?

Another question, not related to the previous ones:
4. Is it possible to catch exceptions in a root macro executed with

root -l -b -q macro.C

Thanks a lot !

Hi,

  1. The “;n” are “backup” copies of the object (called “cycles”). When you write several times an object with the same name into a file, root appends a cycle number. These numbers are different “revision” of the object. See the User’s guide or the documentation for some explanation on how to minimize the number of cycle kept on file.
    See e.g. TTree:AutoSave: root.cern.ch/root/htmldoc/TTree. … e:AutoSave
    See also the User’s Guide: root.cern.ch/drupal/content/users-guide
    Especially the chapter about I/O: (ftp://root.cern.ch/root/doc/11InputOutput.pdf)

  2. Weird, if it is a TGraph, double-clicking should work…

  3. See the User’s Guide: ftp://root.cern.ch/root/doc/12Trees.pdf

  4. I can’t help for this, but there are several posts about exceptions on the forum…
    See e.g. root.cern.ch/phpBB2/viewtopic.ph … =exception

Cheers,
Bertrand.