Computation of chiSquare for 2D p.d.f. after plot on 1D

Dear RooFit experts,
I already posted this problem long time ago and I’ve never got an answer:
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 shall I give to N ?
What’s the number of degrees of freedom for the plot myFrameY ?

Thanks,

  • Mauro.