AliPhysics  fb6b143 (fb6b143)
GraphSysErr Class Reference
Inheritance diagram for GraphSysErr:

Classes

struct  Combiner
 
struct  Holder
 
struct  HolderCommon
 
struct  HolderP2P
 
struct  LinearSigmaCombiner
 
struct  LinearVarianceCombiner
 

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
}
 
enum  EChi2Type { kExperimentExperiment, kExperimentModel, kModelModel, kExperimentTruth }
 
enum  ERatioOption {
  kMax = 0x00001, kMin = 0x00002, kCancel = 0x00004, kDenomRel = 0x00008,
  kRatioDefault = kCancel
}
 
enum  { kUsedBit = (1 << 18), kOnlyWeightBit = (1 << 19) }
 
typedef TGraphAsymmErrors Graph
 

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
 
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
 
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
 
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
 
Allocation, dealloction, copy, and assignment
 GraphSysErr ()
 
 GraphSysErr (Int_t n)
 
 GraphSysErr (const char *name, const char *title, Int_t n=0)
 
 GraphSysErr (const GraphSysErr &other)
 
virtual ~GraphSysErr ()
 
GraphSysErroperator= (const GraphSysErr &other)
 
TObject functions
virtual void ls (Option_t *option="") const
 
virtual void Print (Option_t *option="R") const
 
virtual Bool_t IsFolder () const
 
virtual void Browse (TBrowser *b)
 
Drawing/Fitting
void Draw (Option_t *option="")
 
TFitResultPtr Fit (TF1 *f1, Option_t *fitOption, Option_t *drawOption, Axis_t min=0, Axis_t max=0)
 
TFitResultPtr Fit (const char *formula, Option_t *fitOption, Option_t *drawOption, Axis_t min=0, Axis_t max=0)
 
TMultiGraph * GetMulti (Option_t *option="")
 
Declaring systematic errors
UInt_t DefineCommon (const char *title, Bool_t relative, Double_t ey, EDrawOption_t option=kFill)
 
UInt_t DefineCommon (const char *title, Bool_t relative, Double_t eyl, Double_t eyh, EDrawOption_t option=kRect)
 
UInt_t DeclarePoint2Point (const char *title, Bool_t relative, EDrawOption_t option=kBar)
 
void RemoveSysError (Int_t id)
 
UInt_t FindId (const char *title) const
 
Int_t GetNSys () const
 
Setting the data and errors
void SetPoint (Int_t i, Double_t x, Double_t y)
 
void SetPointError (Int_t i, Double_t ex)
 
void SetPointError (Int_t i, Double_t exl, Double_t exh)
 
void SetStatRelative (Bool_t rel)
 
Bool_t IsStatRelative () const
 
void SetStatError (Int_t i, Double_t ey)
 
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)
 
void SetSysError (Int_t id, Int_t i, Double_t exl, Double_t exh, Double_t eyl, Double_t eyh)
 
Setting drawing options
void SetTitle (const char *name)
 
void SetDataOption (EDrawOption_t opt)
 
void SetXTitle (const char *title)
 
void SetYTitle (const char *title)
 
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
 
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
 
Style_t GetSysFillStyle (Int_t id) const
 
Style_t GetSysLineStyle (Int_t id) const
 
Color_t GetSysFillColor (Int_t id) const
 
Color_t GetSysLineColor (Int_t id) const
 
Width_t GetSysLineWidth (Int_t id) const
 
const char * GetSumTitle () const
 
UInt_t GetSumOption () const
 
Style_t GetSumFillStyle () const
 
Style_t GetSumLineStyle () const
 
Color_t GetSumFillColor () const
 
Color_t GetSumLineColor () const
 
Width_t GetSumLineWidth () const
 
const char * GetCommonSumTitle () const
 
UInt_t GetCommonSumOption () const
 
Style_t GetCommonSumFillStyle () const
 
Style_t GetCommonSumLineStyle () const
 
Color_t GetCommonSumFillColor () const
 
Color_t GetCommonSumLineColor () const
 
Width_t GetCommonSumLineWidth () const
 
Double_t GetCommonErrorYUp (Int_t id) const
 
Double_t GetCommonErrorYDown (Int_t id) const
 
const char * GetXTitle () const
 
const char * GetYTitle () const
 
void GetMinMax (Option_t *option, Double_t &ymin, Double_t &ymax) const
 
void GetMinMax (Option_t *option, Double_t &ymin, Double_t &ymax, Double_t &xmin, Double_t &xmax, Int_t &imin, Int_t &imax) const
 
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
 
Double_t FWHM (Double_t &el, Double_t &eh) const
 
Double_t FWHM (Double_t &el, Double_t &eh, Double_t &xl, Double_t &xh) const
 
Double_t MeanX (Double_t &error, Bool_t cmn=false, Bool_t stat=true, Bool_t quad=true) const
 
Double_t MeanX (Bool_t cmn=false, Bool_t stat=true, Bool_t quad=true) const
 
Double_t StandardDeviationX (Double_t &error, Bool_t cmn=false, Bool_t stat=true, Bool_t quad=true) const
 
Double_t StandardDeviationX (Bool_t cmn=false, Bool_t stat=true, Bool_t quad=true) const
 
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
 
Setting attributes on systematic errors
void SetSysLineColor (Int_t id, Color_t color)
 
void SetSysLineStyle (Int_t id, Style_t style)
 
void SetSysLineWidth (Int_t id, Width_t width)
 
void SetSysFillColor (Int_t id, Color_t color)
 
void SetSysFillStyle (Int_t id, Style_t style)
 
void SetSysTitle (Int_t id, const char *name)
 
void SetSysOption (Int_t id, EDrawOption_t opt)
 
Setting attributes on summed errors
void SetSumOption (EDrawOption_t opt)
 
void SetSumTitle (const char *title)
 
void SetSumLineColor (Color_t color)
 
void SetSumLineStyle (Style_t style)
 
void SetSumLineWidth (Width_t width)
 
void SetSumFillColor (Color_t color)
 
void SetSumFillStyle (Style_t style)
 
void SetCommonSumOption (EDrawOption_t opt)
 
void SetCommonSumTitle (const char *title)
 
void SetCommonSumLineColor (Color_t color)
 
void SetCommonSumLineStyle (Style_t style)
 
void SetCommonSumLineWidth (Width_t width)
 
void SetCommonSumFillColor (Color_t color)
 
void SetCommonSumFillStyle (Style_t style)
 
Key interface
void SetKey (const char *key, const char *value, Bool_t replace=false)
 
const char * GetKey (const char *key) const
 
void CopyKeys (const GraphSysErr *g, Option_t *option="fr")
 
void CopyAttr (const GraphSysErr *f)
 
Qualifiers
void AddQualifier (const TString &key, const TString &value, Bool_t replace=false)
 
void RemoveQualifier (const TString &key)
 
const char * GetQualifier (const char *name) const
 

Static Public Member Functions

static Double_t Round (Double_t v, Int_t p, Int_t &rexpo)
 

Protected Member Functions

Calculations
void SqrtPoint (Graph *g, Int_t i)
 
void SqrtGraph (Graph *g)
 
Graphics
const char * FormatOption (UInt_t opt)
 
void MakeDataGraph (Int_t n)
 
Int_t FindPoint (Double_t x, Int_t &i1, Int_t &i2, Double_t fac=1) const
 
TMultiGraph * MakeMulti (Option_t *option)
 
Internal searches
HolderP2PFindP2P (UInt_t id) const
 
HolderCommonFindCommon (UInt_t id) const
 
HolderCommonFindCompat (const HolderCommon *o, Double_t tol=1e-6, bool verb=false) const
 
HolderP2PFindCompat (const HolderP2P *o, Bool_t verb=false) const
 
HolderFind (UInt_t id) const
 

Static Protected Member Functions

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

Protected Attributes

TList fPoint2Point
 
TList fCommon
 
TGraphAsymmErrorsfData
 
TMultiGraph * fDrawn
 
UInt_t fCounter
 
TAttFill fSumFill
 
TAttLine fSumLine
 
TString fSumTitle
 
UInt_t fSumOption
 
TAttFill fCommonSumFill
 
TAttLine fCommonSumLine
 
TString fCommonSumTitle
 
UInt_t fCommonSumOption
 
UInt_t fDataOption
 
TString fXTitle
 
TString fYTitle
 
TListfMap
 
TListfQualifiers
 
Bool_t fStatRelative
 

Various operations

void Scale (TF1 *f, Double_t s=1)
 
void Scale (Double_t s)
 
Int_t Average (const TCollection *others, Bool_t sep=true)
 
Double_t Integral (Double_t &error, Option_t *option="quad sum stat", UShort_t first=0, Short_t last=-1)
 
void ClearUsed () const
 
void RemovePoint (Int_t i)
 
void SwapPoints (Int_t i, Int_t j, Bool_t reflect=false)
 
GraphSysErrReflect (Double_t x0=0) const
 
Bool_t Symmetrize (GraphSysErr *other)
 
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)
 
static GraphSysErrRatio (const GraphSysErr *num, const GraphSysErr *den, UInt_t flags=kRatioDefault, Double_t fac=1)
 
static Double_t KolomogorovTest (const GraphSysErr *g1, const GraphSysErr *g2)
 
static Double_t KolomogorovTest (const GraphSysErr *g1, const GraphSysErr *g2, Double_t &z)
 
static Int_t CacheGraphs (const GraphSysErr *g1, const GraphSysErr *g2, TArrayD &a1y, TArrayD &a2y, TArrayD &a1e2, TArrayD &a2e2)
 
static Double_t ChisquareTest (const GraphSysErr *g1, const GraphSysErr *g2, EChi2Type type=kExperimentTruth)
 
static Double_t ChisquareTest (const GraphSysErr *g1, const GraphSysErr *g2, Int_t &ndf, EChi2Type type)
 

Import/export

void SavePrimitive (std::ostream &out, Option_t *option="")
 
void Save (const char *fileName)
 
void Export (std::ostream &out=std::cout, Option_t *option="", Int_t nsign=2)
 
static void EscapeLtx (TString &val, const TString &fill="")
 
static void Export (const TSeqCollection *col, std::ostream &out, Option_t *option="H", Int_t nsign=0)
 
static TSeqCollection * Import (const TString &fileName)
 
static GraphSysErrImport (std::istream &in, UShort_t idx=0, UShort_t *nIdx=0)
 

Helpers for importing/exporting

static const char * FormatKey (const char *key)
 
static const char * ExtractField (const TString &value, Int_t idx)
 
static void StoreQual (TList &quals, Int_t idx, const char *name, const char *val)
 
static void StoreQual (TList &quals, Int_t idx, TObject *q)
 
static Int_t ExportError (std::ostream &o, Double_t low, Double_t high, Bool_t nopm, Bool_t rel, Int_t nsign)
 
static Double_t RoundN (Double_t tens, Double_t tmp)
 
static TStringToken (TObjArray *c, UShort_t idx, Bool_t verbose=true)
 
static Bool_t ImportError (const TString &s, Double_t &el, Double_t &eh, Bool_t &rel)
 
static Bool_t ImportPoint (const TString &s, Double_t &v, Double_t &el, Double_t &eh, Bool_t &rel)
 
std::ostream & ExportKey (std::ostream &out, const char *which, Bool_t alsoKey=true, const char *fill="<please fill in>") const
 
std::ostream & ExportHeader (std::ostream &out, Bool_t alsoTop=false, Bool_t alsoComment=false, Int_t nsign=-1) const
 
std::ostream & ExportPoint (std::ostream &out, Int_t i, Bool_t alsoX=true, Bool_t sysName=true, Int_t nsign=0) const
 

Detailed Description

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

Sources that can be specified are

  • 1 set Statistical errors
  • N sets of common systematic errors
  • M sets of point-to-point systematic errors.

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.

Definition at line 184 of file GraphSysErr.C.

Member Typedef Documentation

A short-hand type definition

Definition at line 196 of file GraphSysErr.C.

Member Enumeration Documentation

anonymous enum
Enumerator
kDraw 
kImport 
kExport 
kRatio 
kVerbose 

Definition at line 188 of file GraphSysErr.C.

anonymous enum
Enumerator
kUsedBit 
kOnlyWeightBit 

Definition at line 240 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 219 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 200 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 233 of file GraphSysErr.C.

Constructor & Destructor Documentation

GraphSysErr::GraphSysErr ( )
inline

Default CTOR - use only for I/O

Definition at line 251 of file GraphSysErr.C.

Referenced by 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 283 of file GraphSysErr.C.

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 321 of file GraphSysErr.C.

GraphSysErr::GraphSysErr ( const GraphSysErr other)
inline

Copy CTOR

Parameters
otherObject to copy from

Definition at line 357 of file GraphSysErr.C.

virtual GraphSysErr::~GraphSysErr ( )
inlinevirtual

DTOR

Definition at line 410 of file GraphSysErr.C.

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 4759 of file GraphSysErr.C.

Referenced by CopyKeys(), Import(), SysErrorAdder::Make(), MakeGSE(), MakeTGSE(), BareAdder::MakeTrigger(), INELAdder::MakeTrigger(), INELGt0Adder::MakeTrigger(), NSDAdder::MakeTrigger(), CENTAdder::MakeTrigger(), and ModOne().

Int_t GraphSysErr::Average ( const TCollection others,
Bool_t  sep = true 
)
inline

Average one or more graphs.

The resulting graph is the weighted mean of the input graphs. Common systematic errors common to all input graphs can be specified before hand.

All other errors are taken in to account and are propagated to point-to-point errors.

Parameters
othersList of graphs
sepIf true, then try to separate out point-to-point errors.

Definition at line 1013 of file GraphSysErr.C.

virtual void GraphSysErr::Browse ( TBrowser *  b)
inlinevirtual

Browse this object

Parameters
bBrowser to use

Definition at line 686 of file GraphSysErr.C.

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 2131 of file GraphSysErr.C.

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 2184 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 2204 of file GraphSysErr.C.

void GraphSysErr::ClearUsed ( ) const
inline

Clear bit we set during the processing

Definition at line 2040 of file GraphSysErr.C.

Referenced by Average(), and Ratio().

void GraphSysErr::CopyAttr ( const GraphSysErr f)
inline

Definition at line 4711 of file GraphSysErr.C.

Referenced by Ratio().

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 4661 of file GraphSysErr.C.

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 3393 of file GraphSysErr.C.

Referenced by Average(), Import(), SysErrorAdder::MakeDensity(), SysErrorAdder::MakeEmpirical(), SysErrorAdder::MakeHadron(), SysErrorAdder::MakeMerging(), MakeP2P(), 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 3350 of file GraphSysErr.C.

Referenced by Average(), Import(), MakeCommon(), SysErrorAdder::MakeTrigger(), INELAdder::MakeTrigger(), INELGt0Adder::MakeTrigger(), NSDAdder::MakeTrigger(), CENTAdder::MakeTrigger(), 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 3366 of file GraphSysErr.C.

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

A function to set-up an object

A function to make a canvs

Function to draw the stuff

Some utilies

Steering function to do all tests

The various ways we can draw the data

First, combining all systematic errors

Then, stacking all systematics.

We can also combine all errors

We can also stack the errors

First, combining all errors

End of the tester class

The entry point for the script

Examples:
Example.C.

Definition at line 791 of file GraphSysErr.C.

Referenced by DrawOne(), Extract(), QuickDraw(), and WithSysError().

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 2678 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

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

Definition at line 2612 of file GraphSysErr.C.

Referenced by ExtractGSE(), and ExtractGSE2().

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 2701 of file GraphSysErr.C.

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 6995 of file GraphSysErr.C.

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 6917 of file GraphSysErr.C.

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 6883 of file GraphSysErr.C.

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 7036 of file GraphSysErr.C.

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 6824 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 7744 of file GraphSysErr.C.

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 7763 of file GraphSysErr.C.

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 7830 of file GraphSysErr.C.

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 4054 of file GraphSysErr.C.

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 3424 of file GraphSysErr.C.

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 7727 of file GraphSysErr.C.

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 7414 of file GraphSysErr.C.

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
seyhOn return high error on y
Returns
false in case the point is out side the range

Definition at line 4825 of file GraphSysErr.C.

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 4891 of file GraphSysErr.C.

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 833 of file GraphSysErr.C.

Referenced by 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 901 of file GraphSysErr.C.

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

Definition at line 6811 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 7373 of file GraphSysErr.C.

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 4081 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 4096 of file GraphSysErr.C.

Double_t GraphSysErr::GetCommonErrorYDown ( Int_t  id) const
inline

Get the common systematic error

Returns
Common systematic error

Definition at line 3959 of file GraphSysErr.C.

Referenced by Export().

Double_t GraphSysErr::GetCommonErrorYUp ( Int_t  id) const
inline

Get the common systematic error

Returns
Common systematic error

Definition at line 3947 of file GraphSysErr.C.

Referenced by Export().

Color_t GraphSysErr::GetCommonSumFillColor ( ) const
inline

Get fill color of sum systematic uncertainty

Returns
color, or 0

Definition at line 3920 of file GraphSysErr.C.

Referenced by CopyAttr().

Style_t GraphSysErr::GetCommonSumFillStyle ( ) const
inline

Get fill style of sum systematic uncertainty

Returns
style, or 0

Definition at line 3902 of file GraphSysErr.C.

Referenced by CopyAttr().

Color_t GraphSysErr::GetCommonSumLineColor ( ) const
inline

Get line color of sum systematic uncertainty

Returns
color, or 0

Definition at line 3929 of file GraphSysErr.C.

Referenced by CopyAttr().

Style_t GraphSysErr::GetCommonSumLineStyle ( ) const
inline

Get line style of sum systematic uncertainty

Returns
style, or 0

Definition at line 3911 of file GraphSysErr.C.

Referenced by CopyAttr().

Width_t GraphSysErr::GetCommonSumLineWidth ( ) const
inline

Get line width of sum systematic uncertainty

Returns
width, or 0

Definition at line 3938 of file GraphSysErr.C.

Referenced by CopyAttr().

UInt_t GraphSysErr::GetCommonSumOption ( ) const
inline

Definition at line 3896 of file GraphSysErr.C.

const char* GraphSysErr::GetCommonSumTitle ( ) const
inline

Get title of summed systematic error

Returns
Name

Definition at line 3892 of file GraphSysErr.C.

Referenced by CopyAttr().

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

Definition at line 3621 of file GraphSysErr.C.

Referenced by Average(), FindPoint(), FWHM(), GetYandError(), Integral(), Print(), QuickDraw(), 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 3627 of file GraphSysErr.C.

Referenced by Average(), FindPoint(), FWHM(), GetYandError(), Integral(), Print(), QuickDraw(), 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 4641 of file GraphSysErr.C.

Referenced by ConvertOne(), ExportHeader(), ProcessCandidates(), SetKey(), and WithSysError().

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 3985 of file GraphSysErr.C.

Referenced by DrawOne(), Extract(), FWHM(), and QuickDraw().

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 4003 of file GraphSysErr.C.

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 924 of file GraphSysErr.C.

Referenced by ConvertAndDraw(), DrawOne(), Extract(), ExtractGSE2(), and WithSysError().

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

Definition at line 3442 of file GraphSysErr.C.

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

Get qualifier

Parameters
nameKey of qualifier
Returns
Value of qualifier

Definition at line 4801 of file GraphSysErr.C.

Referenced by CopyKeys().

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

Definition at line 3639 of file GraphSysErr.C.

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

Definition at line 3654 of file GraphSysErr.C.

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 3645 of file GraphSysErr.C.

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 3865 of file GraphSysErr.C.

Referenced by CopyAttr().

Style_t GraphSysErr::GetSumFillStyle ( ) const
inline

Get fill style of sum systematic uncertainty

Returns
style, or 0

Definition at line 3847 of file GraphSysErr.C.

Referenced by CopyAttr().

Color_t GraphSysErr::GetSumLineColor ( ) const
inline

Get line color of sum systematic uncertainty

Returns
color, or 0

Definition at line 3874 of file GraphSysErr.C.

Referenced by CopyAttr().

Style_t GraphSysErr::GetSumLineStyle ( ) const
inline

Get line style of sum systematic uncertainty

Returns
style, or 0

Definition at line 3856 of file GraphSysErr.C.

Referenced by CopyAttr().

Width_t GraphSysErr::GetSumLineWidth ( ) const
inline

Get line width of sum systematic uncertainty

Returns
width, or 0

Definition at line 3883 of file GraphSysErr.C.

Referenced by CopyAttr().

UInt_t GraphSysErr::GetSumOption ( ) const
inline

Definition at line 3841 of file GraphSysErr.C.

Referenced by QuickDraw().

const char* GraphSysErr::GetSumTitle ( ) const
inline

Get title of summed systematic error

Returns
Name

Definition at line 3837 of file GraphSysErr.C.

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 3684 of file GraphSysErr.C.

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 3708 of file GraphSysErr.C.

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 3720 of file GraphSysErr.C.

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 3696 of file GraphSysErr.C.

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 3746 of file GraphSysErr.C.

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 3732 of file GraphSysErr.C.

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 3800 of file GraphSysErr.C.

Style_t GraphSysErr::GetSysFillStyle ( Int_t  id) const
inline

Get fill style of systematic uncertainty

Parameters
idIdentifier
Returns
style, or 0

Definition at line 3774 of file GraphSysErr.C.

Color_t GraphSysErr::GetSysLineColor ( Int_t  id) const
inline

Get line color of systematic uncertainty

Parameters
idIdentifier
Returns
color, or 0

Definition at line 3813 of file GraphSysErr.C.

Style_t GraphSysErr::GetSysLineStyle ( Int_t  id) const
inline

Get line style of systematic uncertainty

Parameters
idIdentifier
Returns
style, or 0

Definition at line 3787 of file GraphSysErr.C.

Width_t GraphSysErr::GetSysLineWidth ( Int_t  id) const
inline

Get line width of systematic uncertainty

Parameters
idIdentifier
Returns
width, or 0

Definition at line 3826 of file GraphSysErr.C.

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

Get title of systematic error

Parameters
idIdentifier
Returns
Name

Definition at line 3761 of file GraphSysErr.C.

Referenced by SysErrorAdder::ModError().

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

Definition at line 3615 of file GraphSysErr.C.

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

const char* GraphSysErr::GetXTitle ( ) const
inline

Get name of X axis

Returns
X-axis name

Definition at line 3971 of file GraphSysErr.C.

Referenced by CopyAttr().

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

Definition at line 3633 of file GraphSysErr.C.

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 6612 of file GraphSysErr.C.

Referenced by Average(), FindFwhm(), FindLeastLargest(), 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 6643 of file GraphSysErr.C.

const char* GraphSysErr::GetYTitle ( ) const
inline

Get name of Y axis

Returns
Y-axis name

Definition at line 3977 of file GraphSysErr.C.

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

Definition at line 2993 of file GraphSysErr.C.

Referenced by Extract(), and ProcessHEPData().

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

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 3043 of file GraphSysErr.C.

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 7201 of file GraphSysErr.C.

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 7265 of file GraphSysErr.C.

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 1524 of file GraphSysErr.C.

Bool_t GraphSysErr::IsCommon ( Int_t  id) const
inline

Definition at line 3658 of file GraphSysErr.C.

virtual Bool_t GraphSysErr::IsFolder ( ) const
inlinevirtual

Say that this should be shown as a folder

Returns
true

Definition at line 680 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 3670 of file GraphSysErr.C.

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 3498 of file GraphSysErr.C.

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 2065 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 2082 of file GraphSysErr.C.

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

List the content

Parameters
optionoption (not used)

Definition at line 493 of file GraphSysErr.C.

void GraphSysErr::MakeDataGraph ( Int_t  n)
inlineprotected

Make our data graph

Parameters
nOptional number of pre-allocated points

Definition at line 7398 of file GraphSysErr.C.

Referenced by GraphSysErr().

TMultiGraph* GraphSysErr::MakeMulti ( Option_t option)
inlineprotected

Make our stack

Parameters
optionOptions - See method Draw for more
Returns
Pointer to stack

Definition at line 7482 of file GraphSysErr.C.

Referenced by Draw(), Fit(), and GetMulti().

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 4194 of file GraphSysErr.C.

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 4219 of file GraphSysErr.C.

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 1576 of file GraphSysErr.C.

Referenced by CacheGraphs().

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

Assignment operator

Parameters
otherObject to copy from
Returns
reference to this

Definition at line 426 of file GraphSysErr.C.

virtual void GraphSysErr::Print ( Option_t option = "R") const
inlinevirtual

Print this.

Parameters
optionnot used

Definition at line 502 of file GraphSysErr.C.

Referenced by Average(), ls(), ModOne(), and Symmetrize().

static GraphSysErr* GraphSysErr::Ratio ( const GraphSysErr num,
const GraphSysErr den,
UInt_t  flags = kRatioDefault,
Double_t  fac = 1 
)
inlinestatic

Take the ratio of 2 graphs.

Parameters
numNumerator
denDenominator
flagsFlags for the ratio calculation. See also ERatioOption.
facFactor for searching points
Returns
Newly allocated graph

Definition at line 1608 of file GraphSysErr.C.

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 2311 of file GraphSysErr.C.

void GraphSysErr::RemovePoint ( Int_t  i)
inline

Remove a point from the graph

Parameters
iPoint to remove

Definition at line 2277 of file GraphSysErr.C.

void GraphSysErr::RemoveQualifier ( const TString key)
inline

Remove a qualifier

Parameters
keyWhich to remove

Definition at line 4786 of file GraphSysErr.C.

void GraphSysErr::RemoveSysError ( Int_t  id)
inline

Definition at line 3404 of file GraphSysErr.C.

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 6749 of file GraphSysErr.C.

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 7148 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 2567 of file GraphSysErr.C.

void GraphSysErr::SavePrimitive ( std::ostream &  out,
Option_t option = "" 
)
inline

Definition at line 2460 of file GraphSysErr.C.

Referenced by Save().

void GraphSysErr::Scale ( TF1 *  f,
Double_t  s = 1 
)
inline

Scale graph by a constant

Parameters
fFunction
sConstant for non-relative common errors

Definition at line 940 of file GraphSysErr.C.

void GraphSysErr::Scale ( Double_t  s)
inline

Scale graph by a constant

Parameters
s

Definition at line 973 of file GraphSysErr.C.

void GraphSysErr::SetCommonSumFillColor ( Color_t  color)
inline

Set the fill color of the sumtematice error identified by ID

Parameters
colorFill color

Definition at line 4521 of file GraphSysErr.C.

Referenced by CopyAttr(), Extract(), MakeGSE(), MakeTGSE(), ModOne(), and ProcessCandidates().

void GraphSysErr::SetCommonSumFillStyle ( Style_t  style)
inline

Set the fill style of the sumtematice error identified by ID

Parameters
styleFill style

Definition at line 4527 of file GraphSysErr.C.

Referenced by CopyAttr(), ModOne(), and ProcessCandidates().

void GraphSysErr::SetCommonSumLineColor ( Color_t  color)
inline

Set the line color of the sumtematice error identified by ID

Parameters
colorLine Color

Definition at line 4503 of file GraphSysErr.C.

Referenced by CopyAttr(), Extract(), MakeGSE(), MakeTGSE(), ModOne(), and ProcessCandidates().

void GraphSysErr::SetCommonSumLineStyle ( Style_t  style)
inline

Set the line style of the sumtematice error identified by ID

Parameters
styleLine style

Definition at line 4509 of file GraphSysErr.C.

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 4515 of file GraphSysErr.C.

Referenced by CopyAttr().

void GraphSysErr::SetCommonSumOption ( EDrawOption_t  opt)
inline

Set the draw option for summed errors

Parameters
optDraw option

Definition at line 4491 of file GraphSysErr.C.

Referenced by Extract(), MakeGSE(), MakeTGSE(), and ProcessCandidates().

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

Set the title uses for summed errors

Parameters
titleTitle

Definition at line 4497 of file GraphSysErr.C.

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 3586 of file GraphSysErr.C.

Referenced by Extract(), MakeGSE(), MakeTGSE(), and ProcessCandidates().

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 4587 of file GraphSysErr.C.

Referenced by CopyKeys(), Import(), SysErrorAdder::Make(), MakeGSE(), MakeTGSE(), and WithSysError().

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 3457 of file GraphSysErr.C.

Referenced by Average(), Import(), SysErrorAdder::Make(), MakeGSE(), MakeTGSE(), 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 3468 of file GraphSysErr.C.

Referenced by Average(), Import(), SysErrorAdder::Make(), MakeGSE(), MakeTGSE(), 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 3479 of file GraphSysErr.C.

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 3505 of file GraphSysErr.C.

Referenced by Average(), Import(), SysErrorAdder::Make(), MakeGSE(), MakeTGSE(), Ratio(), Scale(), and Symmetrize().

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

Definition at line 3516 of file GraphSysErr.C.

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 3492 of file GraphSysErr.C.

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 4479 of file GraphSysErr.C.

Referenced by CopyAttr(), Extract(), MakeGSE(), MakeTGSE(), ModOne(), and ProcessCandidates().

void GraphSysErr::SetSumFillStyle ( Style_t  style)
inline

Set the fill style of the sumtematice error identified by ID

Parameters
styleFill style

Definition at line 4485 of file GraphSysErr.C.

Referenced by CopyAttr(), ModOne(), and ProcessCandidates().

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 4461 of file GraphSysErr.C.

Referenced by CopyAttr(), Extract(), SysErrorAdder::Make(), MakeGSE(), MakeTGSE(), ModOne(), and ProcessCandidates().

void GraphSysErr::SetSumLineStyle ( Style_t  style)
inline

Set the line style of the sumtematice error identified by ID

Parameters
styleLine style

Definition at line 4467 of file GraphSysErr.C.

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 4473 of file GraphSysErr.C.

Referenced by CopyAttr(), and SysErrorAdder::Make().

void GraphSysErr::SetSumOption ( EDrawOption_t  opt)
inline

Set the draw option for summed errors

Parameters
optDraw option
Examples:
Example.C.

Definition at line 4449 of file GraphSysErr.C.

Referenced by DoOne(), Extract(), SysErrorAdder::Make(), MakeGSE(), MakeTGSE(), and ProcessCandidates().

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

Set the title uses for summed errors

Parameters
titleTitle
Examples:
Example.C.

Definition at line 4455 of file GraphSysErr.C.

Referenced by CopyAttr(), and SysErrorAdder::Make().

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

Definition at line 3528 of file GraphSysErr.C.

Referenced by Average(), Import(), SysErrorAdder::Make(), MakeGSE(), 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 3542 of file GraphSysErr.C.

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 3558 of file GraphSysErr.C.

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 4395 of file GraphSysErr.C.

Referenced by Average(), Import(), MakeCommon(), MakeP2P(), and SysErrorAdder::ModError().

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 4407 of file GraphSysErr.C.

Referenced by Average(), Import(), and SysErrorAdder::ModError().

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 4359 of file GraphSysErr.C.

Referenced by Average(), Import(), MakeCommon(), MakeP2P(), and SysErrorAdder::ModError().

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 4371 of file GraphSysErr.C.

Referenced by SysErrorAdder::ModError().

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 4383 of file GraphSysErr.C.

Referenced by SysErrorAdder::ModError().

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 4431 of file GraphSysErr.C.

Referenced by SysErrorAdder::ModError().

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

Set the systematic error title

Parameters
idSystematic error identifier
nameThe title

Definition at line 4419 of file GraphSysErr.C.

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

Set the title of the data

Parameters
nameTitle

Definition at line 3576 of file GraphSysErr.C.

Referenced by AddQualifier(), Extract(), Import(), MakeGSE(), MakeTGSE(), and WithSysError().

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

Set title on X axis

Parameters
title
Examples:
Example.C.

Definition at line 3592 of file GraphSysErr.C.

Referenced by CopyAttr(), Import(), SysErrorAdder::Make(), MakeGSE(), and MakeTGSE().

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

Set title on y axis

Parameters
title
Examples:
Example.C.

Definition at line 3598 of file GraphSysErr.C.

Referenced by CopyAttr(), Import(), SysErrorAdder::Make(), MakeGSE(), and MakeTGSE().

void GraphSysErr::SqrtGraph ( Graph g)
inlineprotected

Take the square root of the errors

Parameters
gGraph

Definition at line 7358 of file GraphSysErr.C.

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 7341 of file GraphSysErr.C.

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 4242 of file GraphSysErr.C.

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 4267 of file GraphSysErr.C.

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 4274 of file GraphSysErr.C.

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

\({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}\\ \){eqnarray}

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

\({eqnarray} \delta\bar{x} &=& s_x/n\\ \delta s_x &=& s_x/(\sqrt{2}n)\\ \){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 4318 of file GraphSysErr.C.

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 6846 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 6869 of file GraphSysErr.C.

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 2294 of file GraphSysErr.C.

Referenced by Reflect().

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

Definition at line 6785 of file GraphSysErr.C.

Bool_t GraphSysErr::Symmetrize ( GraphSysErr other)
inline

Symmetrice the other graph and store result here.

Parameters
otherGraph to summetrice
Returns
true on success

s1, sp1, w1, s2, sp2, w2);

Definition at line 2326 of file GraphSysErr.C.

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 7179 of file GraphSysErr.C.

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

Member Data Documentation

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

Title on summed errors

Definition at line 7900 of file GraphSysErr.C.

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

UInt_t GraphSysErr::fCounter
protected

Counter

Definition at line 7886 of file GraphSysErr.C.

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

UInt_t GraphSysErr::fDataOption
protected

Definition at line 7904 of file GraphSysErr.C.

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

TMultiGraph* GraphSysErr::fDrawn
protected

The drawn graphs

Definition at line 7884 of file GraphSysErr.C.

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

TList* GraphSysErr::fMap
protected

Map of keys

Definition at line 7910 of file GraphSysErr.C.

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

TList* GraphSysErr::fQualifiers
protected

List of qualifiers

Definition at line 7912 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 7914 of file GraphSysErr.C.

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

TAttFill GraphSysErr::fSumFill
protected

Attributes of summed errors

Definition at line 7888 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 7892 of file GraphSysErr.C.

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

TString GraphSysErr::fXTitle
protected

X title

Definition at line 7906 of file GraphSysErr.C.

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

TString GraphSysErr::fYTitle
protected

Y title

Definition at line 7908 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: