In the flollowing macro I am fiiting my histogram with user defined function
but I am getting error as follows.
Warning in TH1F::Fit: Abnormal termination of minimization.
FCN=nan FROM MIGRAD STATUS=CALL LIMIT 5004 CALLS 5005 TOTAL
EDM=nan STRATEGY= 1 NO ERROR MATRIX
EXT PARAMETER CURRENT GUESS STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 p0 nan 9.90000e-03 nan nan
Warning in TCanvas::ResizePad: Inf/NaN propagated to the pad. Check drawn objects.
Warning in TCanvas::ResizePad: c1 height changed from 0 to 10
root [1] Warning in TCanvas::ResizePad: Inf/NaN propagated to the pad. Check drawn objects.
Warning in TCanvas::ResizePad: c1 height changed from 0 to 10
I do not see how you can fit your histogram with a function like yours.
I have modified your code and function such that you get a reasonable fit. See below the lines marked with “//<====”
I get the following error when I have n initiatlized with values>10. for n=20,30 or greater it gives the following:
Inf/NaN propagated to the pad. Check drawn objects.
Warning in <TCanvas::ResizePad>: c1 height changed from 0 to 10
Warning in <TCanvas::ResizePad>: Inf/NaN propagated to the pad. Check drawn objects.
Warning in <TCanvas::ResizePad>: c1 height changed from 0 to 10
My code(here am trying to plot a function in TGraph):
void p1()
{
Float_t alpha = 1090.;
Float_t p = 0.330;
const Int_t n = 10.;
Float_t V[n],r[n];
Float_t R;
for (Int_t i=0; i<n;i++)
{
r[i] = i*10/n;
R = r[i];
if (i == 0)
{V[i] = 1.;}
else {
V[i] = -14.4/R + alpha*exp(-R/p);
******after this I have a TGraph and draw which works well for n= 10*****
}
}
I am getting this error when I am trying to generate histogram like attached histogram. Macro That I am using is also attached. Kindly suggest me what possible changes that I can make?
root [0]
Processing signaltobackratio.C...
sigma BR ==== 4.34e-05
sigma BR ==== 1e-05
sigma BR ==== 4e-06
sigma BR ==== 9.3e-07
sigma BR ==== 35.7154
sigma BR ==== 24.7804
sigma BR ==== 9.64849
sigma BR ==== 1.20161
Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
============================
Max significance with bins 0-0 is: 0
S and B : 0, 0
S/B : -nan
S/sqrt(B) : -nan
Total signal eff.: 0
============================
Max significance with bins 0-0 is: 0
S and B are: 0, 0
S/B : -nan
S/sqrt(B) : -nan
Total signal eff.: 0
============================
Max significance with bins 0-0 is: 0
S and B are: 0, 0
S/B : -nan
S/sqrt(B) : -nan
Total signal eff.: 0
============================
Max significance with bins 0-0 is: 0
S and B are: 0, 0
S/B : -nan
S/sqrt(B) : -nan
Total signal eff.: 0
Warning in <TCanvas::ResizePad>: Inf/NaN propagated to the pad. Check drawn objects.
Warning in <TCanvas::ResizePad>: c1 height changed from 0 to 10
root [1] Warning in <TCanvas::ResizePad>: Inf/NaN propagated to the pad. Check drawn objects.
Warning in <TCanvas::ResizePad>: c1 height changed from 0 to 10
Warning in <TCanvas::ResizePad>: Inf/NaN propagated to the pad. Check drawn objects.
Warning in <TCanvas::ResizePad>: c1 height changed from 0 to 10