signal: gaussian in x with per-event resolution dx
background: some polynomial, does not care about dx
When I generate and plot with the signal model only, using ProjWData to average over dx, things work as expected.
When I make a RooAddPdf of the signal+background, then generate and plot using ProjWData in the same way, my data and model disagree. The disagreement looks like the kind you normally get when accidentally integrating a per-event observable instead of averaging.
I attached a quick script to show the problem.
Maybe this is a “logical problem” rather than a root problem. If so, how do I construct a signal+background model in this fashion, where the signal pdf depends on some per-event observable, but the background does not at all? conditional.cxx (2 KB)
I am reviving this thread as I have ran into the same problem again, which I think is a root bug.
If you run the script attached to the previous post, the printout is as follows:
[quote]
[#1] INFO:Plotting – RooAbsReal::plotOn(sg_x) plot on x averages using data variables (dx)
[#1] INFO:Plotting – RooAbsReal::plotOn(sg_x) only the following components of the projection data will be used: (dx) [#1] INFO:Plotting – RooDataWeightedAverage::ctor(sg_xDataWgtAvg) constructing data weighted average of function sg_x_Norm[x] over 1000 data points of (dx) with a total weight of 1000
…[/quote]
This is the projection of the signal model only… so far ok. I bolded one section for emphasis to compare to the following:
Is this a bug? I specifically ask to average over dx in the projection, not integrate. There is no pdf for dx specified, what I try to plot is
S(x|dx) + B(x)
(individually plotting S(x|dx) and B(x), both using ProjWData to average over dx, produce reasonable results)
I have also run into the same issue , I think, were I am trying to plot deltat distribution using deltaErr as a conditional variable. Just as in your case, the individual extended pdfs are plotting fine, but the RooAdd of these signal + bg components plot looks terrible, the data and the fot don’t agree even though the fit has converged?
Is this fixed in any new root version yet?