13 #ifndef ROOT_Fit_DataVector
14 #define ROOT_Fit_DataVector
29 #ifndef ROOT_Fit_DataOptions
34 #ifndef ROOT_Fit_DataRange
112 return (
unsigned int) (-1) /
sizeof (
double);
243 DataWrapper(
const double * dataX,
const double * val,
const double * eval ,
const double *
ex ) :
259 DataWrapper(
const double * dataX,
const double * dataY,
const double * val,
const double * eval,
const double *
ex ,
const double *
ey ) :
277 DataWrapper(
const double * dataX,
const double * dataY,
const double * dataZ,
const double * val,
const double * eval,
const double *
ex ,
const double *
ey,
const double * ez ) :
297 template<
class Iterator>
310 template<
class Iterator>
311 DataWrapper(
size_t dim, Iterator coordItr,
const double * val,
const double * eval, Iterator errItr ) :
332 const double *
Coords(
unsigned int ipoint)
const {
333 for (
unsigned int i = 0; i <
fDim; ++i) {
341 double Coord(
unsigned int ipoint,
unsigned int icoord)
const {
349 for (
unsigned int i = 0; i <
fDim; ++i) {
351 if (err == 0)
return 0;
352 fErr[i] = err[ipoint];
354 return &
fErr.front();
357 double CoordError(
unsigned int ipoint,
unsigned int icoord)
const {
359 return (err != 0) ? err[ipoint] : 0;
363 double Value(
unsigned int ipoint)
const {
367 double Error(
unsigned int ipoint)
const {
382 mutable std::vector<double>
fX;
383 mutable std::vector<double>
fErr;
DataWrapper(unsigned int dim, Iterator coordItr)
constructor for multi-dim data without errors
Namespace for new ROOT classes and functions.
double Value(unsigned int ipoint) const
FData & Data()
non-const access to underlying vector (in case of insertion/deletion) and iterator ...
FData::const_iterator const_iterator
const iterator access
std::vector< double > FData
Base class for all the fit data types.
FitData(const DataOptions &opt)
construct passing options and default data range
const double * Coords(unsigned int ipoint) const
FitData()
construct with default option and data range
double CoordError(unsigned int ipoint, unsigned int icoord) const
DataWrapper(const double *dataX, const double *dataY, const double *dataZ, const double *val, const double *eval, const double *ex, const double *ey, const double *ez)
constructor for 3D data (if errors are not present a null pointer should be passed) ...
const FData & Data() const
const access to underlying vector
class holding the fit data points.
const double * CoordErrors(unsigned int ipoint) const
DataVector(size_t n)
default constructor for a vector of N -data
~DataVector()
Destructor (no operations)
const_iterator begin() const
DataWrapper(const double *dataX, const double *val, const double *eval, const double *ex)
constructor for 1D data (if errors are not present a null pointer should be passed) ...
iterator begin()
non-const iterator access
class maintaining a pointer to external data Using this class avoids copying the data when performing...
FitData(const DataRange &range)
construct passing range and default options
DataWrapper(const double *dataX)
specialized constructor for 1D data without errors and values
DataWrapper(const double *dataX, const double *dataY, const double *val, const double *eval, const double *ex, const double *ey)
constructor for 2D data (if errors are not present a null pointer should be passed) ...
DataOptions : simple structure holding the options on how the data are filled.
const DataRange & Range() const
access to range
std::vector< const double * > fErrCoords
const double & operator[](unsigned int i) const
access to the point
FitData(const DataOptions &opt, const DataRange &range)
construct passing options and data range
class describing the range in the coordinates it supports multiple range in a coordinate.
virtual ~FitData()
dummy virtual destructor
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
const_iterator end() const
size_t Size() const
full size of data vector (npoints * point size)
double Error(unsigned int ipoint) const
static unsigned int MaxSize()
define a max size to avoid allocating too large arrays
std::vector< double > fErr
std::vector< const double * > fCoords
const DataOptions & Opt() const
access to options
DataWrapper(size_t dim, Iterator coordItr, const double *val, const double *eval, Iterator errItr)
constructor for multi-dim data with errors and values (if errors are not present a null pointer shoul...
double Coord(unsigned int ipoint, unsigned int icoord) const