Several questions about TBrowser and what we can do with it


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 !


  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: … e:AutoSave
    See also the User’s Guide:
    Especially the chapter about I/O: (

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

  3. See the User’s Guide:

  4. I can’t help for this, but there are several posts about exceptions on the forum…
    See e.g. … =exception