Hello
I just wanted to double check about the functionality of trees when adding data to different branches or the same one.
Consider:
//MODE 1: multiple branches
dataTree->Branch("charge", &charge);
dataTree->Branch("mass", &mass);
dataTree->Branch("posX", &posX);
dataTree->Branch("posY", &posY);
dataTree->Branch("localTime", &localTime);
dataTree->Branch("kinE", &kinE);
Against
//CASE 2: Multiple leaves
dataTree->Branch("mybranch", &charge, "charge/I, mass, posX, posY, localTime, kinE/D");
[Q1] These trees will have a different internal structure so I understand from the class reference. Any advantages/disadvantages?
In my specific case, I am looking at a event that produces two signals that goes into two detectors (For simplicity). Each signal has a potential to produce multiple hits. [Q2:] In my scenario, would it be more convenient to create a branch for EACH detector using the MODE 2?
[Q3:] Last question, is there a smart/proper way to keep up with alignment in ttrees? For example, in one event, detector 1 has one hit and detector 2 has 5 hits. I am thinking either to pad detector1’s extra fields with zeros (creating redundancy) or aligning events during the data processing stage. Any suggestions? Could I avoid padding by filling each branch independently and then when i read the trees, I will have to ensure alignment of events, say, by using an eventID field in each branch?
Thank you,