Hi,
I use a small dictionnary containing the contents of a namespace Utils::, in expressions like
mytree->Draw(“some_var”,“Utils::some_function()>cut”)
The sad thing is, if I have a variable
TLorentzVector Utils::jet;
I cannot use
mytree->Draw(“some_var”,“Utils::jet.Pt()>cut”);
I get:
Error in TTreeFormula::Compile: Bad numerical expression : “Utils::jet.Pt()”
(The variable Utils::jet is correctly exported in the dictionnary ; I can use Utils::jet.Pt() from CINT for instance).
So I have to write a wrapper
Utils::getPt() { return Utils::jet.Pt(); }
and then
mytree->Draw(“some_var”,“Utils::getPt()>cut”);
works like a charm.
Why is this ?
That’s all the more disturbing that if I have a variable
TLorentzVector tlv; in my TTree, it can compile expressions like
mytree->Draw(“tlv.Eta()”,“tlv.Pt()>cut”);
Can I do something to be able to use directly the variable, without needing a wrapper ?
Nicolas