# RooFit: Projecting (large)N-D pdf

**URL:** <https://root-forum.cern.ch/t/roofit-projecting-large-n-d-pdf/16925>\
**Category:** ROOT\
**Created:** [November 22, 2013, 8:55pm UTC](https://root-forum.cern.ch/t/roofit-projecting-large-n-d-pdf/16925 "2013-11-22T20:55:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gcree](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/g/9de053/32.png) [@gcree](https://root-forum.cern.ch/u/gcree)\
**Post date:** [November 22, 2013, 8:55pm UTC](https://root-forum.cern.ch/t/roofit-projecting-large-n-d-pdf/16925/1 "2013-11-22T20:55:36Z")

</div>

Hi There,

I am performing a per-event fit where I have a large number of observables in my dataset/pdf:

- Mreco
- 243 per-event error related quantities

and I fit on only one number:

- Mtrue

The 243 observables describe 81 gaussians (means,sigmas,fractions) which completely describe the “response”, Mreco-Mtrue. They are stored in a RooAddPdf pdfResponse.

I am following along in this tutorial, slide 18 [http://roofit.sourceforge.net/docs/tutorial/plot/roofit\_tutorial\_plot.pdf](http://roofit.sourceforge.net/docs/tutorial/plot/roofit_tutorial_plot.pdf)  
From my impression I should be using

` data->plotOn(frame);
  pdfResponse.plotOn(frame,ProjWData(*data));
  `

When I do this, I see something very much like the upper plot of slide 18 (attached my plot), suggesting something may be wrong there. To investigate this, I tried to use the default projection option first using

` data->plotOn(frame);
  pdfResponse.plotOn(frame);
  `

Here I get an error though:

[quote]Warning in ROOT::Math::AdaptiveIntegratorMultiDim::Integral: Wrong function dimension; n = 81  
[/quote]

I looked up where this error comes from, and I found it here [http://web-docs.gsi.de/~halo/docs/hydra/classDocumentation/doxy\_dev/root52800b/html/AdaptiveIntegratorMultiDim\_8cxx-source.html](http://web-docs.gsi.de/~halo/docs/hydra/classDocumentation/doxy_dev/root52800b/html/AdaptiveIntegratorMultiDim_8cxx-source.html):

`00133 if (n < 2 || n > 15) { 
00134 MATH_WARN_MSGVAL("AdaptiveIntegratorMultiDim::Integral","Wrong function dimension",n); 
00135 return 0;
00136 }`

So it seems there is a hardcoded limit on function dimension? Any reason why? I should not actually need to integrate out these dimensions since they are per-event “errors” of a sort, I should be using only ProjWData, but I am trying to debug the behaviour seen in the attached plot.

Many thanks!  
[TestFit\_comb.eps](https://root-forum.cern.ch/uploads/default/original/2X/c/c3ae0e38ff5527707991c55ee0cc8e0ca729ceac.eps) (22.4 KB)
