TUnuran::Sample() issue

Hi,

I’m writing because I want to find a soution for the problem I got today.

This piece of code is crucial:

  (...)
  TUnuranContDist t_genEngine(crossSectionFunc);
  t_genEngine.SetDomain(tMin, tMax);
  TUnuran *t_generator = new TUnuran();
  t_generator->Init(t_genEngine);
  Double_t x = t_generator->Sample();

My programme compiles without any troubles, however when running it stops and the following message is shown:

[quote]
/usr/cern/root/math/unuran/src/TUnuran.cxx:392: double TUnuran::Sample(): Condition `fGen != 0’ was not satisfied.
Stopped (core dumped)[/quote]

I can’t see any reason why it happens. I hope someone knows how to solve it.

Thank you for any help.

Best regards,
Rafal

EDIT:

I found that this message is shown when methon TUnuran::Init() is invoked:

TDR.001: [error] /usr/cern/root/math/unuran/src/unuran-1.8.0-root/src/methods/tdr_init.ch:522 - (generator) condition for method violated:
TDR.001: ..>  dTfx0 < dTfx1 (x0<x1). PDF not T-concave!
CSTD: [error] /usr/cern/root/math/unuran/src/unuran-1.8.0-root/src/methods/cstd.c:53 - (distribution) incomplete distribution object, entry missing:
CSTD: ..>  init() for special generators or inverse CDF
UNURAN: [error] /usr/cern/root/math/unuran/src/unuran-1.8.0-root/src/methods/x_gen.c:22 - invalid NULL pointer:
Error in <SetMethod>: initializing Unuran: condition for method violated

Hi,
Sorry for my late reply. Can you please post a running code, so I can try it

Thank you

Lorenzo