13 #ifndef ROOT_Fit_UnBinData 14 #define ROOT_Fit_UnBinData 16 #ifndef ROOT_Fit_DataVector 20 #ifndef ROOT_Math_Error 55 explicit UnBinData(
unsigned int maxpoints = 0,
unsigned int dim = 1,
bool isWeighted =
false );
61 explicit UnBinData (
const DataRange & range,
unsigned int maxpoints = 0,
unsigned int dim = 1,
bool isWeighted =
false);
71 UnBinData(
unsigned int n,
const double * dataX );
77 UnBinData(
unsigned int n,
const double * dataX,
const double * dataY,
bool isWeighted =
false );
83 UnBinData(
unsigned int n,
const double * dataX,
const double * dataY,
const double * dataZ,
bool isWeighted =
false );
92 template<
class Iterator>
93 UnBinData(
unsigned int n,
unsigned int dim, Iterator dataItr,
bool isWeighted =
false ) :
112 UnBinData(
unsigned int maxpoints,
const double * dataX,
const double * dataY,
const DataRange & range,
bool isWeighted =
false);
118 UnBinData(
unsigned int maxpoints,
const double * dataX,
const double * dataY,
const double * dataZ,
const DataRange & range,
bool isWeighted =
false);
125 template<
class Iterator>
126 UnBinData(
unsigned int maxpoints,
unsigned int dim, Iterator dataItr,
const DataRange & range,
bool isWeighted =
false ) :
143 for (
unsigned int i = 0; i < maxpoints; ++i) {
144 bool isInside =
true;
145 for (
unsigned int icoord = 0; icoord < dim; ++icoord)
193 void Initialize(
unsigned int maxpoints,
unsigned int dim = 1,
bool isWeighted =
false);
255 for (
unsigned int i = 0; i <
fDim; ++i)
264 void Add(
const double *
x,
double w) {
272 for (
unsigned int i = 0; i <
fDim; ++i)
282 const double *
Coords(
unsigned int ipoint)
const {
293 double Weight(
unsigned int ipoint)
const {
305 void Resize (
unsigned int npoints);
const double * Coords(unsigned int ipoint) const
UnBinData(unsigned int n, unsigned int dim, Iterator dataItr, bool isWeighted=false)
constructor for multi-dim external data (data are not copied inside) Uses as argument an iterator of ...
unsigned int NDim() const
return coordinate data dimension
size_t Size() const
full size of data vector (npoints * point size)
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
void SetNPoints(unsigned int n)
void Resize(unsigned int npoints)
resize the vector to the given npoints
Base class for all the fit data types.
Class describing the unbinned data sets (just x coordinates values) of any dimensions.
DataWrapper * fDataWrapper
#define MATH_ERROR_MSGVAL(loc, str, x)
bool IsInside(double x, unsigned int icoord=0) const
check if a point is inside the range for the given coordinate
class holding the fit data points.
const FData & Data() const
const access to underlying vector
void Add(double x, double y)
add 2-dim coordinate data can also be used to add 1-dim data with a weight
unsigned int DataSize() const
return size of internal data vector (is 0 for external data)
void Add(double x, double y, double z)
add 3-dim coordinate data can also be used to add 2-dim data with a weight
class maintaining a pointer to external data Using this class avoids copying the data when performing...
void Add(const double *x, double w)
add multi-dim coordinate data + weight
double Weight(unsigned int ipoint) const
DataOptions : simple structure holding the options on how the data are filled.
UnBinData & operator=(const UnBinData &)
assignment operator (private)
UnBinData(const UnBinData &)
copy constructor (private)
UnBinData(unsigned int maxpoints, unsigned int dim, Iterator dataItr, const DataRange &range, bool isWeighted=false)
constructor for multi-dim external data and a range (data are copied inside according to the range) U...
unsigned int NPoints() const
return number of contained points
virtual ~UnBinData()
destructor, delete pointer to internal data or external data wrapper
const double * Coords(unsigned int ipoint) const
return pointer to coordinate data
class describing the range in the coordinates it supports multiple range in a coordinate.
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
void Add(double x)
add one dim coordinate data (unweighted)
you should not use this method at all Int_t Int_t z
static unsigned int MaxSize()
define a max size to avoid allocating too large arrays
void Add(const double *x)
add multi-dim coordinate data
unsigned int PointSize() const
return point size.
unsigned int Size() const
return number of contained points
UnBinData(unsigned int maxpoints=0, unsigned int dim=1, bool isWeighted=false)
constructor from dimension of point and max number of points (to pre-allocate vector) ...
void Initialize(unsigned int maxpoints, unsigned int dim=1, bool isWeighted=false)
preallocate a data set given size and dimension of the coordinates if a vector already exists with co...