Possible to vary a parameter in an PDF by entries in RooFit?

For example, if I want to fit a dataset

RooDataSet data("data","data",RooArgSet(x));

with an Argus function as below,

double end_value = 5.289;
RooArgusBG bkg(“bkg”,“background”,x, RooConst(end_value), RooConst(-25), RooConst(0.5));

However, I would like to vary my “end_value” in different entries.
(e.g. every entries has its own “beam energy”)
So I tried

RooDataSet data("data","data",RooArgSet(x,y));

with the Argus function

RooArgusBG bkg(“bkg”,“background”,x, y, RooConst(-25), RooConst(0.5));

But it seems that didn’t work as I want…
Is it possible to do such thing by other methods?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

Hi @pinchun,

if x, y are both RooRealVar, this is exactly how you should do it. Maybe print the contents of the dataset to see that the values it contains make sense?

One thing that’s different if you have a 2D dataset is that a 2D integral is required for normalisation. Make sure that the range of the variable y is chosen such that the integral can actually converge. I don’t remember the details of the argus distribution, but I could imagine that y cannot be negative or something like this.

1 Like