RooNDKeysPdf with more than 4 dimensions

Hi Rooters,

I am posting in this forum cause I am facing an issue when using the RooNDKeysPdf class of RooFIT.

What I am trying to do is quite straightforward (see my attached macro) :

  • building a multidimensional kernel based on some experimental and correlated data ;
  • sampling more points from the obtained multidimensional probability density function.

The goal is to extend the experimental data, keeping the observed correlation in the initial data.

Things are working perfectly fine when the dimension of my data is 2,3 or 4.
When I add a fifth dimension, I am getting really weird results :

  • the sampled data do not cover the full expected range ;
  • the sampled data exhibit some really weird “square cuts” (see an example in attached pictures below).

Am I doing something wrong ?
Based on the square shape of the anomalies, I wouldn’t say it comes from the kernel estimator (even ill-conditioned I wouldn’t expect square shape from a gaussian sum).

I simplified my problem and attached some files to show you this behavior :

I am using ROOT v5.34 and RooFIT v3.59.

Thanks in advance for your help,



This could be an issue with the generation of events from the Pdf. You might need to change the default Foam configuration, before calling RooAbsPdf::generate.

This you can do by doing for example :

RooNDKeysPdf k_all("k_all","k_all"  , x_to_use ,data_REX,OPTIONS,RHO,NSIGNAL,ROTATE) ;


RooDataSet *data_KER = k_all.generate(x_to_use , NB_POINTS )								;

You might need to set better values to get still reasonable CPU time. Of corse large sample values and larger number of cells will increase the CPU time

Best Regards