Inherited class branching

Hi. I would like it for all of the data members in the base classes for my Event class to appear at the “top level” when viewing the EventBranch in the TBrowser. Is that possible.

For example:

class A {
Int_t varA1
Int_t varA2
}

class B : public A {
Int_t varB1
Int_t varB2
}

class Event: public B {
Int_t varEvent1

}

I then create a Tree and set the branch to Event. I save some data in the member variables, Fill, Write and then Close.

Then, I open the root file with the tree and open a browser. Each class that Event inherits gets a branch. I would like it if all of the member variables, varA1, varA2, varB1, etc… would show up just in the Event branch. Is that possible.

Currently, I get
TTree T
Event (branch)
varEvent1
B (branch)
varB1
varB2
A (branch)
varA1
varA2

What I want is it to LOOK like this
TTree T
Event (branch)
varEvent1
varB1
varB2
varA1
varA2

This way, it makes it easier for the data analysis user to see all of the available data members without clicking through each inherited branch.

Thanks in advance for your help.

Adam

Hi,

In the TBrowser, this is not possible ; we use this layout in order to avoid confusion in the general case where the same name can be use for variable in various part on the hierarchy. However the layout you are looking for is actually used in the TreeViewer which you can start by (for example) right clicking on the icon of your TTree object and selecting “StartViewer”.

Cheers,
Philippe.