Possible TF1 Parsing bug?

Can anyone explain what’s going on here?

pwaller@jupiter ~ $ root-config --version --svn-revision 5.19/01 21745 pwaller@jupiter ~ $ root -l root [0] TF1 f("f", "TMath::BreitWigner(x,0,1)", -10, 10); f.Draw() <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
The above works exactly as expected, drawing a BW centred on 0.

Again, fine, centred about 5.

Gwuh? What on earth? It’s drawing it upside down with a width of 5. And it seems to ignore the third parameter.

An attempt to rectify:

Gives nothing. It turns out that this one ignores the third parameter and treats the second as the width.

The above works, drawing a BW centred on -1 with gamma = 1.

Is this a bug in ROOT, or am I doing something fundamentally wrong? I can provide plots if necessary.


  • Peter

P.S. Some more strange behavior: If I set the Y log scale, then the Z log scale (it’s only a 1D plot, I know, but bare with me) – upon setting the LogZ, the Y scale changes. Is this another bug? Shouldn’t the Y scale be unaffected?

Use the form

TF1 f("f", "TMath::BreitWigner(x,[0],[1])", -10, 10); f.SetParameters(-5,1); f.Draw();
There is apparently a problem when giving your expression containing a negative sign. TMath::BreitWigner itself is correct.I will investigate once I will be back from my trip.


How about this expression? It contains no negative signs?

How about this expression? It contains no negative signs?

Any updates on this?


This problem has been fixed in the head of the SVN trunk.

Thanks for your patience.