Dear ROOTers,
I have some issues understanding an error during a fit. First let me explain what I am doing…
I am trying to apply a backtracing procedure based on RooFit. The backtracing procedure consists on trying to find the best input parameters of a model which reproduces the best a given (experimental) distribution of chosen experimental variables (observables). I am trying to apply this procedure on Toy-events from a model where I control the input parameters distribution.
The first step of my work is to generate with a model 2 observables from a distribution of 2 input model parameters (in my case a correlated-2D gaussian). These events (10000 events with 2 observables) are then stored in a RooDataHist. It will be the events I want to fit.
The second step is to select a binning in parameters and generate events for each bin of them (1000 events) and store them in a RooDataHist. As an example if I set for the first parameter 20 bins and 10 bins for second, I will have 20x10=200 RooDataHist.
The third step is then to generate a RooHistPdf from each of the RooDataHist created at the second step.
The fourth step is to create a RooAddPdf from the set of RooHistPdf I have created at the third step, each of them with a coefficient value between 0. and 1. This RooAddPdf will then be fitted to the RooDataHist created at the first step.
The fit is going well in my case, using the RooAddPdf::fitTo() method, but I have some issues when I try to fit in a range.
If I set the observables ranges like in the following:
RooRealVar obs1(“obs1”, “observable 1”, Min1, Max1);
RooRealVar obs2(“obs2”, “observable 2”, Min2, Max2);
obs1.setRange(“RANGE”, min1, max1);
obs2.setRange(“RANGE”, min2, max2);
And try to fit the RooDataHist created at first step using the RooAddPdf created at step four like this:
RooFitResult *result = pdf->fitTo(datahist, Save(), NumCPU(7), Minimizer(“GSLMultMin”, “conjugatefr”), Extended(kFALSE), Offset(kTRUE), Range(“RANGE”));
I have error messages arrising like the following one…
WARNING: Minization – RooMinimizerFcn: Minimized function has error status.
Returning maximum FCN so far (-1e+30) to force MIGRAD to back out of this region.
I am quite lost because the fit is going well without setting the range…
Do you have any idea about how to solve this problem, or where to investigate ?
Thanks a lot,
Quentin.