13#ifndef ROOT_Fit_BinData
14#define ROOT_Fit_BinData
63 explicit BinData(
unsigned int maxpoints = 0,
unsigned int dim = 1,
85 BinData(
unsigned int n,
const double * dataX,
const double * val,
86 const double *
ex ,
const double * eval );
91 BinData(
unsigned int n,
const double * dataX,
const double * dataY,
92 const double * val,
const double *
ex ,
const double *
ey,
93 const double * eval );
98 BinData(
unsigned int n,
const double * dataX,
const double * dataY,
99 const double * dataZ,
const double * val,
const double *
ex ,
100 const double *
ey ,
const double * ez ,
const double * eval );
123 Append(newPoints,dim,err);
169 void Add(
double x,
double y );
175 void Add(
double x,
double y,
double ey );
181 void Add(
double x,
double y,
double ex,
double ey );
187 void Add(
double x,
double y,
double ex,
double eyl,
double eyh );
192 void Add(
const double*
x,
double val );
197 void Add(
const double*
x,
double val,
double eval );
202 void Add(
const double*
x,
double val,
const double*
ex,
double eval );
207 void Add(
const double*
x,
double val,
const double*
ex,
double elval,
double ehval );
220 double Value(
unsigned int ipoint )
const
232 const double *
ValuePtr(
unsigned int ipoint )
const
249 const double *
ErrorPtr(
unsigned int ipoint)
const{
262 double Error(
unsigned int ipoint )
const
286 return (eval != 0.0) ? 1.0/eval : 0.0;
300 return (el+eh) / 2.0;
307 void GetAsymError(
unsigned int ipoint,
double& lowError,
double& highError )
const
351 return (eval != 0.0) ? eval : 0.0;
365 return 2.0 / (el+eh);
398 assert( icoord <
fDim );
418 for (
unsigned int i=0; i <
fDim; i++ )
439 const double*
GetPoint(
unsigned int ipoint,
double &
value,
double & invError )
const
444 double e =
Error( ipoint );
449 invError = (
e != 0.0 ) ? 1.0/
e : 1.0;
467 errvalue =
Error( ipoint );
480 const double*
GetPointError(
unsigned int ipoint,
double & errlow,
double & errhigh)
const
504 assert( icoord <
fDim );
506 assert( ipoint <
fBinEdge.front().size() );
537 for (
unsigned int i = 0; i <
fDim; i++) {
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Class describing the binned data sets : vectors of x coordinates, y values and optionally error on y ...
double SumOfContent() const
compute the total sum of the data content (sum of weights in case of weighted data set)
double RefVolume() const
retrieve the reference volume used to normalize the data when the option bin volume is set
const double * fDataErrorHighPtr
~BinData() override
destructor
const double * CoordErrors(unsigned int ipoint) const
Return a pointer to the errors in the coordinates for the given fit point.
const double * GetPointError(unsigned int ipoint, double &errlow, double &errhigh) const
Get errors on the point (coordinate errors and asymmetric value errors) for the given fit point.
std::vector< double > fData
Stores the data values the same way as the coordinates.
double GetBinUpEdgeComponent(unsigned int ipoint, unsigned int icoord) const
returns a single coordinate error component of a point.
bool HasBinEdges() const
query if the data store the bin edges instead of the center
std::vector< const double * > fCoordErrorsPtr
void Append(unsigned int newPoints, unsigned int dim=1, ErrorType err=kValueError)
Equivalent to Initialize()
const double * GetPointError(unsigned int ipoint, double &errvalue) const
Retrieve the errors on the point (coordinate and value) for the given fit point It must be called onl...
std::vector< double > fDataErrorLow
const double * GetPoint(unsigned int ipoint, double &value) const
retrieve at the same time a pointer to the coordinate data and the fit value More efficient than call...
void AddBinUpEdge(const double *xup)
add the bin width data, a pointer to an array with the bin upper edge information.
const double * BinUpEdge(unsigned int ipoint) const
return an array containing the upper edge of the bin for coordinate i In case of empty bin they could...
const double * fDataErrorLowPtr
std::vector< double > fDataErrorHigh
double InvError(unsigned int ipoint) const
Return the inverse of error on the value for the given fit point useful when error in the coordinates...
BinData & LogTransform()
apply a Log transformation of the data values can be used for example when fitting an exponential or ...
bool IsWeighted() const
return true if the data set is weighted We cannot compute ourselves because sometimes errors are fill...
const double * ErrorPtr(unsigned int ipoint) const
Return a pointer to the error (or the inverse error) on the value for a given point depending on the ...
double * fpTmpCoordErrorVector
not threadsafe stuff!
double Value(unsigned int ipoint) const
return the value for the given fit point
void SetRefVolume(double value)
set the reference volume used to normalize the data when the option bin volume is set
bool fIsWeighted
flag to indicate weighted data
std::vector< std::vector< double > > fCoordErrors
ErrorType GetErrorType() const
retrieve the errortype
void Add(double x, double y)
add one dim data with only coordinate and values
bool HaveCoordErrors() const
flag to control if data provides error on the coordinates
double fSumContent
total sum of the bin data content
const double * ValuePtr(unsigned int ipoint) const
return a pointer to the value for the given fit point
void Initialize(unsigned int newPoints, unsigned int dim=1, ErrorType err=kValueError)
Preallocate a data set with given size, dimension and error type.
double GetCoordErrorComponent(unsigned int ipoint, unsigned int icoord) const
returns a single coordinate error component of a point.
BinData & operator=(const BinData &rhs)
assignment operator
std::vector< std::vector< double > > fBinEdge
void GetAsymError(unsigned int ipoint, double &lowError, double &highError) const
double fRefVolume
reference bin volume - used to normalize the bins in case of variable bins data
void GetBinUpEdgeCoordinates(unsigned int ipoint, double *x) const
Thread save version of function retrieving the bin up-edge in case of multidimensions.
const double * fDataErrorPtr
double fSumError2
total sum square of the errors
double * fpTmpBinEdgeVector
not threadsafe stuff!
std::vector< double > fDataError
double Error(unsigned int ipoint) const
Return the error on the given point.
bool HaveAsymErrors() const
flag to control if data provides asymmetric errors on the value
double SumOfError2() const
compute the total sum of the error square (sum of weight square in case of a weighted data set)
const double * GetPoint(unsigned int ipoint, double &value, double &invError) const
retrieve in a single call a pointer to the coordinate data, value and inverse error for the given fit...
class describing the range in the coordinates it supports multiple range in a coordinate.
Base class for all the fit data types: Stores the coordinates and the DataOptions.
const double * Coords(unsigned int ipoint) const
return a pointer to the coordinates data for the given fit point
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
DataOptions : simple structure holding the options on how the data are filled.