Logo ROOT   6.14/05
Reference Guide
minuit2GausFit.C File Reference

Detailed Description

View in nbviewer Open in SWAN Perform fits with different configurations using Minuit2

pict1_minuit2GausFit.C.png
pict2_minuit2GausFit.C.png
Processing /mnt/build/workspace/root-makedoc-v614/rootspi/rdoc/src/v6-14-00-patches/tutorials/fit/minuit2GausFit.C...
Do Fit 1
Do Fit 2
Minuit2Minimizer: Minimize with max-calls 1345 convergence for edm < 0.01 strategy 1
MnSeedGenerator: for initial parameters FCN = 130.4086890832
MnSeedGenerator: Initial state: - FCN = 130.4086890832 Edm = 91.9034 NCalls = 13
VariableMetric: start iterating until Edm is < 2e-05
VariableMetric: Initial state - FCN = 130.4086890832 Edm = 91.9034 NCalls = 13
VariableMetric: Iteration # 0 - FCN = 130.4086890832 Edm = 91.9034 NCalls = 13
VariableMetric: Iteration # 1 - FCN = 69.84374040416 Edm = 1.31429 NCalls = 21
VariableMetric: Iteration # 2 - FCN = 65.47146392405 Edm = 0.251272 NCalls = 29
VariableMetric: Iteration # 3 - FCN = 65.16360304303 Edm = 0.00342912 NCalls = 37
VariableMetric: Iteration # 4 - FCN = 65.15866988104 Edm = 6.85944e-05 NCalls = 45
VariableMetric: Iteration # 5 - FCN = 65.15859769243 Edm = 2.0024e-09 NCalls = 53
VariableMetric: After Hessian - FCN = 65.15859769243 Edm = 1.93774e-09 NCalls = 69
VariableMetric: Iteration # 6 - FCN = 65.15859769243 Edm = 1.93774e-09 NCalls = 69
Number of iterations 7
----------> Iteration 0
FVAL = 130.408689083 Edm = 91.9034258956 Nfcn = 13
Error matrix change = 1
Parameters : p0 = 45.7135 p1 = 0.0276 p2 = 1.03818
----------> Iteration 1
FVAL = 69.8437404042 Edm = 1.314294384 Nfcn = 21
Error matrix change = 0.556547
Parameters : p0 = 39.098 p1 = 0.017263 p2 = 0.97602
----------> Iteration 2
FVAL = 65.4714639241 Edm = 0.251272226796 Nfcn = 29
Error matrix change = 0.506801
Parameters : p0 = 36.0678 p1 = 0.00678987 p2 = 1.02566
----------> Iteration 3
FVAL = 65.163603043 Edm = 0.00342911860885 Nfcn = 37
Error matrix change = 0.25723
Parameters : p0 = 36.3576 p1 = 0.0108748 p2 = 1.03384
----------> Iteration 4
FVAL = 65.158669881 Edm = 6.85944158694e-05 Nfcn = 45
Error matrix change = 0.140183
Parameters : p0 = 36.3021 p1 = 0.0129287 p2 = 1.03428
----------> Iteration 5
FVAL = 65.1585976924 Edm = 2.00240394288e-09 Nfcn = 53
Error matrix change = 0.0876016
Parameters : p0 = 36.3132 p1 = 0.013082 p2 = 1.03413
----------> Iteration 6
FVAL = 65.1585976924 Edm = 1.93773754036e-09 Nfcn = 69
Error matrix change = 0
Parameters : p0 = 36.3132 p1 = 0.013082 p2 = 1.03413
Minuit2Minimizer : Valid minimum - status = 0
FVAL = 65.1585976924265395
Edm = 1.93773754035702457e-09
Nfcn = 69
Constant = 36.3132 +/- 1.52625
Mean = 0.013082 +/- 0.0347499
Sigma = 1.03413 +/- 0.0288039 (limited)
Minuit2Minimizer::GetMinosError for parameter 0 Constant using max-calls 1345, tolerance 0.01
MnFunctionCross: parameter 0 set to 34.7869
MnSeedGenerator: for initial parameters FCN = 66.17168175294
MnSeedGenerator: Initial state: - FCN = 66.17168175294 Edm = 0.000115215 NCalls = 9
VariableMetric: start iterating until Edm is < 1e-05
VariableMetric: Initial state - FCN = 66.17168175294 Edm = 0.000115215 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 66.17168175294 Edm = 0.000115215 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 66.17156294352 Edm = 1.20757e-07 NCalls = 14
MnFunctionCross: parameter 0 set to 34.7967
MnSeedGenerator: for initial parameters FCN = 66.15854209966
MnSeedGenerator: Initial state: - FCN = 66.15854209966 Edm = 2.4499e-05 NCalls = 9
VariableMetric: start iterating until Edm is < 1e-05
VariableMetric: Initial state - FCN = 66.15854209966 Edm = 2.4499e-05 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 66.15854209966 Edm = 2.4499e-05 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 66.15851755606 Edm = 2.34582e-09 NCalls = 14
MnFunctionCross: parameter 0 set to 37.8394
MnSeedGenerator: for initial parameters FCN = 66.14680616321
MnSeedGenerator: Initial state: - FCN = 66.14680616321 Edm = 0.000113488 NCalls = 9
VariableMetric: start iterating until Edm is < 1e-05
VariableMetric: Initial state - FCN = 66.14680616321 Edm = 0.000113488 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 66.14680616321 Edm = 0.000113488 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 66.14669579129 Edm = 9.98321e-08 NCalls = 14
MnFunctionCross: parameter 0 set to 37.8486
MnSeedGenerator: for initial parameters FCN = 66.15854840966
MnSeedGenerator: Initial state: - FCN = 66.15854840966 Edm = 2.54315e-05 NCalls = 9
VariableMetric: start iterating until Edm is < 1e-05
VariableMetric: Initial state - FCN = 66.15854840966 Edm = 2.54315e-05 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 66.15854840966 Edm = 2.54315e-05 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 66.15852305107 Edm = 1.76672e-09 NCalls = 14
Minos: Lower error for parameter Constant : -1.51651
Minos: Upper error for parameter Constant : 1.53547
Minuit2Minimizer::GetMinosError for parameter 1 Mean using max-calls 1345, tolerance 0.01
MnFunctionCross: parameter 0 set to -0.0216679
MnSeedGenerator: for initial parameters FCN = 66.15867475548
MnSeedGenerator: Initial state: - FCN = 66.15867475548 Edm = 0.00108156 NCalls = 9
VariableMetric: start iterating until Edm is < 1e-05
VariableMetric: Initial state - FCN = 66.15867475548 Edm = 0.00108156 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 66.15867475548 Edm = 0.00108156 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 66.15759334219 Edm = 2.34127e-08 NCalls = 14
MnFunctionCross: parameter 0 set to 0.0478319
MnSeedGenerator: for initial parameters FCN = 66.15900963262
MnSeedGenerator: Initial state: - FCN = 66.15900963262 Edm = 0.0010711 NCalls = 9
VariableMetric: start iterating until Edm is < 1e-05
VariableMetric: Initial state - FCN = 66.15900963262 Edm = 0.0010711 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 66.15900963262 Edm = 0.0010711 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 66.15794043745 Edm = 1.78958e-08 NCalls = 14
Minos: Lower error for parameter Mean : -0.0347674
Minos: Upper error for parameter Mean : 0.0347613
Minuit2Minimizer::GetMinosError for parameter 2 Sigma using max-calls 1345, tolerance 0.01
MnFunctionCross: parameter 0 set to 1.00533
MnSeedGenerator: for initial parameters FCN = 66.17114745115
MnSeedGenerator: Initial state: - FCN = 66.17114745115 Edm = 0.000116035 NCalls = 9
VariableMetric: start iterating until Edm is < 1e-05
VariableMetric: Initial state - FCN = 66.17114745115 Edm = 0.000116035 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 66.17114745115 Edm = 0.000116035 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 66.17102737617 Edm = 1.73265e-07 NCalls = 14
MnFunctionCross: parameter 0 set to 1.0055
MnSeedGenerator: for initial parameters FCN = 66.15855782889
MnSeedGenerator: Initial state: - FCN = 66.15855782889 Edm = 2.60516e-05 NCalls = 9
VariableMetric: start iterating until Edm is < 1e-05
VariableMetric: Initial state - FCN = 66.15855782889 Edm = 2.60516e-05 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 66.15855782889 Edm = 2.60516e-05 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 66.15853134832 Edm = 1.47818e-08 NCalls = 14
MnFunctionCross: parameter 0 set to 1.06293
MnSeedGenerator: for initial parameters FCN = 66.14463016447
MnSeedGenerator: Initial state: - FCN = 66.14463016447 Edm = 9.38204e-05 NCalls = 9
VariableMetric: start iterating until Edm is < 1e-05
VariableMetric: Initial state - FCN = 66.14463016447 Edm = 9.38204e-05 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 66.14463016447 Edm = 9.38204e-05 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 66.14453941055 Edm = 1.37821e-07 NCalls = 14
MnFunctionCross: parameter 0 set to 1.06314
MnSeedGenerator: for initial parameters FCN = 66.15851550893
MnSeedGenerator: Initial state: - FCN = 66.15851550893 Edm = 3.22677e-05 NCalls = 9
VariableMetric: start iterating until Edm is < 1e-05
VariableMetric: Initial state - FCN = 66.15851550893 Edm = 3.22677e-05 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 66.15851550893 Edm = 3.22677e-05 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 66.15848385023 Edm = 2.14124e-08 NCalls = 14
Minos: Lower error for parameter Sigma : -0.0286274
Minos: Upper error for parameter Sigma : 0.0290102
Covariance Matrix:
Constant Mean Sigma
Constant 2.3294 0.0002427 -0.027611
Mean 0.0002427 0.0012076 -9.3319e-06
Sigma -0.027611 -9.3319e-06 0.00082969
Correlation Matrix:
Constant Mean Sigma
Constant 1 0.0045761 -0.62806
Mean 0.0045761 1 -0.0093231
Sigma -0.62806 -0.0093231 1
****************************************
Minimizer is Minuit2
Chi2 = 65.1586
NDf = 56
Edm = 1.93774e-09
NCalls = 69
Constant = 36.3132 +/- 1.52625
Mean = 0.013082 +/- 0.0347499
Sigma = 1.03413 +/- 0.0288039 (limited)
Do Fit 3
****************************************
Minimizer is Minuit2
Chi2 = 65.1586
NDf = 56
Edm = 5.63237e-09
NCalls = 68
Constant = 36.3274 +/- 1.52734
Mean = 0.0130805 +/- 0.0347499
Sigma = 1.03373 +/- 0.0288151 (limited)
Do Fit 4
Minuit2Minimizer: Minimize with max-calls 1345 convergence for edm < 0.01 strategy 1
MnSeedGenerator: for initial parameters FCN = 59.37893582261
MnSeedGenerator: Initial state: - FCN = 59.37893582261 Edm = 23.8051 NCalls = 13
VariableMetric: start iterating until Edm is < 1e-05
VariableMetric: Initial state - FCN = 59.37893582261 Edm = 23.8051 NCalls = 13
VariableMetric: Iteration # 0 - FCN = 59.37893582261 Edm = 23.8051 NCalls = 13
VariableMetric: Iteration # 1 - FCN = 44.94069265714 Edm = 0.773988 NCalls = 21
VariableMetric: Iteration # 2 - FCN = 43.43606117719 Edm = 0.0453628 NCalls = 29
VariableMetric: Iteration # 3 - FCN = 43.39363464345 Edm = 0.000175467 NCalls = 37
VariableMetric: Iteration # 4 - FCN = 43.39345546819 Edm = 9.74238e-08 NCalls = 44
VariableMetric: After Hessian - FCN = 43.39345546819 Edm = 9.98059e-08 NCalls = 60
VariableMetric: Iteration # 5 - FCN = 43.39345546819 Edm = 9.98059e-08 NCalls = 60
Number of iterations 6
----------> Iteration 0
FVAL = 59.3789358226 Edm = 23.8051155917 Nfcn = 13
Error matrix change = 1
Parameters : p0 = 45.7135 p1 = 0.0276 p2 = 1.03818
----------> Iteration 1
FVAL = 44.9406926571 Edm = 0.773987920349 Nfcn = 21
Error matrix change = 0.580853
Parameters : p0 = 40.6144 p1 = 0.0276007 p2 = 1.00093
----------> Iteration 2
FVAL = 43.4360611772 Edm = 0.0453627798765 Nfcn = 29
Error matrix change = 0.40441
Parameters : p0 = 38.2485 p1 = 0.0276002 p2 = 1.03476
----------> Iteration 3
FVAL = 43.3936346434 Edm = 0.000175467155603 Nfcn = 37
Error matrix change = 0.237745
Parameters : p0 = 38.4512 p1 = 0.0276009 p2 = 1.0378
----------> Iteration 4
FVAL = 43.3934554682 Edm = 9.7423803633e-08 Nfcn = 44
Error matrix change = 0.128267
Parameters : p0 = 38.427 p1 = 0.027601 p2 = 1.03819
----------> Iteration 5
FVAL = 43.3934554682 Edm = 9.98059014815e-08 Nfcn = 60
Error matrix change = 0
Parameters : p0 = 38.427 p1 = 0.027601 p2 = 1.03819
Minuit2Minimizer : Valid minimum - status = 0
FVAL = 43.3934554681902327
Edm = 9.98059014815227973e-08
Nfcn = 60
Constant = 38.427 +/- 1.48837
Mean = 0.027601 +/- 0.032831
Sigma = 1.03819 +/- 0.0232194 (limited)
Minuit2Minimizer::GetMinosError for parameter 0 Constant using max-calls 1345, tolerance 0.01
MnFunctionCross: parameter 0 set to 36.9387
MnSeedGenerator: for initial parameters FCN = 43.90873925582
MnSeedGenerator: Initial state: - FCN = 43.90873925582 Edm = 0.000132178 NCalls = 9
VariableMetric: start iterating until Edm is < 5e-06
VariableMetric: Initial state - FCN = 43.90873925582 Edm = 0.000132178 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 43.90873925582 Edm = 0.000132178 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 43.90860183103 Edm = 2.09782e-07 NCalls = 14
MnFunctionCross: parameter 0 set to 36.9607
MnSeedGenerator: for initial parameters FCN = 43.89326997499
MnSeedGenerator: Initial state: - FCN = 43.89326997499 Edm = 5.0917e-05 NCalls = 9
VariableMetric: start iterating until Edm is < 5e-06
VariableMetric: Initial state - FCN = 43.89326997499 Edm = 5.0917e-05 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 43.89326997499 Edm = 5.0917e-05 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 43.89321904908 Edm = 6.05599e-13 NCalls = 14
MnFunctionCross: parameter 0 set to 39.9154
MnSeedGenerator: for initial parameters FCN = 43.87938545703
MnSeedGenerator: Initial state: - FCN = 43.87938545703 Edm = 0.000138937 NCalls = 9
VariableMetric: start iterating until Edm is < 5e-06
VariableMetric: Initial state - FCN = 43.87938545703 Edm = 0.000138937 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 43.87938545703 Edm = 0.000138937 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 43.87925218963 Edm = 2.295e-07 NCalls = 14
MnFunctionCross: parameter 0 set to 39.937
MnSeedGenerator: for initial parameters FCN = 43.89329471521
MnSeedGenerator: Initial state: - FCN = 43.89329471521 Edm = 5.69203e-05 NCalls = 9
VariableMetric: start iterating until Edm is < 5e-06
VariableMetric: Initial state - FCN = 43.89329471521 Edm = 5.69203e-05 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 43.89329471521 Edm = 5.69203e-05 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 43.89323778415 Edm = 7.78066e-13 NCalls = 14
Minos: Lower error for parameter Constant : -1.46667
Minos: Upper error for parameter Constant : 1.51031
Minuit2Minimizer::GetMinosError for parameter 1 Mean using max-calls 1345, tolerance 0.01
MnFunctionCross: parameter 0 set to -0.00523004
MnSeedGenerator: for initial parameters FCN = 43.89345820803
MnSeedGenerator: Initial state: - FCN = 43.89345820803 Edm = 0.000261584 NCalls = 9
VariableMetric: start iterating until Edm is < 5e-06
VariableMetric: Initial state - FCN = 43.89345820803 Edm = 0.000261584 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 43.89345820803 Edm = 0.000261584 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 43.89319680439 Edm = 6.02092e-11 NCalls = 14
MnFunctionCross: parameter 0 set to 0.060432
MnSeedGenerator: for initial parameters FCN = 43.89345269077
MnSeedGenerator: Initial state: - FCN = 43.89345269077 Edm = 0.000256919 NCalls = 9
VariableMetric: start iterating until Edm is < 5e-06
VariableMetric: Initial state - FCN = 43.89345269077 Edm = 0.000256919 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 43.89345269077 Edm = 0.000256919 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 43.8931959431 Edm = 5.58583e-11 NCalls = 14
Minos: Lower error for parameter Mean : -0.0328395
Minos: Upper error for parameter Mean : 0.0328395
Minuit2Minimizer::GetMinosError for parameter 2 Sigma using max-calls 1345, tolerance 0.01
MnFunctionCross: parameter 0 set to 1.01497
MnSeedGenerator: for initial parameters FCN = 43.91322394171
MnSeedGenerator: Initial state: - FCN = 43.91322394171 Edm = 0.000116281 NCalls = 9
VariableMetric: start iterating until Edm is < 5e-06
VariableMetric: Initial state - FCN = 43.91322394171 Edm = 0.000116281 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 43.91322394171 Edm = 0.000116281 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 43.91310259725 Edm = 2.22312e-07 NCalls = 14
MnFunctionCross: parameter 0 set to 1.01541
MnSeedGenerator: for initial parameters FCN = 43.8931845953
MnSeedGenerator: Initial state: - FCN = 43.8931845953 Edm = 8.60941e-05 NCalls = 9
VariableMetric: start iterating until Edm is < 5e-06
VariableMetric: Initial state - FCN = 43.8931845953 Edm = 8.60941e-05 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 43.8931845953 Edm = 8.60941e-05 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 43.89309848173 Edm = 1.01991e-11 NCalls = 14
MnFunctionCross: parameter 0 set to 1.06141
MnSeedGenerator: for initial parameters FCN = 43.87506262924
MnSeedGenerator: Initial state: - FCN = 43.87506262924 Edm = 0.000127983 NCalls = 9
VariableMetric: start iterating until Edm is < 5e-06
VariableMetric: Initial state - FCN = 43.87506262924 Edm = 0.000127983 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 43.87506262924 Edm = 0.000127983 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 43.87494052583 Edm = 2.67712e-07 NCalls = 14
MnFunctionCross: parameter 0 set to 1.06185
MnSeedGenerator: for initial parameters FCN = 43.89321154572
MnSeedGenerator: Initial state: - FCN = 43.89321154572 Edm = 9.64242e-05 NCalls = 9
VariableMetric: start iterating until Edm is < 5e-06
VariableMetric: Initial state - FCN = 43.89321154572 Edm = 9.64242e-05 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 43.89321154572 Edm = 9.64242e-05 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 43.89311509665 Edm = 6.67633e-12 NCalls = 14
Minos: Lower error for parameter Sigma : -0.0227841
Minos: Upper error for parameter Sigma : 0.0236699
Covariance Matrix:
Constant Mean Sigma
Constant 2.2153 -3.264e-06 -0.019956
Mean -3.264e-06 0.0010779 8.9196e-08
Sigma -0.019956 8.9196e-08 0.00053915
Correlation Matrix:
Constant Mean Sigma
Constant 1 -6.6797e-05 -0.57743
Mean -6.6797e-05 1 0.00011701
Sigma -0.57743 0.00011701 1
****************************************
Minimizer is Minuit2
MinFCN = 43.3935
Chi2 = 74.4576
NDf = 97
Edm = 9.98059e-08
NCalls = 60
Constant = 38.427 +/- 1.48837
Mean = 0.027601 +/- 0.032831
Sigma = 1.03819 +/- 0.0232194 (limited)
Do Fit 1
Do Fit 2
Minuit2Minimizer: Minimize with max-calls 1345 convergence for edm < 0.01 strategy 1
MnSeedGenerator: for initial parameters FCN = 130.4086890832
MnSeedGenerator: Initial state: - FCN = 130.4086890832 Edm = 91.9034 NCalls = 13
Fumili: start iterating until Edm is < 1e-06
Fumili: Initial state - FCN = 130.4086890832 Edm = 91.9034 NCalls = 13
Fumili: Iteration # 2 - FCN = 79.16955382607 Edm = 11.2614 NCalls = 14
Fumili: Iteration # 3 - FCN = 65.15899551325 Edm = 0.000440916 NCalls = 15
Fumili: Iteration # 4 - FCN = 65.15859944286 Edm = 1.63332e-06 NCalls = 16
Fumili: Iteration # 5 - FCN = 65.15859769852 Edm = 7.48888e-09 NCalls = 17
Fumili: After Hessian - FCN = 65.15859769852 Edm = 8.0381e-09 NCalls = 45
Number of iterations 6
----------> Iteration 0
FVAL = 130.408689083 Edm = 91.9034257381 Nfcn = 13
Error matrix change = 1
Parameters : p0 = 45.7135 p1 = 0.0276 p2 = 1.03818
----------> Iteration 1
FVAL = 79.1695538261 Edm = 11.2613963067 Nfcn = 14
Error matrix change = 0.727775
Parameters : p0 = 36.1708 p1 = 0.0126892 p2 = 0.949066
----------> Iteration 2
FVAL = 65.1589955133 Edm = 0.000440916181331 Nfcn = 15
Error matrix change = 0.429675
Parameters : p0 = 36.2965 p1 = 0.0129513 p2 = 1.03469
----------> Iteration 3
FVAL = 65.1585994429 Edm = 1.63332378597e-06 Nfcn = 16
Error matrix change = 0.215296
Parameters : p0 = 36.3119 p1 = 0.0130821 p2 = 1.03417
----------> Iteration 4
FVAL = 65.1585976985 Edm = 7.48887817869e-09 Nfcn = 17
Error matrix change = 0.107683
Parameters : p0 = 36.3131 p1 = 0.0130818 p2 = 1.03413
----------> Iteration 5
FVAL = 65.1585976985 Edm = 8.03809660244e-09 Nfcn = 45
Error matrix change = 0
Parameters : p0 = 36.3131 p1 = 0.0130818 p2 = 1.03413
Minuit2Minimizer : Valid minimum - status = 0
FVAL = 65.1585976985221151
Edm = 8.03809660243548436e-09
Nfcn = 45
Constant = 36.3131 +/- 1.52625
Mean = 0.0130818 +/- 0.0347499
Sigma = 1.03413 +/- 0.0288039 (limited)
Minuit2Minimizer::GetMinosError for parameter 0 Constant using max-calls 1345, tolerance 0.01
MnFunctionCross: parameter 0 set to 34.7868
MnSeedGenerator: for initial parameters FCN = 66.1717965769
MnSeedGenerator: Initial state: - FCN = 66.1717965769 Edm = 0.000114641 NCalls = 9
VariableMetric: start iterating until Edm is < 1e-05
VariableMetric: Initial state - FCN = 66.1717965769 Edm = 0.000114641 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 66.1717965769 Edm = 0.000114641 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 66.17167835849 Edm = 1.20177e-07 NCalls = 14
MnFunctionCross: parameter 0 set to 34.7967
MnSeedGenerator: for initial parameters FCN = 66.15854261729
MnSeedGenerator: Initial state: - FCN = 66.15854261729 Edm = 2.49664e-05 NCalls = 9
VariableMetric: start iterating until Edm is < 1e-05
VariableMetric: Initial state - FCN = 66.15854261729 Edm = 2.49664e-05 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 66.15854261729 Edm = 2.49664e-05 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 66.15851760561 Edm = 2.38472e-09 NCalls = 14
MnFunctionCross: parameter 0 set to 37.8393
MnSeedGenerator: for initial parameters FCN = 66.1466913873
MnSeedGenerator: Initial state: - FCN = 66.1466913873 Edm = 0.00011292 NCalls = 9
VariableMetric: start iterating until Edm is < 1e-05
VariableMetric: Initial state - FCN = 66.1466913873 Edm = 0.00011292 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 66.1466913873 Edm = 0.00011292 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 66.14658156819 Edm = 9.93496e-08 NCalls = 14
MnFunctionCross: parameter 0 set to 37.8486
MnSeedGenerator: for initial parameters FCN = 66.1585488481
MnSeedGenerator: Initial state: - FCN = 66.1585488481 Edm = 2.58951e-05 NCalls = 9
VariableMetric: start iterating until Edm is < 1e-05
VariableMetric: Initial state - FCN = 66.1585488481 Edm = 2.58951e-05 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 66.1585488481 Edm = 2.58951e-05 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 66.15852302751 Edm = 1.80675e-09 NCalls = 14
Minos: Lower error for parameter Constant : -1.51642
Minos: Upper error for parameter Constant : 1.53556
Minuit2Minimizer::GetMinosError for parameter 1 Mean using max-calls 1345, tolerance 0.01
MnFunctionCross: parameter 0 set to -0.0216681
MnSeedGenerator: for initial parameters FCN = 66.15868704242
MnSeedGenerator: Initial state: - FCN = 66.15868704242 Edm = 0.00108064 NCalls = 9
VariableMetric: start iterating until Edm is < 1e-05
VariableMetric: Initial state - FCN = 66.15868704242 Edm = 0.00108064 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 66.15868704242 Edm = 0.00108064 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 66.15760652846 Edm = 2.3681e-08 NCalls = 14
MnFunctionCross: parameter 0 set to 0.0478317
MnSeedGenerator: for initial parameters FCN = 66.15899735833
MnSeedGenerator: Initial state: - FCN = 66.15899735833 Edm = 0.00107023 NCalls = 9
VariableMetric: start iterating until Edm is < 1e-05
VariableMetric: Initial state - FCN = 66.15899735833 Edm = 0.00107023 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 66.15899735833 Edm = 0.00107023 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 66.15792904363 Edm = 1.80959e-08 NCalls = 14
Minos: Lower error for parameter Mean : -0.0347671
Minos: Upper error for parameter Mean : 0.0347615
Minuit2Minimizer::GetMinosError for parameter 2 Sigma using max-calls 1345, tolerance 0.01
MnFunctionCross: parameter 0 set to 1.00533
MnSeedGenerator: for initial parameters FCN = 66.1710342688
MnSeedGenerator: Initial state: - FCN = 66.1710342688 Edm = 0.00011552 NCalls = 9
VariableMetric: start iterating until Edm is < 1e-05
VariableMetric: Initial state - FCN = 66.1710342688 Edm = 0.00011552 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 66.1710342688 Edm = 0.00011552 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 66.17091473247 Edm = 1.72099e-07 NCalls = 14
MnFunctionCross: parameter 0 set to 1.0055
MnSeedGenerator: for initial parameters FCN = 66.1585572843
MnSeedGenerator: Initial state: - FCN = 66.1585572843 Edm = 2.56056e-05 NCalls = 9
VariableMetric: start iterating until Edm is < 1e-05
VariableMetric: Initial state - FCN = 66.1585572843 Edm = 2.56056e-05 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 66.1585572843 Edm = 2.56056e-05 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 66.15853125528 Edm = 1.46111e-08 NCalls = 14
MnFunctionCross: parameter 0 set to 1.06293
MnSeedGenerator: for initial parameters FCN = 66.14474255193
MnSeedGenerator: Initial state: - FCN = 66.14474255193 Edm = 9.33719e-05 NCalls = 9
VariableMetric: start iterating until Edm is < 1e-05
VariableMetric: Initial state - FCN = 66.14474255193 Edm = 9.33719e-05 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 66.14474255193 Edm = 9.33719e-05 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 66.14465222524 Edm = 1.36711e-07 NCalls = 14
MnFunctionCross: parameter 0 set to 1.06314
MnSeedGenerator: for initial parameters FCN = 66.15851512067
MnSeedGenerator: Initial state: - FCN = 66.15851512067 Edm = 3.17345e-05 NCalls = 9
VariableMetric: start iterating until Edm is < 1e-05
VariableMetric: Initial state - FCN = 66.15851512067 Edm = 3.17345e-05 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 66.15851512067 Edm = 3.17345e-05 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 66.1584839883 Edm = 2.12152e-08 NCalls = 14
Minos: Lower error for parameter Sigma : -0.0286291
Minos: Upper error for parameter Sigma : 0.0290085
Covariance Matrix:
Constant Mean Sigma
Constant 2.3294 0.00024274 -0.027611
Mean 0.00024274 0.0012076 -9.3326e-06
Sigma -0.027611 -9.3326e-06 0.00082969
Correlation Matrix:
Constant Mean Sigma
Constant 1 0.0045768 -0.62806
Mean 0.0045768 1 -0.0093238
Sigma -0.62806 -0.0093238 1
****************************************
Minimizer is Minuit2 / Fumili
Chi2 = 65.1586
NDf = 56
Edm = 8.0381e-09
NCalls = 45
Constant = 36.3131 +/- 1.52625
Mean = 0.0130818 +/- 0.0347499
Sigma = 1.03413 +/- 0.0288039 (limited)
Do Fit 3
****************************************
Minimizer is Minuit2 / Fumili
Chi2 = 65.1586
NDf = 56
Edm = 1.52369e-08
NCalls = 45
Constant = 36.3272 +/- 1.52734
Mean = 0.0130818 +/- 0.0347499
Sigma = 1.03373 +/- 0.0288151 (limited)
Do Fit 4
Minuit2Minimizer: Minimize with max-calls 1345 convergence for edm < 0.01 strategy 1
MnSeedGenerator: for initial parameters FCN = 59.37893582261
MnSeedGenerator: Initial state: - FCN = 59.37893582261 Edm = 23.8051 NCalls = 13
Fumili: start iterating until Edm is < 5e-07
Fumili: Initial state - FCN = 59.37893582261 Edm = 23.8051 NCalls = 13
Fumili: Iteration # 2 - FCN = 52.23535906457 Edm = 15.7973 NCalls = 14
Fumili: Iteration # 3 - FCN = 44.59114050033 Edm = 0.678155 NCalls = 15
Fumili: Iteration # 4 - FCN = 43.49291484645 Edm = 0.0638834 NCalls = 16
Fumili: Iteration # 5 - FCN = 43.40537058219 Edm = 0.00696015 NCalls = 17
Fumili: Iteration # 6 - FCN = 43.39560346137 Edm = 0.00120472 NCalls = 18
Fumili: Iteration # 7 - FCN = 43.39386966545 Edm = 0.000231498 NCalls = 19
Fumili: Iteration # 8 - FCN = 43.39353563705 Edm = 4.48954e-05 NCalls = 20
Fumili: Iteration # 9 - FCN = 43.39347091481 Edm = 8.70149e-06 NCalls = 21
Fumili: Iteration # 10 - FCN = 43.39345837804 Edm = 1.68518e-06 NCalls = 22
Fumili: Iteration # 11 - FCN = 43.39345595089 Edm = 3.26218e-07 NCalls = 23
Fumili: After Hessian - FCN = 43.39345595089 Edm = 5.82496e-07 NCalls = 51
Fumili: Iteration # 13 - FCN = 43.39345536839 Edm = 1.95593e-15 NCalls = 52
Fumili: After Hessian - FCN = 43.39345536839 Edm = 1.9682e-15 NCalls = 84
Number of iterations 14
----------> Iteration 0
FVAL = 59.3789358226 Edm = 23.8051156133 Nfcn = 13
Error matrix change = 1
Parameters : p0 = 45.7135 p1 = 0.0276 p2 = 1.03818
----------> Iteration 1
FVAL = 52.2353590646 Edm = 15.7973168083 Nfcn = 14
Error matrix change = 0.946152
Parameters : p0 = 37.0455 p1 = 0.0276012 p2 = 0.975225
----------> Iteration 2
FVAL = 44.5911405003 Edm = 0.678155216866 Nfcn = 15
Error matrix change = 0.516813
Parameters : p0 = 37.6923 p1 = 0.0135425 p2 = 1.01848
----------> Iteration 3
FVAL = 43.4929148465 Edm = 0.0638834334807 Nfcn = 16
Error matrix change = 0.269485
Parameters : p0 = 38.0009 p1 = 0.0171462 p2 = 1.0397
----------> Iteration 4
FVAL = 43.4053705822 Edm = 0.00696014757926 Nfcn = 17
Error matrix change = 0.139355
Parameters : p0 = 38.2218 p1 = 0.0263423 p2 = 1.03895
----------> Iteration 5
FVAL = 43.3956034614 Edm = 0.00120472220688 Nfcn = 18
Error matrix change = 0.072946
Parameters : p0 = 38.3316 p1 = 0.0271707 p2 = 1.03891
----------> Iteration 6
FVAL = 43.3938696654 Edm = 0.000231498052867 Nfcn = 19
Error matrix change = 0.0380601
Parameters : p0 = 38.3845 p1 = 0.0275055 p2 = 1.03848
----------> Iteration 7
FVAL = 43.3935356371 Edm = 4.48954177821e-05 Nfcn = 20
Error matrix change = 0.0197548
Parameters : p0 = 38.4079 p1 = 0.0275531 p2 = 1.03834
----------> Iteration 8
FVAL = 43.3934709148 Edm = 8.70149163197e-06 Nfcn = 21
Error matrix change = 0.010197
Parameters : p0 = 38.4183 p1 = 0.0275828 p2 = 1.03826
----------> Iteration 9
FVAL = 43.393458378 Edm = 1.68517864445e-06 Nfcn = 22
Error matrix change = 0.00523948
Parameters : p0 = 38.4229 p1 = 0.0275925 p2 = 1.03822
----------> Iteration 10
FVAL = 43.3934559509 Edm = 3.26217609918e-07 Nfcn = 23
Error matrix change = 0.00268169
Parameters : p0 = 38.4249 p1 = 0.0275974 p2 = 1.03821
----------> Iteration 11
FVAL = 43.3934559509 Edm = 5.82496394611e-07 Nfcn = 51
Error matrix change = 0
Parameters : p0 = 38.4249 p1 = 0.0275974 p2 = 1.03821
----------> Iteration 12
FVAL = 43.3934553684 Edm = 1.95593296744e-15 Nfcn = 52
Error matrix change = 0.37759
Parameters : p0 = 38.4265 p1 = 0.027601 p2 = 1.0382
----------> Iteration 13
FVAL = 43.3934553684 Edm = 1.96820480035e-15 Nfcn = 84
Error matrix change = 0
Parameters : p0 = 38.4265 p1 = 0.027601 p2 = 1.0382
Minuit2Minimizer : Valid minimum - status = 0
FVAL = 43.3934553683858653
Edm = 1.96820480035472574e-15
Nfcn = 84
Constant = 38.4265 +/- 1.48835
Mean = 0.027601 +/- 0.0328313
Sigma = 1.0382 +/- 0.0232198 (limited)
Minuit2Minimizer::GetMinosError for parameter 0 Constant using max-calls 1345, tolerance 0.01
MnFunctionCross: parameter 0 set to 36.9381
MnSeedGenerator: for initial parameters FCN = 43.90913752278
MnSeedGenerator: Initial state: - FCN = 43.90913752278 Edm = 0.000128912 NCalls = 9
VariableMetric: start iterating until Edm is < 5e-06
VariableMetric: Initial state - FCN = 43.90913752278 Edm = 0.000128912 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 43.90913752278 Edm = 0.000128912 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 43.9090034941 Edm = 2.04554e-07 NCalls = 14
MnFunctionCross: parameter 0 set to 36.9607
MnSeedGenerator: for initial parameters FCN = 43.89327284467
MnSeedGenerator: Initial state: - FCN = 43.89327284467 Edm = 5.38545e-05 NCalls = 9
VariableMetric: start iterating until Edm is < 5e-06
VariableMetric: Initial state - FCN = 43.89327284467 Edm = 5.38545e-05 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 43.89327284467 Edm = 5.38545e-05 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 43.89321898141 Edm = 5.72217e-13 NCalls = 14
MnFunctionCross: parameter 0 set to 39.9148
MnSeedGenerator: for initial parameters FCN = 43.87898699835
MnSeedGenerator: Initial state: - FCN = 43.87898699835 Edm = 0.000135588 NCalls = 9
VariableMetric: start iterating until Edm is < 5e-06
VariableMetric: Initial state - FCN = 43.87898699835 Edm = 0.000135588 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 43.87898699835 Edm = 0.000135588 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 43.87885694373 Edm = 2.2403e-07 NCalls = 14
MnFunctionCross: parameter 0 set to 39.937
MnSeedGenerator: for initial parameters FCN = 43.89329728072
MnSeedGenerator: Initial state: - FCN = 43.89329728072 Edm = 5.99101e-05 NCalls = 9
VariableMetric: start iterating until Edm is < 5e-06
VariableMetric: Initial state - FCN = 43.89329728072 Edm = 5.99101e-05 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 43.89329728072 Edm = 5.99101e-05 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 43.89323735999 Edm = 7.27868e-13 NCalls = 14
Minos: Lower error for parameter Constant : -1.46608
Minos: Upper error for parameter Constant : 1.5109
Minuit2Minimizer::GetMinosError for parameter 1 Mean using max-calls 1345, tolerance 0.01
MnFunctionCross: parameter 0 set to -0.00523033
MnSeedGenerator: for initial parameters FCN = 43.89345811774
MnSeedGenerator: Initial state: - FCN = 43.89345811774 Edm = 0.000252607 NCalls = 9
VariableMetric: start iterating until Edm is < 5e-06
VariableMetric: Initial state - FCN = 43.89345811774 Edm = 0.000252607 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 43.89345811774 Edm = 0.000252607 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 43.89320568703 Edm = 5.81379e-11 NCalls = 14
MnFunctionCross: parameter 0 set to 0.0604323
MnSeedGenerator: for initial parameters FCN = 43.89345258468
MnSeedGenerator: Initial state: - FCN = 43.89345258468 Edm = 0.000248021 NCalls = 9
VariableMetric: start iterating until Edm is < 5e-06
VariableMetric: Initial state - FCN = 43.89345258468 Edm = 0.000248021 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 43.89345258468 Edm = 0.000248021 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 43.89320473069 Edm = 5.37495e-11 NCalls = 14
Minos: Lower error for parameter Mean : -0.0328395
Minos: Upper error for parameter Mean : 0.0328395
Minuit2Minimizer::GetMinosError for parameter 2 Sigma using max-calls 1345, tolerance 0.01
MnFunctionCross: parameter 0 set to 1.01498
MnSeedGenerator: for initial parameters FCN = 43.91282757902
MnSeedGenerator: Initial state: - FCN = 43.91282757902 Edm = 0.000119483 NCalls = 9
VariableMetric: start iterating until Edm is < 5e-06
VariableMetric: Initial state - FCN = 43.91282757902 Edm = 0.000119483 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 43.91282757902 Edm = 0.000119483 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 43.91270289343 Edm = 2.28497e-07 NCalls = 14
MnFunctionCross: parameter 0 set to 1.01541
MnSeedGenerator: for initial parameters FCN = 43.8931803459
MnSeedGenerator: Initial state: - FCN = 43.8931803459 Edm = 8.24298e-05 NCalls = 9
VariableMetric: start iterating until Edm is < 5e-06
VariableMetric: Initial state - FCN = 43.8931803459 Edm = 8.24298e-05 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 43.8931803459 Edm = 8.24298e-05 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 43.89309789631 Edm = 9.64817e-12 NCalls = 14
MnFunctionCross: parameter 0 set to 1.06142
MnSeedGenerator: for initial parameters FCN = 43.87545635229
MnSeedGenerator: Initial state: - FCN = 43.87545635229 Edm = 0.000131341 NCalls = 9
VariableMetric: start iterating until Edm is < 5e-06
VariableMetric: Initial state - FCN = 43.87545635229 Edm = 0.000131341 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 43.87545635229 Edm = 0.000131341 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 43.87533104498 Edm = 2.74651e-07 NCalls = 14
MnFunctionCross: parameter 0 set to 1.06185
MnSeedGenerator: for initial parameters FCN = 43.89320778158
MnSeedGenerator: Initial state: - FCN = 43.89320778158 Edm = 9.26238e-05 NCalls = 9
VariableMetric: start iterating until Edm is < 5e-06
VariableMetric: Initial state - FCN = 43.89320778158 Edm = 9.26238e-05 NCalls = 9
VariableMetric: Iteration # 0 - FCN = 43.89320778158 Edm = 9.26238e-05 NCalls = 9
VariableMetric: Iteration # 1 - FCN = 43.8931151326 Edm = 6.53073e-12 NCalls = 14
Minos: Lower error for parameter Sigma : -0.0227933
Minos: Upper error for parameter Sigma : 0.0236607
Covariance Matrix:
Constant Mean Sigma
Constant 2.2152 -3.2651e-06 -0.019956
Mean -3.2651e-06 0.0010779 8.9223e-08
Sigma -0.019956 8.9223e-08 0.00053917
Correlation Matrix:
Constant Mean Sigma
Constant 1 -6.6819e-05 -0.57743
Mean -6.6819e-05 1 0.00011704
Sigma -0.57743 0.00011704 1
****************************************
Minimizer is Minuit2 / Fumili
MinFCN = 43.3935
Chi2 = 74.4574
NDf = 97
Edm = 1.9682e-15
NCalls = 84
Constant = 38.4265 +/- 1.48835
Mean = 0.027601 +/- 0.0328313
Sigma = 1.0382 +/- 0.0232198 (limited)
#include "TH1.h"
#include "TF1.h"
#include "TCanvas.h"
#include "TRandom3.h"
#include "TVirtualFitter.h"
#include "TPaveLabel.h"
#include "TStyle.h"
#include <iostream>
#include <string>
void testGausFit( std::string type = "Minuit2", int n = 1000) {
gRandom = new TRandom3();
std::string name;
name = "h1_" + type;
TH1D * h1 = new TH1D(name.c_str(),"Chi2 Fit",100, -5, 5. );
name = "h2_" + type;
TH1D * h2 = new TH1D(name.c_str(),"Chi2 Fit with Minos Error",100, -5, 5. );
name = "h3_" + type;
TH1D * h3 = new TH1D(name.c_str(),"Chi2 Fit with Integral and Minos",100, -5, 5. );
name = "h4_" + type;
TH1D * h4 = new TH1D(name.c_str(),"Likelihood Fit with Minos Error",100, -5, 5. );
gStyle->SetOptStat(1111111);
gStyle->SetOptFit(1111111);
for (int i = 0; i < n; ++i) {
double x = gRandom->Gaus(0,1);
h1->Fill( x );
h2->Fill( x );
h3->Fill( x );
h4->Fill( x );
}
std::string cname = type + "Canvas" ;
std::string ctitle = type + " Gaussian Fit" ;
TCanvas *c1 = new TCanvas(cname.c_str(),cname.c_str(),10,10,900,900);
c1->Divide(2,2);
c1->cd(1);
cout << "\nDo Fit 1\n";
h1->Fit("gaus","Q");
h1->Draw();
c1->cd(2);
cout << "\nDo Fit 2\n";
h2->Fit("gaus","VE");
h2->Draw();
c1->cd(3);
cout << "\nDo Fit 3\n";
h3->Fit("gaus","IE");
h3->Draw();
c1->cd(4);
cout << "\nDo Fit 4\n";
h4->Fit("gaus","VLE");
h4->Draw();
}
void minuit2GausFit() {
int n = 1000;
testGausFit("Minuit2",n);
testGausFit("Fumili2",n);
}
Author
Lorenzo Moneta

Definition in file minuit2GausFit.C.