Problem with TF1 definition to use CONV function

Hello, I want to get convolution between my distribution (W cross-section)
and Gauss (Doppler effect). The input data I read from file, then define
myFunc.t.C (24.5 KB)
Problem with program t.C (attached) :

  1. when I use : func = new TF1(“func”,myFunc,1,10); - compilation error
  2. for func = new TF1(“func”,“myFunc”,1,10);
    the answer : myFunc is unknown !

How to define myFunc ? or where is my error ?

thank you,

See the and examples in the TF1 Class Reference, and in particular “1 - Expression using variable x and no parameters” and " 4 - A general C function with parameters"

thank you, I replaced “myFunc”,1,10); into “myFunc(x)”,1,10);
and it works now.
But there is another point: after running job I see result:
voigt = -nan
i.e. convolution does not work ! Could you give me any advice
where is problem : i send t1.C corrected and input data

thank you,
Vladimirt1.C (25.0 KB) W182-in-W-R-full.txt (11.3 KB)

Where is the CONV function defined? (used in voigt = new TF1("voigt", "CONV(func, mygausn)", 1, 1e+09);)

… it is library function :
#include <TF1Convolution.h>


OK, I’ll take a look later today

Maybe @moneta can take a look when back from vacation

  TF1 *f = new TF1("f", "[0] * TMath::Voigt(x - [1], [2], [3], 4)", -10., 10.);
  f->SetParNames("scale", "median", "sigma", "lg");
  // f->Print();
  f->SetParameters(4., 3., 2., 1.); // scale, median, sigma, lg