66 TNamed( TString(name), TString(title) ),
85 if (option.Contains(
"CLB")) type = 1;
86 else if (option.Contains(
"CLS+B") || option.Contains(
"CLSPLUSB")) type = 2;
87 else if (option.Contains(
"CLS" )) type = 3;
92 std::vector<unsigned int> index(nEntries);
96 std::vector<Double_t> xArray(nEntries);
97 std::vector<Double_t> yArray(nEntries);
98 std::vector<Double_t> yErrArray(nEntries);
99 for (
int i=0; i<nEntries; i++) {
104 }
else if (type == 1) {
107 }
else if (type == 2) {
110 }
else if (type == 3) {
117 TString pValueName =
"CLs";
118 if (type == 1 ) pValueName =
"CLb";
119 if (type == 2 || (type == 0 && !
fResults->
fUseCLs) ) pValueName =
"CLs+b";
120 TString
name = pValueName + TString(
"_observed");
121 TString title = TString(
"Observed ") + pValueName;
140 bool doFirstBand = (nsig1 > 0);
141 bool doSecondBand = (nsig2 > nsig1);
143 nsig1 = std::abs(nsig1);
144 nsig2 = std::abs(nsig2);
147 std::vector<unsigned int> index(nEntries);
152 TString pValueName =
"CLs";
159 if (nsig1 -
int(nsig1) < 0.01)
166 if (nsig2 -
int(nsig2) < 0.01)
181 for (
int j=0; j<nEntries; ++j) {
187 if (resultIsAsymptotic) {
189 double dsig = 2* maxSigma/ (values.size() -1) ;
190 int i0 = (int)
TMath::Floor ( ( -nsig2 + maxSigma )/dsig + 0.5);
191 int i1 = (int)
TMath::Floor ( (-nsig1 + maxSigma )/dsig + 0.5);
193 int i3 = (int)
TMath::Floor ( ( nsig1 + maxSigma)/dsig + 0.5);
194 int i4 = (int)
TMath::Floor ( ( nsig2 + maxSigma)/dsig + 0.5);
202 double *
x =
const_cast<double *
>(&values[0]);
223 TString title = TString(
"Expected ") +
GetTitle();
266 bool drawAxis = !option.Contains(
"SAME");
267 bool drawObs = option.Contains(
"OBS") || !option.Contains(
"EXP");
268 bool drawExp = option.Contains(
"EXP") || !option.Contains(
"OBS");
269 bool drawCLb = option.Contains(
"CLB");
270 bool draw2CL = option.Contains(
"2CL");
283 else gobs->
Draw(
"PL");
291 if (drawAxis && !drawObs) {
350 double verticalSize = (gexp || draw2CL || drawCLb ) ? 0.3 : 0.15;
351 double y1 = y0 + verticalSize;
353 if (gobs) l->
AddEntry(gobs,
"",
"PEL");
354 if (gclsb) l->
AddEntry(gclsb,
"",
"PEL");
355 if (gcls) l->
AddEntry(gcls,
"",
"PEL");
356 if (gclb) l->
AddEntry(gclb,
"",
"PEL");
360 for (
int i = ngraphs-1; i>=0; --i) {
363 if (i == ngraphs-1) lopt =
"L";
virtual const char * GetName() const
Returns name of object.
std::string GetName(const std::string &scope_name)
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
const std::vector< Double_t > & GetSamplingDistribution() const
Get test statistics values.
SamplingDistribution * GetSignalAndBackgroundTestStatDist(int index) const
get the signal and background test statistic distribution
Double_t Floor(Double_t x)
This class displays a legend box (TPaveText) containing several legend entries.
SamplingDistribution * GetExpectedPValueDist(int index) const
return expected distribution of p-values (Cls or Clsplusb)
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
double GetXValue(int index) const
function to return the value of the parameter of interest for the i^th entry in the results ...
HypoTestResult is a base class for results from hypothesis tests.
A TMultiGraph is a collection of TGraph (or derived) objects.
TAxis * GetYaxis() const
Get y axis of the graph.
Double_t AddSamplingDistribution(const SamplingDistribution *samplingDist, Option_t *drawOptions="NORMALIZE HIST")
adds the sampling distribution and returns the scale factor
This class provides the plots for the result of a study performed with any of the HypoTestCalculatorG...
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
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...
virtual void SetTitle(const char *title="")
Set graph title.
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...
virtual void Draw(Option_t *chopt="")
Draw this graph with its current attributes.
HypoTestInverterPlot(HypoTestInverterResult *results)
constructor from a HypoTestInverterResult class name and title are taken from the result class ...
HypoTestInverterResult * fResults
TGraph with asymmetric error bars.
static const double x2[5]
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
double CLsError(int index) const
return the observed CLb value for the i-th entry
The TNamed class is the base class for all named ROOT classes.
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 Parameters: x -the data sample n ...
double normal_cdf(double x, double sigma=1, double x0=0)
Cumulative distribution function of the normal (Gaussian) distribution (lower tail).
virtual void SetPointEYlow(Int_t i, Double_t eyl)
Set EYlow for point i.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
double CLsplusb(int index) const
return the observed CLsplusb value for the i-th entry
virtual void Draw(Option_t *chopt="")
Draw this multigraph with its current attributes.
double CLs(int index) const
return the observed CLb value for the i-th entry
virtual void SetLineColor(Color_t lcolor)
Set the line color.
SamplingDistPlot * MakeTestStatPlot(int index, int type=0, int nbins=100)
Plot the test statistic distributions type =0 null and alt type = 1 only null (S+B) type = 2 only alt...
TH1F * GetHistogram() const
Returns a pointer to the histogram used to draw the axis.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
SamplingDistribution * GetBackgroundTestStatDist(int index) const
get the background test statistic distribution
TGraphErrors * MakePlot(Option_t *opt="")
return a TGraphErrors with the obtained observed p-values resultinf from the scan By default (Option ...
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
RooAbsArg * first() const
virtual Double_t ConfidenceLevel() const
return confidence level
double CLbError(int index) const
return the observed CLb value for the i-th entry
double CLb(int index) const
return the observed CLb value for the i-th entry
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
This class simply holds a sampling distribution of some test statistic.
TAxis * GetXaxis() const
Get x axis of the graph.
static double fgAsymptoticMaxSigma
Namespace for the RooStats classes.
static const double x1[5]
TH1F * GetHistogram() const
Returns a pointer to the histogram used to draw the axis Takes into account the two following cases...
HypoTestInverterResult class holds the array of hypothesis test results and compute a confidence inte...
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
Class to plot an HypoTestInverterResult, result of the HypoTestInverter calculator.
~HypoTestInverterPlot()
destructor
double GetYValue(int index) const
function to return the value of the confidence level for the i^th entry in the results ...
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
This class provides simple and straightforward utilities to plot SamplingDistribution objects...
Mother of all ROOT objects.
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
TList * GetListOfGraphs() const
void Draw(Option_t *opt="")
Draw the scan result in the current canvas Possible options: "" (default): draw observed + expected w...
SamplingDistribution * GetNullTestStatDist(int index) const
same in terms of alt and null
A Graph is a graphics object made of two arrays X and Y with npoints each.
A TGraphErrors is a TGraph with error bars.
virtual void SetTitle(const char *title)
Change (i.e.
virtual void Add(TGraph *graph, Option_t *chopt="")
Add a new graph to the list of graphs.
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
virtual Int_t GetSize() const
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
double CLsplusbError(int index) const
return the observed CLsplusb value for the i-th entry
int ArraySize() const
number of entries in the results array
virtual void SetPointEYhigh(Int_t i, Double_t eyh)
Set EYhigh for point i.
virtual const char * GetTitle() const
Returns title of object.
SamplingDistribution * GetAltTestStatDist(int index) const
void SortItr(Iterator first, Iterator last, IndexIterator index, Bool_t down=kTRUE)
std::vector< double > fXValues
number of points used to build expected p-values