Combined (simultaneous) fit of two histogram with separate functions and some common parameters
****************************************
Minimizer is Minuit2 / Migrad
Chi2 = 131.104
NDf = 115
Edm = 2.11602e-08
NCalls = 225
Par_0 = 5.5396 +/- 0.0354094
Par_1 = 4.66089 +/- 0.050106
Par_2 = -0.0514037 +/- 0.00108539 (limited)
Par_3 = 77.2733 +/- 3.93105 (limited)
Par_4 = 30 (fixed)
Par_5 = 4.864 +/- 0.243005
import ROOT
import numpy as np
[
1,
2,
3,
4,
5,
],
)
def __init__(self, f1, f2):
self._f1 = f1
self._f2 = f2
p1 = par_arr[iparB]
p2 = par_arr[iparSB]
return self._f1(p1) + self._f2(p2)
hSB =
ROOT.TH1D(
"hSB",
"histo S+B", 100, 0, 100)
fSB =
ROOT.TF1(
"fSB",
"expo + gaus(2)", 0, 100)
Npar = 6
par0 =
np.array([5, 5, -0.1, 100, 30, 10])
c1 =
ROOT.TCanvas(
"Simfit",
"Simultaneous fit of two histograms", 10, 10, 700, 700)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Class describing the binned data sets : vectors of x coordinates, y values and optionally error on y ...
class describing the range in the coordinates it supports multiple range in a coordinate.
Fitter class, entry point for performing all type of fits.
Documentation for class Functor class.
TMatrixT< Element > & Add(TMatrixT< Element > &target, Element scalar, const TMatrixT< Element > &source)
Modify addition: target += scalar * source.
DataOptions : simple structure holding the options on how the data are filled.
- Author
- Jonas Rembser, Lorenzo Moneta (C++ version)
Definition in file combinedFit.py.