# Fitting Data with user defined function

**URL:** <https://root-forum.cern.ch/t/fitting-data-with-user-defined-function/30758>\
**Category:** ROOT\
**Tags:** hist\
**Created:** [September 20, 2018, 3:33pm UTC](https://root-forum.cern.ch/t/fitting-data-with-user-defined-function/30758 "2018-09-20T15:33:45Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [October 5, 2018, 11:10am UTC](https://root-forum.cern.ch/t/fitting-data-with-user-defined-function/30758/16 "2018-10-05T11:10:43Z")

</div>

```auto
"crystalball" = "[Constant] * ROOT::Math::crystalball_function(x, [Alpha], [N], [Sigma], [Mean])"

```

[Wikipedia → Crystal Ball function](https://en.wikipedia.org/wiki/Crystal_Ball_function) ;

[ROOT::Math::crystalball\_function](https://root.cern/doc/master/group__PdfFunc.html#ga8f46b655fa77cceb930ddb11e4e12196) ;

[${ROOTSYS}/tutorials/math/CrystalBall.C](https://root.cern.ch/doc/master/CrystalBall_8C.html) ;  
[${ROOTSYS}/tutorials/fit/fitNormSum.C](https://root.cern.ch/doc/master/fitNormSum_8C.html) ;  
[${ROOTSYS}/tutorials/fit/fitNormSum.py](https://root.cern.ch/doc/master/fitNormSum_8py.html)

---

_[View the full topic](https://root-forum.cern.ch/t/fitting-data-with-user-defined-function/30758)._
