Root File design -links between trees

Dear all,

I would need help with the design of a root file:
For the analysis of a silicon strip sensor, I would like to implement the following structure in a root file:
One tree with calibration data from a the strips of a strip sensor
e.g. (sensorID, noise, pedestals, stripNr).
Then a second tree should contain information about charge deposition:
(HitCharge, SensorID, stripNr).

Ideally I would want to generate plots with signal over noise by simply using the the Tree->Draw() method.
I would think of doing this by having for each cluster a pointer to the corresponding strip in the calibration tree.

However it is not clear to me how to implement this. Could you point me to an example or a different way how this should be done?

Thanks,

Christoph

Hi,

I think you simply need to make those 2 tree ‘friends’ of each other (See TTree::AddFriend).

Cheers,
Philippe.

Hi Philippe,

thanks for your suggestion I had a look at the example:
root.cern.ch/cgi-bin/print_hit_b … treefriend.
C.html?AddFriend#first_hit
But I did not figure out how this would help me with my problem -as my trees would not have the same structure. (Did I misunderstood this part?)
What I would want to do is to “link” from one tree to the elements of another one.

Thanks,

Christoph

Hi,

The TTree do not have to have the same structure to become friend.
Also check the documentation for TTree::BuildIndex (which allows the connection of 2 trees where the event/entry are not in the same order).

Cheers,
Philippe.