13#ifndef ROOT_Fit_UnBinData
14#define ROOT_Fit_UnBinData
54 explicit UnBinData(
unsigned int maxpoints = 0,
unsigned int dim = 1,
55 bool isWeighted =
false ) :
56 FitData( maxpoints, isWeighted ? dim + 1 : dim ),
68 unsigned int dim = 1,
bool isWeighted =
false ) :
69 FitData( range, maxpoints, isWeighted ? dim + 1 : dim ),
80 unsigned int maxpoints = 0,
unsigned int dim = 1,
bool isWeighted =
false ) :
81 FitData( opt, range, maxpoints, isWeighted ? dim + 1 : dim ),
101 UnBinData(
unsigned int n,
const double * dataX,
const double * dataY,
102 bool isWeighted =
false ) :
112 UnBinData(
unsigned int n,
const double * dataX,
const double * dataY,
113 const double * dataZ,
bool isWeighted =
false ) :
126 template<
class Iterator>
127 UnBinData(
unsigned int n,
unsigned int dim, Iterator dataItr,
128 bool isWeighted =
false ) :
129 FitData(
n, isWeighted ? dim + 1 : dim, dataItr ),
140 FitData( range, maxpoints, dataX ),
150 UnBinData(
unsigned int maxpoints,
const double * dataX,
const double * dataY,
151 const DataRange & range,
bool isWeighted =
false) :
152 FitData( range, maxpoints, dataX, dataY ),
161 UnBinData(
unsigned int maxpoints,
const double * dataX,
const double * dataY,
162 const double * dataZ,
const DataRange & range,
bool isWeighted =
false) :
163 FitData( range, maxpoints, dataX, dataY, dataZ ),
173 template<
class Iterator>
174 UnBinData(
unsigned int maxpoints,
unsigned int dim, Iterator dataItr,
const DataRange & range,
bool isWeighted =
false ) :
175 FitData( range, maxpoints, dim, dataItr ),
210 double dataTmp[] = {
x,
y };
219 void Add(
double x,
double y,
double z)
222 double dataTmp[] = {
x,
y, z };
242 std::vector<double> tmpVec(
fDim);
243 std::copy(
x,
x +
fDim - 1, tmpVec.begin() );
252 double Weight(
unsigned int ipoint )
const
265 MATH_ERROR_MSG(
"UnBinData::WeightsPtr",
"The function is unweighted!");
283 void Append(
unsigned int newPoints,
unsigned int dim = 1,
bool isWeighted =
false )
#define MATH_ERROR_MSG(loc, str)
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.
void Add(double x)
add one dim data with only coordinate and values
void Append(unsigned int newPoints, unsigned int dim=1)
const double * GetCoordComponent(unsigned int ipoint, unsigned int icoord) const
returns a single coordinate component of a point.
Class describing the un-binned data sets (just x coordinates values) of any dimensions.
UnBinData(const DataRange &range, unsigned int maxpoints=0, unsigned int dim=1, bool isWeighted=false)
constructor from range and default option
void Add(const double *x, double w)
add multi-dim coordinate data + weight
UnBinData & operator=(const UnBinData &)
assignment operator
double Weight(unsigned int ipoint) const
return weight
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...
const double * WeightsPtr(unsigned int ipoint) const
void Add(double x)
add one dim coordinate data (unweighted)
unsigned int NDim() const
return coordinate data dimension
UnBinData(unsigned int n, const double *dataX, const double *dataY, const double *dataZ, bool isWeighted=false)
constructor for 3D external data (data are not copied inside) or 2D data with a weight (if isWeighted...
void Append(unsigned int newPoints, unsigned int dim=1, bool isWeighted=false)
UnBinData(unsigned int maxpoints, const double *dataX, const DataRange &range)
constructor for 1D data and a range (data are copied inside according to the given range)
UnBinData(const DataOptions &opt, const DataRange &range, unsigned int maxpoints=0, unsigned int dim=1, bool isWeighted=false)
constructor from options and range
void Add(double x, double y)
add 2-dim coordinate data can also be used to add 1-dim data with a weight
~UnBinData() override
destructor, delete pointer to internal data or external data wrapper
UnBinData(unsigned int n, const double *dataX)
constructor for 1D external data (data are not copied inside)
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
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)
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 ...
void Add(const double *x)
add multi-dim coordinate data
UnBinData(unsigned int maxpoints, const double *dataX, const double *dataY, const double *dataZ, const DataRange &range, bool isWeighted=false)
constructor for 3D data and a range (data are copied inside according to the given range) or a 2D dat...
UnBinData(unsigned int maxpoints, const double *dataX, const double *dataY, const DataRange &range, bool isWeighted=false)
constructor for 2D data and a range (data are copied inside according to the given range) or 1 1D dat...
UnBinData(unsigned int n, const double *dataX, const double *dataY, bool isWeighted=false)
constructor for 2D external data (data are not copied inside) or 1D data with a weight (if isWeighted...
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.