Chisquare("pdf","hist") returning -1

Hi,

So I am fitting a data set with a pdf sum of multiple things. to do this I use the following format


RooDataHist data("data","data",x,hData);

RooAddPdf sum("sum","sum", RooArgSet(Pdf1,Pdf2,Pdf3), RooArgSet(Param1,Param2,Param3));

sum.fitTo(data,extended());

data.plotOn(frame);
sum.plotOn(frame);

I can get a reasonable value through

frame->chiSquare();

and

frame->chiSquare(n);

but if I try to specify which things to compare

frame->chiSquare(“sum”,“data”,n);

it just returns -1, what am I doing wrong, any ideas?

George

Hi,

I think the names you specify should be the one for the RooCurve and RooHist objects which are inside the RooPlot.
Just do a frame->Print() to see the list of contained objects

Lorenzo