# Accessing crystalball cdf parameters

**URL:** <https://root-forum.cern.ch/t/accessing-crystalball-cdf-parameters/32413>\
**Category:** Newbie\
**Created:** [January 23, 2019, 12:41pm UTC](https://root-forum.cern.ch/t/accessing-crystalball-cdf-parameters/32413 "2019-01-23T12:41:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vangi](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/8baadc/32.png) [@Vangi](https://root-forum.cern.ch/u/Vangi)\
**Post date:** [January 23, 2019, 12:41pm UTC](https://root-forum.cern.ch/t/accessing-crystalball-cdf-parameters/32413/1 "2019-01-23T12:41:44Z")

</div>

Dear ROOTers,  
I am trying to add a crystalball cdf to my function map, and adjust its parameters for every event. When I try accessing them, it tells me to use the parameter name instead of a number, but I still get nothing. When I call Print(), it tells me that there are no parameters. How can I access them in order to change them? I attach a simple macro that shows the above.  
Thank you,  
Vangi  
[CB\_cdf.C](https://root-forum.cern.ch/uploads/default/original/3X/4/f/4f532ad6109a5888ccea011226945d9d2765fb64.C) (610 Bytes)

---

<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:** [January 23, 2019, 1:12pm UTC](https://root-forum.cern.ch/t/accessing-crystalball-cdf-parameters/32413/2 "2019-01-23T13:12:34Z")

</div>

```auto
{
  TF1 *cdf_test = new TF1("cdf_test", "ROOT::Math::crystalball_cdf(x, [Alpha], [N], [Sigma], [Mean])", -5., 5.);
  cdf_test->SetParameter("Alpha", 2.);
  cdf_test->SetParameter("N", 2.);
  cdf_test->SetParameter("Sigma", 2.);
  cdf_test->SetParameter("Mean", 1.);
  cdf_test->Print();
}

```

---

<div class="post-metadata">

**Author:** ![Vangi](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/8baadc/32.png) [@Vangi](https://root-forum.cern.ch/u/Vangi)\
**Post date:** [January 23, 2019, 1:21pm UTC](https://root-forum.cern.ch/t/accessing-crystalball-cdf-parameters/32413/3 "2019-01-23T13:21:59Z")

</div>

Perfect, thank you very much!
