# Please, help me! :(

**URL:** <https://root-forum.cern.ch/t/please-help-me/37231>\
**Category:** Newbie\
**Tags:** hist\
**Created:** [December 17, 2019, 7:10am UTC](https://root-forum.cern.ch/t/please-help-me/37231 "2019-12-17T07:10:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shaggylee](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/67e7ee/32.png) [@Shaggylee](https://root-forum.cern.ch/u/Shaggylee)\
**Post date:** [December 17, 2019, 7:10am UTC](https://root-forum.cern.ch/t/please-help-me/37231/1 "2019-12-17T07:10:10Z")

</div>

Hello, Rooter.

 ![1mgkk](https://root-forum.cern.ch/uploads/default/original/3X/2/8/28fca7e852bab22235eb9990371ccb986c0d4326.jpeg)

I have gaussian fitting histogram. (red line)  
However, I want to fit the histogram around the blue line.  
I also want to know the function used for fitting.

Please help…!

---

<div class="post-metadata">

**Author:** ![OSchaile](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/o/e495f1/32.png) [@OSchaile](https://root-forum.cern.ch/u/OSchaile)\
**Post date:** [December 17, 2019, 9:16am UTC](https://root-forum.cern.ch/t/please-help-me/37231/2 "2019-12-17T09:16:56Z")

</div>

Hi,  
your data seem to have (at least) 2 gaussian compents.  
The following may give you a hint how to treat that case:

```auto
#include "TH1.h"
#include "TF1.h"

void double_gauss()
{
	auto h1 = new TH1F("h1", "2 gauss", 80, -0.5, 0.5);
	auto f1 = new TF1("g2", "gaus(0) + gaus(3)", -0.5, 0.5);
	f1->SetParameters(20, 0, 0.1, 80, 0, 0.01);
	h1->FillRandom("g2", 3000);
	h1->Draw();
	h1->Fit("g2");
}

```

Cheers  
Otto
