After a fit I need to define a multidimensional gaussian with a dimension per parameter and including all correlations. Then using RooAbsPdf::generate() I need to generate sets of random parameters with correlations.
In the allowing code “model” is the model I previously fit.
“Unfortunately” it works fine… but at least it makes clear what I want to do.
The actual code I’m running is part of a much more complex set of classes but in principle it does the same thing as the script.
Do you have any idea of what could cause that error in general?
It looks like a sort of type mismatch inside generate().
In the attached example no error is printed. I don’t understand why you are getting an error in a larger example. Unfortunately if I cannot reproduce the problem, there is little I can do to help you
I have understood what the problem is. It is happening when you fix one parameter and therefore the covariance matrix from the fit has a reduced size (it contains only the free parameters).
On the other hand you also do not want to generate variations for the fixed parameters, so you should remove them from the list of the parameters passed to generate().
yes I can confirm that that was one problem.
In addition a fit was failing with covQual=-1.
And therefore the MultiVarGaussian did not find a matrix.
Strange that it didn’t give a working though.