Computation of the chiSquare for a 2D p.d.f.

Dear RooFit experts,
I have one question about the computation of the chiSquare for a 2D p.d.f. after plotting on one dimension.

Data of the problem:

  • myPDF is a product of two “sub-pdfs” (pdfA and pdfB)
  • pdfA depends on x
  • pdfA has 2 free parameters
  • pdfB depends on y
  • pdfB has 2 free parameters

When I do the following :
RooPlot* myFrameY = y->frame(NBINS);
myPDF->plotOn(myFrameY,Name(myPDF->getPlotLabel()));
cout << myFrameY->chiSquare(myPDF->getPlotLabel(),data->GetName(),N) << endl;

Which value shell I give to N ?
What’s the number of degrees of freedom for the plot myFrameY ? Maybe it’s NBINS - N ?

Thanks,

  • Mauro.