I’m having a problem with histogram fitting. My histogram is essentially a propagator in position space, and just by eyeballing the histograms, it seems like they should fit well to the TF1 function:
root [0] TF1 f1(“fit”, “[0]*((cos([1]*x+[2])+[3])^[4])*exp(-[5]*x)/x^[6] + [7]”, 1, 128)
The sinusoidal part is important – there are certain clear features in the histograms that indicate some long wavelength fluctuations. However, when I try to fit to this function, the fitting algorithm seems to ignore parameters 1-4 entirely (i.e., those dealing with the sinusoidal part). The output from TH1::Fit is, for example:
root [1] myHist->Fit(“fit”, “R”)
FCN=0.289994 FROM MIGRAD STATUS=CONVERGED 829 CALLS 830 TOTAL
EDM=8.71362e-11 STRATEGY= 1 ERROR MATRIX UNCERTAINTY 0.3 per cent
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 p0 8.35807e-01 9.89969e-01 6.11083e-05 3.71399e-05
2 p1 0.00000e+00 1.84346e+00 -0.00000e+00 0.00000e+00
3 p2 0.00000e+00 1.84346e+00 -0.00000e+00 0.00000e+00
4 p3 0.00000e+00 1.84346e+00 -0.00000e+00 0.00000e+00
5 p4 0.00000e+00 1.84346e+00 -0.00000e+00 0.00000e+00
6 p5 5.24897e-02 9.21890e-02 -1.76725e-05 -5.42536e-04
7 p6 1.70477e-01 8.81161e-01 1.05471e-04 -7.63447e-05
8 p7 5.26325e-02 6.94328e-02 -1.41878e-05 4.61086e-04
TCanvas::MakeDefCanvas: created default TCanvas with name c1
(Int_t)0
The fit is actually pretty poor – not surprisingly, it completely misses the sinusoidal behavior. I’ve also tried calling Fit with the “M” option and there is no improvement. I’ve also tried changing some of the free parameters in question to constants, and it still ignores whatever free paremters are left among 1-4.