# Roofit, Crystal Ball

RooCBShape CBShape(“CBShape”, “Cystal Ball Function”, x, m, s, a, n);

What are the limits of the “a” ans “n” parameters?

Thanx,

k

Hi,

Therer are no limits on alpha, n should be positive for the function to make sense as
a p.d.f although it is technically defined for negative n as well.

NB: The CrystalBall shape is Gaussian that is ‘connected’ to an exponential taill at ‘alpha’ sigma of the Gaussian. The sign determines if it happens on the left or right side. The ‘n’ parameter control the slope of the exponential part.

Wouter

------- from RooCBShape.cc

Double_t t = (m-m0)/sigma;
if (alpha < 0) t = -t;

Double_t absAlpha = fabs((Double_t)alpha);

if (t >= -absAlpha) {
return exp(-0.5tt);
}
else {
Double_t a = TMath::Power(n/absAlpha,n)exp(-0.5absAlpha*absAlpha);
Double_t b= n/absAlpha - absAlpha;

``````return a/TMath::Power(b - t, n);
``````

}

Hi…
I’ve got some problems with the crystal ball pdf…
I’m trying to fit a peak with the function posted by Wouter Verkerke, but…
if I change the initialization of the parameters the results are very very different.

This is not the only problem…I tested the same program (with the same version of root) on another pc and I got this error:

MINUIT WARNING IN PARAM DEF
============== STARTING VALUE OUTSIDE LIMITS.

for all the parameters!

How is this possible? Where can I find some documentation for this kind of problems?

Thanks a lot!!!

actually, while there seem to be no limits on alpha, the special case alpha = 0 can lead to NaNs (if t < 0, e.g. for m < m0 and sigma > 0) due to division by the absolute value of alpha in the a and b terms (and this can cause problems in fits etc.).