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);
231 void Add(
double x,
double y,
double z) {
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);
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 ...
Namespace for new ROOT classes and functions.
void SetNPoints(unsigned int n)
void Resize(unsigned int npoints)
resize the vector to the given npoints
double Weight(unsigned int ipoint) const
Base class for all the fit data types.
unsigned int NDim() const
return coordinate data dimension
Class describing the unbinned data sets (just x coordinates values) of any dimensions.
const double * Coords(unsigned int ipoint) const
DataWrapper * fDataWrapper
#define MATH_ERROR_MSGVAL(loc, str, x)
const FData & Data() const
const access to underlying vector
class holding the fit data points.
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 NPoints() const
return number of contained points
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
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...
virtual ~UnBinData()
destructor, delete pointer to internal data or external data wrapper
class describing the range in the coordinates it supports multiple range in a coordinate.
const double * Coords(unsigned int ipoint) const
return pointer to coordinate data
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)
size_t Size() const
full size of data vector (npoints * point size)
unsigned int PointSize() const
return point size.
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 Size() const
return number of contained points
bool IsInside(double x, unsigned int icoord=0) const
check if a point is inside the range for the given coordinate
unsigned int DataSize() const
return size of internal data vector (is 0 for external data)
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...