# PDF becomes flat in 2D fit

Hi,

I am facing a strange problem in a 2D fit I am performing on a data set. I have defined a PDF, with all the parameters fixed (so, only area under the component will change, but not the PDF shape).

The

``````
RooGenericPdf dsstCFrhoPolarization("dsstCFrhoPolarization",
"(1 - fLong)*(3/2)*(1 - rhoHelicity*rhoHelicity) + 2*fLong*rhoHelicity*rhoHelicity",
RooArgList(fLong, rhoHelicity));

RooRealVar d0("d0", "d0", -0.99),
d1("d1", "d1", 0.29),
d2("d2", "d2", -0.11),
d3("d3", "d3", 0.41),
d4("d4", "d4", 0.39),
d5("d5", "d5", 0.37),
d6("d6", "d6", 0.16),
d7("d7", "d7", 0.16);

RooChebychev dsstCFdsstAcceptance("dsstCFdsstAcceptance", "dsstCFdsstAcceptance",
dsstHelicity, RooArgList(d0, d1, d2));
RooChebychev dsstCFrhoAcceptance("dsstCFrhoAcceptance", "dsstCFrhoAcceptance",
rhoHelicity, RooArgList(d3, d4, d5, d6, d7));

// Dsst crossfeed Total PDF

RooProdPdf dsstCrossfeedTotal("dsstCrossfeelTotal", "dsstCrossfeedTotal",
RooArgList(dsstCrossfeedDE, dsstCFrhoPolarization, dsstCFdsstAcceptance, dsstCFrhoAcceptance));
``````

The figure attached shows the fit results. The gray curve in the upper plot represents the PDF dsstCFdsstAcceptance, which is a 3rd order Chebyshev polynomial, with all the coefficients (d0, d1, d2) fixed.

This is strange and I am unable to understand why

though it appears more as a conceptual problem than a fitting bug, I feel: If the component dsstCFrhoPolarization is removed, the above PDF recovers it’s original shape !!

BTW, this doesn’t happen in a similar fit in the other dimension.

TIA,
Nikhil
dsstrho-PolarizationFit-test.pdf (24.4 KB)

Hi Nikhil,

I see nothing obviously wrong with your code fragement, but cannot tell much at this point. If you send me a self-contained macro with your full pdf definition that reproduces the problem I will look into it.

Wouter

Hi Wouter and Others,

In fact, the problem is simpler than it appeared and has something to do with how RooProdPdf handles the arguments.

In the last line of the above excerpt, where I defined the RooProdPdf, changing the order of the component PDFs does the job.

If I insert the dsstCFdsstAcceptance (3rd PDF) before dsstCFrhoPolarization (2nd), everything works fine.

The point is, in the present case, the 2nd and 4th PDFs are functions of the same variable, rhoHelicity; whereas the 3rd one is a function of dsstHelicity and the RooProdPdf doesn’t seem to like sandwiching PDF of one variable between two PDFs of some other (but common) variable

I might have overlooked this fact about RooProdPdf in the documentation, but I am curious to know the reason behind this specificity

Thanks and regards,
Nikhil

Hi Nikhil,

The order of RooProdPdf arguments should never be relevant, so this looks like a bug, I will look into it.

Looking at your pdf a bit more closely though, I would advise to write it differently: multiplying two p.d.f.s with the same observable is in general not good practice, as it is conceptually confusing can also have unnecessary performance issues.

If you want to multiply an acceptance function with a p.d.f. class RooEffProd is preferred, which takes a RooAbsReal acceptance function and a RooAbsPdf model. If you wish you can still use a RooChebychev for the efficiency, but it is explicitly used as a function rather than a pdf here (i.e. no normalization term is used). Your present 4-term RooProdPdf should then be replaced by a RooProdPdf of two RooEffProds.

Wouter

FYI: I have entered this RooProfPdf bug report report in savannah under ticket number 56413 (savannah.cern.ch/bugs/?56413)

Wouter

Hi Wouter,

Thanks a lot for your help

I will look into the RooEffProd class

Thanks again,
Nikhil

Hi,

I am posting it here, just for the sake of follow up. Otherwise, it should be posted under fresh query, for easy referencing in future.

I have modified my code to include RooEffProd at the relevant places. While, checking for any bias in the fitting, I am trying to generate toys using the total PDF in my case and it appears that the toys are generated with the pure PDFs (without the effect of the efficiency/acceptance function).

Is it a genuine behaviour of a PDF, which has RooEffProd in its construction? If so, how does one generates a toy with the acceptance effect included?

thanks and regards,
Nikhil