Hello
I’m trying some basic stuff with Roofit through PyRoot.
>>> hh=TH1F("hh", "test histo", 100, -5, 5)
>>> hh.FillRandom("gaus", 10000)
>>> hh.Draw()
>>> x=RooRealVar("x", "x", -5, 5)
RooFit v2.10 -- Developed by Wouter Verkerke and David Kirkby
Copyright (C) 2000-2005 NIKHEF, University of California & Stanford University
All rights reserved, please read http://roofit.sourceforge.net/license.txt
>>> data=RooDataHist("data", "dataset with x", x, hh)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: none of the 5 overloaded methods succeeded. Full details:
RooDataHist::RooDataHist() =>
takes at most 0 arguments (4 given)
RooDataHist::RooDataHist(const char* name, const char* title, const RooArgSet& vars) =>
takes at most 3 arguments (4 given)
RooDataHist::RooDataHist(const RooDataHist& other, const char* newname = 0) =>
takes at most 2 arguments (4 given)
RooDataHist::RooDataHist(const char* name, const char* title, const RooArgSet& vars, const RooAbsData& data, Double_t initWgt = 1.0) =>
could not convert argument 3
RooDataHist::RooDataHist(const char* name, const char* title, const RooArgList& vars, const TH1* hist, Double_t initWgt = 1.0) =>
could not convert argument 3
Equivalent code in bare root works but apparently there’s some problem with type, I proceeded as follows,
>>> data=RooDataHist("data", "dataset with x", RooArgList(x), hh)
>>> frame=x.frame()
>>> data.plotOn(frame)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: RooPlot* RooDataHist(RooPlot* frame, RooTreeData::PlotOpt o) =>
takes at least 2 arguments (1 given)
at this point I don’t really know what to do… Could you tell me where I’m doing wrong?
Cheers
Akira