67MCMCIntervalPlot::MCMCIntervalPlot()
167 const char* title,
Bool_t scale)
174 <<
"Couldn't get posterior histogram." << endl;
212 <<
"Couldn't get posterior Keys PDF." << endl;
224 <<
"Invalid parameter" << endl;
228 frame->
SetTitle(
Form(
"Posterior Keys PDF for %s",
v->GetName()));
244 Form(
"MCMC histogram of posterior Keys PDF for %s, %s",
249 keysHist->
Draw(options);
269 "Interval type not supported" << endl;
328 frame->
Draw(options);
337 llLine->
Draw(options);
338 ulLine->
Draw(options);
345 <<
"Couldn't get posterior Keys PDF." << endl;
377 <<
" Sorry: " <<
fDimension <<
"-D plots not currently supported" << endl;
398 if (hist == NULL)
return;
412 for (i = 1; i <= nBins; i++) {
415 if (height < histCutoff) {
428 copy->
Draw(
"HIST SAME");
438 llLine->
Draw(options);
439 ulLine->
Draw(options);
447 <<
"Couldn't get posterior histogram." << endl;
476 <<
" Sorry: " <<
fDimension <<
"-D plots not currently supported" << endl;
495 if (hist == NULL)
return;
508 for (i = 1; i <= nBins; i++) {
511 if (center < ll || center > ul) {
523 copy->
Draw(
"hist same");
532 llLine->
Draw(options);
533 ulLine->
Draw(options);
536 <<
" Sorry: " <<
fDimension <<
"-D plots not currently supported"
550 <<
"Couldn't get posterior Keys product." << endl;
561 if (!frame)
return NULL;
563 frame->
SetTitle(
Form(
"Posterior Keys PDF * Heaviside product for %s",
570 frame->
Draw(options);
579 Form(
"MCMC Posterior Keys Product Hist. for %s, %s",
583 productHist->
Draw(options);
607 if (burnInSteps > 0) {
608 burnInX =
new Double_t[burnInSteps];
609 burnInY =
new Double_t[burnInSteps];
614 for (
Int_t i = burnInSteps; i < size; i++) {
619 for (
Int_t i = 0; i < burnInSteps; i++) {
632 walk->
SetTitle(
Form(
"2-D Scatter Plot of Markov chain for %s, %s",
644 walk->
Draw(
"A,L,P,same");
647 if (burnInX != NULL && burnInY != NULL) {
648 burnIn =
new TGraph(burnInSteps - 1, burnInX, burnInY);
652 burnIn->
Draw(
"L,P,same");
657 first->SetMarkerStyle(3);
658 first->SetMarkerSize(2);
660 first->Draw(
"L,P,same");
665 if (burnInX != NULL)
delete [] burnInX;
666 if (burnInY != NULL)
delete [] burnInY;
678 Int_t numEntries = 2 * size;
684 for (
Int_t i = 0; i < size; i++) {
688 value[2*i + 1] = val;
697 TGraph* paramGraph =
new TGraph(numEntries, time, value);
705 paramGraph->
Draw(
"A,L,same");
717 Int_t numEntries = 2 * size;
723 for (
Int_t i = 0; i < size; i++) {
724 nll = markovChain->
NLL(i);
727 nllValue[2*i + 1] = nll;
736 TGraph* nllGraph =
new TGraph(numEntries, time, nllValue);
738 nllGraph->
SetTitle(
"NLL value vs. time in Markov chain");
744 nllGraph->
Draw(
"A,L,same");
759 for (
Int_t i = 0; i < size; i++)
760 if (markovChain->
NLL(i) > maxNLL)
761 maxNLL = markovChain->
NLL(i);
763 fNLLHist =
new TH1F(
"mcmc_nll_hist",
"MCMC NLL Histogram",
770 for (
Int_t i = 0; i < size; i++)
785 for (
Int_t i = 0; i < size; i++)
786 if (markovChain->
Weight(i) > maxWeight)
787 maxWeight = markovChain->
Weight(i);
789 (
Int_t)(maxWeight + 1), 0, maxWeight * 1.02);
790 for (
Int_t i = 0; i < size; i++)
798 // 3-d plot of the parameter points
800 // also plot the points in the markov chain
801 RooDataSet* markovChainData = ((MCMCInterval*)mcmcint)->GetChainAsDataSet();
803 TTree& chain = ((RooTreeDataStore*) markovChainData->store())->tree();
804 chain.SetMarkerStyle(6);
805 chain.SetMarkerColor(kRed);
806 chain.Draw("s:ratioSigEff:ratioBkgEff","","box"); // 3-d box proportional to posterior
808 // the points used in the profile construction
809 TTree& parameterScan = ((RooTreeDataStore*) fc.GetPointsToScan()->store())->tree();
810 parameterScan.SetMarkerStyle(24);
811 parameterScan.Draw("s:ratioSigEff:ratioBkgEff","","same");
813 chain.SetMarkerStyle(6);
814 chain.SetMarkerColor(kRed);
815 //chain.Draw("s:ratioSigEff:ratioBkgEff", "_MarkovChain_local_nll","box");
816 //chain.Draw("_MarkovChain_local_nll");
char * Form(const char *fmt,...)
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.
RooAbsArg * first() 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 RooCmdArg &arg9=RooCmdArg::none(), const RooCmdArg &arg10=RooCmdArg::none()) const
Helper calling plotOn(RooPlot*, RooLinkedList&) const.
virtual Double_t getMax(const char *name=0) const
Get maximum of currently defined range.
virtual Int_t numBins(const char *rangeName=0) const
virtual Int_t getBins(const char *name=0) const
Get number of bins of currently defined range.
virtual Double_t getMin(const char *name=0) const
Get miniminum of currently defined range.
virtual RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1=RooCmdArg(), const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg(), const RooCmdArg &arg9=RooCmdArg(), const RooCmdArg &arg10=RooCmdArg()) const
Plot (project) PDF on specified frame.
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 w...
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
A RooPlot is a plot frame and a container for graphics objects within that frame.
void SetTitle(const char *name)
Set the title of the RooPlot to 'title'.
virtual void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.
RooRealVar represents a variable that can be changed from the outside.
This class provides simple and straightforward utilities to plot a MCMCInterval object.
void DrawWeightHist(const Option_t *options=NULL)
void DrawKeysPdfInterval(const Option_t *options=NULL)
void DrawInterval(const Option_t *options=NULL)
RooProduct * fPosteriorKeysProduct
void * DrawPosteriorHist(const Option_t *options=NULL, const char *title=NULL, Bool_t scale=kTRUE)
void DrawChainScatter(RooRealVar &xVar, RooRealVar &yVar)
void * DrawPosteriorKeysProduct(const Option_t *options=NULL)
TH1 * fPosteriorHistTFCopy
TH1 * fPosteriorHistHistCopy
void SetMCMCInterval(MCMCInterval &interval)
void * DrawPosteriorKeysPdf(const Option_t *options=NULL)
void DrawTailFractionInterval(const Option_t *options=NULL)
void DrawPosterior(const Option_t *options=NULL)
void DrawHistInterval(const Option_t *options=NULL)
void DrawShortestInterval(const Option_t *options=NULL)
void DrawParameterVsTime(RooRealVar ¶m)
virtual ~MCMCIntervalPlot()
Destructor of SamplingDistribution.
RooNDKeysPdf * fPosteriorKeysPdf
void DrawNLLHist(const Option_t *options=NULL)
void Draw(const Option_t *options=NULL)
MCMCInterval is a concrete implementation of the RooStats::ConfInterval interface.
virtual Double_t UpperLimitByKeys(RooRealVar ¶m)
determine upper limit in the shortest interval by using keys pdf
virtual Bool_t GetUseKeys()
get whether we used kernel estimation to determine the interval
virtual enum IntervalType GetIntervalType()
Return the type of this interval.
virtual TH1 * GetPosteriorHist()
set the number of bins to use (same for all axes, for now) virtual void SetNumBins(Int_t numBins);
virtual Double_t LowerLimitByKeys(RooRealVar ¶m)
determine lower limit in the shortest interval by using keys pdf
virtual Double_t GetHistCutoff()
get the cutoff bin height for being considered in the confidence interval
virtual Double_t UpperLimitTailFraction(RooRealVar ¶m)
determine upper limit of the lower confidence interval
virtual RooArgList * GetAxes()
return a list of RooRealVars representing the axes you own the returned RooArgList
virtual Int_t GetNumBurnInSteps()
get the number of steps in the chain to discard as burn-in,
virtual RooRealVar * GetNLLVar() const
Get a clone of the NLL variable from the markov chain.
virtual const MarkovChain * GetChain()
Get the markov chain on which this interval is based You do not own the returned MarkovChain*.
virtual Double_t GetKeysPdfCutoff()
get the cutoff RooNDKeysPdf value for being considered in the confidence interval
virtual Double_t LowerLimitTailFraction(RooRealVar ¶m)
determine lower limit of the lower confidence interval
virtual RooProduct * GetPosteriorKeysProduct()
Get a clone of the (keyspdf * heaviside) product of the posterior.
virtual Double_t UpperLimitByHist(RooRealVar ¶m)
determine upper limit using histogram
virtual Double_t LowerLimitByHist(RooRealVar ¶m)
determine lower limit using histogram
virtual RooNDKeysPdf * GetPosteriorKeysPdf()
Get a clone of the keys pdf of the posterior.
virtual Int_t GetDimension() const
Get the number of parameters of interest in this interval.
Double_t GetKeysMax()
Determine the approximate maximum value of the Keys PDF.
virtual RooArgSet * GetParameters() const
return a set containing the parameters of this interval the caller owns the returned RooArgSet*
Stores the steps in a Markov Chain of points.
virtual Double_t Weight() const
get the weight of the current (last indexed) entry
virtual Double_t NLL(Int_t i) const
get the NLL value of entry at position i
virtual const RooArgSet * Get(Int_t i) const
get the entry at position i
virtual Int_t Size() const
get the number of steps in the chain
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void Set(Int_t nbins, Double_t xmin, Double_t xmax)
Initialize axis with fix bins.
A TGraph is an object made of two arrays X and Y with npoints each.
virtual void SetTitle(const char *title="")
Change (i.e.
virtual void Draw(Option_t *chopt="")
Draw this graph with its current attributes.
TAxis * GetXaxis() const
Get x axis of the graph.
TAxis * GetYaxis() const
Get y axis of the graph.
1-D histogram with a float per channel (see TH1 documentation)}
virtual void SetTitle(const char *title)
See GetStatOverflows for more information.
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
TObject * Clone(const char *newname=0) const
Make a complete copy of the underlying object.
virtual Int_t GetNbinsX() const
virtual void SetBinError(Int_t bin, Double_t error)
Set the bin Error Note that this resets the bin eror option to be of Normal Type and for the non-empt...
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
virtual void SetContour(Int_t nlevels, const Double_t *levels=0)
Set the number and values of contour levels.
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
virtual void Draw(Option_t *option="")
Draw this histogram with options.
virtual Int_t GetMaximumBin() const
Return location of bin with maximum value in the range.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
2-D histogram with a float per channel (see TH1 documentation)}
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
const char * Data() const
TString & Append(const char *cs)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
RooCmdArg Scaling(Bool_t flag)
RooCmdArg YVar(const RooAbsRealLValue &var, const RooCmdArg &arg=RooCmdArg::none())
RooCmdArg DrawOption(const char *opt)
RooCmdArg FillColor(Color_t color)
RooCmdArg Range(const char *rangeName, Bool_t adjustNorm=kTRUE)
RooCmdArg Normalization(Double_t scaleFactor)
Namespace for the RooStats classes.