Creating a my p.d.f. with RooClassFactory but p.d.f. is nan

I used RooClassFactory to create my own pdf (a Breit-Wigner with a Boltzmann factor) to fit my data.
In the pdf expression (which I wrote in the .cxx that was automatically created) there are also three constant values, all of these expressed in GeV (like every other quantity used for the fit - for example particle masş and width, particle momentum…).
When I execute the macro, it draws the fit curve but, even if the shape is the correct one, it is not coherent with the data points. The error it gives me is:

[#0] ERROR:Eval -- RooAbsReal::logEvalError(relbw) evaluation error,                                                                                                  
 origin       : RooRelBW::relbw[ x=m mass=mean width=width ptMean=pt ]                                                                                                
 message      : p.d.f value is Not-a-Number (nan), forcing value to zero                                                                                              
 server values: x=m=1.29734, mass=mean=0.896 +/- 3.74674e-08, width=width=0.0505 +/- 5.12922e-09, ptMean=pt=2.25 +/- 0                                                
[#0] WARNING:Plotting -- At observable [x]=0.62 RooRelBW::relbw[ x=m mass=mean width=width ptMean=pt ]                                                                
     p.d.f value is Not-a-Number (nan), forcing value to zero @ x=m=1.3, mass=mean=0.896 +/- 3.74674e-08, width=width=0.0505 +/- 5.12922e-09, ptMean=pt=2.25 +/- 0    
     p.d.f value is Not-a-Number (nan), forcing value to zero @ x=m=1.13, mass=mean=0.896 +/- 3.74674e-08, width=width=0.0505 +/- 5.12922e-09, ptMean=pt=2.25 +/- 0   
     p.d.f value is Not-a-Number (nan), forcing value to zero @ x=m=1.045, mass=mean=0.896 +/- 3.74674e-08, width=width=0.0505 +/- 5.12922e-09, ptMean=pt=2.25 +/- 0  
     p.d.f value is Not-a-Number (nan), forcing value to zero @ x=m=1.215, mass=mean=0.896 +/- 3.74674e-08, width=width=0.0505 +/- 5.12922e-09, ptMean=pt=2.25 +/- 0  
     p.d.f value is Not-a-Number (nan), forcing value to zero @ x=m=1.0875, mass=mean=0.896 +/- 3.74674e-08, width=width=0.0505 +/- 5.12922e-09, ptMean=pt=2.25 +/- 0 
     p.d.f value is Not-a-Number (nan), forcing value to zero @ x=m=1.1725, mass=mean=0.896 +/- 3.74674e-08, width=width=0.0505 +/- 5.12922e-09, ptMean=pt=2.25 +/- 0 
     p.d.f value is Not-a-Number (nan), forcing value to zero @ x=m=1.2575, mass=mean=0.896 +/- 3.74674e-08, width=width=0.0505 +/- 5.12922e-09, ptMean=pt=2.25 +/- 0 
     p.d.f value is Not-a-Number (nan), forcing value to zero @ x=m=1.06625, mass=mean=0.896 +/- 3.74674e-08, width=width=0.0505 +/- 5.12922e-09, ptMean=pt=2.25 +/- 0
     p.d.f value is Not-a-Number (nan), forcing value to zero @ x=m=1.10875, mass=mean=0.896 +/- 3.74674e-08, width=width=0.0505 +/- 5.12922e-09, ptMean=pt=2.25 +/- 0
     p.d.f value is Not-a-Number (nan), forcing value to zero @ x=m=1.15125, mass=mean=0.896 +/- 3.74674e-08, width=width=0.0505 +/- 5.12922e-09, ptMean=pt=2.25 +/- 0
     p.d.f value is Not-a-Number (nan), forcing value to zero @ x=m=1.19375, mass=mean=0.896 +/- 3.74674e-08, width=width=0.0505 +/- 5.12922e-09, ptMean=pt=2.25 +/- 0
     p.d.f value is Not-a-Number (nan), forcing value to zero @ x=m=1.23625, mass=mean=0.896 +/- 3.74674e-08, width=width=0.0505 +/- 5.12922e-09, ptMean=pt=2.25 +/- 0
    ... (remaining 90 messages suppressed)                                                                                                                            
[#0] WARNING:Plotting -- At observable [x]=1.04 RooRelBW::relbw[ x=m mass=mean width=width ptMean=pt ]                                                                
     p.d.f value is Not-a-Number (nan), forcing value to zero @ x=m=1.04, mass=mean=0.896 +/- 3.74674e-08, width=width=0.0505 +/- 5.12922e-09, ptMean=pt=2.25 +/- 0   
[#0] WARNING:Plotting -- At observable [x]=1.05 RooRelBW::relbw[ x=m mass=mean width=width ptMean=pt ]                                                                
     p.d.f value is Not-a-Number (nan), forcing value to zero @ x=m=1.05, mass=mean=0.896 +/- 3.74674e-08, width=width=0.0505 +/- 5.12922e-09, ptMean=pt=2.25 +/- 0   
[#0] WARNING:Plotting -- At observable [x]=1.06 RooRelBW::relbw[ x=m mass=mean width=width ptMean=pt ]

Trying to understand why it wasn’t working, I also tried to express the above mentioned constant values in MeV: it works and the fit parameters in output are good.

Can anyone please explain me what I am doing wrong?

Thank you
Lucia

Hi,

I recommend you repost your question in the Math and Stat forum, you are more likely to get an answer about roofit.

Cheers,
Philippe.