GraphSysErr  0.10-2
A class to hold results with statistical and systematic errors A class to hold results with statistical and systematic errors
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
GraphSysErr Class Reference

This class defines an (X,Y) with any number of error sources. More...

Inheritance diagram for GraphSysErr:
Inheritance graph
[legend]
Collaboration diagram for GraphSysErr:
Collaboration graph
[legend]

Classes

struct  Combiner
 Combining measurements. More...
 
struct  Holder
 Base class to hold systematic errors. More...
 
struct  HolderCommon
 Holder of common errors. More...
 
struct  HolderP2P
 A holder for Point-to-Point systematic errors. More...
 
struct  LinearSigmaCombiner
 A combiner that uses a linear $\sigma$ approximation. More...
 
struct  LinearVarianceCombiner
 A combiner that uses a linear variance approximation. More...
 

Public Types

enum  {
  kDraw = 0x1, kImport = 0x2, kExport = 0x4, kRatio = 0x8,
  kVerbose = 0
}
 
enum  EDrawOption_t {
  kNormal = 0, kNoTick = 1, kArrow = 2, kRect = 3,
  kBox = 4, kFill = 5, kCurve = 6, kHat = 7,
  kBar = 8, kNone = 9, kLine = 10, kConnect = 11
}
 Drawing options. More...
 
enum  EChi2Type { kExperimentExperiment, kExperimentModel, kModelModel, kExperimentTruth }
 Types of $\chi^2$ comparisons. More...
 
enum  ERatioOption {
  kMax = 0x00001, kMin = 0x00002, kCancel = 0x00004, kDenomRel = 0x00008,
  kRatioDefault = kCancel
}
 Options for ratios. More...
 
enum  { kUsedBit = (1 << 18), kOnlyWeightBit = (1 << 19) }
 
typedef TGraphAsymmErrors Graph
 A short-hand type definition. More...
 

Public Member Functions

Bool_t FindYandError (Double_t x, Bool_t cmn, Bool_t stat, Bool_t quad, Bool_t nosqrt, Double_t &y, Double_t &eyl, Double_t &eyh, Double_t &seyl, Double_t &seyh) const
 Find Y value and errors corresponding X. More...
 
Bool_t FindYandError (Double_t x, Bool_t cmn, Bool_t stat, Bool_t quad, Bool_t nosqrt, Double_t &y, Double_t &eyl, Double_t &eyh) const
 Find Y value and errors corresponding X. More...
 
Double_t GetYandError (Int_t i, Bool_t cmn, Bool_t stat, Bool_t quad, Bool_t nosqrt, Double_t &eyl, Double_t &eyh) const
 Get the point value and low and high errors. More...
 
Double_t GetYandError (Int_t i, Bool_t cmn, Bool_t stat, Bool_t quad, Bool_t nosqrt, Double_t &eyl, Double_t &eyh, Double_t &wyl, Double_t &wyh) const
 Get the point value and low and high errors. More...
 
Allocation, dealloction, copy, and assignment
 GraphSysErr ()
 Default CTOR - use only for I/O. More...
 
 GraphSysErr (Int_t n)
 CTOR with number of points. More...
 
 GraphSysErr (const char *name, const char *title, Int_t n=0)
 Constructor with name, title, and optional pre-allocated size. More...
 
 GraphSysErr (const GraphSysErr &other)
 Copy CTOR. More...
 
virtual ~GraphSysErr ()
 DTOR. More...
 
GraphSysErroperator= (const GraphSysErr &other)
 Assignment operator. More...
 
TObject functions
virtual void ls (Option_t *option="") const
 List the content. More...
 
virtual void Print (Option_t *option="R") const
 Print this. More...
 
virtual Bool_t IsFolder () const
 Say that this should be shown as a folder. More...
 
virtual void Browse (TBrowser *b)
 Browse this object. More...
 
Drawing/Fitting
void Draw (Option_t *option="")
 Draw this data. More...
 
TFitResultPtr Fit (TF1 *f1, Option_t *fitOption, Option_t *drawOption, Axis_t min=0, Axis_t max=0)
 Fit a function to the data. More...
 
TFitResultPtr Fit (const char *formula, Option_t *fitOption, Option_t *drawOption, Axis_t min=0, Axis_t max=0)
 Fit a function to the data. More...
 
TMultiGraph * GetMulti (Option_t *option="")
 Get last drawn multigraph or create a new one. More...
 
Declaring systematic errors
UInt_t DefineCommon (const char *title, Bool_t relative, Double_t ey, EDrawOption_t option=kFill)
 Define a common systematic error. More...
 
UInt_t DefineCommon (const char *title, Bool_t relative, Double_t eyl, Double_t eyh, EDrawOption_t option=kRect)
 Define a common systematic error. More...
 
UInt_t DeclarePoint2Point (const char *title, Bool_t relative, EDrawOption_t option=kBar)
 Delcare a point-to-point systematic error. More...
 
void RemoveSysError (Int_t id)
 
UInt_t FindId (const char *title) const
 Find the ID of an error with the given title. More...
 
Int_t GetNSys () const
 
Setting the data and errors
void SetPoint (Int_t i, Double_t x, Double_t y)
 Set the ith data point. More...
 
void SetPointError (Int_t i, Double_t ex)
 Set the X error (bin width) of the ith point. More...
 
void SetPointError (Int_t i, Double_t exl, Double_t exh)
 Set the X error (bin width) of the ith point. More...
 
void SetStatRelative (Bool_t rel)
 Set whether statistical errors should be considered relative. More...
 
Bool_t IsStatRelative () const
 Check if statistical errors are relative. More...
 
void SetStatError (Int_t i, Double_t ey)
 Set the statistical error on the ith data point. More...
 
void SetStatError (Int_t i, Double_t eyl, Double_t eyh)
 
void SetSysError (Int_t id, Double_t eyl, Double_t eyh)
 
void SetSysError (Int_t id, Int_t i, Double_t ex, Double_t ey)
 Set the systematic error identified by id on the ith data point. More...
 
void SetSysError (Int_t id, Int_t i, Double_t exl, Double_t exh, Double_t eyl, Double_t eyh)
 Set the systematic error identified by id on the ith data point. More...
 
Setting drawing options
void SetTitle (const char *name)
 Set the title of the data. More...
 
void SetDataOption (EDrawOption_t opt)
 Set the draw option for the data and statistical errors. More...
 
void SetXTitle (const char *title)
 Set title on X axis. More...
 
void SetYTitle (const char *title)
 Set title on y axis. More...
 
Getting information
Int_t GetN () const
 
Double_t GetX (Int_t p) const
 
Double_t GetErrorXLeft (Int_t p) const
 
Double_t GetErrorXRight (Int_t p) const
 
Double_t GetY (Int_t point) const
 
Double_t GetStatError (Int_t point) const
 
Double_t GetStatErrorUp (Int_t point) const
 
Double_t GetStatErrorDown (Int_t point) const
 
Bool_t IsCommon (Int_t id) const
 
Bool_t IsRelative (Int_t id) const
 Check if an error is relative. More...
 
Double_t GetSysErrorX (Int_t id, Int_t point) const
 
Double_t GetSysErrorY (Int_t id, Int_t point) const
 
Double_t GetSysErrorXLeft (Int_t id, Int_t point) const
 
Double_t GetSysErrorXRight (Int_t id, Int_t point) const
 
Double_t GetSysErrorYUp (Int_t id, Int_t point) const
 
Double_t GetSysErrorYDown (Int_t id, Int_t point) const
 
const char * GetSysTitle (Int_t id) const
 Get title of systematic error. More...
 
Style_t GetSysFillStyle (Int_t id) const
 Get fill style of systematic uncertainty. More...
 
Style_t GetSysLineStyle (Int_t id) const
 Get line style of systematic uncertainty. More...
 
Color_t GetSysFillColor (Int_t id) const
 Get fill color of systematic uncertainty. More...
 
Color_t GetSysLineColor (Int_t id) const
 Get line color of systematic uncertainty. More...
 
Width_t GetSysLineWidth (Int_t id) const
 Get line width of systematic uncertainty. More...
 
const char * GetSumTitle () const
 Get title of summed systematic error. More...
 
UInt_t GetSumOption () const
 
Style_t GetSumFillStyle () const
 Get fill style of sum systematic uncertainty. More...
 
Style_t GetSumLineStyle () const
 Get line style of sum systematic uncertainty. More...
 
Color_t GetSumFillColor () const
 Get fill color of sum systematic uncertainty. More...
 
Color_t GetSumLineColor () const
 Get line color of sum systematic uncertainty. More...
 
Width_t GetSumLineWidth () const
 Get line width of sum systematic uncertainty. More...
 
const char * GetCommonSumTitle () const
 Get title of summed systematic error. More...
 
UInt_t GetCommonSumOption () const
 
Style_t GetCommonSumFillStyle () const
 Get fill style of sum systematic uncertainty. More...
 
Style_t GetCommonSumLineStyle () const
 Get line style of sum systematic uncertainty. More...
 
Color_t GetCommonSumFillColor () const
 Get fill color of sum systematic uncertainty. More...
 
Color_t GetCommonSumLineColor () const
 Get line color of sum systematic uncertainty. More...
 
Width_t GetCommonSumLineWidth () const
 Get line width of sum systematic uncertainty. More...
 
Double_t GetCommonErrorYUp (Int_t id) const
 Get the common systematic error. More...
 
Double_t GetCommonErrorYDown (Int_t id) const
 Get the common systematic error. More...
 
const char * GetXTitle () const
 Get name of X axis. More...
 
const char * GetYTitle () const
 Get name of Y axis. More...
 
void GetMinMax (Option_t *option, Double_t &ymin, Double_t &ymax) const
 Get minimum and maximum. More...
 
void GetMinMax (Option_t *option, Double_t &ymin, Double_t &ymax, Double_t &xmin, Double_t &xmax, Int_t &imin, Int_t &imax) const
 Get minimum and maximum. More...
 
void FindFwhm (Int_t start, Int_t dir, Double_t ymax, Bool_t cmn, Bool_t stat, Bool_t quad, Int_t &i1, Int_t &i2) const
 Find the full-width at half-maximum. More...
 
Double_t FWHM (Double_t &el, Double_t &eh) const
 Calculate the full-width at half-maximum. More...
 
Double_t FWHM (Double_t &el, Double_t &eh, Double_t &xl, Double_t &xh) const
 Calculate the full-width at half-maximum. More...
 
Double_t MeanX (Double_t &error, Bool_t cmn=false, Bool_t stat=true, Bool_t quad=true) const
 Calculate the mean along X. More...
 
Double_t MeanX (Bool_t cmn=false, Bool_t stat=true, Bool_t quad=true) const
 Calculate the mean along X. More...
 
Double_t StandardDeviationX (Double_t &error, Bool_t cmn=false, Bool_t stat=true, Bool_t quad=true) const
 Calculate the standard deviatin along X. More...
 
Double_t StandardDeviationX (Bool_t cmn=false, Bool_t stat=true, Bool_t quad=true) const
 Calculate the standard deviatin along X. More...
 
Double_t StandardDeviationXMean (Double_t mean, Double_t &error, Bool_t cmn=false, Bool_t stat=true, Bool_t quad=true) const
 
void StatisticsX (Double_t &meanX, Double_t &stdDevX, Double_t &n, Bool_t cmn=false, Bool_t stat=true, Bool_t quad=true) const
 Calculates the statistics of X. More...
 
Setting attributes on systematic errors
void SetSysLineColor (Int_t id, Color_t color)
 Set the line color of the systematice error identified by ID. More...
 
void SetSysLineStyle (Int_t id, Style_t style)
 Set the line style of the systematice error identified by ID. More...
 
void SetSysLineWidth (Int_t id, Width_t width)
 Set the line width of the systematice error identified by ID. More...
 
void SetSysFillColor (Int_t id, Color_t color)
 Set the fill color of the systematice error identified by ID. More...
 
void SetSysFillStyle (Int_t id, Style_t style)
 Set the fill style of the systematice error identified by ID. More...
 
void SetSysTitle (Int_t id, const char *name)
 Set the systematic error title. More...
 
void SetSysOption (Int_t id, EDrawOption_t opt)
 Set the draw option for a specific systematic error. More...
 
Setting attributes on summed errors
void SetSumOption (EDrawOption_t opt)
 Set the draw option for summed errors. More...
 
void SetSumTitle (const char *title)
 Set the title uses for summed errors. More...
 
void SetSumLineColor (Color_t color)
 Set the line color of the sumtematice error identified by ID. More...
 
void SetSumLineStyle (Style_t style)
 Set the line style of the sumtematice error identified by ID. More...
 
void SetSumLineWidth (Width_t width)
 Set the line width of the sumtematice error identified by ID. More...
 
void SetSumFillColor (Color_t color)
 Set the fill color of the sumtematice error identified by ID. More...
 
void SetSumFillStyle (Style_t style)
 Set the fill style of the sumtematice error identified by ID. More...
 
void SetCommonSumOption (EDrawOption_t opt)
 Set the draw option for summed errors. More...
 
void SetCommonSumTitle (const char *title)
 Set the title uses for summed errors. More...
 
void SetCommonSumLineColor (Color_t color)
 Set the line color of the sumtematice error identified by ID. More...
 
void SetCommonSumLineStyle (Style_t style)
 Set the line style of the sumtematice error identified by ID. More...
 
void SetCommonSumLineWidth (Width_t width)
 Set the line width of the sumtematice error identified by ID. More...
 
void SetCommonSumFillColor (Color_t color)
 Set the fill color of the sumtematice error identified by ID. More...
 
void SetCommonSumFillStyle (Style_t style)
 Set the fill style of the sumtematice error identified by ID. More...
 
Key interface
void SetKey (const char *key, const char *value, Bool_t replace=false)
 Set a key/value pair. More...
 
const char * GetKey (const char *key) const
 Get (first) value of a key. More...
 
void CopyKeys (const GraphSysErr *g, Option_t *option="fr")
 Copy key/value and qualifiers from one graph to this graph. More...
 
void CopyAttr (const GraphSysErr *f)
 
Qualifiers
void AddQualifier (const TString &key, const TString &value, Bool_t replace=false)
 Adds a qualifier. More...
 
void RemoveQualifier (const TString &key)
 Remove a qualifier. More...
 
const char * GetQualifier (const char *name) const
 Get qualifier. More...
 

Static Public Member Functions

static Double_t Round (Double_t v, Int_t p, Int_t &rexpo)
 Round number v to n significant digits. More...
 

Protected Member Functions

 ClassDef (GraphSysErr, 4)
 
Calculations
void SqrtPoint (Graph *g, Int_t i)
 Take the square root of the errors at point. More...
 
void SqrtGraph (Graph *g)
 Take the square root of the errors. More...
 
Graphics
const char * FormatOption (UInt_t opt)
 Parse options. More...
 
void MakeDataGraph (Int_t n)
 Make our data graph. More...
 
Int_t FindPoint (Double_t x, Int_t &i1, Int_t &i2, Double_t fac=1) const
 Find point (or possibly two points) that match X. More...
 
TMultiGraph * MakeMulti (Option_t *option)
 Make our stack. More...
 
Internal searches
HolderP2PFindP2P (UInt_t id) const
 Find a point-2-point error graph. More...
 
HolderCommonFindCommon (UInt_t id) const
 Find a common error graph. More...
 
HolderCommonFindCompat (const HolderCommon *o, Double_t tol=1e-6, bool verb=false) const
 Find an error in this graph that is compatible with the passed error. More...
 
HolderP2PFindCompat (const HolderP2P *o, Bool_t verb=false) const
 Find an error in this graph that is compatible with the passed error. More...
 
HolderFind (UInt_t id) const
 Find any error. More...
 

Static Protected Member Functions

static void SwapPoints (Graph *g, Int_t i, Int_t j, Bool_t reflect)
 

Protected Attributes

TList fPoint2Point
 List of graphs. More...
 
TList fCommon
 List of common errors. More...
 
TGraphAsymmErrors * fData
 Our data points. More...
 
TMultiGraph * fDrawn
 The drawn graphs. More...
 
UInt_t fCounter
 Counter. More...
 
TAttFill fSumFill
 Attributes of summed errors. More...
 
TAttLine fSumLine
 Attributes of summed errors. More...
 
TString fSumTitle
 Title on summed errors. More...
 
UInt_t fSumOption
 
TAttFill fCommonSumFill
 Attributes of summed errors. More...
 
TAttLine fCommonSumLine
 Attributes of summed errors. More...
 
TString fCommonSumTitle
 Title on summed errors. More...
 
UInt_t fCommonSumOption
 
UInt_t fDataOption
 
TString fXTitle
 X title. More...
 
TString fYTitle
 Y title. More...
 
TList * fMap
 Map of keys. More...
 
TList * fQualifiers
 List of qualifiers. More...
 
Bool_t fStatRelative
 Whether statistical errors are relative. More...
 

Various operations

void Scale (TF1 *f, Double_t s=1)
 Scale graph by a constant. More...
 
void Scale (Double_t s)
 Scale graph by a constant. More...
 
Int_t Average (const TCollection *others, Bool_t sep=true)
 Average one or more graphs. More...
 
Double_t Integral (Double_t &error, Option_t *option="quad sum stat", UShort_t first=0, Short_t last=-1)
 Calculate the intergral and error on integral of the graph. More...
 
void ClearUsed () const
 Clear bit we set during the processing. More...
 
void RemovePoint (Int_t i)
 Remove a point from the graph. More...
 
void SwapPoints (Int_t i, Int_t j, Bool_t reflect=false)
 Swap two points. More...
 
GraphSysErrReflect (Double_t x0=0) const
 Make a copy of the graph, and reflect around x0. More...
 
Bool_t Symmetrize (GraphSysErr *other)
 Symmetrice the other graph and store result here. More...
 
static Bool_t NextPoint (Int_t i, const GraphSysErr *num, const GraphSysErr *denom, Double_t &x, Double_t &dY, Double_t &dEyl, Double_t &dEyh, Double_t &nY, Double_t &nEyl, Double_t &nEyh)
 Find the next point and for ratio. More...
 
static GraphSysErrRatio (const GraphSysErr *num, const GraphSysErr *den, UInt_t flags=kRatioDefault, Double_t fac=1)
 Take the ratio of 2 graphs. More...
 
static Double_t KolomogorovTest (const GraphSysErr *g1, const GraphSysErr *g2)
 Perform a Kolomogorov-Smironov test. More...
 
static Double_t KolomogorovTest (const GraphSysErr *g1, const GraphSysErr *g2, Double_t &z)
 Perform a Kolomogorov-Smironov test. More...
 
static Int_t CacheGraphs (const GraphSysErr *g1, const GraphSysErr *g2, TArrayD &a1y, TArrayD &a2y, TArrayD &a1e2, TArrayD &a2e2)
 Get the Y and error values for the two passed graphs. More...
 
static Double_t ChisquareTest (const GraphSysErr *g1, const GraphSysErr *g2, EChi2Type type=kExperimentTruth)
 Calculate the $ \chi^2$ test of equivilance between two graphs. More...
 
static Double_t ChisquareTest (const GraphSysErr *g1, const GraphSysErr *g2, Int_t &ndf, EChi2Type type)
 Calculate the $ \chi^2$ test of equivilance between two graphs. More...
 

Import/export

void SavePrimitive (std::ostream &out, Option_t *option="")
 
void Save (const char *fileName)
 Save to a ROOT script. More...
 
void Export (std::ostream &out=std::cout, Option_t *option="", Int_t nsign=2)
 Dump on stream a table suitable (After some editing) for uploading to the Durham database. More...
 
static void EscapeLtx (TString &val, const TString &fill="")
 Utility to escape out TLatex stuff, and put '$...$' around LaTeX. More...
 
static void Export (const TSeqCollection *col, std::ostream &out, Option_t *option="H", Int_t nsign=0)
 Export a set of data sets to a single table. More...
 
static TSeqCollection * Import (const TString &fileName)
 Import all data sets from a Durham input formatted file. More...
 
static GraphSysErrImport (std::istream &in, UShort_t idx=0, UShort_t *nIdx=0)
 Import data from input formatted Durham database file. More...
 

Helpers for importing/exporting

static const char * FormatKey (const char *key)
 
static const char * ExtractField (const TString &value, Int_t idx)
 Extract a field from a string. More...
 
static void StoreQual (TList &quals, Int_t idx, const char *name, const char *val)
 Store a qualifier in a table. More...
 
static void StoreQual (TList &quals, Int_t idx, TObject *q)
 Store a qualifier in a table. More...
 
static Int_t ExportError (std::ostream &o, Double_t low, Double_t high, Bool_t nopm, Bool_t rel, Int_t nsign)
 Export an error. More...
 
static Double_t RoundN (Double_t tens, Double_t tmp)
 Round number. More...
 
static TString & Token (TObjArray *c, UShort_t idx, Bool_t verbose=true)
 Get the ith token from the array of tokens c. More...
 
static Bool_t ImportError (const TString &s, Double_t &el, Double_t &eh, Bool_t &rel)
 Import errors from a string. More...
 
static Bool_t ImportPoint (const TString &s, Double_t &v, Double_t &el, Double_t &eh, Bool_t &rel)
 Service function to import a point value (X or Y) with errors. More...
 
std::ostream & ExportKey (std::ostream &out, const char *which, Bool_t alsoKey=true, const char *fill="<please fill in>") const
 Export all values of a key. More...
 
std::ostream & ExportHeader (std::ostream &out, Bool_t alsoTop=false, Bool_t alsoComment=false, Int_t nsign=-1) const
 Export data set header, and possibly file header too. More...
 
std::ostream & ExportPoint (std::ostream &out, Int_t i, Bool_t alsoX=true, Bool_t sysName=true, Int_t nsign=0) const
 Export a single point. More...
 

Detailed Description

This class defines an (X,Y) with any number of error sources.

Sources that can be specified are

Systematic errors can be defined to relative to the point value or absolute numbers.

There are various options for drawing this data set (see Draw). A function can also be fitted to the data set, talking various kinds of errors into consideration (see Fit). The data set can be export to a format more or less acceptable by the Durham database (see Export), and one can import data sets from Durham database input formatted files (see Import)

See also
Example
Examples:
Example.C, TestImport.C, and TestMultiImport.C.

Definition at line 174 of file GraphSysErr.C.

Member Typedef Documentation

typedef TGraphAsymmErrors GraphSysErr::Graph

A short-hand type definition.

Definition at line 186 of file GraphSysErr.C.

Member Enumeration Documentation

anonymous enum
Enumerator
kDraw 
kImport 
kExport 
kRatio 
kVerbose 

Definition at line 178 of file GraphSysErr.C.

anonymous enum
Enumerator
kUsedBit 
kOnlyWeightBit 

Definition at line 230 of file GraphSysErr.C.

Types of $\chi^2$ comparisons.

See also

https://root.cern.ch/root/htmldoc/TH1#TH1:Chi2Test

Enumerator
kExperimentExperiment 
kExperimentModel 
kModelModel 
kExperimentTruth 

Definition at line 209 of file GraphSysErr.C.

Drawing options.

We re-encode them here as distinct enums.

Enumerator
kNormal 
kNoTick 
kArrow 
kRect 
kBox 
kFill 
kCurve 
kHat 
kBar 
kNone 
kLine 
kConnect 

Definition at line 190 of file GraphSysErr.C.

Options for ratios.

  • kChi2 and kKolomogorov are mutally exclusive. If none of them are given, no test is calculated.
  • kProp and kMax are mutually exclusive. The default is kProp
Enumerator
kMax 
kMin 
kCancel 
kDenomRel 
kRatioDefault 

Definition at line 223 of file GraphSysErr.C.

Constructor & Destructor Documentation

GraphSysErr::GraphSysErr ( )
inline

Default CTOR - use only for I/O.

Definition at line 241 of file GraphSysErr.C.

Referenced by Example(), Import(), Ratio(), Reflect(), and Symmetrize().

GraphSysErr::GraphSysErr ( Int_t  n)
inline

CTOR with number of points.

Parameters
nNumber of points to pre-allocate

Definition at line 273 of file GraphSysErr.C.

References fCommon, fPoint2Point, and MakeDataGraph().

GraphSysErr::GraphSysErr ( const char *  name,
const char *  title,
Int_t  n = 0 
)
inline

Constructor with name, title, and optional pre-allocated size.

Parameters
nameName
titleTitle
nPre-allocated points

Definition at line 311 of file GraphSysErr.C.

References fCommon, fPoint2Point, and MakeDataGraph().

GraphSysErr::GraphSysErr ( const GraphSysErr other)
inline

Copy CTOR.

Parameters
otherObject to copy from

Definition at line 347 of file GraphSysErr.C.

References CopyKeys(), fCommon, fCounter, fData, and fPoint2Point.

virtual GraphSysErr::~GraphSysErr ( )
inlinevirtual

DTOR.

Definition at line 400 of file GraphSysErr.C.

References fCommon, fData, fDrawn, fMap, fPoint2Point, and fQualifiers.

Member Function Documentation

void GraphSysErr::AddQualifier ( const TString &  key,
const TString &  value,
Bool_t  replace = false 
)
inline

Adds a qualifier.

Parameters
keyThe key
valuehe value
replaceIf true, replace exsiting value
Examples:
Example.C.

Definition at line 4749 of file GraphSysErr.C.

References fQualifiers, and SetTitle().

Referenced by CopyKeys(), Example(), and Import().

Int_t GraphSysErr::Average ( const TCollection *  others,
Bool_t  sep = true 
)
inline
virtual void GraphSysErr::Browse ( TBrowser *  b)
inlinevirtual

Browse this object.

Parameters
bBrowser to use

Definition at line 676 of file GraphSysErr.C.

References fCommon, fData, fDrawn, fMap, fPoint2Point, and fQualifiers.

static Int_t GraphSysErr::CacheGraphs ( const GraphSysErr g1,
const GraphSysErr g2,
TArrayD &  a1y,
TArrayD &  a2y,
TArrayD &  a1e2,
TArrayD &  a2e2 
)
inlinestatic

Get the Y and error values for the two passed graphs.

The graphs are evaluated at the X values of Graph 1. This is used for Chi square and Kolomogorov-Smirnov tests

Parameters
g1Graph 1
g2Graph 2
a1yY values of Graph 1
a2yY values of Graph 2 evaluated at X of Graph1
a1e2Y-error values of Graph 1
a2e2Y-error values of Graph 2 evaluated at X of Graph1
Returns
Count of points, or -1 on error

Definition at line 2121 of file GraphSysErr.C.

References GetN(), and NextPoint().

Referenced by ChisquareTest(), and KolomogorovTest().

static Double_t GraphSysErr::ChisquareTest ( const GraphSysErr g1,
const GraphSysErr g2,
EChi2Type  type = kExperimentTruth 
)
inlinestatic

Calculate the $ \chi^2$ test of equivilance between two graphs.

See also

https://root.cern.ch/root/htmldoc/TH1#TH1:Chi2Test

Parameters
g1First graph
g2Second graph
typeType
Returns
reduced $\chi^2$ or -1 on error

Definition at line 2174 of file GraphSysErr.C.

static Double_t GraphSysErr::ChisquareTest ( const GraphSysErr g1,
const GraphSysErr g2,
Int_t &  ndf,
EChi2Type  type 
)
inlinestatic

Calculate the $ \chi^2$ test of equivilance between two graphs.

See also

https://root.cern.ch/root/htmldoc/TH1#TH1:Chi2Test

Parameters
g1First graph
g2Second graph
ndfOn return, number degrees of freedom
typeType
Returns
reduced $\chi^2$ or -1 on error

Definition at line 2194 of file GraphSysErr.C.

References CacheGraphs(), kExperimentExperiment, kExperimentModel, kExperimentTruth, and kModelModel.

GraphSysErr::ClassDef ( GraphSysErr  ,
 
)
protected
void GraphSysErr::ClearUsed ( ) const
inline

Clear bit we set during the processing.

Definition at line 2030 of file GraphSysErr.C.

References fCommon, fPoint2Point, kOnlyWeightBit, and kUsedBit.

Referenced by Average(), and Ratio().

void GraphSysErr::CopyAttr ( const GraphSysErr f)
inline
void GraphSysErr::CopyKeys ( const GraphSysErr g,
Option_t *  option = "fr" 
)
inline

Copy key/value and qualifiers from one graph to this graph.

Parameters
gGraph to copy from
optionOptions specifying what to copy
  • a Copy all key/values and qualifiers
  • f Copy file key/values
  • h Copy data set header key/values
  • q Copy data set qualifiers
  • r Replace existing values

Definition at line 4651 of file GraphSysErr.C.

References AddQualifier(), fMap, fQualifiers, GetQualifier(), and SetKey().

Referenced by Average(), GraphSysErr(), Import(), and Ratio().

UInt_t GraphSysErr::DeclarePoint2Point ( const char *  title,
Bool_t  relative,
EDrawOption_t  option = kBar 
)
inline

Delcare a point-to-point systematic error.

Parameters
titleTitle
relativeRelative error mission
optionOptions
Returns
Indentifier of systematic error

Example of how make declare point-to-point errors

UInt_t pp1 = gse->DeclarePoint2Point("Point-to-Point 0.1-0.2", true);
UInt_t pp2 = gse->DeclarePoint2Point("Point-to-Point 5-10%", false);

Examples:
Example.C.

Definition at line 3383 of file GraphSysErr.C.

References fCounter, and fPoint2Point.

Referenced by Average(), Example(), Import(), Ratio(), and Symmetrize().

UInt_t GraphSysErr::DefineCommon ( const char *  title,
Bool_t  relative,
Double_t  ey,
EDrawOption_t  option = kFill 
)
inline

Define a common systematic error.

Parameters
titleTitle of error
relativeTrue if this relative to data
eyError
optionOptions
Returns
Indentifier of systematic error

Example of how make define common errors

UInt_t cm1 = gse->DefineCommon("Common 0.05", false, .05);
UInt_t cm2 = gse->DefineCommon("Common 10%", true, .1);

Examples:
Example.C.

Definition at line 3340 of file GraphSysErr.C.

Referenced by Average(), Example(), Import(), and Ratio().

UInt_t GraphSysErr::DefineCommon ( const char *  title,
Bool_t  relative,
Double_t  eyl,
Double_t  eyh,
EDrawOption_t  option = kRect 
)
inline

Define a common systematic error.

Parameters
titleTitle of error
relativeTrue if this relative to data
eylError
eyhError
optionOptions
Returns
Indentifier of systematic error

Definition at line 3356 of file GraphSysErr.C.

References fCommon, fCounter, and GraphSysErr::HolderCommon::Set().

void GraphSysErr::Draw ( Option_t *  option = "")
inline

Draw this data.

Options:

  • STACK/COMBINED Either errors are stacked or combined
  • QUADRATIC/DIRECT Add errors in quadrature or direct
  • STAT Add statistical errors to systematics
  • COMMON Add common errors to points
  • SPLIT Without COMMON - do not stack common errors
  • MIN Without COMMON - put common near minimum
  • MAX Without COMMON - put common near maximum
  • WEST/EAST Without COMMON - put common west/east
  • AXIS Paint axis

If option COMMON isn't given and neither MIN nor MAX is not given, then the common errors are displayed near the middle of the Y range

some examples are shown in the image below

DrawStyles.png
struct TestMaker
{
static void FillKeys(GraphSysErr* gse)
{
// Draw data with-out ticks
gse->SetXTitle("X");
gse->SetYTitle("Y");
// Set some key/value pairs
gse->SetKey("laboratory", "The Center");
gse->SetKey("accelerator", "Mega Collider");
gse->SetKey("detector", "Huge Experiment");
gse->SetKey("author", "Christensen");
gse->SetKey("reference","Jour.All.Things A1,999");
gse->SetKey("doi","9999-9999-9999-9999");
gse->SetKey("abstract", "The data");
gse->SetKey("location", "In the paper");
gse->SetKey("reackey", "graviton -> tachyons");
gse->SetKey("obskey", "GUT");
gse->SetKey("qual", "Life, universe, and everything");
// Set options on summed errors (in case of option COMBINED)
gse->SetSumLineColor(kRed+2);
gse->SetSumLineWidth(2);
gse->SetSumTitle("All errors");
}

A function to set-up an object

static GraphSysErr* MakeGaus(const char* name="foo",
Double_t off=0,
Double_t cmnFix=.05,
Double_t cmnRel=.10,
Double_t p2pFix=.10,
Double_t p2pRel=.05)
{
GraphSysErr* gse = new GraphSysErr(name, "Gaussian");
FillKeys(gse);
// Two sources of common errors, one relative, one absolute
// MakeCommon(gse, false, cmnFix);
MakeCommon(gse, true, cmnRel);
// Two sources of point-to-point errors, one relative, one absolute
UInt_t pp1 = MakeP2P(gse, false, p2pFix, 2*p2pFix);
UInt_t pp2 = MakeP2P(gse, true, p2pRel, 2*p2pRel);
// Fill a histogram with a Guassian random deviate
TH1* h = new TH1F("h", "h", 30, -3, 3);
h->Sumw2();
h->SetDirectory(0);
h->FillRandom("gaus",10000);
h->Scale(1./10000, "width");
for (Int_t i = 0, j = 0; i < h->GetNbinsX(); i++) {
Int_t bin = i+1;
Double_t x = h->GetXaxis()->GetBinCenter(bin);
Double_t y = h->GetBinContent(bin);
Double_t sta = h->GetBinError(bin);
if (TMath::Abs(off) > 1e-9) y += off;
if (sta < 1e-6) continue;
if (y < 1e-6) continue;
// Set data
gse->SetPoint(j, x, y);
gse->SetStatError(j, sta);
// gse->SetPointError(j, h->GetXaxis()->GetBinWidth(i)/2);
Double_t abs = gRandom->Uniform(p2pFix, 2*p2pFix);
Double_t rl = gRandom->Uniform(p2pRel, 2*p2pRel);
Double_t rh = gRandom->Uniform(p2pRel, 2*p2pRel);
// Info("", "Point %2d abs=%f rl=%f rh=%f", abs, rl, rh);
// Set point-to-point errors
if (pp1 > 0) gse->SetSysError(pp1, j, 0., abs);
if (pp2 > 0) gse->SetSysError(pp2, j, 0., 0., rl, rh);
j++;
}
delete h;
return gse;
} //EndTest1

A function to make a canvs

TVirtualPad* MakeCanvas(const char* n, const char* t)
{
TCanvas* c = new TCanvas(n, t, 1200, 900);
c->SetTopMargin(0.02);
c->SetRightMargin(0.02);
c->cd();
return c;
} //EndMakeCanvas

Function to draw the stuff

void DrawIt(TVirtualPad* p, Option_t* option, Bool_t fit=false)
{
p->SetTopMargin(0.02);
p->SetRightMargin(0.02);
gStyle->SetOptTitle(0);
Sizes();
// If we're to fit, do so, otherwise just draw
// Note that the same drawing options are used
TFitResultPtr r;
if (!fit)
gse->Draw(option);
else
r = gse->Fit("gaus", "SQ", option, -3, 3);
gse->GetMulti()->GetXaxis()->SetTitle("X");
gse->GetMulti()->GetYaxis()->SetTitle("P(X)");
// Make a legend from canvas content
TLegend* l = p->BuildLegend(.12, .7, .4, .97);
l->SetFillColor(0);
l->SetFillStyle(0);
l->SetBorderSize(0);
// Show our drawing options
TLatex* ltx = new TLatex(.02,.02,option);
ltx->SetTextAlign(11);
ltx->SetTextFont(42);
ltx->SetTextSize(0.03);
ltx->SetNDC();
ltx->Draw();
// Check have a fit, and put stuff on canvas
if (fit) {
Double_t y = .97;
Double_t x1 = .6;
Double_t x2 = .75;
Double_t x3 = .76;
TLatex* name = new TLatex(x1, y, "#chi^{2}/#nu");
name->SetTextAlign(13);
name->SetTextFont(62);
name->SetTextSize(0.02);
name->SetNDC();
name->Draw();
TLatex* value = new TLatex(x2, y, "");
value->SetTextAlign(33);
value->SetTextFont(42);
value->SetTextSize(0.02);
value->SetNDC();
value->Draw();
TLatex* error = new TLatex(x2, y, Form("%7.4f", r->Chi2()/r->Ndf()));
error->SetTextAlign(13);
error->SetTextFont(42);
error->SetTextSize(0.02);
error->SetNDC();
error->Draw();
y -= error->GetTextSize() + .01;
for (Int_t i = 0; i < r->NPar(); i++) {
name->DrawLatex(x1,y,r->ParName(i).c_str());
value->DrawLatex(x2,y,Form("%7.4f",r->Parameter(i)));
error->DrawLatex(x3,y,Form("#pm %8.5f",r->ParError(i)));
y -= error->GetTextSize() + .01;
}
}
// Make sure the canvas is updated
p->Modified();
p->Update();
p->cd();
} // EndDrawIt

Some utilies

void Sizes()
{
// Adjust size along X of common errors
gStyle->SetErrorX(.2);
// Adjust size of hat, cap, ...
gStyle->SetEndErrorSize(6);
} //EndSizes

Steering function to do all tests

void DrawAll()
{
TVirtualPad* p = MakeCanvas("all", "All Tests");
p->Divide(3,2);
TVirtualPad* q = 0;
// Draw our data in various ways
q = p->cd(1); DrawCombined(q);
q = p->cd(2); DrawStack(q);
q = p->cd(3); DrawCombinedCommonStat(q);
q = p->cd(4); DrawStackCommonStat(q);
q = p->cd(5); DrawStackStat(q);
q = p->cd(6);
// Put a description
TPaveText* txt = new TPaveText(0.02,0.02,.95,.95,"NB NDC");
txt->SetFillColor(0);
txt->SetFillStyle(0);
txt->SetTextFont(42);
txt->SetTextAlign(11);
txt->SetBorderSize(0);
txt->AddText("#bf{GraphSysErr}");
txt->AddText("A TGraph-like object with separate statistical");
txt->AddText("and systematic errors. Many options for drawing");
txt->AddText("the data, and full configurability of styles.");
txt->AddText("Data can be exported to a file suitabile for");
txt->AddText("upload to the Durham database with minimal editting");
txt->AddText("");
txt->AddText("#it{Christian Holm Christensen}");
txt->Draw();
p->Print("DrawStyles.png");
} //EndDrawAll

The various ways we can draw the data

First, combining all systematic errors

void DrawCombined(TVirtualPad* p=0)
{
if (!p) p = MakeCanvas("combined", "Combined");
else p->SetTitle("Combined");
DrawIt(p, "COMBINE axis quad max", true);;
} // EndDrawCombined

Then, stacking all systematics.

void DrawStack(TVirtualPad* p=0)
{
Sizes();
if (!p) p = MakeCanvas("stack","Stack");
else p->SetTitle("Stack");
DrawIt(p, "STACK axis quad split min west");
} // EndDrawStack

We can also combine all errors

void DrawCombinedCommonStat(TVirtualPad* p=0)
{
if (!p) p = MakeCanvas("combinedCommonStat","Combined,Common,Stat");
else p->SetTitle("Combined,Common,Stat");
gse->SetSumFillColor(kPink+2);
gse->SetSumFillStyle(3002);
DrawIt(p, "COMBINED COMMON STAT axis quad");
} // EndDrawCombinedCommonStat

We can also stack the errors

void DrawStackCommonStat(TVirtualPad* p=0)
{
if (!p) p = MakeCanvas("stackCommonStat","Stack, Common, Stat");
else p->SetTitle("Stack, Common, Stat");
DrawIt(p, "STACK COMMON STAT axis quad", true);;
} // EndDrawStackCommonStat

First, combining all errors

void DrawStackStat(TVirtualPad* p=0)
{
if (!p) p = MakeCanvas("stackStat","Stack,Stat");
else p->SetTitle("Stack,Stat");
DrawIt(p, "STACK STAT axis quad split max", true);;
} // EndDrawStackStat

End of the tester class

};

The entry point for the script

void
DrawStyles()
{
gROOT->Macro("tests/Load.C(1,0)");
Drawer t(TestMaker::MakeGaus());
t.DrawAll();
} // EndDrawStyles

Examples:
Example.C, TestImport.C, and TestMultiImport.C.

Definition at line 781 of file GraphSysErr.C.

References fDrawn, fXTitle, fYTitle, and MakeMulti().

Referenced by Example().

static void GraphSysErr::EscapeLtx ( TString &  val,
const TString &  fill = "" 
)
inlinestatic

Utility to escape out TLatex stuff, and put '$...$' around LaTeX.

Parameters
valString to modify
fillIf val is null, use this value

Definition at line 2668 of file GraphSysErr.C.

Referenced by Export().

void GraphSysErr::Export ( std::ostream &  out = std::cout,
Option_t *  option = "",
Int_t  nsign = 2 
)
inline

Dump on stream a table suitable (After some editing) for uploading to the Durham database.

If one has many objects that should be uploaded together, one can do

TList l;
l.Add(new GraphSysErr(...));
...
std::ofstream out("export");
TIter next(&l);
GraphSysErr* g = 0;
Bool_t first = true;
while ((g = static_cast<GraphSysErr*>(next()))) {
g->Export(out, (first ? "h" : ""));
first = false;
}
out.close();
Parameters
outOutput stream to write to.
optionOptions
nsignNumber of significant digits on errors
  • H Export file header
  • C Export file comment
  • S Export Point-to-point systematic names
  • T Export title as RE qual
Examples:
TestImport.C, and TestMultiImport.C.

Definition at line 2602 of file GraphSysErr.C.

References EscapeLtx(), ExportError(), ExportHeader(), ExportPoint(), fCommon, FormatKey(), fQualifiers, fXTitle, fYTitle, GetN(), GraphSysErr::HolderCommon::GetYDown(), GraphSysErr::HolderCommon::GetYUp(), and GraphSysErr::Holder::IsRelative().

static void GraphSysErr::Export ( const TSeqCollection *  col,
std::ostream &  out,
Option_t *  option = "H",
Int_t  nsign = 0 
)
inlinestatic

Export a set of data sets to a single table.

All graphs must have the same format. The title of each graph is written as the "qual" field.

Parameters
colCollection of GraphSysErr objets
outOutput stream
optionOptions
nsignNumber of significant digits
  • H Export file header
  • C Export file comment
  • S Export Point-to-point systematic names

chekc if we have this error

Definition at line 2691 of file GraphSysErr.C.

References EscapeLtx(), ExportError(), ExportHeader(), ExportPoint(), fCommon, fData, FindId(), FormatKey(), fQualifiers, fXTitle, fYTitle, GetCommonErrorYDown(), GetCommonErrorYUp(), GetN(), GetX(), IsRelative(), and StoreQual().

static Int_t GraphSysErr::ExportError ( std::ostream &  o,
Double_t  low,
Double_t  high,
Bool_t  nopm,
Bool_t  rel,
Int_t  nsign 
)
inlinestaticprotected

Export an error.

Parameters
oOutput stream
lowLow error
highHigh error
nopmIf true, do not prefix symmetric errors with +/-
relIF true, the error is relative
nsignNumber of significant digits
Returns
Least exponent used

Definition at line 6985 of file GraphSysErr.C.

References Round().

Referenced by Export(), and ExportPoint().

std::ostream& GraphSysErr::ExportHeader ( std::ostream &  out,
Bool_t  alsoTop = false,
Bool_t  alsoComment = false,
Int_t  nsign = -1 
) const
inlineprotected

Export data set header, and possibly file header too.

Parameters
outOutput stream
alsoTopIf true, export file header
alsoCommentIf true, also write out comment
nsignNumber of significant digits
Returns
output stream

Definition at line 6907 of file GraphSysErr.C.

References ExportKey(), FormatKey(), and GetKey().

Referenced by Export().

std::ostream& GraphSysErr::ExportKey ( std::ostream &  out,
const char *  which,
Bool_t  alsoKey = true,
const char *  fill = "<please fill in>" 
) const
inlineprotected

Export all values of a key.

Parameters
outOutput stream
whichWhich key
alsoKeyIf true, output key value
fillFiller in case the key isn't defined
Returns
The output stream

Definition at line 6873 of file GraphSysErr.C.

References fMap, and FormatKey().

Referenced by ExportHeader().

std::ostream& GraphSysErr::ExportPoint ( std::ostream &  out,
Int_t  i,
Bool_t  alsoX = true,
Bool_t  sysName = true,
Int_t  nsign = 0 
) const
inlineprotected

Export a single point.

Parameters
outOutput stream
iPoint number
alsoXIf true, also export X coordinate
sysNameIf true, export P2P names
nsignNumber of significant digits
Returns
output stream

Definition at line 7026 of file GraphSysErr.C.

References ExportError(), GraphSysErr::Combiner::fData, fPoint2Point, fStatRelative, GetStatErrorDown(), GetStatErrorUp(), GetX(), GetY(), GraphSysErr::HolderP2P::GetYDown(), GraphSysErr::HolderP2P::GetYUp(), GraphSysErr::Holder::IsRelative(), and Round().

Referenced by Export().

static const char* GraphSysErr::ExtractField ( const TString &  value,
Int_t  idx 
)
inlinestaticprotected

Extract a field from a string.

Parameters
valueThe string
idxWhich index
Returns
String at index, or last value

Definition at line 6814 of file GraphSysErr.C.

Referenced by Import().

Holder* GraphSysErr::Find ( UInt_t  id) const
inlineprotected
HolderCommon* GraphSysErr::FindCommon ( UInt_t  id) const
inlineprotected

Find a common error graph.

Parameters
ididentifier
Returns
Common systematic error holder or null

Definition at line 7734 of file GraphSysErr.C.

References fCommon.

Referenced by Average(), FindCompat(), GetCommonErrorYDown(), GetCommonErrorYUp(), GetSysErrorYDown(), GetSysErrorYUp(), IsCommon(), IsRelative(), Ratio(), RemoveSysError(), SetSysError(), and Symmetrize().

HolderCommon* GraphSysErr::FindCompat ( const HolderCommon o,
Double_t  tol = 1e-6,
bool  verb = false 
) const
inlineprotected

Find an error in this graph that is compatible with the passed error.

Parameters
oTest
verbBe verbose
tolRelative error tolerance
Returns
Pointer to holder for found errror or null

Definition at line 7753 of file GraphSysErr.C.

References FindCommon(), FindId(), GraphSysErr::HolderCommon::GetYDown(), GraphSysErr::HolderCommon::GetYUp(), GraphSysErr::Holder::IsRelative(), and GraphSysErr::HolderCommon::Print().

Referenced by Average().

HolderP2P* GraphSysErr::FindCompat ( const HolderP2P o,
Bool_t  verb = false 
) const
inlineprotected

Find an error in this graph that is compatible with the passed error.

Parameters
oTest
verbBe verbose
Returns
Pointer to holder for found errror or null

Definition at line 7820 of file GraphSysErr.C.

References FindId(), FindP2P(), and GraphSysErr::Holder::IsRelative().

void GraphSysErr::FindFwhm ( Int_t  start,
Int_t  dir,
Double_t  ymax,
Bool_t  cmn,
Bool_t  stat,
Bool_t  quad,
Int_t &  i1,
Int_t &  i2 
) const
inline

Find the full-width at half-maximum.

Parameters
startStarting point
dirDirection (-1: to the left, +1: to the right)
ymaxThe maximum value
cmnWhether to include common systematics
statWhether to include statistical errors
quadWhether to add in quadrature
i1On return, the lower bound for found point
i2On return, the upper bound for found point

Definition at line 4044 of file GraphSysErr.C.

References GetN(), and GetYandError().

Referenced by FWHM().

UInt_t GraphSysErr::FindId ( const char *  title) const
inline

Find the ID of an error with the given title.

Parameters
titleTitle
Returns
ID or null

Definition at line 3414 of file GraphSysErr.C.

References fCommon, and fPoint2Point.

Referenced by Export(), FindCompat(), Import(), Ratio(), and Symmetrize().

HolderP2P* GraphSysErr::FindP2P ( UInt_t  id) const
inlineprotected

Find a point-2-point error graph.

Parameters
ididentifier
Returns
Point-to-point systematic error holder or null

Definition at line 7717 of file GraphSysErr.C.

References fPoint2Point.

Referenced by Average(), Find(), FindCompat(), GetSysErrorX(), GetSysErrorXLeft(), GetSysErrorXRight(), GetSysErrorY(), GetSysErrorYDown(), GetSysErrorYUp(), Import(), IsRelative(), Ratio(), RemoveSysError(), and SetSysError().

Int_t GraphSysErr::FindPoint ( Double_t  x,
Int_t &  i1,
Int_t &  i2,
Double_t  fac = 1 
) const
inlineprotected

Find point (or possibly two points) that match X.

Parameters
xX to mach
i1On return, the two points
i2On return, the two points
facFactor on errors for searching
Returns

Definition at line 7404 of file GraphSysErr.C.

References GetErrorXLeft(), GetErrorXRight(), GetN(), and GetX().

Referenced by Average(), FindYandError(), Ratio(), and Symmetrize().

Bool_t GraphSysErr::FindYandError ( Double_t  x,
Bool_t  cmn,
Bool_t  stat,
Bool_t  quad,
Bool_t  nosqrt,
Double_t &  y,
Double_t &  eyl,
Double_t &  eyh,
Double_t &  seyl,
Double_t &  seyh 
) const
inline

Find Y value and errors corresponding X.

Parameters
xX value
cmnInclude common errors
statInclude statistical error
quadAdd errors in quadrature
nosqrtNo not take square root of errors
yOn return, the y value
eylOn return low error on y
eyhOn return high error on y
seylOn return low error on y (with statistical errors)
seyhOn return high error on y (with statistical errors)
Returns
false in case the point is out side the range

Definition at line 4815 of file GraphSysErr.C.

References fData, FindPoint(), GetStatErrorDown(), GetStatErrorUp(), and GetYandError().

Referenced by FindYandError(), NextPoint(), and Symmetrize().

Bool_t GraphSysErr::FindYandError ( Double_t  x,
Bool_t  cmn,
Bool_t  stat,
Bool_t  quad,
Bool_t  nosqrt,
Double_t &  y,
Double_t &  eyl,
Double_t &  eyh 
) const
inline

Find Y value and errors corresponding X.

Parameters
xX value
cmnInclude common errors
statInclude statistical error
quadAdd errors in quadrature
nosqrtNo not take square root of errors
yOn return, the y value
eylOn return low error on y
eyhOn return high error on y
Returns
false in case the point is out side the range

Definition at line 4881 of file GraphSysErr.C.

References FindYandError().

TFitResultPtr GraphSysErr::Fit ( TF1 *  f1,
Option_t *  fitOption,
Option_t *  drawOption,
Axis_t  min = 0,
Axis_t  max = 0 
)
inline

Fit a function to the data.

Which errors are considered depends on the options given in drawOption i.e.,

  • STAT COMMON: Statistical, common, and point-to-point errors are factored in
  • STAT: Statistical and point-to-point errors are factored in, but common errors are not
  • COMMON: Common and point-to-point errors are factored in, but statistical errors are not
  • otherwise: Ppoint-to-point errors are factored in, but statistical and common errors are not
Parameters
f1Pointer to function objet
fitOptionThe fit options (See TGraph::Fit)
drawOptionDraw options (See Draw)
minLeast X value to consider
maxLargest X value to consider
Returns
See TGraph::Fit
Examples:
Example.C.

Definition at line 823 of file GraphSysErr.C.

References fDrawn, fXTitle, fYTitle, and MakeMulti().

Referenced by Example(), and Fit().

TFitResultPtr GraphSysErr::Fit ( const char *  formula,
Option_t *  fitOption,
Option_t *  drawOption,
Axis_t  min = 0,
Axis_t  max = 0 
)
inline

Fit a function to the data.

Which errors are considered depends on the options given in drawOption i.e.,

  • STAT COMMON: Statistical, common, and point-to-point errors are factored in
  • STAT: Statistical and point-to-point errors are factored in, but common errors are not
  • COMMON: Common and point-to-point errors are factored in, but statistical errors are not
  • otherwise: Ppoint-to-point errors are factored in, but statistical and common errors are not
Parameters
formulaThe fit formula
fitOptionThe fit options (See TGraph::Fit)
drawOptionDraw options (See Draw)
minLeast X value to consider
maxLargest X value to consider
Returns
See TGraph::Fit

Definition at line 891 of file GraphSysErr.C.

References Fit().

static const char* GraphSysErr::FormatKey ( const char *  key)
inlinestaticprotected

Definition at line 6801 of file GraphSysErr.C.

Referenced by Export(), ExportHeader(), and ExportKey().

const char* GraphSysErr::FormatOption ( UInt_t  opt)
inlineprotected

Parse options.

Parameters
optOptions to parse

Definition at line 7363 of file GraphSysErr.C.

References kArrow, kBar, kBox, kConnect, kCurve, kFill, kHat, kLine, kNone, kNormal, kNoTick, and kRect.

Referenced by MakeMulti().

Double_t GraphSysErr::FWHM ( Double_t &  el,
Double_t &  eh 
) const
inline

Calculate the full-width at half-maximum.

Parameters
elOn return, lower error on FWHM
ehOn return, higher error on FWHM
Returns
FWHM

Definition at line 4071 of file GraphSysErr.C.

Double_t GraphSysErr::FWHM ( Double_t &  el,
Double_t &  eh,
Double_t &  xl,
Double_t &  xh 
) const
inline

Calculate the full-width at half-maximum.

Parameters
elOn return, lower error on FWHM
ehOn return, higher error on FWHM
xlOn return, left-hand X value
xhOn return, right-hand X value
Returns
FWHM

Definition at line 4086 of file GraphSysErr.C.

References GraphSysErr::Combiner::Add(), GraphSysErr::Combiner::Calculate(), GraphSysErr::Combiner::Observation::fEh, GraphSysErr::Combiner::Observation::fEl, FindFwhm(), GraphSysErr::Combiner::Observation::fX, GetErrorXLeft(), GetErrorXRight(), GetMinMax(), GetX(), GraphSysErr::Combiner::Result::Print(), and GraphSysErr::Combiner::Print().

Double_t GraphSysErr::GetCommonErrorYDown ( Int_t  id) const
inline

Get the common systematic error.

Returns
Common systematic error

Definition at line 3949 of file GraphSysErr.C.

References FindCommon(), GraphSysErr::HolderCommon::GetYDown(), and GraphSysErr::Holder::IsRelative().

Referenced by Export().

Double_t GraphSysErr::GetCommonErrorYUp ( Int_t  id) const
inline

Get the common systematic error.

Returns
Common systematic error

Definition at line 3937 of file GraphSysErr.C.

References FindCommon(), GraphSysErr::HolderCommon::GetYUp(), and GraphSysErr::Holder::IsRelative().

Referenced by Export().

Color_t GraphSysErr::GetCommonSumFillColor ( ) const
inline

Get fill color of sum systematic uncertainty.

Returns
color, or 0

Definition at line 3910 of file GraphSysErr.C.

References fCommonSumFill.

Referenced by CopyAttr().

Style_t GraphSysErr::GetCommonSumFillStyle ( ) const
inline

Get fill style of sum systematic uncertainty.

Returns
style, or 0

Definition at line 3892 of file GraphSysErr.C.

References fCommonSumFill.

Referenced by CopyAttr().

Color_t GraphSysErr::GetCommonSumLineColor ( ) const
inline

Get line color of sum systematic uncertainty.

Returns
color, or 0

Definition at line 3919 of file GraphSysErr.C.

References fCommonSumLine.

Referenced by CopyAttr().

Style_t GraphSysErr::GetCommonSumLineStyle ( ) const
inline

Get line style of sum systematic uncertainty.

Returns
style, or 0

Definition at line 3901 of file GraphSysErr.C.

References fCommonSumLine.

Referenced by CopyAttr().

Width_t GraphSysErr::GetCommonSumLineWidth ( ) const
inline

Get line width of sum systematic uncertainty.

Returns
width, or 0

Definition at line 3928 of file GraphSysErr.C.

References fCommonSumLine.

Referenced by CopyAttr().

UInt_t GraphSysErr::GetCommonSumOption ( ) const
inline

Definition at line 3886 of file GraphSysErr.C.

References fCommonSumOption.

const char* GraphSysErr::GetCommonSumTitle ( ) const
inline

Get title of summed systematic error.

Returns
Name

Definition at line 3882 of file GraphSysErr.C.

References fCommonSumTitle.

Referenced by CopyAttr().

Double_t GraphSysErr::GetErrorXLeft ( Int_t  p) const
inline
Parameters
pPoint
Returns
Left error on X at point

Definition at line 3611 of file GraphSysErr.C.

References fData.

Referenced by Average(), FindPoint(), FWHM(), GetYandError(), Integral(), Print(), Ratio(), SavePrimitive(), and Symmetrize().

Double_t GraphSysErr::GetErrorXRight ( Int_t  p) const
inline
Parameters
pPoint
Returns
Right error on X at point

Definition at line 3617 of file GraphSysErr.C.

References fData.

Referenced by Average(), FindPoint(), FWHM(), GetYandError(), Integral(), Print(), Ratio(), SavePrimitive(), and Symmetrize().

const char* GraphSysErr::GetKey ( const char *  key) const
inline

Get (first) value of a key.

Parameters
keyKey
Returns
Value or null

Definition at line 4631 of file GraphSysErr.C.

References fMap.

Referenced by ExportHeader(), and SetKey().

void GraphSysErr::GetMinMax ( Option_t *  option,
Double_t &  ymin,
Double_t &  ymax 
) const
inline

Get minimum and maximum.

Parameters
option
ymin
ymax

Definition at line 3975 of file GraphSysErr.C.

Referenced by FWHM().

void GraphSysErr::GetMinMax ( Option_t *  option,
Double_t &  ymin,
Double_t &  ymax,
Double_t &  xmin,
Double_t &  xmax,
Int_t &  imin,
Int_t &  imax 
) const
inline

Get minimum and maximum.

Parameters
optionOptions
yminOn return, lease Y value
ymaxOn return, largest Y value
xminOn return, X value corresponding to least Y value
xmaxOn return, X value corresponding to largest Y value
iminOn return, point number corresponding to lesat Y value
imaxOn return, point number corresponding to largest Y value

Definition at line 3993 of file GraphSysErr.C.

References GetN(), GetX(), GetY(), and GetYandError().

TMultiGraph* GraphSysErr::GetMulti ( Option_t *  option = "")
inline

Get last drawn multigraph or create a new one.

Parameters
optionOptions
Returns
The multi graph

Definition at line 914 of file GraphSysErr.C.

References fDrawn, and MakeMulti().

Int_t GraphSysErr::GetN ( ) const
inline
Int_t GraphSysErr::GetNSys ( ) const
inline

Definition at line 3432 of file GraphSysErr.C.

References fCounter.

const char* GraphSysErr::GetQualifier ( const char *  name) const
inline

Get qualifier.

Parameters
nameKey of qualifier
Returns
Value of qualifier

Definition at line 4791 of file GraphSysErr.C.

References fQualifiers.

Referenced by CopyKeys().

Double_t GraphSysErr::GetStatError ( Int_t  point) const
inline
Parameters
pointPoint
Returns
statistical error at point

Definition at line 3629 of file GraphSysErr.C.

References fData.

Double_t GraphSysErr::GetStatErrorDown ( Int_t  point) const
inline
Parameters
pointPoint
Returns
statistical error at point

Definition at line 3644 of file GraphSysErr.C.

References fData.

Referenced by Average(), ExportPoint(), FindYandError(), GetYandError(), Print(), Ratio(), SavePrimitive(), Scale(), and Symmetrize().

Double_t GraphSysErr::GetStatErrorUp ( Int_t  point) const
inline
Parameters
pointPoint
Returns
statistical error at point

Definition at line 3635 of file GraphSysErr.C.

References fData.

Referenced by Average(), ExportPoint(), FindYandError(), GetYandError(), Print(), Ratio(), SavePrimitive(), Scale(), and Symmetrize().

Color_t GraphSysErr::GetSumFillColor ( ) const
inline

Get fill color of sum systematic uncertainty.

Returns
color, or 0

Definition at line 3855 of file GraphSysErr.C.

References fSumFill.

Referenced by CopyAttr().

Style_t GraphSysErr::GetSumFillStyle ( ) const
inline

Get fill style of sum systematic uncertainty.

Returns
style, or 0

Definition at line 3837 of file GraphSysErr.C.

References fSumFill.

Referenced by CopyAttr().

Color_t GraphSysErr::GetSumLineColor ( ) const
inline

Get line color of sum systematic uncertainty.

Returns
color, or 0

Definition at line 3864 of file GraphSysErr.C.

References fSumLine.

Referenced by CopyAttr().

Style_t GraphSysErr::GetSumLineStyle ( ) const
inline

Get line style of sum systematic uncertainty.

Returns
style, or 0

Definition at line 3846 of file GraphSysErr.C.

References fSumLine.

Referenced by CopyAttr().

Width_t GraphSysErr::GetSumLineWidth ( ) const
inline

Get line width of sum systematic uncertainty.

Returns
width, or 0

Definition at line 3873 of file GraphSysErr.C.

References fSumLine.

Referenced by CopyAttr().

UInt_t GraphSysErr::GetSumOption ( ) const
inline

Definition at line 3831 of file GraphSysErr.C.

References fSumOption.

const char* GraphSysErr::GetSumTitle ( ) const
inline

Get title of summed systematic error.

Returns
Name

Definition at line 3827 of file GraphSysErr.C.

References fSumTitle.

Referenced by CopyAttr().

Double_t GraphSysErr::GetSysErrorX ( Int_t  id,
Int_t  point 
) const
inline
Parameters
id
pointPoint
Returns
systematic error from id at point

Definition at line 3674 of file GraphSysErr.C.

References FindP2P(), and GraphSysErr::HolderP2P::GetX().

Double_t GraphSysErr::GetSysErrorXLeft ( Int_t  id,
Int_t  point 
) const
inline
Parameters
id
pointPoint
Returns
systematic error from id at point

Definition at line 3698 of file GraphSysErr.C.

References FindP2P(), and GraphSysErr::HolderP2P::GetXLeft().

Referenced by SavePrimitive().

Double_t GraphSysErr::GetSysErrorXRight ( Int_t  id,
Int_t  point 
) const
inline
Parameters
id
pointPoint
Returns
systematic error from id at point

Definition at line 3710 of file GraphSysErr.C.

References FindP2P(), and GraphSysErr::HolderP2P::GetXRight().

Referenced by SavePrimitive().

Double_t GraphSysErr::GetSysErrorY ( Int_t  id,
Int_t  point 
) const
inline
Parameters
id
pointPoint
Returns
systematic error from id at point

Definition at line 3686 of file GraphSysErr.C.

References FindP2P(), and GraphSysErr::HolderP2P::GetY().

Referenced by Symmetrize().

Double_t GraphSysErr::GetSysErrorYDown ( Int_t  id,
Int_t  point 
) const
inline
Parameters
id
pointPoint
Returns
systematic error from id at point

Definition at line 3736 of file GraphSysErr.C.

References FindCommon(), FindP2P(), GetY(), GraphSysErr::HolderP2P::GetYDown(), and GraphSysErr::HolderCommon::GetYDown().

Referenced by Average(), and SavePrimitive().

Double_t GraphSysErr::GetSysErrorYUp ( Int_t  id,
Int_t  point 
) const
inline
Parameters
id
pointPoint
Returns
systematic error from id at point

Definition at line 3722 of file GraphSysErr.C.

References FindCommon(), FindP2P(), GetY(), GraphSysErr::HolderP2P::GetYUp(), and GraphSysErr::HolderCommon::GetYUp().

Referenced by Average(), and SavePrimitive().

Color_t GraphSysErr::GetSysFillColor ( Int_t  id) const
inline

Get fill color of systematic uncertainty.

Parameters
idIdentifier
Returns
color, or 0

Definition at line 3790 of file GraphSysErr.C.

References Find().

Style_t GraphSysErr::GetSysFillStyle ( Int_t  id) const
inline

Get fill style of systematic uncertainty.

Parameters
idIdentifier
Returns
style, or 0

Definition at line 3764 of file GraphSysErr.C.

References Find().

Color_t GraphSysErr::GetSysLineColor ( Int_t  id) const
inline

Get line color of systematic uncertainty.

Parameters
idIdentifier
Returns
color, or 0

Definition at line 3803 of file GraphSysErr.C.

References Find().

Style_t GraphSysErr::GetSysLineStyle ( Int_t  id) const
inline

Get line style of systematic uncertainty.

Parameters
idIdentifier
Returns
style, or 0

Definition at line 3777 of file GraphSysErr.C.

References Find().

Width_t GraphSysErr::GetSysLineWidth ( Int_t  id) const
inline

Get line width of systematic uncertainty.

Parameters
idIdentifier
Returns
width, or 0

Definition at line 3816 of file GraphSysErr.C.

References Find().

const char* GraphSysErr::GetSysTitle ( Int_t  id) const
inline

Get title of systematic error.

Parameters
idIdentifier
Returns
Name

Definition at line 3751 of file GraphSysErr.C.

References Find().

Double_t GraphSysErr::GetX ( Int_t  p) const
inline
Parameters
pPoint
Returns
X at point

Definition at line 3605 of file GraphSysErr.C.

References fData.

Referenced by Average(), Export(), ExportPoint(), FindPoint(), FWHM(), GetMinMax(), Integral(), NextPoint(), Print(), Ratio(), SavePrimitive(), Scale(), StatisticsX(), and Symmetrize().

const char* GraphSysErr::GetXTitle ( ) const
inline

Get name of X axis.

Returns
X-axis name

Definition at line 3961 of file GraphSysErr.C.

References fXTitle.

Referenced by CopyAttr().

Double_t GraphSysErr::GetY ( Int_t  point) const
inline
Parameters
pointPoint
Returns
Y at point

Definition at line 3623 of file GraphSysErr.C.

References fData.

Referenced by Average(), ExportPoint(), GetMinMax(), GetSysErrorYDown(), GetSysErrorYUp(), Ratio(), SavePrimitive(), Scale(), and Symmetrize().

Double_t GraphSysErr::GetYandError ( Int_t  i,
Bool_t  cmn,
Bool_t  stat,
Bool_t  quad,
Bool_t  nosqrt,
Double_t &  eyl,
Double_t &  eyh 
) const
inline

Get the point value and low and high errors.

Parameters
iPoint number
cmnConsider commons
statConsider statistics
quadAdd in quadrature
nosqrtDo not take square root in case quad=true
eylOutput: Low error
eyhOutput: high error
Returns

Definition at line 6602 of file GraphSysErr.C.

Referenced by Average(), FindFwhm(), FindYandError(), GetMinMax(), Integral(), NextPoint(), Print(), Ratio(), StatisticsX(), and Symmetrize().

Double_t GraphSysErr::GetYandError ( Int_t  i,
Bool_t  cmn,
Bool_t  stat,
Bool_t  quad,
Bool_t  nosqrt,
Double_t &  eyl,
Double_t &  eyh,
Double_t &  wyl,
Double_t &  wyh 
) const
inline

Get the point value and low and high errors.

Errors that have been marked as used (kUsedBit) are not considered. Errors marked as only for weights (kWeightsOnlyBit) are only factored in on the weights (weyl, weyh) calculation. Statistical errors are always factored in on the calculation of weights.

Parameters
iPoint number
cmnConsider commons
statConsider statistics
quadAdd in quadrature
nosqrtDo not take square root in case quad=true
eylOutput: Low error
eyhOutput: high error
wylOutput: Low weight
wyhOutput: high weight
Returns
The graph value at point i

Definition at line 6633 of file GraphSysErr.C.

References fCommon, GraphSysErr::Combiner::fData, fPoint2Point, fSumOption, GetErrorXLeft(), GetErrorXRight(), GetStatErrorDown(), GetStatErrorUp(), kOnlyWeightBit, kUsedBit, GraphSysErr::HolderP2P::SumPointError(), GraphSysErr::HolderCommon::SumPointError(), and GraphSysErr::Holder::XMode().

const char* GraphSysErr::GetYTitle ( ) const
inline

Get name of Y axis.

Returns
Y-axis name

Definition at line 3967 of file GraphSysErr.C.

References fYTitle.

Referenced by CopyAttr().

static TSeqCollection* GraphSysErr::Import ( const TString &  fileName)
inlinestatic

Import all data sets from a Durham input formatted file.

The data sets are returned in a flat collection. The collection owns the contained the objects and it is the responsibility of the caller to manage the returned collection.

The returned GraphSysErr objects are named like

*   ds_INDEX_SUB-INDEX  
* 
Parameters
fileNameName of file to read.
Returns
Pointer to newly allocated collection of graphs, or 0 in case of errors. Note that the returned collection may be empty
Examples:
TestImport.C, and TestMultiImport.C.

Definition at line 2983 of file GraphSysErr.C.

References CopyKeys(), kImport, and kVerbose.

static GraphSysErr* GraphSysErr::Import ( std::istream &  in,
UShort_t  idx = 0,
UShort_t *  nIdx = 0 
)
inlinestatic

Import data from input formatted Durham database file.

dndeta_pa.png

The source input file of the above graph is

*dataset:
*location: F 1
*reackey: P PB --> CHARGED X
*obskey: DN/DETARAP
*dscomment: The pseudorapidity density of charged particles in the lab. frame
*qual: RE : P PB --> CHARGED X
*qual: SQRT(S)/NUCLEON IN GEV : 5020.0
*xheader: ETARAP(C=LAB)
*yheader: D(N)/DETARAP
*data: x : y
-2.0 TO -1.9; 16.590 +- 0.178 (DSYS=0.65);
-1.9 TO -1.8; 16.715 +- 0.109 (DSYS=0.654);
-1.8 TO -1.7; 17.061 +- 0.083 (DSYS=0.665);
-1.7 TO -1.6; 17.157 +- 0.066 (DSYS=0.667);
-1.6 TO -1.5; 17.267 +- 0.054 (DSYS=0.67);
-1.5 TO -1.4; 17.400 +- 0.047 (DSYS=0.674);
-1.4 TO -1.3; 17.595 +- 0.044 (DSYS=0.681);
-1.3 TO -1.2; 17.632 +- 0.039 (DSYS=0.682);
-1.2 TO -1.1; 17.681 +- 0.037 (DSYS=0.683);
-1.1 TO -1.0; 17.607 +- 0.035 (DSYS=0.68);
-1.0 TO -0.9; 17.545 +- 0.033 (DSYS=0.677);
-0.9 TO -0.8; 17.519 +- 0.032 (DSYS=0.676);
-0.8 TO -0.7; 17.445 +- 0.032 (DSYS=0.673);
-0.7 TO -0.6; 17.348 +- 0.031 (DSYS=0.669);
-0.6 TO -0.5; 17.253 +- 0.03 (DSYS=0.665);
-0.5 TO -0.4; 17.195 +- 0.03 (DSYS=0.663);
-0.4 TO -0.3; 17.160 +- 0.03 (DSYS=0.661);
-0.3 TO -0.2; 17.123 +- 0.029 (DSYS=0.659);
-0.2 TO -0.1; 17.174 +- 0.029 (DSYS=0.661);
-0.1 TO 0.0; 17.173 +- 0.029 (DSYS=0.661);
0.0 TO 0.1; 17.299 +- 0.029 (DSYS=0.666);
0.1 TO 0.2; 17.359 +- 0.029 (DSYS=0.669);
0.2 TO 0.3; 17.509 +- 0.029 (DSYS=0.674);
0.3 TO 0.4; 17.655 +- 0.03 (DSYS=0.68);
0.4 TO 0.5; 17.891 +- 0.03 (DSYS=0.689);
0.5 TO 0.6; 18.031 +- 0.03 (DSYS=0.695);
0.6 TO 0.7; 18.195 +- 0.031 (DSYS=0.701);
0.7 TO 0.8; 18.424 +- 0.031 (DSYS=0.71);
0.8 TO 0.9; 18.629 +- 0.032 (DSYS=0.718);
0.9 TO 1.0; 18.811 +- 0.033 (DSYS=0.726);
1.0 TO 1.1; 19.050 +- 0.034 (DSYS=0.735);
1.1 TO 1.2; 19.229 +- 0.036 (DSYS=0.743);
1.2 TO 1.3; 19.385 +- 0.037 (DSYS=0.75);
1.3 TO 1.4; 19.609 +- 0.041 (DSYS=0.759);
1.4 TO 1.5; 19.703 +- 0.043 (DSYS=0.764);
1.5 TO 1.6; 19.852 +- 0.049 (DSYS=0.771);
1.6 TO 1.7; 19.816 +- 0.058 (DSYS=0.771);
1.7 TO 1.8; 19.866 +- 0.071 (DSYS=0.776);
1.8 TO 1.9; 19.901 +- 0.091 (DSYS=0.781);
1.9 TO 2.0; 19.709 +- 0.141 (DSYS=0.776);
*dataend:
Note
This is not omnipotent. While the function works for most typical inputs. it can fail for particular inputs.

To read multiple graphs, use GraphSysErr::Import(const TString&)

Parameters
inInput stream
idxColumn of data set to import.
nIdxIf non-null, holds the number of available columns on return.
Returns
Newly allocated object or null

Definition at line 3033 of file GraphSysErr.C.

References AddQualifier(), DeclarePoint2Point(), DefineCommon(), ExtractField(), FindId(), FindP2P(), GraphSysErr(), ImportError(), ImportPoint(), GraphSysErr::Holder::IsRelative(), IsStatRelative(), kImport, kRect, kVerbose, SetKey(), SetPoint(), SetPointError(), SetStatError(), SetStatRelative(), SetSysError(), SetSysFillColor(), SetSysFillStyle(), SetSysLineColor(), SetTitle(), SetXTitle(), SetYTitle(), and Token().

static Bool_t GraphSysErr::ImportError ( const TString &  s,
Double_t &  el,
Double_t &  eh,
Bool_t &  rel 
)
inlinestaticprotected

Import errors from a string.

Parameters
sString to parse
elOn return, the low error
ehOn return, the high error
relOn returm, true if relative
Returns
true on success

Definition at line 7191 of file GraphSysErr.C.

References Token().

Referenced by Import().

static Bool_t GraphSysErr::ImportPoint ( const TString &  s,
Double_t &  v,
Double_t &  el,
Double_t &  eh,
Bool_t &  rel 
)
inlinestaticprotected

Service function to import a point value (X or Y) with errors.

Parameters
sString to parse
vOn return, the value
elOn return, the lower error
ehOn return, the higher error
relOn return, true if the errors are relative to the value
Returns
true on success

Definition at line 7255 of file GraphSysErr.C.

References Token().

Referenced by Import().

Double_t GraphSysErr::Integral ( Double_t &  error,
Option_t *  option = "quad sum stat",
UShort_t  first = 0,
Short_t  last = -1 
)
inline

Calculate the intergral and error on integral of the graph.

Parameters
errorOn return, the error on the integral
optionWhat to take into account (see Draw)
firstFirst point to evalute at
lastLast point to evaluate at
Returns
The integral

Definition at line 1514 of file GraphSysErr.C.

References GetErrorXLeft(), GetErrorXRight(), GetN(), GetX(), and GetYandError().

Bool_t GraphSysErr::IsCommon ( Int_t  id) const
inline

Definition at line 3648 of file GraphSysErr.C.

References FindCommon().

virtual Bool_t GraphSysErr::IsFolder ( ) const
inlinevirtual

Say that this should be shown as a folder.

Returns
true

Definition at line 670 of file GraphSysErr.C.

Bool_t GraphSysErr::IsRelative ( Int_t  id) const
inline

Check if an error is relative.

Parameters
id
Returns

Definition at line 3660 of file GraphSysErr.C.

References FindCommon(), FindP2P(), and GraphSysErr::Holder::IsRelative().

Referenced by Average(), Export(), GraphSysErr::Holder::Print(), GraphSysErr::HolderCommon::Print(), Ratio(), and GraphSysErr::HolderP2P::SavePrimitive().

Bool_t GraphSysErr::IsStatRelative ( ) const
inline

Check if statistical errors are relative.

Returns
true if statistical errors are defined as relative

Definition at line 3488 of file GraphSysErr.C.

References fStatRelative.

Referenced by Average(), Import(), and SavePrimitive().

static Double_t GraphSysErr::KolomogorovTest ( const GraphSysErr g1,
const GraphSysErr g2 
)
inlinestatic

Perform a Kolomogorov-Smironov test.

See als

https://root.cern.ch/root/htmldoc/TH1#TH1:KolmogorovTest

Parameters
g1First graph.
g2Second graph
Returns
Kolomogorov-Smirnov probability

Definition at line 2055 of file GraphSysErr.C.

static Double_t GraphSysErr::KolomogorovTest ( const GraphSysErr g1,
const GraphSysErr g2,
Double_t &  z 
)
inlinestatic

Perform a Kolomogorov-Smironov test.

See als

https://root.cern.ch/root/htmldoc/TH1#TH1:KolmogorovTest

Parameters
g1First graph.
g2Second graph
zOn return, Kolomogorov-Smirnov test statistic
Returns
Kolomogorov-Smirnov probability

Definition at line 2072 of file GraphSysErr.C.

References CacheGraphs().

virtual void GraphSysErr::ls ( Option_t *  option = "") const
inlinevirtual

List the content.

Parameters
optionoption (not used)

Definition at line 483 of file GraphSysErr.C.

References Print().

void GraphSysErr::MakeDataGraph ( Int_t  n)
inlineprotected

Make our data graph.

Parameters
nOptional number of pre-allocated points

Definition at line 7388 of file GraphSysErr.C.

References GraphSysErr::Combiner::fData.

Referenced by GraphSysErr().

TMultiGraph* GraphSysErr::MakeMulti ( Option_t *  option)
inlineprotected
Double_t GraphSysErr::MeanX ( Double_t &  error,
Bool_t  cmn = false,
Bool_t  stat = true,
Bool_t  quad = true 
) const
inline

Calculate the mean along X.

The strategy used here is the same as for TH1::GetMean - that is the weighted average using the Y values as weights.

If both the mean and standard deviation are needed, one can use the function StatisticsX directly, and calculate the errors as outlined there.

Parameters
errorOn return, the error on the mean
cmnIf true, use common uncertainties
statIf true, use statistical errors
quadIf true, add in quadrature
Returns
The weighted of X

Definition at line 4184 of file GraphSysErr.C.

References StatisticsX().

Referenced by MeanX().

Double_t GraphSysErr::MeanX ( Bool_t  cmn = false,
Bool_t  stat = true,
Bool_t  quad = true 
) const
inline

Calculate the mean along X.

The strategy used here is the same as for TH1::GetMean - that is the weighted average using the Y values as weights.

If both the mean and standard deviation are needed, one can use the function StatisticsX directly, and calculate the errors as outlined there.

Parameters
cmnIf true, use common uncertainties
statIf true, use statistical errors
quadIf true, add in quadrature
Returns
The mean

Definition at line 4209 of file GraphSysErr.C.

References MeanX().

static Bool_t GraphSysErr::NextPoint ( Int_t  i,
const GraphSysErr num,
const GraphSysErr denom,
Double_t &  x,
Double_t &  dY,
Double_t &  dEyl,
Double_t &  dEyh,
Double_t &  nY,
Double_t &  nEyl,
Double_t &  nEyh 
)
inlinestatic

Find the next point and for ratio.

Parameters
iPoint numver
numNumerator
denomDenominator
xOn return, the X value
dYOn return, the denominator Y
dEylOn return, the denominator lower error on Y
dEyhOn return, the denominator upper error on Y
nYOn return, the numerator Y
nEylOn return, the numerator lower error on Y
nEyhOn return, the numerator upper error on Y
Returns

Definition at line 1566 of file GraphSysErr.C.

References FindYandError(), GetX(), and GetYandError().

Referenced by CacheGraphs().

GraphSysErr& GraphSysErr::operator= ( const GraphSysErr other)
inline

Assignment operator.

Parameters
otherObject to copy from
Returns
reference to this

Definition at line 416 of file GraphSysErr.C.

References fCommon, fCommonSumFill, fCommonSumLine, fCommonSumOption, fCommonSumTitle, fCounter, fData, fDrawn, fMap, fPoint2Point, fQualifiers, fStatRelative, fSumFill, fSumLine, fSumOption, fSumTitle, fXTitle, and fYTitle.

virtual void GraphSysErr::Print ( Option_t *  option = "R") const
inlinevirtual
static GraphSysErr* GraphSysErr::Ratio ( const GraphSysErr num,
const GraphSysErr den,
UInt_t  flags = kRatioDefault,
Double_t  fac = 1 
)
inlinestatic
GraphSysErr* GraphSysErr::Reflect ( Double_t  x0 = 0) const
inline

Make a copy of the graph, and reflect around x0.

Parameters
x0Where to reflect around
Returns
Newly allocated graph

Definition at line 2301 of file GraphSysErr.C.

References GetN(), GraphSysErr(), and SwapPoints().

void GraphSysErr::RemovePoint ( Int_t  i)
inline

Remove a point from the graph.

Parameters
iPoint to remove

Definition at line 2267 of file GraphSysErr.C.

References fData, GraphSysErr::HolderP2P::fGraph, fPoint2Point, and GetN().

void GraphSysErr::RemoveQualifier ( const TString &  key)
inline

Remove a qualifier.

Parameters
keyWhich to remove

Definition at line 4776 of file GraphSysErr.C.

References fQualifiers.

void GraphSysErr::RemoveSysError ( Int_t  id)
inline

Definition at line 3394 of file GraphSysErr.C.

References fCommon, FindCommon(), FindP2P(), and fPoint2Point.

Referenced by Symmetrize().

static Double_t GraphSysErr::Round ( Double_t  v,
Int_t  p,
Int_t &  rexpo 
)
inlinestatic

Round number v to n significant digits.

It returns the mantisa and the exponent. To calculate the number, do

Int_t e = 0;
Double_t m = Round(v,n,e);
Double_t x = m * TMath::Power(10,e);

If one has a value x and and associated error dx, one can use this function to format the pair:

Int_t e = 0;
Double_t m = Round(dx,n,e);
Double_t p = m * TMath::Power(10,e);
Int_t o = TMath::Ceil(TMath::Log10(TMath::Abs(x)))-e;
std::cout << std::setprecision(o) << x << " +/- "
<< std::setprecision(n) << p << std::endl;

For asymmetric errors, this would be

Int_t el, eh;
Double_t ml = Round(dxl,n,el);
Double_t m2 = Round(dxh,n,eh);
Int_t ne = TMath::Min(el, eh);
Double_t pl = ml * TMath::Power(10,el);
Double_t ph = mh * TMath::Power(10,eh);
Int_t o = TMath::Ceil(TMath::Log10(TMath::Abs(x)))-ne;
std::cout << std::setprecision(o) << x << " -"
<< std::setprecision(n) << pl << " +"
<< std::setprecision(n) << ph << std::endl;
Parameters
vValue to round
pNumber of signficant digits
rexpoOn return, the exponent
Returns
The "mantisa"

Definition at line 6739 of file GraphSysErr.C.

References RoundN().

Referenced by ExportError(), and ExportPoint().

static Double_t GraphSysErr::RoundN ( Double_t  tens,
Double_t  tmp 
)
inlinestaticprotected

Round number.

tens is the scaling divisor to convert tmp into an integer with n significant digits.

The algorightm looks at the n+1 significant digit d, and depending on the value of that, it does one of the following:

  • if d > 5, it rounds the number up
  • if d < 5, it rounds the number down.
  • if d = 5, then the n+2 significant digit dd is investigated.
    • if dd = 0 then the number is rounded up nearest even number
    • if dd != 0 the the number is rounded down
Parameters
tensThe scaling of the number to integer
tmpThe absolute value of the number
Returns
The rounded number

Definition at line 7138 of file GraphSysErr.C.

Referenced by Round().

void GraphSysErr::Save ( const char *  fileName)
inline

Save to a ROOT script.

Parameters
fileNameScript to write to

Definition at line 2557 of file GraphSysErr.C.

References SavePrimitive().

void GraphSysErr::SavePrimitive ( std::ostream &  out,
Option_t *  option = "" 
)
inline
void GraphSysErr::Scale ( TF1 *  f,
Double_t  s = 1 
)
inline
void GraphSysErr::Scale ( Double_t  s)
inline
void GraphSysErr::SetCommonSumFillColor ( Color_t  color)
inline

Set the fill color of the sumtematice error identified by ID.

Parameters
colorFill color

Definition at line 4511 of file GraphSysErr.C.

References fCommonSumFill.

Referenced by CopyAttr().

void GraphSysErr::SetCommonSumFillStyle ( Style_t  style)
inline

Set the fill style of the sumtematice error identified by ID.

Parameters
styleFill style

Definition at line 4517 of file GraphSysErr.C.

References fCommonSumFill.

Referenced by CopyAttr().

void GraphSysErr::SetCommonSumLineColor ( Color_t  color)
inline

Set the line color of the sumtematice error identified by ID.

Parameters
colorLine Color

Definition at line 4493 of file GraphSysErr.C.

References fCommonSumLine.

Referenced by CopyAttr().

void GraphSysErr::SetCommonSumLineStyle ( Style_t  style)
inline

Set the line style of the sumtematice error identified by ID.

Parameters
styleLine style

Definition at line 4499 of file GraphSysErr.C.

References fCommonSumLine.

Referenced by CopyAttr().

void GraphSysErr::SetCommonSumLineWidth ( Width_t  width)
inline

Set the line width of the sumtematice error identified by ID.

Parameters
widthLine width in pixels

Definition at line 4505 of file GraphSysErr.C.

References fCommonSumLine.

Referenced by CopyAttr().

void GraphSysErr::SetCommonSumOption ( EDrawOption_t  opt)
inline

Set the draw option for summed errors.

Parameters
optDraw option

Definition at line 4481 of file GraphSysErr.C.

References fCommonSumOption.

void GraphSysErr::SetCommonSumTitle ( const char *  title)
inline

Set the title uses for summed errors.

Parameters
titleTitle

Definition at line 4487 of file GraphSysErr.C.

References fCommonSumTitle.

Referenced by CopyAttr().

void GraphSysErr::SetDataOption ( EDrawOption_t  opt)
inline

Set the draw option for the data and statistical errors.

Parameters
optDraw option
Examples:
Example.C.

Definition at line 3576 of file GraphSysErr.C.

References fDataOption.

Referenced by Example().

void GraphSysErr::SetKey ( const char *  key,
const char *  value,
Bool_t  replace = false 
)
inline

Set a key/value pair.

This can be used to fill out fields in a Durham input file for uploading.

File Keys

  • cdsId Should be the number of the CERN Document Server entry
  • inspireId Should be the number of the inSpire record
  • durhamId Will be given on upload
  • reference One, or more, list of references, followed by the year
  • laboratory Main laboratory name
  • accelerator Facility
  • detector The experimental apparatus
  • title Title of the paper
  • author Last name of first author in all-caps.

Data-set keys

  • reackey The reaction
  • obskey The observable
  • location Location of figure in paper
  • dscomment Comments on data set
  • qual One or more entries of qualifiers. Must contain a value (separated by colons) for each X and Y value

At least one qual line will be written with the title of the data set as the Y value.

GraphSysErr g("foo","bar");
// Over all header keys
g.SetKey("cdsId", "1483543");
g.SetKey("inspireId", "1190545");
g.SetKey("durhamId", "6047");
g.SetKey("reference", "ARXIV:1210.3615 : 2012");
g.SetKey("reference", "CERN-PH-EP-2012-307 : 2012");
g.SetKey("laboratory", "CERN");
g.SetKey("accelerator", "LHC");
g.SetKey("detector", "ALICE");
g.SetKey("title", "Pseudorapidity density of charged particles "
"in p-Pb collisions at sqrt{s_{NN}}=5.02");
g.SetKey("author", "ABELEV");
// Data set specific keys
g.SetKey("reackey", "P PB --> CHARGED X");
g.SetKey("obskey" "DN/DETARAP");
g.SetKey("qual" "RE : P PB --> CHARGED X");
g.SetKey("qual" "SQRT(S)/NUCLEON in GEV : 5020.0")
...
g.Export();
Parameters
keyKey.
valueValue.
replaceIf true, remove all values of key and set new value
Examples:
Example.C.

Definition at line 4577 of file GraphSysErr.C.

References fMap, GetKey(), and Token().

Referenced by CopyKeys(), Example(), and Import().

void GraphSysErr::SetPoint ( Int_t  i,
Double_t  x,
Double_t  y 
)
inline

Set the ith data point.

Parameters
i
x
y
Examples:
Example.C.

Definition at line 3447 of file GraphSysErr.C.

References fData.

Referenced by Average(), Example(), Import(), Ratio(), Scale(), and Symmetrize().

void GraphSysErr::SetPointError ( Int_t  i,
Double_t  ex 
)
inline

Set the X error (bin width) of the ith point.

Parameters
iPoint
exError
Examples:
Example.C.

Definition at line 3458 of file GraphSysErr.C.

Referenced by Average(), Example(), Import(), Ratio(), and Symmetrize().

void GraphSysErr::SetPointError ( Int_t  i,
Double_t  exl,
Double_t  exh 
)
inline

Set the X error (bin width) of the ith point.

Parameters
iPoint
exlLower error
exhUpper error

Definition at line 3469 of file GraphSysErr.C.

References fData.

void GraphSysErr::SetStatError ( Int_t  i,
Double_t  ey 
)
inline

Set the statistical error on the ith data point.

Parameters
iPoint number
eyError on Y
Examples:
Example.C.

Definition at line 3495 of file GraphSysErr.C.

Referenced by Average(), Example(), Import(), Ratio(), Scale(), and Symmetrize().

void GraphSysErr::SetStatError ( Int_t  i,
Double_t  eyl,
Double_t  eyh 
)
inline

Definition at line 3506 of file GraphSysErr.C.

References fData, and fStatRelative.

void GraphSysErr::SetStatRelative ( Bool_t  rel)
inline

Set whether statistical errors should be considered relative.

Parameters
relIf true, statistical errors are specified relative to the y values.

Definition at line 3482 of file GraphSysErr.C.

References fStatRelative.

Referenced by Import().

void GraphSysErr::SetSumFillColor ( Color_t  color)
inline

Set the fill color of the sumtematice error identified by ID.

Parameters
colorFill color

Definition at line 4469 of file GraphSysErr.C.

References fSumFill.

Referenced by CopyAttr().

void GraphSysErr::SetSumFillStyle ( Style_t  style)
inline

Set the fill style of the sumtematice error identified by ID.

Parameters
styleFill style

Definition at line 4475 of file GraphSysErr.C.

References fSumFill.

Referenced by CopyAttr().

void GraphSysErr::SetSumLineColor ( Color_t  color)
inline

Set the line color of the sumtematice error identified by ID.

Parameters
colorLine Color
Examples:
Example.C.

Definition at line 4451 of file GraphSysErr.C.

References fSumLine.

Referenced by CopyAttr(), and Example().

void GraphSysErr::SetSumLineStyle ( Style_t  style)
inline

Set the line style of the sumtematice error identified by ID.

Parameters
styleLine style

Definition at line 4457 of file GraphSysErr.C.

References fSumLine.

Referenced by CopyAttr().

void GraphSysErr::SetSumLineWidth ( Width_t  width)
inline

Set the line width of the sumtematice error identified by ID.

Parameters
widthLine width in pixels
Examples:
Example.C.

Definition at line 4463 of file GraphSysErr.C.

References fSumLine.

Referenced by CopyAttr(), and Example().

void GraphSysErr::SetSumOption ( EDrawOption_t  opt)
inline

Set the draw option for summed errors.

Parameters
optDraw option
Examples:
Example.C.

Definition at line 4439 of file GraphSysErr.C.

References fSumOption.

Referenced by Example().

void GraphSysErr::SetSumTitle ( const char *  title)
inline

Set the title uses for summed errors.

Parameters
titleTitle
Examples:
Example.C.

Definition at line 4445 of file GraphSysErr.C.

References fSumTitle.

Referenced by CopyAttr(), and Example().

void GraphSysErr::SetSysError ( Int_t  id,
Double_t  eyl,
Double_t  eyh 
)
inline
Examples:
Example.C.

Definition at line 3518 of file GraphSysErr.C.

References FindCommon(), and GraphSysErr::HolderCommon::Set().

Referenced by Average(), Example(), Import(), Ratio(), Scale(), and Symmetrize().

void GraphSysErr::SetSysError ( Int_t  id,
Int_t  i,
Double_t  ex,
Double_t  ey 
)
inline

Set the systematic error identified by id on the ith data point.

Parameters
idSystematic error identifier
iPoint number (starting at 0)
exX error
eyY error

Definition at line 3532 of file GraphSysErr.C.

References fData, FindP2P(), and GraphSysErr::HolderP2P::Set().

void GraphSysErr::SetSysError ( Int_t  id,
Int_t  i,
Double_t  exl,
Double_t  exh,
Double_t  eyl,
Double_t  eyh 
)
inline

Set the systematic error identified by id on the ith data point.

Parameters
idSystematic error identifier
iPoint number (starting at 0)
exlLeft X error
exhRight X error
eylLower Y error
eyhUpper Y error

Definition at line 3548 of file GraphSysErr.C.

References fData, FindP2P(), and GraphSysErr::HolderP2P::Set().

void GraphSysErr::SetSysFillColor ( Int_t  id,
Color_t  color 
)
inline

Set the fill color of the systematice error identified by ID.

Parameters
idSystematic error identifier
colorColor
Examples:
Example.C.

Definition at line 4385 of file GraphSysErr.C.

References Find().

Referenced by Average(), Example(), and Import().

void GraphSysErr::SetSysFillStyle ( Int_t  id,
Style_t  style 
)
inline

Set the fill style of the systematice error identified by ID.

Parameters
idSystematic error identifier
styleFill style
Examples:
Example.C.

Definition at line 4397 of file GraphSysErr.C.

References Find().

Referenced by Average(), Example(), and Import().

void GraphSysErr::SetSysLineColor ( Int_t  id,
Color_t  color 
)
inline

Set the line color of the systematice error identified by ID.

Parameters
idSystematic error identifier
colorLine color
Examples:
Example.C.

Definition at line 4349 of file GraphSysErr.C.

References Find().

Referenced by Average(), Example(), and Import().

void GraphSysErr::SetSysLineStyle ( Int_t  id,
Style_t  style 
)
inline

Set the line style of the systematice error identified by ID.

Parameters
idSystematic error identifier
styleLine style

Definition at line 4361 of file GraphSysErr.C.

References Find().

void GraphSysErr::SetSysLineWidth ( Int_t  id,
Width_t  width 
)
inline

Set the line width of the systematice error identified by ID.

Parameters
idSystematic error identifier
widthLine width
Examples:
Example.C.

Definition at line 4373 of file GraphSysErr.C.

References Find().

Referenced by Example().

void GraphSysErr::SetSysOption ( Int_t  id,
EDrawOption_t  opt 
)
inline

Set the draw option for a specific systematic error.

Parameters
idSystematic error identifier
optDraw option
Examples:
Example.C.

Definition at line 4421 of file GraphSysErr.C.

References Find(), and GraphSysErr::Holder::SetDOption().

Referenced by Example().

void GraphSysErr::SetSysTitle ( Int_t  id,
const char *  name 
)
inline

Set the systematic error title.

Parameters
idSystematic error identifier
nameThe title

Definition at line 4409 of file GraphSysErr.C.

References Find().

void GraphSysErr::SetTitle ( const char *  name)
inline

Set the title of the data.

Parameters
nameTitle

Definition at line 3566 of file GraphSysErr.C.

References fData.

Referenced by AddQualifier(), and Import().

void GraphSysErr::SetXTitle ( const char *  title)
inline

Set title on X axis.

Parameters
title
Examples:
Example.C.

Definition at line 3582 of file GraphSysErr.C.

References fXTitle.

Referenced by CopyAttr(), Example(), and Import().

void GraphSysErr::SetYTitle ( const char *  title)
inline

Set title on y axis.

Parameters
title
Examples:
Example.C.

Definition at line 3588 of file GraphSysErr.C.

References fYTitle.

Referenced by CopyAttr(), Example(), and Import().

void GraphSysErr::SqrtGraph ( Graph g)
inlineprotected

Take the square root of the errors.

Parameters
gGraph

Definition at line 7348 of file GraphSysErr.C.

References SqrtPoint().

Referenced by MakeMulti().

void GraphSysErr::SqrtPoint ( Graph g,
Int_t  i 
)
inlineprotected

Take the square root of the errors at point.

Parameters
gGraph
iPoint

Definition at line 7331 of file GraphSysErr.C.

References kDraw, and kVerbose.

Referenced by MakeMulti(), and SqrtGraph().

Double_t GraphSysErr::StandardDeviationX ( Double_t &  error,
Bool_t  cmn = false,
Bool_t  stat = true,
Bool_t  quad = true 
) const
inline

Calculate the standard deviatin along X.

The strategy used here is the same as for TH1::GetMean - that is the weighted average using the Y values as weights.

If both the mean and standard deviation are needed, one can use the function StatisticsX directly, and calculate the errors as outlined there.

Parameters
errorOn return, the error on the standard deviation
cmnIf true, use common uncertainties
statIf true, use statistical errors
quadIf true, add in quadrature
Returns
The standard deviation

Definition at line 4232 of file GraphSysErr.C.

References StatisticsX().

Referenced by StandardDeviationX().

Double_t GraphSysErr::StandardDeviationX ( Bool_t  cmn = false,
Bool_t  stat = true,
Bool_t  quad = true 
) const
inline

Calculate the standard deviatin along X.

The strategy used here is the same as for TH1::GetMean - that is the weighted average using the Y values as weights.

If both the mean and standard deviation are needed, one can use the function StatisticsX directly, and calculate the errors as outlined there.

Parameters
cmnIf true, use common uncertainties
statIf true, use statistical errors
quadIf true, add in quadrature
Returns
The standard deviation

Definition at line 4257 of file GraphSysErr.C.

References StandardDeviationX().

Double_t GraphSysErr::StandardDeviationXMean ( Double_t  mean,
Double_t &  error,
Bool_t  cmn = false,
Bool_t  stat = true,
Bool_t  quad = true 
) const
inline

Definition at line 4264 of file GraphSysErr.C.

References StatisticsX().

void GraphSysErr::StatisticsX ( Double_t &  meanX,
Double_t &  stdDevX,
Double_t &  n,
Bool_t  cmn = false,
Bool_t  stat = true,
Bool_t  quad = true 
) const
inline

Calculates the statistics of X.

\begin{eqnarray*} \bar{x} &=& \frac{\sum xy}{\sum y}\\ s_x &=& \sqrt{\frac{\sum x^2y}{\sum y}-\bar{x}^2}\\ n &=& \frac{(\sum y)^2}{\sum \delta^2 y}\\ \end{eqnarray*}

The errors on $\bar{x}$ and $ s_x$ is given by

\begin{eqnarray*} \delta\bar{x} &=& s_x/n\\ \delta s_x &=& s_x/(\sqrt{2}n)\\ \end{eqnarray*}

Note
The variable passed for meanX must have the value inf (use TMath::Infinity()) to get the calculated mean back. Any other value will be taken as the mean for the reminder of the calculaitions. This is useful if one wants to calculate the standard deviation around some pre-determined mean rather than the sample mean.
Parameters
meanXOn return, $\bar{x}$
stdDevXOn return, $ s_x$
nOn return, $ n $ (effective entries)
cmnIf true, use common uncertainties
statIf true, use statistical errors
quadIf true, add in quadrature

Definition at line 4308 of file GraphSysErr.C.

References GetN(), GetX(), and GetYandError().

Referenced by MeanX(), StandardDeviationX(), and StandardDeviationXMean().

static void GraphSysErr::StoreQual ( TList &  quals,
Int_t  idx,
const char *  name,
const char *  val 
)
inlinestaticprotected

Store a qualifier in a table.

Parameters
qualsTable.
idxColumn number
nameRow name
valThe cell content

Definition at line 6836 of file GraphSysErr.C.

Referenced by Export(), and StoreQual().

static void GraphSysErr::StoreQual ( TList &  quals,
Int_t  idx,
TObject *  q 
)
inlinestaticprotected

Store a qualifier in a table.

Parameters
qualsTable.
idxColumn number
qKey, value pair. The key is the row name

Definition at line 6859 of file GraphSysErr.C.

References StoreQual().

void GraphSysErr::SwapPoints ( Int_t  i,
Int_t  j,
Bool_t  reflect = false 
)
inline

Swap two points.

Parameters
iIndex
jIndex
reflectif true, multiply X values with -1

Definition at line 2284 of file GraphSysErr.C.

References fData, GraphSysErr::HolderP2P::fGraph, and fPoint2Point.

Referenced by Reflect().

static void GraphSysErr::SwapPoints ( Graph g,
Int_t  i,
Int_t  j,
Bool_t  reflect 
)
inlinestaticprotected

Definition at line 6775 of file GraphSysErr.C.

Bool_t GraphSysErr::Symmetrize ( GraphSysErr other)
inline
static TString& GraphSysErr::Token ( TObjArray *  c,
UShort_t  idx,
Bool_t  verbose = true 
)
inlinestaticprotected

Get the ith token from the array of tokens c.

Parameters
cArray of tokens
idxWhich to get
verboseBe verbose
Returns
Rererence to the token, or the empty string

Definition at line 7169 of file GraphSysErr.C.

Referenced by Import(), ImportError(), ImportPoint(), and SetKey().

Member Data Documentation

TList GraphSysErr::fCommon
protected
TAttFill GraphSysErr::fCommonSumFill
protected
TAttLine GraphSysErr::fCommonSumLine
protected
UInt_t GraphSysErr::fCommonSumOption
protected
TString GraphSysErr::fCommonSumTitle
protected

Title on summed errors.

Definition at line 7890 of file GraphSysErr.C.

Referenced by GetCommonSumTitle(), operator=(), Print(), SavePrimitive(), and SetCommonSumTitle().

UInt_t GraphSysErr::fCounter
protected

Counter.

Definition at line 7876 of file GraphSysErr.C.

Referenced by DeclarePoint2Point(), DefineCommon(), GetNSys(), GraphSysErr(), and operator=().

TGraphAsymmErrors* GraphSysErr::fData
protected
UInt_t GraphSysErr::fDataOption
protected

Definition at line 7894 of file GraphSysErr.C.

Referenced by CopyAttr(), MakeMulti(), Print(), SavePrimitive(), and SetDataOption().

TMultiGraph* GraphSysErr::fDrawn
protected

The drawn graphs.

Definition at line 7874 of file GraphSysErr.C.

Referenced by Browse(), Draw(), Fit(), GetMulti(), operator=(), SavePrimitive(), and ~GraphSysErr().

TList* GraphSysErr::fMap
protected

Map of keys.

Definition at line 7900 of file GraphSysErr.C.

Referenced by Browse(), CopyKeys(), ExportKey(), GetKey(), operator=(), Print(), SetKey(), and ~GraphSysErr().

TList GraphSysErr::fPoint2Point
protected
TList* GraphSysErr::fQualifiers
protected

List of qualifiers.

Definition at line 7902 of file GraphSysErr.C.

Referenced by AddQualifier(), Browse(), CopyKeys(), Export(), GetQualifier(), operator=(), Print(), RemoveQualifier(), and ~GraphSysErr().

Bool_t GraphSysErr::fStatRelative
protected

Whether statistical errors are relative.

Definition at line 7904 of file GraphSysErr.C.

Referenced by ExportPoint(), IsStatRelative(), operator=(), SavePrimitive(), SetStatError(), and SetStatRelative().

TAttFill GraphSysErr::fSumFill
protected

Attributes of summed errors.

Definition at line 7878 of file GraphSysErr.C.

Referenced by GetSumFillColor(), GetSumFillStyle(), MakeMulti(), operator=(), Print(), SavePrimitive(), SetSumFillColor(), and SetSumFillStyle().

TAttLine GraphSysErr::fSumLine
protected
UInt_t GraphSysErr::fSumOption
protected
TString GraphSysErr::fSumTitle
protected

Title on summed errors.

Definition at line 7882 of file GraphSysErr.C.

Referenced by GetSumTitle(), MakeMulti(), operator=(), Print(), SavePrimitive(), and SetSumTitle().

TString GraphSysErr::fXTitle
protected

X title.

Definition at line 7896 of file GraphSysErr.C.

Referenced by Draw(), Export(), Fit(), GetXTitle(), operator=(), Print(), SavePrimitive(), and SetXTitle().

TString GraphSysErr::fYTitle
protected

Y title.

Definition at line 7898 of file GraphSysErr.C.

Referenced by Draw(), Export(), Fit(), GetYTitle(), operator=(), Print(), SavePrimitive(), and SetYTitle().


The documentation for this class was generated from the following file: