54 #if !defined(__CINT__) || defined(__MAKECINT__)
55 #include "../tutorials/roostats/NuMuToNuE_Oscillation.h"
56 #include "../tutorials/roostats/NuMuToNuE_Oscillation.cxx"
58 #include "../tutorials/roostats/NuMuToNuE_Oscillation.cxx+"
62 using namespace RooFit ;
63 using namespace RooStats ;
97 RooRealVar deltaMSq(
"deltaMSq",
"#Delta m^{2}",40,1,300,
"eV/c^{2}");
98 RooRealVar sinSq2theta(
"sinSq2theta",
"sin^{2}(2#theta)", .006,.0,.02);
120 RooRealVar EPrime(
"EPrime",
"", 15,10,60,
"GeV");
121 RooRealVar LPrime(
"LPrime",
"", .800,.600, 1.0,
"km");
123 LPrime,EPrime,deltaMSq);
133 RooConstVar maxEventsTot(
"maxEventsTot",
"maximum number of sinal events",50000);
134 RooConstVar inverseArea(
"inverseArea",
"1/(#Delta E #Delta L)",
138 RooProduct sigNorm(
"sigNorm",
"",
RooArgSet(maxEventsTot, *intProbToOscInExp, inverseArea, sinSq2theta));
140 RooConstVar bkgNorm(
"bkgNorm",
"normalization for background",500);
163 cout <<
"generate toy data with nEvents = " << nEventsData << endl;
172 TCanvas* dataCanvas =
new TCanvas(
"dataCanvas");
173 dataCanvas->Divide(2,2);
191 Eframe->
SetTitle(
"toy data with best fit model (and sig+bkg components)");
201 hhh->
SetTitle(
"Likelihood Function");
204 dataCanvas->Update();
211 RooArgSet parameters(deltaMSq, sinSq2theta);
216 modelConfig.
SetPdf(model);
239 MCMCInterval* mcInt =
NULL;
268 if (doFeldmanCousins) {
270 TH2F* hist = (TH2F*) parameterScan->
createHistogram(
"sinSq2theta:deltaMSq",30,30);
272 TH2F* forContour = (TH2F*)hist->
Clone();
283 forContour->SetBinContent( hist->FindBin(tmpPoint->
getRealValue(
"sinSq2theta"),
286 forContour->SetBinContent( hist->FindBin(tmpPoint->
getRealValue(
"sinSq2theta"),
297 forContour->SetContour(1,&level);
298 forContour->SetLineWidth(2);
299 forContour->SetLineColor(
kRed);
300 forContour->
Draw(
"cont2,same");
306 cout <<
"MCMC actual confidence level: "
307 << mcInt->GetActualConfidenceLevel() << endl;
312 dataCanvas->Update();
315 plotInt.
SetTitle(
"90% Confidence Intervals");
317 plotInt.
Draw(
"same");
320 dataCanvas->Update();
void Print(Option_t *option="") const
Print the real and cpu time passed between the start and stop events.
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
void Draw(const Option_t *options=0)
draw the likelihood interval or contour for the 1D case a RooPlot is drawn by default of the profiled...
This class provides simple and straightforward utilities to plot a MCMCInterval object.
Class RooProfileLL implements the profile likelihood estimator for a given likelihood and set of para...
RooCmdArg LineColor(Color_t color)
LikelihoodInterval is a concrete implementation of the RooStats::ConfInterval interface.
virtual void SetWorkspace(RooWorkspace &ws)
RooArgList L(const RooAbsArg &v1)
virtual void SetTestSize(Double_t size)
set the size of the test (rate of Type I error) ( Eg. 0.05 for a 95% Confidence Interval) ...
virtual void SetTestSize(Double_t size)
set the size of the test (rate of Type I error) ( Eg. 0.05 for a 95% Confidence Interval) ...
This class provides simple and straightforward utilities to plot a LikelihoodInterval object...
ProfileLikelihoodCalculator is a concrete implementation of CombinedCalculator (the interface class f...
virtual void SetNumBurnInSteps(Int_t numBurnInSteps)
set the number of steps in the chain to discard as burn-in, starting from the first ...
virtual Bool_t IsInInterval(const RooArgSet &) const =0
check if given point is in the interval
virtual Double_t getMin(const char *name=0) const
void Draw(const Option_t *options=NULL)
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
void SetTitle(const char *name)
Set the title of the RooPlot to 'title'.
static RooMsgService & instance()
Return reference to singleton instance.
virtual void SetSeed(UInt_t seed=0)
Set the random generator seed.
RooCmdArg Extended(Bool_t flag=kTRUE)
TObject * Clone(const char *newname=0) const
Make a complete copy of the underlying object.
virtual const RooArgSet * get() const
virtual LikelihoodInterval * GetInterval() const
Return a likelihood interval.
RooAbsData * GetPointsToScan()
void setStreamStatus(Int_t id, Bool_t active)
(De)Activate stream with given unique ID
static struct mg_connection * fc(struct mg_context *ctx)
RooDataSet is a container class to hold N-dimensional binned data.
void Stop()
Stop the stopwatch.
virtual void SetPdf(const RooAbsPdf &pdf)
Set the Pdf, add to the the workspace if not already there.
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
RooConstVar represent a constant real-valued object.
Double_t getVal(const RooArgSet *set=0) const
virtual RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
Plot dataset on specified frame.
virtual RooAbsPdf * createProjection(const RooArgSet &iset)
Return a p.d.f that represent a projection of this p.d.f integrated over given observables.
RooRealVar represents a fundamental (non-derived) real valued object.
virtual void SetLineColor(Color_t lcolor)
Class RooNLLVar implements a a -log(likelihood) calculation from a dataset and a PDF.
virtual void SetNumIters(Int_t numIters)
set the number of iterations to run the metropolis algorithm
virtual MCMCInterval * GetInterval() const
Main interface to get a ConfInterval.
virtual void SetTestSize(Double_t size)
set the size of the test (rate of Type I error) ( Eg. 0.05 for a 95% Confidence Interval) ...
virtual void Draw(Option_t *option="")
Draw this histogram with options.
virtual RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none(), const RooCmdArg &arg9=RooCmdArg::none(), const RooCmdArg &arg10=RooCmdArg::none()) const
Plot (project) PDF on specified frame.
virtual void SetAxes(RooArgList &axes)
set which variables to put on each axis
void SetNBins(Int_t bins)
void SetLineColor(Color_t color)
TH1 * createHistogram(const char *name, const RooAbsRealLValue &xvar, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
Create and fill a ROOT histogram TH1,TH2 or TH3 with the values of this dataset.
RooPlot * frame(const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
RooDataSet is a container class to hold unbinned data.
RooProduct a RooAbsReal implementation that represent the product of a given set of other RooAbsReal ...
A RooPlot is a plot frame and a container for graphics objects within that frame. ...
The FeldmanCousins class (like the Feldman-Cousins technique) is essentially a specific configuration...
ConfInterval is an interface class for a generic interval in the RooStats framework.
virtual TObject * clone(const char *newname) const
virtual void SetUseKeys(Bool_t useKeys)
set whether to use kernel estimation to determine the interval
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
RooCmdArg Components(const RooArgSet &compSet)
RooCmdArg YVar(const RooAbsRealLValue &var, const RooCmdArg &arg=RooCmdArg::none())
virtual PointSetInterval * GetInterval() const
Main interface to get a ConfInterval (will be a PointSetInterval)
TH1 * createHistogram(const char *varNameList, Int_t xbins=0, Int_t ybins=0, Int_t zbins=0) const
Create and fill a ROOT histogram TH1,TH2 or TH3 with the values of this function for the variables wi...
virtual Int_t numEntries() const
Return the number of bins.
RooCmdArg Scaling(Bool_t flag)
virtual Double_t getMax(const char *name=0) const
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
RooDataSet * generate(const RooArgSet &whatVars, Int_t nEvents, const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none())
Generate a new dataset containing the specified variables with events sampled from our distribution...
virtual RooFitResult * fitTo(RooAbsData &data, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none())
Fit PDF to given dataset.
RooPolynomial implements a polynomial p.d.f of the form By default coefficient a_0 is chosen to be 1...
virtual void SetParametersOfInterest(const RooArgSet &set)
virtual void SetTitle(const char *title)
Change (i.e.
Bayesian Calculator estimating an interval or a credible region using the Markov-Chain Monte Carlo me...
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
void rs401d_FeldmanCousins(bool doFeldmanCousins=false, bool doMCMC=true)
The RooWorkspace is a persistable container for RooFit projects.
void UseAdaptiveSampling(bool flag=true)
RooAbsReal * createIntegral(const RooArgSet &iset, const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
Create an object that represents the integral of the function over one or more observables listed in ...
virtual void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.
RooCmdArg Binning(const RooAbsBinning &binning)
Double_t getRealValue(const char *name, Double_t defVal=0, Bool_t verbose=kFALSE) const
Get value of a RooAbsReal stored in set with given name.