Dear experts,
I am fitting a Missing Mass Square distribution whose background is a polynomial shape. I tried to use RooPolynomial to fit the distribution but it remained unsuccessful. However, when I construct a generic PDF using RooGenericPdf it fits the same distribution well. The relevant part of the code is as follows
RooRealVar a0("a0", "", 3.91127e+01, -325.725, 325.725);
RooRealVar a1("a1", "", -1.18839e+01, -92.7361, 92.7361);
RooRealVar a2("a2", "", -2.04872e+0, -21.8625, 21.8625);
RooRealVar a3("a3", "", 4.10267e-01, -3.39566, 3.39566);
RooRealVar a4("a4", "", 7.36547e-02, -0.0883327, 0.0883327);
RooGenericPdf gpdf("gpdf","","a0+a1*MMissSq+a2*pow(MMissSq,2)+a3*pow(MMissSq,3)+a4*pow(MMissSq,4)", RooArgList(a0,a1,MMissSq, a2,a3,a4));
This works well. However, if I use
RooPolynomial gpdf("gpdf"," ", MMissSq, RooArgList(a0,a1,a2,a3,a4));
This does not work. I thought both did the same job. Can anyone explain why both work differently?