20 using namespace RooFit;
22 void rf106_plotdecoration()
28 RooRealVar x(
"x",
"x", -10, 10);
31 RooRealVar sigma(
"sigma",
"sigma", 1, 0.1, 10);
32 RooRealVar mean(
"mean",
"mean", -3, -10, 10);
33 RooGaussian gauss(
"gauss",
"gauss", x, mean, sigma);
36 RooDataSet *data = gauss.generate(x, 1000);
45 RooPlot *frame = x.frame(Name(
"xframe"), Title(
"RooPlot with decorations"), Bins(40));
53 gauss.paramOn(frame, Layout(0.55));
59 data->statOn(frame, Layout(0.55, 0.99, 0.8));
65 TText *txt =
new TText(2, 100,
"Signal");
66 txt->SetTextSize(0.04);
67 txt->SetTextColor(kRed);
68 frame->addObject(txt);
71 TArrow *arrow =
new TArrow(2, 100, -1, 50, 0.01,
"|>");
72 arrow->SetLineColor(kRed);
73 arrow->SetFillColor(kRed);
74 arrow->SetLineWidth(3);
75 frame->addObject(arrow);
80 TFile f(
"rf106_plotdecoration.root",
"RECREATE");
88 new TCanvas(
"rf106_plotdecoration",
"rf106_plotdecoration", 600, 600);
89 gPad->SetLeftMargin(0.15);
90 frame->GetYaxis()->SetTitleOffset(1.6);