Suggested Data Structure for Event with Subevents

Hi All,

I’m interested in your suggestions for a TTree data structure that will fit my needs. My suspicion is that there is already a well used structure for my need as I can imagine it is typical in HEP.

I need to track the interaction of of a nucleus as it transits through some material…nevermind the actual physics model here…just consider it motivation. The point is that I’ll have a primary event at which the original projectile nucleus interacts with a target nucleus. This will create particles(pions, kaons, ect.), but it will also create nuclear fragments which will continue on and have additional interactions with the nuclei in the material. These “secondary events” will produce particles, but they may also create additional nuclear fragments which could lead to “tertiary events” and so on. So as you can see the event structure repeats itself in levels. Then the entire process would repeat with a second projectile nucleus.

Although I have quite a bit of experience with ROOT it isn’t clear to me how to utilize TTrees and TBranches in a way that could store this multi-level data. I’d eventually like to access the data by looping over a TTree were the entries represent instances of the original nucleus incident on the material. Each of these entries would contain all the information about the primary, secondary, and tertiary events. Where I could then loop over the contents of the primary event’s tracks, or secondary events tracks ect.

So to get to the point: How do you create a TTree (with branches) which can represent a multi-leveled, repeating data such as this?

Many thanks in advance for your thoughts,
Chris