# Fixing parameters

**URL:** <https://root-forum.cern.ch/t/fixing-parameters/33091>\
**Category:** Newbie\
**Created:** [March 9, 2019, 10:44pm UTC](https://root-forum.cern.ch/t/fixing-parameters/33091 "2019-03-09T22:44:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prya13](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/ea666f/32.png) [@Prya13](https://root-forum.cern.ch/u/Prya13)\
**Post date:** [March 9, 2019, 10:44pm UTC](https://root-forum.cern.ch/t/fixing-parameters/33091/1 "2019-03-09T22:44:17Z")

</div>

Dear All,

I want to fix mass of particle to 3.097 and vary background by 0.1.  
In doubt of where to put fixing parameters in code. No know how or where to include this FixParameter.  
[mass plots and continuum background.cpp](https://root-forum.cern.ch/uploads/default/original/3X/5/3/533fe77cf145819596f9cd6c54a897ec352c545a.cpp) (5.5 KB)

Thanks

---

<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:** [March 10, 2019, 7:02am UTC](https://root-forum.cern.ch/t/fixing-parameters/33091/2 "2019-03-10T07:02:24Z")

</div>

You have it in the right place. You just need to use:

```auto
fit2->FixParameter(fit2->GetParNumber("Mean_Gaus"), 3.097);

```

or simply:

```auto
fit2->FixParameter(1, 3.097); // 1 = "Mean_Gaus"

```

---

<div class="post-metadata">

**Author:** ![Prya13](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/ea666f/32.png) [@Prya13](https://root-forum.cern.ch/u/Prya13)\
**Post date:** [March 10, 2019, 6:04pm UTC](https://root-forum.cern.ch/t/fixing-parameters/33091/3 "2019-03-10T18:04:07Z")

</div>

Great idea, Thank you.
