Predefined crystal ball function

Dear Rooters,

I am simply trying to use the crystal ball function in a macro just as in the tutorial: https://root.cern.ch/root/html/tutorials/math/CrystalBall.C.html

However, it does not work when I am trying to use it:

[quote]Error in TFormula::Compile: Bad numerical expression : "crystalball"
Error in TF1::TF1: function: f1/crystalball has 0 parameters instead of 1
Error in TFormula::Compile: Bad numerical expression : "ROOT::Math::crystalball_function(x,2,1,1,0)"
Error in TF1::TF1: function: f2/ROOT::Math::crystalball_function(x, 2, 1, 1, 0) has 0 parameters instead of 1
Error in TFormula::Compile: Bad numerical expression : "ROOT::Math::crystalball_function(x,2,2,1,0)"
Error in TF1::TF1: function: f3/ROOT::Math::crystalball_function(x, 2, 2, 1, 0) has 0 parameters instead of 1
Error in TFormula::Compile: Bad numerical expression : "crystalballn"
Error in TF1::TF1: function: pdf/crystalballn has 0 parameters instead of 1
Error in TFormula::Compile: Bad numerical expression : "ROOT::Math::crystalball_pdf(x,3,1.01,1,0)"
Error in TF1::TF1: function: pdf/ROOT::Math::crystalball_pdf(x, 3, 1.01, 1, 0) has 0 parameters instead of 1
Error in TFormula::Compile: Bad numerical expression : "ROOT::Math::crystalball_pdf(x,2,2,1,0)"
Error in TF1::TF1: function: pdf/ROOT::Math::crystalball_pdf(x, 2, 2, 1, 0) has 0 parameters instead of 1
Error in TFormula::Compile: Bad numerical expression : "ROOT::Math::crystalball_cdf(x,1.2,2,1,0)"
Error in TF1::TF1: function: cdf/ROOT::Math::crystalball_cdf(x, 1.2, 2, 1, 0) has 0 parameters instead of 1
Error in TFormula::Compile: Bad numerical expression : "ROOT::Math::crystalball_cdf_c(x,1.2,2,1,0)"
Error in TF1::TF1: function: cdfc/ROOT::Math::crystalball_cdf_c(x, 1.2, 2, 1, 0) has 0 parameters instead of 1[/quote]

Fitting with expo or gaus works out of the box, but not with the crystalball predefined function. What is required?

Thanks a lot,

Patrick

Note: you need a decent ROOT version, e.g. 6.06/04, in order to have the “crystalball” predefined.