View tree leaf array element in TBrowser

Hello!

I am currently working on learning about trees and branches and leaves. I have a question about viewing array elements in the TBrowser. I noticed that if a leaf is an array as it is in the tutorial tree2.C

   TFile f("tree2.root","recreate");
   TTree t2("t2","a Tree with data from a fake Geant3");
   t2.Branch("lmec",gstep.lmec,"lmec[nmec]/I");

When the root file is opened in TBrowser, lmec just shows up as a single leaf. Is there a way to select one element of the array (for example lmec[1]) in TBrowser without typing in the command terminal?

Thank you!
Jen

Hi Jen,

You cant. A leaf may represent millions of entries. How would you display every single entry in the browser?

Cheers, Bertrand.

Hi Bertrand,

My apologies, I didn’t mean each entry.

For example:

This would draw a histogram of array element 2. When I click on the lmec leaf, a histogram of the entire array is drawn. I was wondering if there was something I can click in TBrowser that would only draw a histogram of one element of the array just like the code above would.

Thank you!
Jen

Hi Jen,

Well, I don’t see how I could implement such a GUI element to achieve this kind of selection. If you have an idea, feel free to share it :slight_smile:
And note that you can type the “tree->Draw(“lmec[2]”)” command in the browser itself

Cheers, Bertrand.