13#ifndef ROOT_Fit_UnBinData
14#define ROOT_Fit_UnBinData
50 explicit UnBinData(
unsigned int maxpoints = 0,
unsigned int dim = 1,
51 bool isWeighted =
false ) :
52 FitData( maxpoints, isWeighted ? dim + 1 : dim ),
64 unsigned int dim = 1,
bool isWeighted =
false ) :
65 FitData( range, maxpoints, isWeighted ? dim + 1 : dim ),
76 unsigned int maxpoints = 0,
unsigned int dim = 1,
bool isWeighted =
false ) :
77 FitData( opt, range, maxpoints, isWeighted ? dim + 1 : dim ),
97 UnBinData(
unsigned int n,
const double * dataX,
const double * dataY,
98 bool isWeighted =
false ) :
108 UnBinData(
unsigned int n,
const double * dataX,
const double * dataY,
109 const double * dataZ,
bool isWeighted =
false ) :
122 template<
class Iterator>
123 UnBinData(
unsigned int n,
unsigned int dim, Iterator dataItr,
124 bool isWeighted =
false ) :
125 FitData(
n, isWeighted ? dim + 1 : dim, dataItr ),
136 FitData( range, maxpoints, dataX ),
146 UnBinData(
unsigned int maxpoints,
const double * dataX,
const double * dataY,
147 const DataRange & range,
bool isWeighted =
false) :
148 FitData( range, maxpoints, dataX, dataY ),
157 UnBinData(
unsigned int maxpoints,
const double * dataX,
const double * dataY,
158 const double * dataZ,
const DataRange & range,
bool isWeighted =
false) :
159 FitData( range, maxpoints, dataX, dataY, dataZ ),
169 template<
class Iterator>
170 UnBinData(
unsigned int maxpoints,
unsigned int dim, Iterator dataItr,
const DataRange & range,
bool isWeighted =
false ) :
171 FitData( range, maxpoints, dim, dataItr ),
215 double dataTmp[] = {
x,
y };
224 void Add(
double x,
double y,
double z)
227 double dataTmp[] = {
x,
y, z };
243 void Add(
const double *
x,
double w)
247 std::vector<double> tmpVec(
fDim);
248 std::copy(
x,
x +
fDim - 1, tmpVec.begin() );
257 double Weight(
unsigned int ipoint )
const
270 MATH_ERROR_MSG(
"UnBinData::WeightsPtr",
"The function is unweighted!");
288 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 unbinned 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 (private)
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...
virtual ~UnBinData()
destructor, delete pointer to internal data or external data wrapper
const double * WeightsPtr(unsigned int ipoint) const
void Add(double x)
preallocate a data set given size and dimension of the coordinates if a vector already exists with co...
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(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...
UnBinData(const UnBinData &)
copy constructor (private)
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
DataOptions : simple structure holding the options on how the data are filled.