Hi, I have a somewhat similar question. I’m working with a tree whose branches are collection.
I’m trying to do something like:
tree->Draw(“Cone4H1TowerJets.pt()”, “f(Cone4H1TowerJets)>0”);
I get different root reactions, depending on the way f is defined:
- double f(const JetCollection *jets)
Error in TTreeFormula::Compile: Bad numerical expression :
“f(Cone4H1TowerJets)”
if I use @Cone4H1TowerJets in the selection argument of Draw:
Error in TTreeFormula::Compile: Bad numerical expression :
“f(@Cone4H1TowerJets)”
same thing without the const.
-
double f(JetCollection jets)
no errors, but inside f, jets.size() is always 0
same thing with const.
same thing with @ -
double f( JetCollection &jets)
segmentation fault
same thing with const
same thing with @
I was also trying to use MakeProxy, but I get punched in the face:
root [1] tree->MakeProxy(“proxytest01”, “somefunc.C”, “”, “nohist”);
Fatal in ROOT::TBranchProxyClassDescriptor:: strcmp(fInfo->GetName(), type)==0 violated at line 117 of `treeplayer/src/TBranchProxyClassDescriptor.cxx’
aborting
… … …
root version is 5.18/00a btw.
Thanks,
Raz