Hello, Rooter.
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…!
Hello, Rooter.
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…!
Hi,
your data seem to have (at least) 2 gaussian compents.
The following may give you a hint how to treat that case:
#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