Hiii Root Users
I would like to fit a histogram with a function which can be obtained by reflecting the landau distribution about x axis how can i do this
does anybody knows the solution…
Thanks in advance
Hiii Root Users
I would like to fit a histogram with a function which can be obtained by reflecting the landau distribution about x axis how can i do this
does anybody knows the solution…
Thanks in advance
Hi,
hist->Fit(“TMath::Landau(-x)”)
See TMath::Landau() for available parameters.
Cheers, Axel.
[edit 2020-05-04: fixed the link.]
or even simpler h->Fit(“landau”);
Rene
Hiii Axel
Thanks for reply
I did try to fit the distribution with for example TMath::Landau(-x,0,1,0) but it says unknown function TMath::Landau(-x,0,1,0) and also tried with Fit(“landau”) but in this case it is doing with the standard landau not with the mirror reflected landau …
Is there is another alteranative to this problem
You should call the right constructor. In your case do
TF1 f1("f1","[0]*TMath::Landau(-x,[1],[2])",0,1);
f1.SetParameters(1,0,0.3); //for example
Rene
Hii Rene
Actually i first try to plot the distribution with both +x and -x so it is plotting with +x but with -x it is not plotting anything the code that is uses is as follow
TF1 *f1 = new TF1(“f1”,"[0]*TMath::Landau(x,[1],[2])",0,100);
f1->SetParameters(1,50,5);
f1->Draw()
rd.pdf (13 KB)
of course you must set a valid range for your function. Try, eg:
TF1 *f1 = new TF1("f1","[0]*TMath::Landau(x,[1],[2])",-100,100);
Rene
Thanks Rene
Now I am getting the mirror inverted landau distribution