No matching function for call to 'bindFunction'

Hello. This is the continuation of this. Forcing value to zero
I don’t know I write this code on a new topic or on old one.

	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);
	RooAbsReal*pdf = RooFit::bindFunction("pdf",f,me,s,ga);

bindFunction doesn’t work. I don’t know why…
In this case, RooNumConvPdf doesn’t also work because of pdf.

Thank you for spending time for me.

Regards.

Nea.

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.

Cheers,
Enrico

Thank you for your reply.
I use code.cc

code.cc (2.0 KB)
test.root (3.8 KB)

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)


Is these correct you want?
I’m sorry that my English is poor.

Regards,

Nea

Hi,
thank you for the reproducer. If I understand correctly you would like to know why the fit doesn’t converge?

@moneta might have some ideas, let’s ping him :slight_smile:

Cheers,
Enrico

Hi.
I think that gaussian is converge 0 and compton cross section formula is divergent to infinity. So convolution may not work. I’m not sure.

Thank you very much for your reply.

Hi,

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.

Lorenzo

I see. Thank you very much for your answer.

Regards,

Nea

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.