74 const double *
ex ,
const double * eval ) :
83 if (
nullptr != eval )
112 const double * val,
const double *
ex ,
const double *
ey,
113 const double * eval ) :
121 if (
nullptr != eval )
127 if (
nullptr !=
ex ||
nullptr !=
ey )
150 const double * dataZ,
const double * val,
const double *
ex ,
151 const double *
ey ,
const double * ez ,
const double * eval ) :
159 if (
nullptr != eval )
165 if (
nullptr !=
ex ||
nullptr !=
ey ||
nullptr != ez )
200 for (
unsigned int i=0; i <
fDim; i++ )
273 if ( !
fData.empty() )
281 for (
unsigned int i = 0; i <
fDim; i++) {
363 for (
unsigned int i=0; i <
fNPoints; i++ )
365 double val =
fData[i];
369 MATH_ERROR_MSG(
"BinData::TransformLog",
"Some points have negative values - cannot apply a log transformation");
373 fData[i] = std::log( val );
497 if (
y != 0 || eyl != 1.0 || eyh != 1.0)
fSumError2 += (eyl+eyh)*(eyl+eyh)/4;
538 if (val != 0 || eval != 1.0)
fSumError2 += eval*eval;
540 if (val != 0 && std::abs( eval*eval/val - 1.0) > 1.E-12)
fIsWeighted =
true;
558 for(
unsigned int i=0; i<
fDim; i++ )
569 if (val != 0 || eval != 1.0)
fSumError2 += eval*eval;
571 if (val != 0 && std::abs( eval*eval/val - 1.0) > 1.E-12)
fIsWeighted =
true;
577 void BinData::Add(
const double*
x,
double val,
const double*
ex,
double elval,
double ehval )
590 for(
unsigned int i=0; i<
fDim; i++ )
602 if (val != 0 || elval != 1.0 || ehval != 1.0 )
620 for (
unsigned int i=0; i<
fDim; i++ )
631 double binVolume = 1.0;
632 for (
unsigned int j = 0; j <
fDim; j++ )
634 binVolume *= ( xup[j] - xlow[j] );
683 for(
unsigned int i=0; i <
fDim; i++ )
729 for(
unsigned int i=0; i<
fDim; i++ )
753 assert(
fData.empty() );
761 for (
unsigned int i=0; i <
fDim; i++ )
779 for (
unsigned int i=0; i <
fNPoints; i++ )
788 for(
unsigned int i=0; i <
fDim; i++ )
815 unsigned int n =
Size();
819 for (
unsigned int i = 0; i <
n; ++i) {
829 for (
unsigned int i = 0; i <
n; ++i) {
832 double elval,ehval = 0;
834 if (
y != 0 || elval != 1.0 || ehval != 1.0)
#define MATH_ERROR_MSG(loc, str)
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
const double * fDataErrorHighPtr
~BinData() override
destructor
std::vector< double > fData
Stores the data values the same way as the coordinates.
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().
std::vector< double > fDataErrorLow
void AddBinUpEdge(const double *xup)
add the bin width data, a pointer to an array with the bin upper edge information.
const double * fDataErrorLowPtr
std::vector< double > fDataErrorHigh
BinData & LogTransform()
apply a Log transformation of the data values can be used for example when fitting an exponential or ...
BinData(unsigned int maxpoints=0, unsigned int dim=1, ErrorType err=kValueError)
constructor from dimension of point and max number of points (to pre-allocate vector) Give a zero val...
double * fpTmpCoordErrorVector
not threadsafe stuff!
double Value(unsigned int ipoint) const
return the value for the given fit point
bool fIsWeighted
flag to indicate weighted data
std::vector< std::vector< double > > fCoordErrors
void Add(double x, double y)
add one dim data with only coordinate and values
double fSumContent
total sum of the bin data content
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
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.
class describing the range in the coordinates it supports multiple range in a coordinate.
unsigned int Size() const
return number of fit points
FitData(unsigned int maxpoints=0, unsigned int dim=1)
construct with default option and data range
void Add(double x)
add one dim data with only coordinate and values
void Append(unsigned int newPoints, unsigned int dim=1)
static constexpr unsigned VectorPadding(const unsigned)
If std::experimental::simd is not available, there is no vectorization available and the SIMD vector ...
FitData & operator=(const FitData &rhs)
const double * Coords(unsigned int ipoint) const
return a pointer to the coordinates data for the given fit point
Namespace for the fitting classes.
DataOptions : simple structure holding the options on how the data are filled.