RooNDKeysPDF and getVal

Hi just to make my question even more clear it is along the lines of: RooFit: Evaluate fitted function at a point
Is it correct to use getVal() to get the y value of a pdf for a given x value and if so how is the normalisation to be understood? I’ve included an even simpler example to illustrate.

[code] RooRealVar x(“x”,“x”,-10,10) ;
RooRealVar mean(“mean”,“mean of gaussian”,0,-10,10) ;
RooRealVar sigma(“sigma”,“width of gaussian”,7) ;
RooGaussian gauss(“gauss”,“gaussian PDF”,x,mean,sigma) ;

// Generate a toy MC set
RooDataSet* data = gauss.generate(x,1000) ;

double sum=0;
RooArgSet test(x);
for (int i=0 ; inumEntries() ; i++) {
test = *data->get(i);
sum+=gauss.getVal();
}
cout << data->sumEntries()<<endl;
cout << sum << endl;
cout << (gauss.createIntegral(x,x))->getVal() << endl;
[/code]
sumEntries is of course 1000, and the inegral is 1 but the sum is 799.096 so it seems to me, that they sum to 0.8 and not 1 and that the value is dependent on sigma, e.g. something like the area described by the gauss relative to a flat distribution with y=1 in the x-range. I’m sure the logic is simple but I haven’t been able to find out sp any help would be most appreciated.

cheers,

Ask