Exercise 1: Search for H -> gamma gamma

Part 4:

  • Finalize the plot
    • Add the signal simulation to the background histogram.
    • Make the plot look nice.

We can now add the signal to our background model

In [17]:
hBkg -> Add(hSig);
c -> Draw();

Almost there, lets make everything more beautiful, let's start with the axis labels.

In [18]:
gStyle->SetOptStat(0);
hData -> GetYaxis() -> SetTitle("Number of events");
hData -> GetYaxis() -> SetTitleOffset(1.55);
hData -> GetYaxis() -> SetTitleSize(20);
hData -> GetYaxis() -> SetTitleFont(43);
hData -> GetYaxis() -> SetLabelSize(15);
hData -> GetYaxis() -> SetLabelFont(43);

hDiff -> GetYaxis() -> SetTitle("Data-Fit");
hDiff -> GetYaxis() -> SetTitleSize(20);
hDiff -> GetYaxis() -> SetTitleFont(43);
hDiff -> GetYaxis() -> SetTitleOffset(1.55);
hDiff -> GetYaxis() -> SetLabelSize(15);
hDiff -> GetYaxis() -> SetLabelFont(43);
hDiff -> GetYaxis() ->SetRangeUser(-500, 700);

hDiff -> GetXaxis() -> SetTitle("m_{#gamma #gamma} [GeV]");
hDiff -> GetXaxis() -> SetTitleSize(20);
hDiff -> GetXaxis() -> SetTitleFont(43);
hDiff -> GetXaxis() -> SetTitleOffset(4.);
hDiff -> GetXaxis() -> SetLabelSize(15);
hDiff -> GetXaxis() -> SetLabelFont(43);

c->Draw();

Connect the pads

In [19]:
pad1 -> SetBottomMargin(0);
pad2 -> SetTopMargin(0);
pad2 -> SetBottomMargin(0.2);
c -> Draw();

Let's add a legend:

In [20]:
pad1->cd();
TLegend *fLegend = new TLegend(0.625, 0.66, 0.625+0.255, 0.865);
fLegend -> AddEntry(hData,   "PseudoData", "lp");
fLegend -> AddEntry(hBkg,    "MC",         "f");
fLegend -> AddEntry(fit,     "Fit",        "l");
fLegend -> SetFillColor(0);
fLegend -> SetLineColor(0);
fLegend -> SetBorderSize(0);
fLegend -> SetTextFont(72);
fLegend -> SetTextSize(0.035);
fLegend -> Draw("SAME");
c->Draw();

Let's add a text label for the Lumi, Hasco, Simulation

In [21]:
TLatex l1;
l1.SetTextAlign(9);
l1.SetTextSize(0.04);
l1.SetNDC();
l1.DrawLatex(0.21, 0.160, "#int L dt = 100 fb^{-1}");

TLatex l2;
l2.SetTextAlign(9);
l2.SetTextFont(72);
l2.SetTextSize(0.04);
l2.SetNDC();
l2.DrawLatex(0.21, 0.310, "Hasco");

TLatex l3;
l3.SetTextAlign(9);
l3.SetTextSize(0.04);
l3.SetNDC();
l3.DrawLatex(0.21, 0.235, "Simulation");
c->Draw();