Dear RooFiters,

I came across an undesired behaviour from RooFit when I create a negative log-likelihood with the RooFit::Range() command RooFit uses numerical integration:

```
RooAbsReal* nll =(RooAbsReal*) model_2D_ProjY->createNLL(*y_Data,RooFit::Verbose(),RooFit::Optimize(kTRUE),RooFit::Range("R"));
```

I get as output:

```
[#1] INFO:Eval -- RooRealVar::setRange(y) new range named 'R' created with bounds [0,10]
[#1] INFO:Fitting -- RooAbsOptTestStatistic::ctor(nll_model_2D_Proj[x]_genData) constructing test statistic for sub-range named R
[#1] INFO:Eval -- RooRealVar::setRange(y) new range named 'NormalizationRangeForR' created with bounds [0,10]
[#1] INFO:Eval -- RooRealVar::setRange(y) new range named 'fit_nll_model_2D_Proj[x]_genData' created with bounds [0,10]
[#1] INFO:Fitting -- RooAbsOptTestStatistic::ctor(nll_model_2D_Proj[x]_genData) fixing interpretation of coefficients of any RooAddPdf to full domain of observables
[#1] INFO:NumericIntegration -- RooRealIntegral::init([model_x_X_ratio(model_y_Int[y],model_y_Int[y|NormalizationRangeForR])]_Norm[x]_denominator_Int[x]) using numeric integrator RooIntegrator1D to calculate Int(x)
[#1] INFO:NumericIntegration -- RooRealIntegral::init([model_x_X_ratio(model_y_Int[y],model_y_Int[y|NormalizationRangeForR])]_Int[x]) using numeric integrator RooIntegrator1D to calculate Int(x)
[#1] INFO:NumericIntegration -- RooRealIntegral::init([model_x_X_ratio(model_y_Int[y],model_y_Int[y|NormalizationRangeForR])]_Norm[x]_denominator_Int[x]) using numeric integrator RooIntegrator1D to calculate Int(x)
[#1] INFO:NumericIntegration -- RooRealIntegral::init([[model_x_X_ratio(model_y_Int[y],model_y_Int[y|NormalizationRangeForR])]_Norm[x]_X_model_y_NORM[y]]_Int[x]) using numeric integrator RooIntegrator1D to calculate Int(x)
```

It resorts to numerical integration even if the Range is the same as the natural range of the variable.

Is there any way to prevent RooFit to use numerical integration when it is not necessary ?

I join a simplified macro reproducing the issue Projected2D_Simple.C (1.9 KB) (I run it on ROOT Version: 6.18/04)

but the real model I’m working on is much more complex and numerical integration is becoming an issue because of computing time.

If anyone could look into that, I’d be grateful.

Cheers,

Loïc,