55 TNamed( results->GetName(), results->GetTitle() ),
86 enum Mode_t { Default, CLb, CLsPlusb, CLs };
87 Mode_t
type = Default;
95 std::vector<unsigned int> index(nEntries);
99 std::vector<Double_t> xArray;
100 std::vector<Double_t> yArray;
101 std::vector<Double_t> yErrArray;
103 for (
int i=0; i<nEntries; i++) {
104 double CLVal = 0., CLErr = 0.;
105 if (
type == Default) {
108 }
else if (
type == CLb) {
111 }
else if (
type == CLsPlusb) {
114 }
else if (
type == CLs) {
119 if (CLVal < 0. || !std::isfinite(CLVal)) {
120 Warning(
"HypoTestInverterPlot::MakePlot",
"Got a confidence level of %f at x=%f (failed fit?). Skipping this point.", CLVal,
fResults->
GetXValue(index[i]));
124 yArray.push_back(CLVal);
125 yErrArray.push_back(CLErr);
131 if (
type == CLb ) pValueName =
"CLb";
136 graph->SetTitle(title);
137 graph->SetMarkerStyle(20);
138 graph->SetLineWidth(2);
153 bool doFirstBand = (nsig1 > 0);
154 bool doSecondBand = (nsig2 > nsig1);
156 nsig1 = std::abs(nsig1);
157 nsig2 = std::abs(nsig2);
160 std::vector<unsigned int> index(nEntries);
172 if (nsig1 -
int(nsig1) < 0.01)
179 if (nsig2 -
int(nsig2) < 0.01)
194 for (
int j=0; j<nEntries; ++j) {
200 if (resultIsAsymptotic) {
202 double dsig = 2* maxSigma/ (values.size() -1) ;
215 double *
x =
const_cast<double *
>(&values[0]);
279 bool drawAxis = !option.
Contains(
"SAME");
282 bool drawCLb = option.
Contains(
"CLB");
283 bool draw2CL = option.
Contains(
"2CL");
296 else gobs->
Draw(
"PL");
304 if (drawAxis && !drawObs) {
363 double verticalSize = (gexp || draw2CL || drawCLb ) ? 0.3 : 0.15;
364 double y1 = y0 + verticalSize;
366 if (gobs)
l->AddEntry(gobs,
"",
"PEL");
367 if (gclsb)
l->AddEntry(gclsb,
"",
"PEL");
368 if (gcls)
l->AddEntry(gcls,
"",
"PEL");
369 if (gclb)
l->AddEntry(gclb,
"",
"PEL");
373 for (
int i = ngraphs-1; i>=0; --i) {
376 if (i == ngraphs-1) lopt =
"L";
377 if (obj)
l->AddEntry(obj,
"",lopt);
static const double x2[5]
static const double x1[5]
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
RooAbsArg * first() const
Class to plot a HypoTestInverterResult, the output of the HypoTestInverter calculator.
void Draw(Option_t *opt="")
Draw the scan result in the current canvas Possible options: "" (default): draw observed + expected w...
HypoTestInverterResult * fResults
SamplingDistPlot * MakeTestStatPlot(int index, int type=0, int nbins=100)
Plot the test statistic distributions.
~HypoTestInverterPlot()
destructor
HypoTestInverterPlot(HypoTestInverterResult *results)
constructor from a HypoTestInverterResult class name and title are taken from the result class
TMultiGraph * MakeExpectedPlot(double sig1=1, double sig2=2)
Make the expected plot and the bands nsig1 and nsig2 indicates the n-sigma value for the bands if nsi...
TGraphErrors * MakePlot(Option_t *opt="")
return a TGraphErrors with the obtained observed p-values resultinf from the scan By default (Option ...
HypoTestInverterResult class holds the array of hypothesis test results and compute a confidence inte...
double GetYValue(int index) const
function to return the value of the confidence level for the i^th entry in the results
SamplingDistribution * GetSignalAndBackgroundTestStatDist(int index) const
get the signal and background test statistic distribution
int ArraySize() const
number of entries in the results array
std::vector< double > fXValues
number of points used to build expected p-values
double CLsplusbError(int index) const
return the observed CLsplusb value for the i-th entry
double CLsError(int index) const
return the observed CLb value for the i-th entry
double CLbError(int index) const
return the observed CLb value for the i-th entry
double GetXValue(int index) const
function to return the value of the parameter of interest for the i^th entry in the results
static double fgAsymptoticMaxSigma
double CLs(int index) const
return the observed CLb value for the i-th entry
double GetYError(int index) const
function to return the estimated error on the value of the confidence level for the i^th entry in the...
double CLb(int index) const
return the observed CLb value for the i-th entry
SamplingDistribution * GetExpectedPValueDist(int index) const
return expected distribution of p-values (Cls or Clsplusb)
double CLsplusb(int index) const
return the observed CLsplusb value for the i-th entry
SamplingDistribution * GetNullTestStatDist(int index) const
same in terms of alt and null
SamplingDistribution * GetAltTestStatDist(int index) const
SamplingDistribution * GetBackgroundTestStatDist(int index) const
get the background test statistic distribution
This class provides the plots for the result of a study performed with any of the HypoTestCalculatorG...
HypoTestResult is a base class for results from hypothesis tests.
This class provides simple and straightforward utilities to plot SamplingDistribution objects.
Double_t AddSamplingDistribution(const SamplingDistribution *samplingDist, Option_t *drawOptions="NORMALIZE HIST")
adds the sampling distribution and returns the scale factor
This class simply holds a sampling distribution of some test statistic.
const std::vector< Double_t > & GetSamplingDistribution() const
Get test statistics values.
virtual Double_t ConfidenceLevel() const
return confidence level
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetLineStyle(Style_t lstyle)
Set the line 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 Int_t GetSize() const
Return the capacity of the collection, i.e.
TGraph with asymmetric error bars.
virtual void SetPointEYlow(Int_t i, Double_t eyl)
Set EYlow for point i.
virtual void SetPointEYhigh(Int_t i, Double_t eyh)
Set EYhigh for point i.
A TGraphErrors is a TGraph with error bars.
A TGraph is an object made of two arrays X and Y with npoints each.
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
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.
TH1F * GetHistogram() const
Returns a pointer to the histogram used to draw the axis Takes into account the two following cases.
virtual void SetTitle(const char *title)
See GetStatOverflows for more information.
This class displays a legend box (TPaveText) containing several legend entries.
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
A TMultiGraph is a collection of TGraph (or derived) objects.
TList * GetListOfGraphs() const
TH1F * GetHistogram()
Returns a pointer to the histogram used to draw the axis.
virtual void Draw(Option_t *chopt="")
Draw this multigraph with its current attributes.
The TNamed class is the base class for all named ROOT classes.
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.
Mother of all ROOT objects.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
const char * Data() const
void ToUpper()
Change string to upper case.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
double normal_cdf(double x, double sigma=1, double x0=0)
Cumulative distribution function of the normal (Gaussian) distribution (lower tail).
Namespace for the RooStats classes.
void SortItr(Iterator first, Iterator last, IndexIterator index, Bool_t down=kTRUE)
Double_t Floor(Double_t x)
void Quantiles(Int_t n, Int_t nprob, Double_t *x, Double_t *quantiles, Double_t *prob, Bool_t isSorted=kTRUE, Int_t *index=0, Int_t type=7)
Computes sample quantiles, corresponding to the given probabilities.