Hi @Nea ,
sorry for the lack of reply in the other thread.
There seems to be a typo in your code:
root [0] TF1* f = new TF1("f", "1/[2]/[2]*([0] *( ([1]*[1])/(([2]*[2])*(1-[1])*(1-[1])) + [1]/(1-[1])*([1]-2/[2]) + 2)", 0, 0.8);
input_line_9:2:172: error: expected ')'
Double_t TFormula____id13702893493832039346(Double_t *x,Double_t *p){ return 1/p[2]/p[2]*(p[0]*((p[1]*p[1])/((p[2]*p[2])*(1-p[1])*(1-p[1]))+p[1]/(1-p[1])*(p[1]-2/p[2])+2) ; }
^
input_line_9:2:90: note: to match this '('
Double_t TFormula____id13702893493832039346(Double_t *x,Double_t *p){ return 1/p[2]/p[2]*(p[0]*((p[1]*p[1])/((p[2]*p[2])*(1-p[1])*(1-p[1]))+p[1]/(1-p[1])*(p[1]-2/p[2])+2) ; }
^
input_line_10:2:172: error: expected ')'
Double_t TFormula____id13702893493832039346(Double_t *x,Double_t *p){ return 1/p[2]/p[2]*(p[0]*((p[1]*p[1])/((p[2]*p[2])*(1-p[1])*(1-p[1]))+p[1]/(1-p[1])*(p[1]-2/p[2])+2) ; }
^
input_line_10:2:90: note: to match this '('
Double_t TFormula____id13702893493832039346(Double_t *x,Double_t *p){ return 1/p[2]/p[2]*(p[0]*((p[1]*p[1])/((p[2]*p[2])*(1-p[1])*(1-p[1]))+p[1]/(1-p[1])*(p[1]-2/p[2])+2) ; }
^
Error in <prepareMethod>: Can't compile function TFormula____id13702893493832039346 prototype with arguments Double_t*,Double_t*
Error in <TFormula::InputFormulaIntoCling>: Error compiling formula expression in Cling
Error in <TFormula::ProcessFormula>: Formula "1/[p2]/[p2]*([p0]*(([p1]*[p1])/(([p2]*[p2])*(1-[p1])*(1-[p1]))+[p1]/(1-[p1])*([p1]-2/[p2])+2)" is invalid !
e.g. some unbalanced brackets.
When you fix that, please post the smallest possible self-contained reproducer of your issue that we can run on our end to figure out what’s going wrong.
I expect the fitting is converge to 0 but in fact it’s like test1.png or test2.png which are different from Integration range.(I have to use from 0 to 0.8)
The function should be not divergent in the range you define, otherwise the convolution will not work. In addition, if you are using FFT based convolution, you would need to have the functions going to zero at the edges of the range.