iminuit/probfit — pull request #21 by piti118 (2013-03-22 01:24:03+00:00)
Title: add nint_subdiv to control how binned chi^2 and binned LH calculate expected number of event

Here you go @gitcheng. This fixed both BinnedChi2 and BinnedLH

```python
from iminuit import Minuit, describe
from probfit import BinnedChi2, Extended
from probfit.pdf import gaussian
import numpy as np
np.random.seed(0)
bound=(2,10)
nbins=3
bkg = np.random.randn(10000)+5
ebkg= Extended(gaussian, extname='N')
blh= BinnedChi2(ebkg, bkg, bins=nbins, bound=bound, nint_subdiv=1) #nint_subdiv=1 is the old behavior
m= Minuit(blh, N=len(bkg), error_N=10, mean=5., sigma=1.,error_mean=1,
error_sigma=1)
m.migrad()
blh.draw(m)
```
gives

![Unknown](https://f.cloud.github.com/assets/591316/288986/dae64e22-928e-11e2-8cf3-17462d9d8dd3.png)

New with better nint_subdiv=100
```python
from iminuit import Minuit, describe
from probfit import BinnedChi2, Extended
from probfit.pdf import gaussian
import numpy as np
np.random.seed(0)
bound=(2,10)
nbins=3
bkg = np.random.randn(10000)+5
ebkg= Extended(gaussian, extname='N')
blh= BinnedChi2(ebkg, bkg, bins=nbins, bound=bound, nint_subdiv=100)
m= Minuit(blh, N=len(bkg), error_N=10, mean=5., sigma=1.,error_mean=1,
error_sigma=1)
m.migrad()
blh.draw(m)
```
![Unknown-1](https://f.cloud.github.com/assets/591316/288991/16d82acc-928f-11e2-9505-bffb08799929.png)