Hi,

I’m in need to use the RooMomentMorph class of Root and I’m having some problems.

I’m using Root version 5.34.32-HiggsComb-p1-x86_64-slc6-gcc48-opt.

I’m trying to figure out how to generate a dataset from the RooMomentMorph.

I did a very simple example with two RooGaussian that I gave to RooMomentMorph as input and then I generate a dataset:

mymorph->generate(x,10); For 10 events.

This works fine without any problem.

But If I do this same example, but now the input pdfs are 2 dimensional (product of 2 gaussian for two different observables) and I call the generate method:

mymorph2D -> generate(obs,10); (obs is a RooArgSet with two RooRealVars)

I get a bunch of evaluate errors like this:

--- RooGenContext ---

Using PDF RooMomentMorph::mymorph2[ m=m4l varList=(mZ1,mZ2) pdfList=(p1,p2) ]

Use PDF generator for ()

Use MC sampling generator RooFoamGenerator for (mZ1,mZ2)

[#0] ERROR:Eval -- RooAbsReal::logEvalError(p1_pdf_0) evaluation error,

origin : RooProdPdf::p1_pdf_0[ gauss_mZ1_pdf_0 * gauss_mZ11_pdf_0 ]

message : p.d.f value is Not-a-Number (-nan), forcing value to zero

server values: !pdfs=(gauss_mZ1_pdf_0 = 0/-nan,gauss_mZ11_pdf_0 = 0/-nan)

[#0] ERROR:Eval -- RooAbsReal::logEvalError(p2_pdf_1) evaluation error,

origin : RooProdPdf::p2_pdf_1[ gauss_mZ2_pdf_1 * gauss_mZ22_pdf_1 ]

message : p.d.f value is Not-a-Number (-nan), forcing value to zero

server values: !pdfs=(gauss_mZ2_pdf_1 = 0/-nan,gauss_mZ22_pdf_1 = 0/-nan)

Here is my simple 2D example:

TVectorD ref_points(2);

ref_points(0) = 300.;

ref_points(1) = 320.;

RooRealVar * m4l = new RooRealVar("m4l","m4l",300.,130.,510.);

RooRealVar * mZ1 = new RooRealVar("mZ1","mZ1",90., 0., 120.);

RooRealVar * mZ2 = new RooRealVar("mZ2","mZ2",90., 0., 120.);

RooArgSet* obs = new RooArgSet(*mZ1, *mZ2);

RooRealVar * mZ_1 = new RooRealVar("mZ_1","mZ_1",90.,0., 120.);

RooRealVar * mZ_2 = new RooRealVar("mZ_2","mZ_2",92.,0., 120.);

RooRealVar * sigmaZ_1 = new RooRealVar("sigmaZ1","sigmaZ1", 0.2, 0., 1.0);

RooRealVar * sigmaZ_2 = new RooRealVar("sigmaZ2","sigmaZ2", 0.3, 0., 1.0);

RooGaussian gauss_mZ1("gauss_mZ1", "gauss1",*mZ1,*mZ_1,*sigmaZ_1);

RooGaussian gauss_mZ2("gauss_mZ2", "gauss2",*mZ1,*mZ_2,*sigmaZ_2);

RooGaussian gauss_mZ11("gauss_mZ11", "gauss11",*mZ2,*mZ_1,*sigmaZ_1);

RooGaussian gauss_mZ22("gauss_mZ22", "gauss22",*mZ2,*mZ_2,*sigmaZ_2);

RooProdPdf p1("p1","p1", RooArgSet(gauss_mZ1,gauss_mZ11));

RooProdPdf p2("p2","p2", RooArgSet(gauss_mZ2,gauss_mZ22));

RooMomentMorph * mymorph2 = new RooMomentMorph("mymorph2","mymorph2", *m4l, *obs, RooArgSet(p1,p2),ref_points,RooMomentMorph::Linear);

m4l->setVal(300.);

mymorph2->Print();

RooDataSet* d2 = mymorph2->generate(*obs,1,Verbose(true)) ;

d2->Print();

Any suggestion or help is welcome.

Thanks in advance.

Best regards,

Francisca.