# Crystal Ball function

Examples of the Crystal Ball function.

The Crystal Ball function, named after the Crystal Ball Collaboration (hence the capitalized initial letters), is a probability density function commonly used to model various lossy processes in high-energy physics. It consists of a Gaussian core portion and a power-law low-end tail, below a certain threshold. The function itself and its first derivative are both continuous.

The Crystal Ball function is given by:

${\displaystyle f(x;\alpha ,n,{\bar {x}},\sigma )=N\cdot {\begin{cases}\exp(-{\frac {(x-{\bar {x}})^{2}}{2\sigma ^{2}}}),&{\mbox{for }}{\frac {x-{\bar {x}}}{\sigma }}>-\alpha \\A\cdot (B-{\frac {x-{\bar {x}}}{\sigma }})^{-n},&{\mbox{for }}{\frac {x-{\bar {x}}}{\sigma }}\leqslant -\alpha \end{cases}}}$

where

${\displaystyle A=\left({\frac {n}{\left|\alpha \right|}}\right)^{n}\cdot \exp \left(-{\frac {\left|\alpha \right|^{2}}{2}}\right)}$,
${\displaystyle B={\frac {n}{\left|\alpha \right|}}-\left|\alpha \right|}$,
${\displaystyle N={\frac {1}{\sigma (C+D)}}}$
${\displaystyle C={\frac {n}{\left|\alpha \right|}}\cdot {\frac {1}{n-1}}\cdot \exp \left(-{\frac {\left|\alpha \right|^{2}}{2}}\right)}$
${\displaystyle D={\sqrt {\frac {\pi }{2}}}\left(1+\operatorname {erf} \left({\frac {\left|\alpha \right|}{\sqrt {2}}}\right)\right)}$

${\displaystyle N}$ (Skwarnicki 1986) is a normalization factor and ${\displaystyle \alpha }$, ${\displaystyle n}$, ${\displaystyle {\bar {x}}}$ and ${\displaystyle \sigma }$ are parameters which are fitted with the data. erf is the error function.