Skip to content
Snippets Groups Projects
Commit ace64bd4 authored by Marshall Scott's avatar Marshall Scott
Browse files

New fit function implementation

parent 435c2b20
No related branches found
No related tags found
No related merge requests found
......@@ -180,10 +180,8 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
//Energy Resolution Work
auto hdE = d1.Histo1D({"hdE", "dE; dE[GeV]; Events", 20, -7.5, 7.5}, "dE");//changed from 100
auto hdE_rel = d1.Histo1D({"hdE_rel", "dE Relative; dE Relative; Events", 20, -7.5, 7.5}, "dE_rel");//changed from 100
TFitResultPtr f1 = hdE_rel->Fit("gaus", "S");
const double* res = f1->GetParams();
auto tf1 = new TF1("", "TMath::Gaus(x, [0], [1], [2])", -7.5, 7.5);
tf1 -> SetParameters(res[0], res[1], res[2]);
auto f1 = hdE_rel->Fit("gaus", "", "", -7.5, 7.5);
double* res = f1->GetParams();
//Pass/Fail
/*
......@@ -209,10 +207,9 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
hdE_rel->GetYaxis()->SetTitleOffset(1.4);
hdE_rel->SetLineWidth(2);
hdE_rel->SetLineColor(kBlue);
tf1->SetLineWidth(2);
tf1->SetLineColor(kRed);
hdE_rel->GetFunction("gaus")->SetLineWidth(2);
hdE_rel->GetFunction("gaus")->SetLineColor(kRed);
hdE_rel->DrawClone();
tf1->Draw("SAME");
cdE_rel->SaveAs("results/emcal_barrel_pi0_dE_rel.png");
cdE_rel->SaveAs("results/emcal_barrel_pi0_dE_rel.pdf");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment