Using Friend and Chains


I have some ntuples with several trees, Truth0 and FullRec0 f.ex.

I use a chain and loop over all events in this chain from the FullRec0 tree. I would like to access leafs in Truth0. How do I do this when operating with chains, and am I sure I am reading the same events in Truth0 and FullRec0 ?




See this post for some details on using Friends in Atlas.

The short answer is that in your case instead of accessing directly Truth0 and FullRec0, you need to use the ‘CollectionTree’:

TFile f("user.MarijaMilosavljevic.SU1_jimmy_susy.recon.v12000SV_HPTV_12071.AANT1.root") TTree *t = (TTree*)f->Get("CollectionTree"); t->Draw("El_p_T");
or make a TChain of [i]CollectionTree/i.


Hi again,

thanks for the reply.

Does this mean that I need to do MakeClass with CollectionTree instead of the FullRec0 that I used before, to get access to all the leafs?

And how do I access the right leaf. in my Analysis.C Loop function generated by the MakeClass. E.g. both Truth0 and FullRec0 has a leaf called e.g. El_px.