Bug loading Short_t branch into Roofit RooDataSet

Hello,

I’m trying to load a branch of type UShort_t into a RooDataSet through the following lines:

import ROOT
import sys

filename=str(sys.argv[1])
rootfile = ROOT.TFile(filename,"READ")
tree=rootfile.Get("signalTree")

channelID = ROOT.RooRealVar("channelID","channelID",0,2)
data=ROOT.RooDataSet("data","data",tree,ROOT.RooArgSet(channelID))

When I do this, I get the following error:

[#0] ERROR:InputArguments -- RooAbsReal::attachToTree(channelID) data type UShort_t is not supported

I’m using ROOT 6.08/06. I see people have had similar problems with similar variables before (ULong64_t, Bool_t, etc.) but I don’t see how their problem has been fixed. Any suggestions to fix this? Thank you!

May be @wlav can help with this question

Hi,

I’m out of this and don’t even have ROOT installed anymore, so can’t try to reproduce.

But typical with RooFit are scoping problems (as it likes to cast away const and save pointers to temporaries), so this may help:

argset = ROOT.RooArgSet(channelID)
data=ROOT.RooDataSet(“data”,“data”,tree,argset)

Good luck,
Wim

Thanks for the response.

The above lines didn’t work. Doing some more searching, I found this patch which may solve the problem:
https://sft.its.cern.ch/jira/browse/ROOT-6882

I can’t currently test this, as I don’t have permissions to edit these files on the machine I’m using, but I will check when I get home. If this works, maybe it could be included in a future version?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.