52void rs302_JeffreysPriorDemo()
55 w.factory(
"Uniform::u(x[0,1])");
56 w.factory(
"mu[100,1,200]");
57 w.factory(
"ExtendPdf::p(u,mu)");
66 cout <<
"variance = " << (cov.
Determinant()) << endl;
71 w.defineSet(
"poi",
"mu");
72 w.defineSet(
"obs",
"x");
74 RooJeffreysPrior pi(
"jeffreys",
"jeffreys", *w.pdf(
"p"), *w.set(
"poi"), *w.set(
"obs"));
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();
106 cout <<
"variance = " << (cov.
Determinant()) << endl;
111 w.defineSet(
"poi",
"mu");
112 w.defineSet(
"obs",
"x");
114 RooJeffreysPrior pi(
"jeffreys",
"jeffreys", *w.pdf(
"p"), *w.set(
"poi"), *w.set(
"obs"));
117 pi.getParameters(*temp)->
Print();
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);
156 cout <<
"variance = " << (cov.
Determinant()) << endl;
161 w.defineSet(
"poi",
"sigma");
162 w.defineSet(
"obs",
"x");
164 RooJeffreysPrior pi(
"jeffreys",
"jeffreys", *w.pdf(
"p"), *w.set(
"poi"), *w.set(
"obs"));
167 pi.getParameters(*temp)->
Print();
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);
204 cout <<
"variance = " << (cov.
Determinant()) << endl;
209 w.defineSet(
"poi",
"mu,sigma");
210 w.defineSet(
"obs",
"x");
212 RooJeffreysPrior pi(
"jeffreys",
"jeffreys", *w.pdf(
"p"), *w.set(
"poi"), *w.set(
"obs"));
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");
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
The RooDataHist is a container class to hold N-dimensional binned data.
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
const TMatrixDSym & covarianceMatrix() const
Return covariance matrix.
RooGenericPdf is a concrete implementation of a probability density function, which takes a RooArgLis...
Implementation of Jeffrey's prior.
A RooPlot is a plot frame and a container for graphics objects within that frame.
static RooPlot * frame(const RooAbsRealLValue &var, Double_t xmin, Double_t xmax, Int_t nBins)
Create a new frame for a given variable in x.
std::unique_ptr< TLegend > BuildLegend() const
Build a legend that contains all objects that have been drawn on the plot.
virtual void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.
The RooWorkspace is a persistable container for RooFit projects.
TH1 is the base class of all histogram classes in ROOT.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
virtual Double_t Determinant() const
TMatrixTSym< Element > & Invert(Double_t *det=0)
Invert the matrix and calculate its determinant Notice that the LU decomposition is used instead of B...
RooCmdArg YVar(const RooAbsRealLValue &var, const RooCmdArg &arg=RooCmdArg::none())
RooCmdArg SumW2Error(Bool_t flag)
RooCmdArg Save(Bool_t flag=kTRUE)
RooCmdArg ExpectedData(Bool_t flag=kTRUE)
RooCmdArg Binning(const RooAbsBinning &binning)
RooCmdArg LineColor(Color_t color)
RooCmdArg LineStyle(Style_t style)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...