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 | Public Attributes | List of all members
GraphSysErr::Combiner Struct Referenceabstract

Combining measurements. More...

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

Classes

struct  Observation
 An experimental observation. More...
 
struct  Result
 The final result. More...
 

Public Types

typedef Double_t(* Wrapper_t) (Double_t *, Double_t *)
 

Public Member Functions

 Combiner ()
 Constructor. More...
 
virtual ~Combiner ()
 Virtual destructor. More...
 
virtual Double_t W (const Observation &r) const =0
 Calculate the weight. More...
 
virtual Double_t StepW (Double_t guess, const Observation &r) const =0
 Calculate the weight based on a guess of best $ x'$. More...
 
virtual Double_t StepOffset (Double_t guess, const Observation &r) const =0
 Calculate the bias. More...
 
virtual Double_t VarTerm (Double_t guess, const Observation &r) const =0
 Calculate the contribution variance to the $\chi^2$ with the guess $x'$. More...
 
Double_t ChiTerm (Double_t guess, const Observation &r) const
 Calculate the contribution variance to the $\chi^2$ with the guess $ x'$. More...
 
Double_t F (Double_t guess, Double_t chi2) const
 Calculate the $ \chi^2(x')$ where $ x'$ is current guess at the observation. More...
 
Double_t E (UShort_t nIter, Int_t sign, Double_t best, Double_t chi2, Double_t s)
 Try to find best error. More...
 
Double_t X (UShort_t nIter, Double_t lowest, Double_t highest)
 Find best estimate of $ x$. More...
 
ResultCalculate (UShort_t nIter=50)
 Do the calculation. More...
 
virtual Wrapper_t Wrapper () const =0
 Return function pointer to wrapper. More...
 
TF1 * MakeF (const Observation &r, Int_t j) const
 Make a function that represents to Log-likehood for a given observation. More...
 
TLine * MakeL (TF1 *f) const
 Make a line that represents the best found errors. More...
 
void Draw (Option_t *option="")
 
 ClassDef (Combiner, 1)
 
The data store
void Clear (Option_t *option="")
 Clear the internal data. More...
 
void Add (const Observation &r)
 Add an obervation. More...
 
void Add (Double_t x, Double_t el, Double_t eh)
 Add an observation. More...
 
void Print (Option_t *option="") const
 Print content of the list. More...
 

Public Attributes

TClonesArray fData
 
ResultfResult
 

Detailed Description

Combining measurements.

From http://www.slac.stanford.edu/~barlow/java/

Definition at line 4901 of file GraphSysErr.C.

Member Typedef Documentation

typedef Double_t(* GraphSysErr::Combiner::Wrapper_t) (Double_t *, Double_t *)

Definition at line 4903 of file GraphSysErr.C.

Constructor & Destructor Documentation

GraphSysErr::Combiner::Combiner ( )
inline

Constructor.

Definition at line 5067 of file GraphSysErr.C.

virtual GraphSysErr::Combiner::~Combiner ( )
inlinevirtual

Virtual destructor.

Definition at line 5075 of file GraphSysErr.C.

References fResult.

Member Function Documentation

void GraphSysErr::Combiner::Add ( const Observation r)
inline
void GraphSysErr::Combiner::Add ( Double_t  x,
Double_t  el,
Double_t  eh 
)
inline

Add an observation.

Parameters
x$ x_i$
el$ \sigma_i^-$
eh$ \sigma_i^+$

Definition at line 5107 of file GraphSysErr.C.

References GraphSysErr::Combiner::Observation::Observation().

Result* GraphSysErr::Combiner::Calculate ( UShort_t  nIter = 50)
inline

Do the calculation.

Parameters
nIterHow many iterations to do.
Returns
The best estimate of $ x$ and associated errors
Examples:
TestCombiner.C.

Definition at line 5300 of file GraphSysErr.C.

References E(), F(), GraphSysErr::Combiner::Observation::fEh, GraphSysErr::Combiner::Observation::fEl, fResult, GraphSysErr::Combiner::Observation::High(), GraphSysErr::Combiner::Observation::Low(), Wrapper(), and X().

Referenced by GraphSysErr::Average(), and GraphSysErr::FWHM().

Double_t GraphSysErr::Combiner::ChiTerm ( Double_t  guess,
const Observation r 
) const
inline

Calculate the contribution variance to the $\chi^2$ with the guess $ x'$.

\[ t_i(x') = (x' - x_i)^2 / v_i(x') \]

where $ v_i(x')$ is the term variance

Parameters
guess$ x'$
rObersvation
Returns
$ t(x')$

Definition at line 5173 of file GraphSysErr.C.

References GraphSysErr::Combiner::Observation::fX, and VarTerm().

Referenced by F().

GraphSysErr::Combiner::ClassDef ( Combiner  ,
 
)
void GraphSysErr::Combiner::Clear ( Option_t *  option = "")
inline

Clear the internal data.

Parameters
optionNot used

Definition at line 5085 of file GraphSysErr.C.

References fResult.

void GraphSysErr::Combiner::Draw ( Option_t *  option = "")
inline
Double_t GraphSysErr::Combiner::E ( UShort_t  nIter,
Int_t  sign,
Double_t  best,
Double_t  chi2,
Double_t  s 
)
inline

Try to find best error.

Parameters
nIterNumber of iterations
signDirection (-1 is low, +1 is high)
bestCurrent best $ x$ value
chi2$ \chi^2$ of current best $ x$ value
sSummed weights in the direction
Returns
The error in the chosen direction

Definition at line 5212 of file GraphSysErr.C.

References F(), GraphSysErr::Combiner::Observation::fEh, and GraphSysErr::Combiner::Observation::fEl.

Referenced by Calculate().

Double_t GraphSysErr::Combiner::F ( Double_t  guess,
Double_t  chi2 
) const
inline

Calculate the $ \chi^2(x')$ where $ x'$ is current guess at the observation.

Parameters
guessCurrent guess $ x'$
chi2Optional old $ \chi^2$ from best $ x$ value
Returns
$ \chi^2(x')$

Definition at line 5189 of file GraphSysErr.C.

References ChiTerm().

Referenced by Calculate(), and E().

TF1* GraphSysErr::Combiner::MakeF ( const Observation r,
Int_t  j 
) const
inline

Make a function that represents to Log-likehood for a given observation.

Parameters
rObservation
jSerial number
Returns
Pointer to newly allocated function object

Definition at line 5345 of file GraphSysErr.C.

References GraphSysErr::Combiner::Observation::fEh, GraphSysErr::Combiner::Observation::fEl, GraphSysErr::Combiner::Observation::fX, GraphSysErr::Combiner::Observation::High(), GraphSysErr::Combiner::Observation::Low(), and Wrapper().

Referenced by Draw().

TLine* GraphSysErr::Combiner::MakeL ( TF1 *  f) const
inline

Make a line that represents the best found errors.

Parameters
fLog-likelyhood function to make it from
Returns

Definition at line 5362 of file GraphSysErr.C.

Referenced by Draw().

void GraphSysErr::Combiner::Print ( Option_t *  option = "") const
inline

Print content of the list.

Parameters
optionnot used

Definition at line 5119 of file GraphSysErr.C.

References GraphSysErr::Combiner::Observation::Print(), StepOffset(), StepW(), VarTerm(), and W().

Referenced by GraphSysErr::FWHM().

virtual Double_t GraphSysErr::Combiner::StepOffset ( Double_t  guess,
const Observation r 
) const
pure virtual

Calculate the bias.

Returns
$\delta(x')$

Implemented in GraphSysErr::LinearVarianceCombiner, and GraphSysErr::LinearSigmaCombiner.

Referenced by Print(), and X().

virtual Double_t GraphSysErr::Combiner::StepW ( Double_t  guess,
const Observation r 
) const
pure virtual

Calculate the weight based on a guess of best $ x'$.

Parameters
guessCurrent guess $ x'$
rObservation
Returns
$ W(x')$

Implemented in GraphSysErr::LinearVarianceCombiner, and GraphSysErr::LinearSigmaCombiner.

Referenced by Print(), GraphSysErr::LinearSigmaCombiner::W(), and X().

virtual Double_t GraphSysErr::Combiner::VarTerm ( Double_t  guess,
const Observation r 
) const
pure virtual

Calculate the contribution variance to the $\chi^2$ with the guess $x'$.

Returns
$ v(x')$

Implemented in GraphSysErr::LinearVarianceCombiner, and GraphSysErr::LinearSigmaCombiner.

Referenced by ChiTerm(), and Print().

virtual Double_t GraphSysErr::Combiner::W ( const Observation r) const
pure virtual

Calculate the weight.

Parameters
rObservation
Returns
$ W$

Implemented in GraphSysErr::LinearVarianceCombiner, and GraphSysErr::LinearSigmaCombiner.

Referenced by Print().

virtual Wrapper_t GraphSysErr::Combiner::Wrapper ( ) const
pure virtual

Return function pointer to wrapper.

Returns
Function pointer

Implemented in GraphSysErr::LinearVarianceCombiner, and GraphSysErr::LinearSigmaCombiner.

Referenced by Calculate(), and MakeF().

Double_t GraphSysErr::Combiner::X ( UShort_t  nIter,
Double_t  lowest,
Double_t  highest 
)
inline

Find best estimate of $ x$.

Parameters
nIterNumber of iterations
lowestLower bound
highestUpper bound
Returns
$ x$

Definition at line 5262 of file GraphSysErr.C.

References GraphSysErr::Combiner::Observation::fX, StepOffset(), and StepW().

Referenced by Calculate().

Member Data Documentation

TClonesArray GraphSysErr::Combiner::fData
Result* GraphSysErr::Combiner::fResult
Examples:
TestCombiner.C.

Definition at line 5062 of file GraphSysErr.C.

Referenced by GraphSysErr::Average(), Calculate(), Clear(), and ~Combiner().


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