# Facing an unexpected warning while fitting efficiency plot

**URL:** <https://root-forum.cern.ch/t/facing-an-unexpected-warning-while-fitting-efficiency-plot/41582>\
**Category:** Newbie\
**Tags:** root\
**Created:** [September 24, 2020, 8:42pm UTC](https://root-forum.cern.ch/t/facing-an-unexpected-warning-while-fitting-efficiency-plot/41582 "2020-09-24T20:42:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![robertfroast](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/robertfroast/32/21121_2.png) [@robertfroast](https://root-forum.cern.ch/u/robertfroast)\
**Post date:** [September 24, 2020, 8:42pm UTC](https://root-forum.cern.ch/t/facing-an-unexpected-warning-while-fitting-efficiency-plot/41582/1 "2020-09-24T20:42:27Z")

</div>

Hi All,

I am plotting a graph and getting a unknown error.  
Kindly look at the error.

_ROOT Version:_ Not Provided  
_Platform:_ Not Provided  
_Compiler:_ Not Provided

* * *

---

<div class="post-metadata">

**Author:** ![robertfroast](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/robertfroast/32/21121_2.png) [@robertfroast](https://root-forum.cern.ch/u/robertfroast)\
**Post date:** [September 24, 2020, 8:43pm UTC](https://root-forum.cern.ch/t/facing-an-unexpected-warning-while-fitting-efficiency-plot/41582/2 "2020-09-24T20:43:20Z")

</div>

Thanks and have a nice day.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [September 25, 2020, 7:44am UTC](https://root-forum.cern.ch/t/facing-an-unexpected-warning-while-fitting-efficiency-plot/41582/3 "2020-09-25T07:44:55Z")

</div>

When I run you macro I get this output:

```auto
Processing efficiency_R.C...
Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
Warning in <Fit>: Abnormal termination of minimization.
 FCN=1.48884 FROM MIGRAD STATUS=CALL LIMIT 1958 CALLS 1959 TOTAL
                     EDM=0.00227753 STRATEGY= 1 ERROR MATRIX UNCERTAINTY 22.0 per cent
  EXT PARAMETER APPROXIMATE STEP FIRST   
  NO. NAME VALUE ERROR SIZE DERIVATIVE 
   1 p0 1.70870e+01 9.59083e-01 -2.26106e-02 -2.16897e+00
   2 p1 2.42956e+01 2.91082e+00 -5.81109e-02 -2.32986e+00
   3 p2 -7.21918e+00 7.78611e-01 1.33460e-02 -4.90493e+00
   4 p3 8.18918e-01 9.46875e-03 -2.07925e-04 -1.76156e+02
   5 p4 8.73157e+00 3.80668e-01 8.82789e-03 -1.43363e+01
   6 p5 -4.14868e-01 1.16687e-01 2.79141e-03 9.56771e+00
   7 p6 4.84329e-01 1.11470e-01 2.69642e-03 -2.06878e+01

```

I guess the unknown error you are talking about is the warning about abnormal termination. @moneta may help.

---

<div class="post-metadata">

**Author:** ![robertfroast](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/robertfroast/32/21121_2.png) [@robertfroast](https://root-forum.cern.ch/u/robertfroast)\
**Post date:** [September 25, 2020, 8:35am UTC](https://root-forum.cern.ch/t/facing-an-unexpected-warning-while-fitting-efficiency-plot/41582/4 "2020-09-25T08:35:10Z")

</div>

@couet @moneta  
Yes It is the warning.

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [September 25, 2020, 8:46am UTC](https://root-forum.cern.ch/t/facing-an-unexpected-warning-while-fitting-efficiency-plot/41582/5 "2020-09-25T08:46:49Z")

</div>

Hi,  
The fit failed because the minimiser requires a larger number of function calls. You can see this information if you use the “V” option when fitting.  
If you add this line before fitting:

```auto
ROOT::Math::MinimizerOptions::SetDefaultMaxFunctionCalls(1000000);

```

The fit works. There is still a problem with a failure in MINOS, that you run because you use the ‘E’ option.  
There is however a problem with your data fit. You are fitting 7 data points with a 7 parameter functions. The fit has no degree of freedom and this is probably the case of the MINOS failure. You cannot estimate uncertainty in this case, since the function will follow exactly the data points.

Lorenzo

---

<div class="post-metadata">

**Author:** ![robertfroast](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/robertfroast/32/21121_2.png) [@robertfroast](https://root-forum.cern.ch/u/robertfroast)\
**Post date:** [September 25, 2020, 11:08am UTC](https://root-forum.cern.ch/t/facing-an-unexpected-warning-while-fitting-efficiency-plot/41582/6 "2020-09-25T11:08:44Z")

</div>

@moneta @couet  
May be what you said is correct. I tried to add another two points on the .txt file. It is still showing the same warning.  
Is there any kind of help that you can do?

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [September 25, 2020, 1:01pm UTC](https://root-forum.cern.ch/t/facing-an-unexpected-warning-while-fitting-efficiency-plot/41582/7 "2020-09-25T13:01:16Z")

</div>

Have you tried increasing the maximum function calls for the minimizer ?

> [@moneta](#):
>
> `ROOT::Math::MinimizerOptions::SetDefaultMaxFunctionCalls(1000000);`

If you have still a failing fit you might need to try fitting with different initial parameter points, which  
represent a function closer to the solution

Lorenzo

---

<div class="post-metadata">

**Author:** ![robertfroast](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/robertfroast/32/21121_2.png) [@robertfroast](https://root-forum.cern.ch/u/robertfroast)\
**Post date:** [September 25, 2020, 4:53pm UTC](https://root-forum.cern.ch/t/facing-an-unexpected-warning-while-fitting-efficiency-plot/41582/8 "2020-09-25T16:53:06Z")

</div>

@moneta  
Yes, I’m using the following code and the file is attached below. [candle\_32degree.txt](https://root-forum.cern.ch/uploads/short-url/2lcBqsJ8MwwV9EuCzbhFJhRBkAC.txt) (179 Bytes) [efficiency\_R.C](https://root-forum.cern.ch/uploads/short-url/9B2rkxLitTXjCCLg8cM61hx6R0J.C) (1.8 KB)  
Also I’m showing the warning that is coming at the terminal.

```auto
FCN=0.239356 FROM MINOS STATUS=FAILURE 4163 CALLS 24090 TOTAL
                     EDM=1.75701e-07 STRATEGY= 1 ERR MATRIX NOT POS-DEF
  EXT PARAMETER APPROXIMATE STEP FIRST   
  NO. NAME VALUE ERROR SIZE DERIVATIVE 
   1 p0 7.26901e+00 2.96165e-02 7.94950e-04 -3.42929e-01
   2 p1 2.43059e+00 2.31583e-02 2.90961e-03 -6.70624e-01
   3 p2 -8.41004e-01 9.19084e-03 -1.09213e-03 -1.55201e+00
   4 p3 8.00000e-01 fixed    
   5 p4 4.22326e+01 9.03598e-01 -6.25268e-03 -7.29399e-02
   6 p5 7.77117e+00 1.08859e+00 6.10007e-03 1.19668e-02
   7 p6 1.52554e+01 8.10130e-01 8.10130e-01 -3.62734e-04

 ***Break*** segmentation violation

===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0 0x00007f57df5cd6e7 in __GI___ waitpid (pid=8034, stat_loc=stat_loc
entry=0x7ffce24f5ce8, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
#1 0x00007f57df538107 in do_system (line=&lt;optimized out&gt;) at ../sysdeps/posix/system.c:149
#2 0x00007f57e01e1b23 in TUnixSystem::Exec (shellcmd=&lt;optimized out&gt;, this=0x55acb54dd7c0) at /home/Downloads/root6/core/unix/src/TUnixSystem.cxx:2119
#3 TUnixSystem::StackTrace (this=0x55acb54dd7c0) at /home/Downloads/root6/core/unix/src/TUnixSystem.cxx:2413
#4 0x00007f57e01e4514 in TUnixSystem::DispatchSignals (this=0x55acb54dd7c0, sig=kSigSegmentationViolation) at /home/Downloads/root6/core/unix/src/TUnixSystem.cxx:3644
#5 &lt;signal handler called&gt;
#6 0x00007f57d1527215 in ?? () from /usr/lib/x86_64-linux-gnu/libfreetype.so.6
#7 0x00007f57d18beca1 in TTF::LayoutGlyphs () at /home/Downloads/root6/graf2d/graf/src/TTF.cxx:215
#8 0x00007f57d18bf37f in TTF::GetTextExtent (w=
0x7ffce24f8848: 0, h=
0x7ffce24f884c: 0, text=0x55acb65ae8f0 &quot;WITH X = LOG (X/100) &amp; Y = LOG (X/1000)&quot;) at /home/Downloads/root6/graf2d/graf/src/TTF.cxx:138
#9 0x00007f57d18857ed in TLatex::Analyse (this=this
entry=0x55acb657dc70, x=x
entry=0, y=y
entry=0, spec=..., t=t
entry=0x55acb657f090 &quot;WITH X = LOG (X/100) &amp; Y = LOG (X/1000)&quot;, length=51) at /home/Downloads/root6/graf2d/graf/src/TLatex.cxx:1897
#10 0x00007f57d1887a21 in TLatex::Anal1 (this=this
entry=0x55acb657dc70, spec=..., t=t
entry=0x55acb657f090 &quot;WITH X = LOG (X/100) &amp; Y = LOG (X/1000)&quot;, length=&lt;optimized out&gt;) at /home/Downloads/root6/graf2d/graf/src/TLatex.cxx:492
#11 0x00007f57d1887bd9 in TLatex::FirstParse (this=this
entry=0x55acb657dc70, angle=angle
entry=0, size=500.22335815429688, text=text
entry=0x55acb657f090 &quot;WITH X = LOG (X/100) &amp; Y = LOG (X/1000)&quot;) at /home/Downloads/root6/graf2d/graf/src/TLatex.cxx:2484
#12 0x00007f57d1889c0e in TLatex::GetXsize (this=this
entry=0x55acb657dc70) at /home/Downloads/root6/graf2d/graf/src/TLatex.cxx:2534
#13 0x00007f57d18aa52e in TPaveText::PaintPrimitives (this=0x55acb5f95790, mode=13) at /home/Downloads/root6/graf2d/graf/src/TPaveText.cxx:454
#14 0x00007f57d10a715b in TPad::PaintModified (this=0x55acb55547f0) at /home/Downloads/root6/graf2d/gpad/src/TPad.cxx:3669
#15 0x00007f57d1069876 in TCanvas::Update (this=0x55acb55547f0) at /home/Downloads/root6/graf2d/gpad/src/TCanvas.cxx:2323
#16 0x00007f57da93a45c in TCling::UpdateAllCanvases () at /home/Downloads/root6/core/metacling/src/TCling.cxx:6318
#17 0x00007f57da9432ea in TCling::ProcessLine (this=0x55acb5550fc0, line=&lt;optimized out&gt;, error=0x0) at /home/Downloads/root6/core/metacling/src/TCling.cxx:2206
#18 0x00007f57da936ebe in TCling::ProcessLineSynch (error=0x0, line=0x7f57dcc6af14 &quot;TRint::EndOfLineAction();&quot;, this=0x55acb5550fc0) at /home/Downloads/root6/core/metacling/src/TCling.cxx:3168
#19 TCling::EndOfLineAction (this=0x55acb5550fc0) at /home/Downloads/root6/core/metacling/src/TCling.cxx:2819
#20 0x00007f57e056417f in TRint::Run (this=0x55acb553cac0, retrn=&lt;optimized out&gt;) at /home/Downloads/root6/core/rint/src/TRint.cxx:422
#21 0x000055acb40f9a0c in main (argc=&lt;optimized out&gt;, argv=0x7ffce24fb838) at /home/Downloads/root6/main/src/rmain.cxx:30
===========================================================

The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum http://root.cern.ch/forum
Only if you are really convinced it is a bug in ROOT then please submit a
report at http://root.cern.ch/bugs Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#6 0x00007f57d1527215 in ?? () from /usr/lib/x86_64-linux-gnu/libfreetype.so.6
#7 0x00007f57d18beca1 in TTF::LayoutGlyphs () at /home/Downloads/root6/graf2d/graf/src/TTF.cxx:215
#8 0x00007f57d18bf37f in TTF::GetTextExtent (w=
0x7ffce24f8848: 0, h=
0x7ffce24f884c: 0, text=0x55acb65ae8f0 &quot;WITH X = LOG (X/100) &amp; Y = LOG (X/1000)&quot;) at /home/Downloads/root6/graf2d/graf/src/TTF.cxx:138
#9 0x00007f57d18857ed in TLatex::Analyse (this=this
entry=0x55acb657dc70, x=x
entry=0, y=y
entry=0, spec=..., t=t
entry=0x55acb657f090 &quot;WITH X = LOG (X/100) &amp; Y = LOG (X/1000)&quot;, length=51) at /home/Downloads/root6/graf2d/graf/src/TLatex.cxx:1897
#10 0x00007f57d1887a21 in TLatex::Anal1 (this=this
entry=0x55acb657dc70, spec=..., t=t
entry=0x55acb657f090 &quot;WITH X = LOG (X/100) &amp; Y = LOG (X/1000)&quot;, length=&lt;optimized out&gt;) at /home/Downloads/root6/graf2d/graf/src/TLatex.cxx:492
#11 0x00007f57d1887bd9 in TLatex::FirstParse (this=this
entry=0x55acb657dc70, angle=angle
entry=0, size=500.22335815429688, text=text
entry=0x55acb657f090 &quot;WITH X = LOG (X/100) &amp; Y = LOG (X/1000)&quot;) at /home/Downloads/root6/graf2d/graf/src/TLatex.cxx:2484
#12 0x00007f57d1889c0e in TLatex::GetXsize (this=this
entry=0x55acb657dc70) at /home/Downloads/root6/graf2d/graf/src/TLatex.cxx:2534
#13 0x00007f57d18aa52e in TPaveText::PaintPrimitives (this=0x55acb5f95790, mode=13) at /home/Downloads/root6/graf2d/graf/src/TPaveText.cxx:454
#14 0x00007f57d10a715b in TPad::PaintModified (this=0x55acb55547f0) at /home//Downloads/root6/graf2d/gpad/src/TPad.cxx:3669
#15 0x00007f57d1069876 in TCanvas::Update (this=0x55acb55547f0) at /home/Downloads/root6/graf2d/gpad/src/TCanvas.cxx:2323
#16 0x00007f57da93a45c in TCling::UpdateAllCanvases () at /home/Downloads/root6/core/metacling/src/TCling.cxx:6318
===========================================================

Root > 

```
