Hi there,
The code below produces a strange output: it calls MRF_Fct() endlessly (whether the code is interpreted or compiled (Root 5.28, CentOS 5))
[code]#include <TF1.h>
#include <TCanvas.h>
Double_t MRF_Fct ( Double_t *x , Double_t *par )
{
printf ("\n\tIn MRF_Fct") ;
return (1.) ;
}
TF1* MRF_TF1 ()
{
printf ("\nMRF_TF1: in… ") ;
TF1 *fct = new TF1 (“fct”,MRF_Fct,0.,1000.,0) ;
printf (“out !”) ;
return (fct) ;
}
void ztest ()
{
TF1 * f_flux_ = MRF_TF1 () ;
TCanvas *canvas = new TCanvas (“canvas”) ;
canvas->SetFillStyle(0) ;
f_flux_->Draw() ;
//canvas->Close() ;
return ;
}
[/code]
It seems to only happen:
- with type C functions (see root.cern.ch/root/htmldoc/TF1.html)
- if fstyle >= 4000 (or =0)
Bug on the horizon?
Cheers,
Z
PS: A workaround is to close the canvas after plotting.