Hi all,
I’m trying to fit a reflected landau onto some output from a Geant4 simulation. My issue is that when I try to reflect the fit by setting the scale parameter to -1, the fit disappears entirely (but can be seen as a black line on the x-axis).
When the scale parameter is set to 1, a landau distribution fits over the dataset as expected. I have included my code below.
Thank-you,
Vincent
{
gROOT->Reset();
gROOT->SetStyle("Plain");
TFile f("B4.root");
TCanvas* c1 = new TCanvas("c1", "", 20, 20, 1000, 1000);
c1->Divide(1,1);
c1->cd(1);
TTree *B4 = (TTree*)f.Get("B4");
TF1 f1("f1","[0]*TMath::Landau(x,[1],[2])",0,530);
f1.SetParameters(1.59,480,0.3);
B4->Draw("Ecore>>h1(50,300,530)");
Ecore->Fit("f1");
_ROOT Version: 6.26
Platform: Fedora Linux
Compiler: GNU

