19 using namespace RooFit;
21 void rf110_normintegration()
27 RooRealVar x(
"x",
"x", -10, 10);
30 RooGaussian gx(
"gx",
"gx", x, RooConst(-2), RooConst(3));
36 cout <<
"gx = " << gx.getVal() << endl;
40 cout <<
"gx_Norm[x] = " << gx.getVal(&nset) << endl;
44 RooAbsReal *igx = gx.createIntegral(x);
45 cout <<
"gx_Int[x] = " << igx->getVal() << endl;
51 x.setRange(
"signal", -5, 5);
56 RooAbsReal *igx_sig = gx.createIntegral(x, NormSet(x), Range(
"signal"));
57 cout <<
"gx_Int[x|signal]_Norm[x] = " << igx_sig->getVal() << endl;
64 RooAbsReal *gx_cdf = gx.createCdf(x);
67 RooPlot *frame = x.frame(Title(
"c.d.f of Gaussian p.d.f"));
68 gx_cdf->plotOn(frame);
71 new TCanvas(
"rf110_normintegration",
"rf110_normintegration", 600, 600);
72 gPad->SetLeftMargin(0.15);
73 frame->GetYaxis()->SetTitleOffset(1.6);