20 auto c =
new TCanvas(
"ModifiedGaussianCore",
"ModifiedGaussianCore", 600, 800);
26 c->DrawFrame(x1, y1, x2, y2,
";#Delta;");
37 double p[] = { N, mu, sigma,
B, C };
41 TF1 * g =
new TF1(
"gaus",
"gaus(0)", x1, x2);
43 g->SetLineColor(kBlue);
48 TF1 * h =
new TF1(
"diff",
difference, x1, x2, 5);
50 h->SetLineColor(kGreen+2);
54 TLegend * legend =
new TLegend(0.6, 0.7, 0.89, 0.85);
55 legend->SetBorderSize(0);
56 legend->AddEntry(
f,
"global function",
"l");
57 legend->AddEntry(g,
"Gaussian core",
"l");
58 legend->AddEntry(h,
"difference",
"l");
60 auto line = [&](Style_t s,
double x, TString title =
"") {
61 TLine * line =
new TLine;
62 line->SetLineStyle(s);
63 line->DrawLine(x, y1, x,
f->Eval(x));
64 if (title !=
"") legend->AddEntry(line, title,
"l");
66 line(1, mu, Form(
"mean (#mu = %.2f)", mu));
67 line(2, mu+sigma, Form(
"mean #pm width (#sigma = %.2f)", sigma));
72 c->Print(
"ModifiedGaussianCore.pdf");