Voigt function with parameter which depends on energy

___Hello
I cannot use gauss function when width parameter depends on energy -
compilation error. I can overcame it using my own function. -
see attachment.
How to solve this problem with voigt function ?

thank you,
VladimirForum-Voigt.C (5.1 KB)

Voigt profile -> TMath::Voigt

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

hi, parameter depends on x ! this scripts does not work here …

You can define it as you want (I’ve just written a very basic form).

ok, could you please give me short example, where
parameter sigma = 1. + 1./sqrt(x)

Vladimir

{
  TF1 *f = new TF1("f", "TMath::Voigt(x - [0], 1. + 1. / TMath::Sqrt(x), [1], 4)", 1.e-6, 10.);
  // f->SetNpx(10000);
  f->SetParameters(3., 2.); // median, lg
  f->Draw();
}