Hi, @moneta,

Adding `r.RooFit.Minimizer("Minuit2", "migrad")`

to the `fitTo`

command results in very nearly the same results as above:

With `BatchMode`

:

```
RooFitResult: minimized FCN value: -303.383, estimated distance to minimum: 133.316
covariance matrix quality: Full, accurate covariance matrix
Status : MINIMIZE=0 HESSE=0 HESSE=0
Floating Parameter FinalValue +/- Error
-------------------- --------------------------
Nbkg 5.4048e+01 +/- 6.76e+01
Nsig 1.4599e+02 +/- 7.71e+01
c1 2.0586e-01 +/- 5.89e-01
mu 4.6270e-01 +/- 1.05e+00
s 3.1733e+00 +/- 1.40e+00
```

Without `BatchMode`

:

```
RooFitResult: minimized FCN value: -303.384, estimated distance to minimum: 1.01821e-05
covariance matrix quality: Full, accurate covariance matrix
Status : MINIMIZE=0 HESSE=0 HESSE=0
Floating Parameter FinalValue +/- Error
-------------------- --------------------------
Nbkg 5.4053e+01 +/- 2.23e+01
Nsig 1.4595e+02 +/- 2.43e+01
c1 2.0472e-01 +/- 3.44e-01
mu 4.6150e-01 +/- 4.05e-01
s 3.1738e+00 +/- 4.88e-01
```

I do not think it is just statistics. Here it is with 100x more stats.:

```
import ROOT as r
ws = r.RooWorkspace("workspace")
x = ws.factory("x[-10, 10]")
sig = ws.factory("Gaussian::sig(x, mu[-1, 1], s[0.1, 5])")
bkg = ws.factory("Chebychev::bkg(x, {c1[0.1, -1, 1]})")
shp = ws.factory("SUM::shp(Nsig[0, 20000] * sig, Nbkg[0, 20000] * bkg)")
data = shp.generate(r.RooArgSet(x))
datahist = r.RooDataHist("datahist", "datahist", data.get(), data)
print("with BatchMode:")
resWith = shp.fitTo(
datahist,
r.RooFit.Extended(),
r.RooFit.Save(),
r.RooFit.SumW2Error(True),
r.RooFit.Strategy(1),
r.RooFit.BatchMode(True),
r.RooFit.Minimizer("Minuit2", "migrad"),
)
print("without BatchMode:")
resWithout = shp.fitTo(
datahist,
r.RooFit.Extended(),
r.RooFit.Save(),
r.RooFit.SumW2Error(True),
r.RooFit.Strategy(1),
r.RooFit.BatchMode(False),
r.RooFit.Minimizer("Minuit2", "migrad"),
)
```

Which gives:

With `BatchMode`

:

```
RooFitResult: minimized FCN value: -121094, estimated distance to minimum: 4.95332e+11
covariance matrix quality: Full matrix, but forced positive-definite
Status : MINIMIZE=0 HESSE=0 HESSE=0
Floating Parameter FinalValue +/- Error
-------------------- --------------------------
Nbkg 9.8942e+03 +/- 6.96e+04
Nsig 1.0106e+04 +/- 8.79e+04
c1 9.0743e-02 +/- 8.03e+00
mu -6.5631e-02 +/- 2.70e+01
s 2.5349e+00 +/- 2.01e+01
```

Without `BatchMode`

:

```
RooFitResult: minimized FCN value: -121094, estimated distance to minimum: 2.56742e-06
covariance matrix quality: Full, accurate covariance matrix
Status : MINIMIZE=0 HESSE=0 HESSE=0
Floating Parameter FinalValue +/- Error
-------------------- --------------------------
Nbkg 9.8941e+03 +/- 1.84e+02
Nsig 1.0106e+04 +/- 1.85e+02
c1 9.0777e-02 +/- 1.99e-02
mu -6.5422e-02 +/- 4.05e-02
s 2.5349e+00 +/- 4.29e-02
```