TLorentzVectors in new TSelector are broken?

Hi all,

It looks like in the new versions of Root (I am running 6.06/02) the MakeSelector() method is changed to generate code using TTreeReader thing. With this new version, I get seg. faults when trying to read a tree with TLorentzVectors inside.
Here is an example tree I have: small.root (1.15 MB)
I generate my code like this:

root -l small.root apzTree->MakeSelector("smallAna")
Then in smallAna.C in Process() method I simply try: std::cout<<"lep1 pt = "<<lep1->Pt()<<std::endl; and this breaks.

The same tree works fine if the TSelector code is created in an older version of Root.

Q1. Is this a bug, or something I’m not doing right?
Q2. Is it possible to call an older version of MakeSelector() method within a new version of Root.

Thanks,
Andrey

PS. For completeness, attaching here the smallAna.C and smallAna.h:
smallAna.C (842 Bytes)smallAna.h (2.53 KB)
I run it with apzTree->Process(“smallAna.C”)
And the error I get is Error in TBranchProxy::Read: Unable to initialize lep1

Hi Andrey,

Sorry for picking this up only now. This indeed looks like a bug. I will let you know as I make progress…

Cheers, Axel.

Hi Axel,
Thanks for looking into this.
I’m still interested in a solution if you have one. Will I be able to read that tree with a newer version of ROOT?

Hi,

You can always call MakeSelector with the “=legacy” option (see the doc at sft.its.cern.ch/jira/browse/ROOT-8373

Would you have an example ROOT file that demonstrates the issue?

Cheers, Axel.

Hi,

The root file is also attached to my first post - at the top.

Andrey

Got it, thanks!

Axel.