249      fEYlow[i]  = 
h->GetBinErrorLow(i+1);
 
 
  263      Error(
"TGraphAsymmErrors",
"Invalid histogram pointers");
 
  268   std::string 
sname = 
"divide_" + std::string(
pass->GetName()) + 
"_by_" +
 
  269      std::string(
total->GetName());
 
  274   pass->TAttLine::Copy(*
this);
 
  275   pass->TAttFill::Copy(*
this);
 
  276   pass->TAttMarker::Copy(*
this);
 
 
  310      Error(
"TGraphAsymmErrors", 
"Cannot open file: %s, TGraphAsymmErrors is Zombie", 
filename);
 
  325         } 
else if (
ncol < 5) {
 
  347      format_.ReplaceAll(
"%*", 
"0") ;
 
  350         Error(
"TGraphAsymmErrors", 
"Incorrect input format! Allowed format tags are {\"%%lg\",\"%%*lg\" or \"%%*s\"}");
 
  355         Error(
"TGraphAsymmErrors", 
"Incorrect input format! Only %d tag(s) in format whereas at least 2 \"%%lg\" tags are expected!", 
ntokens);
 
  367         Error(
"TGraphAsymmErrors", 
"Incorrect input format! There are %d \"%%lg\" tag(s) in format whereas 2, 3, 4, 5 or 6 are expected!", 
ntokensToBeSaved);
 
  374      char *token = 
nullptr;
 
  378      for (
Int_t k = 0; k < 6; k++)
 
  386            if (
line[
line.size() - 1] == 
char(13)) {  
 
 
  593      Error(
"Divide",
"one of the passed pointers is zero");
 
  598   if((
pass->GetDimension() > 1) || (
total->GetDimension() > 1)) {
 
  599      Error(
"Divide",
"passed histograms are not one-dimensional");
 
  610   if (
pass->GetSumw2()->fN > 0) {
 
  611      for (
int i = 0; i < 
pass->GetNcells(); ++i) {
 
  625   if (
total->GetSumw2()->fN > 0) {
 
  626      for (
int i = 0; i < 
total->GetNcells(); ++i) {
 
  662   if(
option.Contains(
"v")) {
 
  663      option.ReplaceAll(
"v",
"");
 
  666         Info(
"Divide",
"weight will be considered in the Histogram Ratio");
 
  671   if(
option.Contains(
"cl=")) {
 
  675      if((level > 0) && (level < 1))
 
  678         Warning(
"Divide",
"given confidence level %.3lf is invalid",level);
 
  679      option.ReplaceAll(
"cl=",
"");
 
  687   if (
option.Contains(
"b(")) {
 
  694         Warning(
"Divide", 
"given shape parameter for alpha %.2lf is invalid", 
a);
 
  698         Warning(
"Divide", 
"given shape parameter for beta %.2lf is invalid", 
b);
 
  699      option.ReplaceAll(
"b(", 
"");
 
  706      if (
option.Contains(
"mode")) {
 
  708         option.ReplaceAll(
"mode", 
"");
 
  715   else if (
option.Contains(
"n")) {
 
  716      option.ReplaceAll(
"n", 
"");
 
  720   else if (
option.Contains(
"cp")) {
 
  721      option.ReplaceAll(
"cp", 
"");
 
  725   else if (
option.Contains(
"w")) {
 
  726      option.ReplaceAll(
"w", 
"");
 
  730   else if (
option.Contains(
"ac")) {
 
  731      option.ReplaceAll(
"ac", 
"");
 
  735   else if (
option.Contains(
"fc")) {
 
  736      option.ReplaceAll(
"fc", 
"");
 
  740   else if (
option.Contains(
"midp")) {
 
  741      option.ReplaceAll(
"midp", 
"");
 
  747   if (
option.Contains(
"pois")) {
 
  749      option.ReplaceAll(
"pois", 
"");
 
  752   if (
option.Contains(
"e0")) {
 
  754      option.ReplaceAll(
"e0", 
"");
 
  760      Warning(
"Divide", 
"Histograms have weights: only Normal or Bayesian error calculation is supported");
 
  761      Info(
"Divide", 
"Using now the Normal approximation for weighted histograms");
 
  765      if (
pass->GetDimension() != 
total->GetDimension()) {
 
  766         Error(
"Divide", 
"passed histograms are not of the same dimension");
 
  771         Error(
"Divide", 
"passed histograms are not consistent");
 
  777         Error(
"Divide", 
"passed histograms are not consistent");
 
  792   double eff, low, 
upper;
 
  819            if (
pw == 0 && 
pw2 == 0)
 
  824            if (
tw == 0 && 
tw2 == 0)
 
  829            if (
pw > 0 && 
tw > 0)
 
  832            else if (
pw == 0 && 
tw > 0)
 
  836            else if (
tw == 0 && 
pw > 0)
 
  859         t = std::round(
total->GetBinContent(
b));
 
  860         p = std::round(
pass->GetBinContent(
b));
 
  876            low = eff; 
upper = eff;
 
  922               if (low < 0) low = 0;
 
  940        low = low/(1. - low);
 
  963      Warning(
"Divide",
"Number of graph points is different than histogram bins - %d points have been skipped",nbins-
npoint);
 
  967      Info(
"Divide",
"made a graph with %d points from %d bins",
npoint,nbins);
 
  968      Info(
"Divide",
"used confidence level: %.2lf\n",
conf);
 
  970         Info(
"Divide",
"used prior probability ~ beta(%.2lf,%.2lf)",alpha,beta);
 
 
 1080   if (
g->GetN() == 0) 
return kFALSE;
 
 1086   if (
exl == 
nullptr || 
exh == 
nullptr || 
eyl == 
nullptr || 
eyh == 
nullptr) {
 
 1088         Warning(
"DoMerge",
"Merging a %s is not compatible with a TGraphAsymmErrors - errors will be ignored",
g->IsA()->GetName());
 
 1091   for (
Int_t i = 0 ; i < 
g->GetN(); i++) {
 
 
 1204               "Cannot merge - an object which doesn't inherit from TGraph found in the list");
 
 1208      int n1 = 
n0+
g->GetN();
 
 1216      for (
Int_t i = 0 ; i < 
g->GetN(); i++) {
 
 
 1233      printf(
"x[%d]=%g, y[%d]=%g, exl[%d]=%g, exh[%d]=%g, eyl[%d]=%g, eyh[%d]=%g\n" 
 1234         ,i,
fX[i],i,
fY[i],i,
fEXlow[i],i,
fEXhigh[i],i,
fEYlow[i],i,
fEYhigh[i]);
 
 
 1252                            TString::Format(
"%d, %s.data(), %s.data(), %s.data(), %s.data(), %s.data(), %s.data()",
 
 
 1295      Error(
"SetPointError", 
"Cannot be used without gPad, requires last mouse position");
 
 1311   if (
ipoint == -2) 
return;
 
 
 1399   if (
b.IsReading()) {
 
 
 1470                 [begin = low, &
sorting_indices, 
this]() 
mutable { return fEXlow[sorting_indices[begin++]]; });
 
 1472                 [begin = low, &
sorting_indices, 
this]() 
mutable { return fEXhigh[sorting_indices[begin++]]; });
 
 1474                 [begin = low, &
sorting_indices, 
this]() 
mutable { return fEYlow[sorting_indices[begin++]]; });
 
 1476                 [begin = low, &
sorting_indices, 
this]() 
mutable { return fEYhigh[sorting_indices[begin++]]; });
 
 
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
 
bool Bool_t
Boolean (0=false, 1=true) (bool)
 
short Version_t
Class version identifier (short)
 
float Float_t
Float 4 bytes (float)
 
double Double_t
Double 8 bytes.
 
const char Option_t
Option string (const char)
 
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
 
static unsigned int total
 
winID h TVirtualViewer3D TVirtualGLPainter p
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t np
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t format
 
R__EXTERN TStyle * gStyle
 
R__EXTERN TSystem * gSystem
 
const_iterator begin() const
 
const_iterator end() const
 
Buffer base class used for serializing objects.
 
Collection abstract base class.
 
static Double_t BetaMode(Double_t alpha, Double_t beta)
Compute the mode of the beta distribution.
 
static Bool_t BetaShortestInterval(Double_t level, Double_t alpha, Double_t beta, Double_t &lower, Double_t &upper)
Calculates the boundaries for a shortest confidence interval for a Beta distribution.
 
static Double_t BetaMean(Double_t alpha, Double_t beta)
Compute the mean (average) of the beta distribution.
 
static Double_t AgrestiCoull(Double_t total, Double_t passed, Double_t level, Bool_t bUpper)
Calculates the boundaries for the frequentist Agresti-Coull interval.
 
static Double_t FeldmanCousins(Double_t total, Double_t passed, Double_t level, Bool_t bUpper)
Calculates the boundaries for the frequentist Feldman-Cousins interval.
 
static Bool_t CheckBinning(const TH1 &pass, const TH1 &total)
Checks binning for each axis.
 
static Double_t BetaCentralInterval(Double_t level, Double_t alpha, Double_t beta, Bool_t bUpper)
Calculates the boundaries for a central confidence interval for a Beta distribution.
 
static Double_t MidPInterval(Double_t total, Double_t passed, Double_t level, Bool_t bUpper)
Calculates the boundaries using the mid-P binomial interval (Lancaster method) from B.
 
static Double_t Normal(Double_t total, Double_t passed, Double_t level, Bool_t bUpper)
Returns the confidence limits for the efficiency supposing that the efficiency follows a normal distr...
 
static Double_t Wilson(Double_t total, Double_t passed, Double_t level, Bool_t bUpper)
Calculates the boundaries for the frequentist Wilson interval.
 
static Bool_t CheckConsistency(const TH1 &pass, const TH1 &total, Option_t *opt="")
Checks the consistence of the given histograms.
 
static Double_t ClopperPearson(Double_t total, Double_t passed, Double_t level, Bool_t bUpper)
Calculates the boundaries for the frequentist Clopper-Pearson interval.
 
TGraph with asymmetric error bars.
 
Double_t * GetEXlow() const override
 
virtual void SetPointEYlow(Int_t i, Double_t eyl)
Set EYlow for point i.
 
Double_t * fEXhigh
[fNpoints] array of X high errors
 
Double_t GetErrorY(Int_t bin) const override
Returns the combined error along Y at point i by computing the average of the lower and upper varianc...
 
void FillZero(Int_t begin, Int_t end, Bool_t from_ctor=kTRUE) override
Set zero values for point arrays in the range [begin, end]
 
virtual void Divide(const TH1 *pass, const TH1 *total, Option_t *opt="cp")
Fill this TGraphAsymmErrors by dividing two 1-dimensional histograms pass/total.
 
Bool_t CtorAllocate()
Should be called from ctors after fNpoints has been set.
 
virtual void SetPointError(Double_t exl, Double_t exh, Double_t eyl, Double_t eyh)
Set ex and ey values for point pointed by the mouse.
 
Double_t GetErrorXhigh(Int_t i) const override
Get high error on X.
 
Double_t * fEYhigh
[fNpoints] array of Y high errors
 
Bool_t CopyPoints(Double_t **arrays, Int_t ibegin, Int_t iend, Int_t obegin) override
Copy errors from fE*** to arrays[***] or to f*** Copy points.
 
virtual void AddPointError(Double_t x, Double_t y, Double_t exl=0., Double_t exh=0., Double_t eyl=0., Double_t eyh=0.)
Add a point with asymmetric errorbars to the graph.
 
void ComputeRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const override
Compute Range.
 
virtual void SetPointEXlow(Int_t i, Double_t exl)
Set EXlow for point i.
 
void Streamer(TBuffer &) override
Stream an object of class TGraphAsymmErrors.
 
virtual void SetPointEYhigh(Int_t i, Double_t eyh)
Set EYhigh for point i.
 
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
 
virtual void BayesDivide(const TH1 *pass, const TH1 *total, Option_t *opt="")
This function is only kept for backward compatibility.
 
Double_t * GetEYhigh() const override
 
void Print(Option_t *chopt="") const override
Print graph and errors values.
 
Double_t GetErrorYhigh(Int_t i) const override
Get high error on Y.
 
Int_t Merge(TCollection *list) override
Adds all graphs with asymmetric errors from the collection to this graph.
 
Double_t GetErrorXlow(Int_t i) const override
Get low error on X.
 
Double_t * fEYlow
[fNpoints] array of Y low errors
 
void UpdateArrays(const std::vector< Int_t > &sorting_indices, Int_t numSortedPoints, Int_t low) override
Update the fX, fY, fEXlow, fEXhigh, fEYlow and fEYhigh arrays with the sorted values.
 
void SwapPoints(Int_t pos1, Int_t pos2) override
Swap points.
 
Double_t * GetEXhigh() const override
 
Double_t * fEXlow
[fNpoints] array of X low errors
 
void Apply(TF1 *f) override
Apply a function to all data points .
 
Double_t ** Allocate(Int_t size) override
Allocate internal data structures for size points.
 
Double_t * GetEYlow() const override
 
Bool_t DoMerge(const TGraph *g) override
Protected function to perform the merge operation of a graph with asymmetric errors.
 
void CopyAndRelease(Double_t **newarrays, Int_t ibegin, Int_t iend, Int_t obegin) override
Copy and release.
 
TClass * IsA() const override
 
virtual void SetPointEXhigh(Int_t i, Double_t exh)
Set EXhigh for point i.
 
Double_t GetErrorYlow(Int_t i) const override
Get low error on Y.
 
Double_t GetErrorX(Int_t bin) const override
Returns the combined error along X at point i by computing the average of the lower and upper varianc...
 
TGraphAsymmErrors()
TGraphAsymmErrors default constructor.
 
TGraphAsymmErrors & operator=(const TGraphAsymmErrors &gr)
TGraphAsymmErrors assignment operator.
 
~TGraphAsymmErrors() override
TGraphAsymmErrors default destructor.
 
void Scale(Double_t c1=1., Option_t *option="y") override
Multiply the values and errors of a TGraphAsymmErrors by a constant c1.
 
static Int_t CalculateScanfFields(const char *fmt)
Calculate scan fields.
 
A TGraph is an object made of two arrays X and Y with npoints each.
 
virtual void AddPoint(Double_t x, Double_t y)
Append a new point to the graph.
 
Int_t fNpoints
Number of points <= fMaxSize.
 
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set x and y values for point number i.
 
Int_t fMaxSize
!Current dimension of arrays fX and fY
 
TH1F * fHistogram
Pointer to histogram used for drawing axis.
 
virtual void UpdateArrays(const std::vector< Int_t > &sorting_indices, Int_t numSortedPoints, Int_t low)
Update the fX and fY arrays with the sorted values.
 
Double_t * fY
[fNpoints] array of Y points
 
Bool_t CtorAllocate()
In constructors set fNpoints than call this method.
 
virtual void ComputeRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const
Compute the x/y range of the points in this graph.
 
Double_t ** AllocateArrays(Int_t Narrays, Int_t arraySize)
Allocate arrays.
 
virtual void Scale(Double_t c1=1., Option_t *option="y")
Multiply the values of a TGraph by a constant c1.
 
static void SwapValues(Double_t *arr, Int_t pos1, Int_t pos2)
Swap values.
 
void Streamer(TBuffer &) override
Stream an object of class TGraph.
 
virtual Bool_t DoMerge(const TGraph *g)
protected function to perform the merge operation of a graph
 
void SetName(const char *name="") override
Set graph name.
 
virtual void SwapPoints(Int_t pos1, Int_t pos2)
Swap points.
 
virtual void FillZero(Int_t begin, Int_t end, Bool_t from_ctor=kTRUE)
Set zero values for point arrays in the range [begin, end) Should be redefined in descendant classes.
 
void SaveHistogramAndFunctions(std::ostream &out, const char *varname, Option_t *option)
Save histogram and list of functions of TGraph as C++ statement Used in all TGraph-derived classes.
 
Double_t * fX
[fNpoints] array of X points
 
void SetTitle(const char *title="") override
Change (i.e.
 
virtual void Set(Int_t n)
Set number of points in the graph Existing coordinates are preserved New coordinates above fNpoints a...
 
virtual Int_t GetPoint(Int_t i, Double_t &x, Double_t &y) const
Get x and y values for point number i.
 
virtual Bool_t CopyPoints(Double_t **newarrays, Int_t ibegin, Int_t iend, Int_t obegin)
Copy points from fX and fY to arrays[0] and arrays[1] or to fX and fY if arrays == 0 and ibegin !...
 
TGraph & operator=(const TGraph &)
Equal operator for this graph.
 
TH1 is the base class of all histogram classes in ROOT.
 
Mother of all ROOT objects.
 
static TString SavePrimitiveVector(std::ostream &out, const char *prefix, Int_t len, Double_t *arr, Bool_t empty_line=kFALSE)
Save array in the output stream "out" as vector.
 
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
 
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
 
static void SavePrimitiveConstructor(std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
Save object constructor in the output stream "out".
 
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
 
void ToLower()
Change string to lower-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
 
Float_t GetErrorX() const
 
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
 
double normal_quantile_c(double z, double sigma)
Inverse ( ) of the cumulative distribution function of the upper tail of the normal (Gaussian) distri...
 
Int_t Finite(Double_t x)
Check if it is finite with a mask in order to be consistent in presence of fast math.
 
Double_t Sqrt(Double_t x)
Returns the square root of x.
 
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
 
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.