26 BinData::BinData(
unsigned int maxpoints,
unsigned int dim,
31 fDataErrorPtr( nullptr ), fDataErrorHighPtr( nullptr ), fDataErrorLowPtr( nullptr ),
32 fpTmpCoordErrorVector( nullptr ), fpTmpBinEdgeVector( nullptr )
59 unsigned int maxpoints,
unsigned int dim,
ErrorType err ) :
60 FitData( opt, range, maxpoints, dim ),
76 const double *
ex ,
const double * eval ) :
85 if (
nullptr != eval )
114 const double * val,
const double *
ex ,
const double *
ey,
115 const double * eval ) :
123 if (
nullptr != eval )
129 if (
nullptr != ex ||
nullptr != ey )
152 const double * dataZ,
const double * val,
const double *
ex ,
153 const double *
ey ,
const double * ez ,
const double * eval ) :
154 FitData( n, dataX, dataY, dataZ ),
161 if (
nullptr != eval )
167 if (
nullptr != ex ||
nullptr != ey ||
nullptr != ez )
202 for (
unsigned int i=0; i <
fDim; i++ )
235 assert(
Opt().fIntegral );
272 if ( !
fData.empty() )
285 for (
unsigned int i=0; i<
fDim; i++ )
313 if (
Opt().fIntegral )
351 Append( newPoints, dim, err );
377 for (
unsigned int i=0; i <
fNPoints; i++ )
379 double val =
fData[i];
383 MATH_ERROR_MSG(
"BinData::TransformLog",
"Some points have negative values - cannot apply a log transformation");
459 if (y != 0 && std::abs( ey*ey/y - 1.0) > 1.
E-12)
fIsWeighted =
true;
486 if (y != 0 && std::abs( ey*ey/y - 1.0) > 1.
E-12)
fIsWeighted =
true;
511 if (y != 0 || eyl != 1.0 || eyh != 1.0)
fSumError2 += (eyl+eyh)*(eyl+eyh)/4;
552 if (val != 0 || eval != 1.0)
fSumError2 += eval*eval;
554 if (val != 0 && std::abs( eval*eval/val - 1.0) > 1.
E-12)
fIsWeighted =
true;
572 for(
unsigned int i=0; i<
fDim; i++ )
583 if (val != 0 || eval != 1.0)
fSumError2 += eval*eval;
585 if (val != 0 && std::abs( eval*eval/val - 1.0) > 1.
E-12)
fIsWeighted =
true;
591 void BinData::Add(
const double*
x,
double val,
const double*
ex,
double elval,
double ehval )
604 for(
unsigned int i=0; i<
fDim; i++ )
616 if (val != 0 || elval != 1.0 || ehval != 1.0 )
634 for (
unsigned int i=0; i<
fDim; i++ )
645 double binVolume = 1.0;
646 for (
unsigned int j = 0; j <
fDim; j++ )
648 binVolume *= ( xup[j] - xlow[j] );
697 for(
unsigned int i=0; i <
fDim; i++ )
743 for(
unsigned int i=0; i<
fDim; i++ )
767 assert(
fData.empty() );
775 for (
unsigned int i=0; i <
fDim; i++ )
793 for (
unsigned int i=0; i <
fNPoints; i++ )
802 for(
unsigned int i=0; i <
fDim; i++ )
829 unsigned int n =
Size();
833 for (
unsigned int i = 0; i <
n; ++i) {
835 double err =
Error(i);
837 if (y != 0 || err != 1.0)
fSumError2 += err*err;
841 for (
unsigned int i = 0; i <
n; ++i) {
844 double elval,ehval = 0;
846 if (y != 0 || elval != 1.0 || ehval != 1.0)
void GetAsymError(unsigned int ipoint, double &lowError, double &highError) const
Namespace for new ROOT classes and functions.
double * fpTmpBinEdgeVector
Base class for all the fit data types: Stores the coordinates and the DataOptions.
const double * fDataErrorPtr
void AddBinUpEdge(const double *xup)
add the bin width data, a pointer to an array with the bin upper edge information.
std::vector< const double *> fCoordErrorsPtr
const double * Coords(unsigned int ipoint) const
return a pointer to the coordinates data for the given fit point
double * fpTmpCoordErrorVector
std::vector< double > fData
Stores the data values the same way as the coordinates.
std::vector< std::vector< double > > fBinEdge
void Append(unsigned int newPoints, unsigned int dim=1)
void Initialize(unsigned int newPoints, unsigned int dim=1, ErrorType err=kValueError)
unsigned int Size() const
return number of fit points
double Error(unsigned int ipoint) const
#define MATH_ERROR_MSG(loc, str)
DataOptions : simple structure holding the options on how the data are filled.
void Add(double x)
add one dim data with only coordinate and values
std::vector< double > fDataError
const DataOptions & Opt() const
access to options
std::vector< double > fDataErrorHigh
virtual ~BinData()
destructor
Class describing the binned data sets : vectors of x coordinates, y values and optionally error on y ...
constexpr Double_t E()
Base of natural log: .
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...
static constexpr unsigned VectorPadding(const unsigned)
If VecCore is not defined, there is no vectorization available and the SIMD vector size will always b...
class describing the range in the coordinates it supports multiple range in a coordinate.
const double * fDataErrorLowPtr
void Add(double x, double y)
add one dim data with only coordinate and values
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
std::vector< double > fDataErrorLow
std::vector< std::vector< double > > fCoordErrors
BinData & operator=(const BinData &rhs)
BinData & LogTransform()
apply a Log transformation of the data values can be used for example when fitting an exponential or ...
double Value(unsigned int ipoint) const
return the value for the given fit point
FitData & operator=(const FitData &rhs)
void Append(unsigned int newPoints, unsigned int dim=1, ErrorType err=kValueError)
preallocate a data set with given size , dimension and error type (to get the full point size) If the...
const double * fDataErrorHighPtr