55 w.factory(
"Uniform::u(x[0,1])");
56 w.factory(
"mu[100,1,200]");
57 w.factory(
"ExtendPdf::p(u,mu)");
59 std::unique_ptr<RooDataHist> asimov{
w.pdf(
"p")->generateBinned(*
w.var(
"x"),
ExpectedData())};
61 std::unique_ptr<RooFitResult> res{
w.pdf(
"p")->fitTo(*asimov,
Save(),
SumW2Error(
true))};
66 cout <<
"variance = " << (cov.
Determinant()) << endl;
71 w.defineSet(
"poi",
"mu");
72 w.defineSet(
"obs",
"x");
85 auto legend =
plot->BuildLegend();
90void TestJeffreysGaussMean()
93 w.factory(
"Gaussian::g(x[0,-20,20],mu[0,-5.,5],sigma[1,0,10])");
94 w.factory(
"n[10,.1,200]");
95 w.factory(
"ExtendPdf::p(g,n)");
96 w.var(
"sigma")->setConstant();
97 w.var(
"n")->setConstant();
99 std::unique_ptr<RooDataHist> asimov{
w.pdf(
"p")->generateBinned(*
w.var(
"x"),
ExpectedData())};
101 std::unique_ptr<RooFitResult> res{
w.pdf(
"p")->fitTo(*asimov,
Save(),
SumW2Error(
true))};
106 cout <<
"variance = " << (cov.
Determinant()) << endl;
111 w.defineSet(
"poi",
"mu");
112 w.defineSet(
"obs",
"x");
117 pi.getParameters(*temp)->
Print();
128 auto legend =
plot->BuildLegend();
133void TestJeffreysGaussSigma()
141 w.factory(
"Gaussian::g(x[0,-20,20],mu[0,-5,5],sigma[1,1,5])");
142 w.factory(
"n[100,.1,2000]");
143 w.factory(
"ExtendPdf::p(g,n)");
145 w.var(
"mu")->setConstant();
146 w.var(
"n")->setConstant();
147 w.var(
"x")->setBins(301);
149 std::unique_ptr<RooDataHist> asimov{
w.pdf(
"p")->generateBinned(*
w.var(
"x"),
ExpectedData())};
151 std::unique_ptr<RooFitResult> res{
w.pdf(
"p")->fitTo(*asimov,
Save(),
SumW2Error(
true))};
156 cout <<
"variance = " << (cov.
Determinant()) << endl;
161 w.defineSet(
"poi",
"sigma");
162 w.defineSet(
"obs",
"x");
167 pi.getParameters(*temp)->
Print();
177 auto legend =
plot->BuildLegend();
182void TestJeffreysGaussMeanAndSigma()
190 w.factory(
"Gaussian::g(x[0,-20,20],mu[0,-5,5],sigma[1,1.,5.])");
191 w.factory(
"n[100,.1,2000]");
192 w.factory(
"ExtendPdf::p(g,n)");
194 w.var(
"n")->setConstant();
195 w.var(
"x")->setBins(301);
197 std::unique_ptr<RooDataHist> asimov{
w.pdf(
"p")->generateBinned(*
w.var(
"x"),
ExpectedData())};
199 std::unique_ptr<RooFitResult> res{
w.pdf(
"p")->fitTo(*asimov,
Save(),
SumW2Error(
true))};
204 cout <<
"variance = " << (cov.
Determinant()) << endl;
209 w.defineSet(
"poi",
"mu,sigma");
210 w.defineSet(
"obs",
"x");
215 pi.getParameters(*temp)->
Print();
219 TH1 *Jeff2d = pi.createHistogram(
"2dJeffreys", *
w.var(
"mu"),
Binning(10, -5., 5),
YVar(*
w.var(
"sigma"),
Binning(10, 1., 5.)));
220 Jeff2d->
Draw(
"surf");
winID h TVirtualViewer3D TVirtualGLPainter char TVirtualGLPainter plot
void Print(Option_t *options=nullptr) const override
This method must be overridden when a class wants to print itself.
RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}, const RooCmdArg &arg9={}, const RooCmdArg &arg10={}) const override
Helper calling plotOn(RooPlot*, RooLinkedList&) const.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Implementation of a probability density function that takes a RooArgList of servers and a C++ express...
Implementation of Jeffrey's prior.
Plot frame and a container for graphics objects within that frame.
Persistable container for RooFit projects.
TH1 is the base class of all histogram classes in ROOT.
void Draw(Option_t *option="") override
Draw this histogram with options.
Double_t Determinant() const override
TMatrixTSym< Element > & Invert(Double_t *det=nullptr)
Invert the matrix and calculate its determinant Notice that the LU decomposition is used instead of B...
virtual TObject * DrawClone(Option_t *option="") const
Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
RooCmdArg YVar(const RooAbsRealLValue &var, const RooCmdArg &arg={})
RooCmdArg Save(bool flag=true)
RooCmdArg SumW2Error(bool flag)
RooCmdArg ExpectedData(bool flag=true)
RooCmdArg Binning(const RooAbsBinning &binning)
RooCmdArg LineColor(Color_t color)
RooCmdArg LineStyle(Style_t style)
VecExpr< UnaryOp< Sqrt< T >, VecExpr< A, T, D >, T >, T, D > sqrt(const VecExpr< A, T, D > &rhs)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...