Hi all,
I decided to learn RooFit this week, so I started working my way through the introX tutorials found at
http://roofit.sourceforge.net/docs/tutorial/intro/index.html
I’ve been using PyRoot more than CINT lately, so I figured I’d convert the 9 tutorials to introX.py as a learning tool. Most worked fine, with some minor tweaks, but I’m still running into issues with two of them. I’m attaching a tarball here with the files in the hopes that they will be useful to others…and perhaps someone can point out my issues. The problems are summarized below.
intro2.py - I’m unable to plot the Components of a RooAddPdf. It’s trying to plot something, but it just shows up as a line at y=0. The code is at line 59:
sum.plotOn(xframe, RooFit.Components(RooArgSet(argus, gauss2)), RooFit.LineColor(2))
Where sum is a RooAddPdf.
intro8.py - I’m unable to plot a RooDataHist, dh, located at line 126.
dh.plotOn(yframe, RooTreeData.PlotOpt() )
This causes the code to spit out unintelligible (to me, at least) text.
TClass::TClass:0: RuntimeWarning: no dictionary for class RooTreeData::PlotOpt is available
Error in <RooFormula::Compile>: ')' is expected
[#0] ERROR:InputArguments -- RooFormula::RooFormula(hj <98>r Â Â±ì· Â±ì·¨Â±ì·¨Â±ì·°Â±ì·°Â±ì·¸Â±ì·¸Â±Ã¬Â±Ã¬Â±Ã¬Â±Ã¬Â±Ã¬Â±Ã¬Â±Ã¬Â±Ã¬Â±Ã¬Â±Ã¬Â±Ã¬Â±Ã¬Â±Ã¬Â±Ã¬[#0]±ì±ì: compile error- RooDataHist::dh:fillHistogram: invalid cuts "`à xy Â Â±ì· Â±ì·¨Â±ì·¨Â±ì·°Â±ì·°Â±ì·¸Â±ì·¸Â±Ã¬Â±Ã¬Â±Ã¬Â±Ã¬Â±Ã¬Â±Ã¬Â±Ã¬Â±Ã¬Â±Ã[#0]¬Â±Ã¬Â±Ã¬Â±Ã¬Â±Ã¬Â±Ã¬Â±Ã¬Â±Ã¬t::dh:plotOn: fillHistogram() failed
[#0]
At line 148, I'm unable to properly add the dh2 RooDataHist to the frame and the session seg faults.
dh2 = dh.reduce( RooArgSet(y), "x>0") # RooDataHist
Any help or suggestions would be greatly appreciated.
Matt
roofit_intro.tar.gz (8.55 KB)