82 enum Mode_t { Default, CLb, CLsPlusb, CLs };
83 Mode_t type = Default;
84 if (option.
Contains(
"CLB")) type = CLb;
85 else if (option.
Contains(
"CLS+B") || option.
Contains(
"CLSPLUSB")) type = CLsPlusb;
86 else if (option.
Contains(
"CLS" )) type = CLs;
88 const int nEntries =
fResults->ArraySize();
91 std::vector<unsigned int> index(nEntries);
95 std::vector<double> xArray;
96 std::vector<double> yArray;
97 std::vector<double> yErrArray;
99 for (
int i=0; i<nEntries; i++) {
102 if (type == Default) {
103 CLVal =
fResults->GetYValue(index[i]);
104 CLErr =
fResults->GetYError(index[i]);
105 }
else if (type == CLb) {
107 CLErr =
fResults->CLbError(index[i]);
108 }
else if (type == CLsPlusb) {
109 CLVal =
fResults->CLsplusb(index[i]);
110 CLErr =
fResults->CLsplusbError(index[i]);
111 }
else if (type == CLs) {
113 CLErr =
fResults->CLsError(index[i]);
116 if (CLVal < 0. || !std::isfinite(CLVal)) {
117 Warning(
"HypoTestInverterPlot::MakePlot",
"Got a confidence level of %f at x=%f (failed fit?). Skipping this point.", CLVal,
fResults->GetXValue(index[i]));
121 yArray.push_back(CLVal);
122 yErrArray.push_back(CLErr);
123 xArray.push_back(
fResults->GetXValue(index[i]));
128 if (type == CLb ) pValueName =
"CLb";
129 if (type == CLsPlusb || (type == Default && !
fResults->fUseCLs) ) pValueName =
"CLs+b";
149 const int nEntries =
fResults->ArraySize();
150 bool doFirstBand = (nsig1 > 0);
151 bool doSecondBand = (nsig2 > nsig1);
153 nsig1 = std::abs(nsig1);
154 nsig2 = std::abs(nsig2);
157 std::vector<unsigned int> index(nEntries);
163 if (!
fResults->fUseCLs) pValueName =
"CLs+b";
169 if (nsig1 -
int(nsig1) < 0.01) {
177 if (nsig2 -
int(nsig2) < 0.01) {
191 bool resultIsAsymptotic = ( !
fResults->GetNullTestStatDist(0) && !
fResults->GetAltTestStatDist(0) );
193 for (
int j=0; j<nEntries; ++j) {
199 if (resultIsAsymptotic) {
200 double maxSigma =
fResults->fgAsymptoticMaxSigma;
201 double dsig = 2* maxSigma/ (values.size() -1) ;
214 double *
x =
const_cast<double *
>(&values[0]);
278 bool drawAxis = !option.
Contains(
"SAME");
281 bool drawCLb = option.
Contains(
"CLB");
282 bool draw2CL = option.
Contains(
"2CL");
295 else gobs->
Draw(
"PL");
303 if (drawAxis && !drawObs) {
315 double alpha = 1.-
fResults->ConfidenceLevel();
362 double verticalSize = (gexp || draw2CL || drawCLb ) ? 0.3 : 0.15;
363 double y1 = y0 + verticalSize;
365 if (gobs)
l->AddEntry(gobs,
"",
"PEL");
366 if (gclsb)
l->AddEntry(gclsb,
"",
"PEL");
367 if (gcls)
l->AddEntry(gcls,
"",
"PEL");
368 if (gclb)
l->AddEntry(gclb,
"",
"PEL");
372 for (
int i = ngraphs-1; i>=0; --i) {
375 if (i == ngraphs-1) lopt =
"L";
376 if (obj)
l->AddEntry(obj,
"",lopt);
int Int_t
Signed integer 4 bytes (int).
const char Option_t
Option string (const char).
Common abstract base class for objects that represent a value and a "shape" in RooFit.
HypoTestInverterResult * fResults
void Draw(Option_t *opt="") override
Draw the scan result in the current canvas Possible options: "" (default): draw observed + expected w...
SamplingDistPlot * MakeTestStatPlot(int index, int type=0, int nbins=100)
Plot the test statistic distributions.
~HypoTestInverterPlot() override
destructor
HypoTestInverterPlot(HypoTestInverterResult *results)
constructor
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...
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 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 > & GetSamplingDistribution() const
Get test statistics values.
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 SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
virtual void SetPointEYhigh(Int_t i, Double_t eyh)
virtual void SetPointEYlow(Int_t i, Double_t eyl)
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
virtual TH1F * GetHistogram() const
void SetName(const char *name="") override
Set the name of the TNamed.
void Draw(Option_t *chopt="") override
Default Draw method for all objects.
void SetTitle(const char *title="") override
Set the title of the TNamed.
void SetTitle(const char *title) override
Change/set the title.
Use the TLine constructor to create a simple line.
TObject * At(Int_t idx) const override
Returns the object at position idx. Returns 0 if idx is out of range.
virtual void Add(TGraph *graph, Option_t *chopt="")
TList * GetListOfGraphs() const
void Draw(Option_t *chopt="") override
Default Draw method for all objects.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
TObject()
TObject constructor.
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)
Sort the n1 elements of the Short_t array defined by its iterators.
Double_t Floor(Double_t x)
Rounds x downward, returning the largest integral value that is not greater than 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=nullptr, Int_t type=7)