ROOT
6.06/09
Reference Guide
|
Class describing the unbinned data sets (just x coordinates values) of any dimensions.
There is the option to construct UnBindata copying the data in (using the DataVector class) or using pointer to external data (DataWrapper) class. In general is found to be more efficient to copy the data. In case of really large data sets for limiting memory consumption then the other option can be used Specialized constructor exists for using external data up to 3 dimensions.
When the data are copying in the number of points can be set later (or re-set) using Initialize and the data are inserted one by one using the Add method. It is mandatory to set the size before using the Add method.
Definition at line 47 of file UnBinData.h.
Public Member Functions | |
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) More... | |
UnBinData (const DataRange &range, unsigned int maxpoints=0, unsigned int dim=1, bool isWeighted=false) | |
constructor from range and default option More... | |
UnBinData (const DataOptions &opt, const DataRange &range, unsigned int maxpoints=0, unsigned int dim=1, bool isWeighted=false) | |
constructor from options and range More... | |
UnBinData (unsigned int n, const double *dataX) | |
constructor for 1D external data (data are not copied inside) More... | |
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 = true) More... | |
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 = true) More... | |
template<class Iterator > | |
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 a list (or vector) containing the const double * of the data An example could be the std::vector<const double *>::begin In case of weighted data, the external data must have a dim+1 lists of data The apssed dim refers just to the coordinate size More... | |
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) More... | |
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 data set + weight. More... | |
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 data set + weights. More... | |
template<class Iterator > | |
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) Uses as argument an iterator of a list (or vector) containing the const double * of the data An example could be the std::vector<const double *>::begin More... | |
virtual | ~UnBinData () |
destructor, delete pointer to internal data or external data wrapper More... | |
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 correct dimension (point size) extend the existing one to a total size of maxpoints (equivalent to a Resize) More... | |
void | Add (double x) |
add one dim coordinate data (unweighted) More... | |
void | Add (double x, double y) |
add 2-dim coordinate data can also be used to add 1-dim data with a weight More... | |
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 More... | |
void | Add (const double *x) |
add multi-dim coordinate data More... | |
void | Add (const double *x, double w) |
add multi-dim coordinate data + weight More... | |
const double * | Coords (unsigned int ipoint) const |
return pointer to coordinate data More... | |
bool | IsWeighted () const |
double | Weight (unsigned int ipoint) const |
void | Resize (unsigned int npoints) |
resize the vector to the given npoints More... | |
unsigned int | NPoints () const |
return number of contained points More... | |
unsigned int | Size () const |
return number of contained points More... | |
unsigned int | NDim () const |
return coordinate data dimension More... | |
unsigned int | PointSize () const |
return point size. More... | |
unsigned int | DataSize () const |
return size of internal data vector (is 0 for external data) More... | |
Public Member Functions inherited from ROOT::Fit::FitData | |
FitData () | |
construct with default option and data range More... | |
virtual | ~FitData () |
dummy virtual destructor More... | |
FitData (const DataOptions &opt) | |
construct passing options and default data range More... | |
FitData (const DataRange &range) | |
construct passing range and default options More... | |
FitData (const DataOptions &opt, const DataRange &range) | |
construct passing options and data range More... | |
const DataOptions & | Opt () const |
access to options More... | |
DataOptions & | Opt () |
const DataRange & | Range () const |
access to range More... | |
Protected Member Functions | |
void | SetNPoints (unsigned int n) |
Private Member Functions | |
UnBinData (const UnBinData &) | |
copy constructor (private) More... | |
UnBinData & | operator= (const UnBinData &) |
assignment operator (private) More... | |
Private Attributes | |
unsigned int | fDim |
unsigned int | fPointSize |
unsigned int | fNPoints |
DataVector * | fDataVector |
DataWrapper * | fDataWrapper |
Additional Inherited Members | |
Static Public Member Functions inherited from ROOT::Fit::FitData | |
static unsigned int | MaxSize () |
define a max size to avoid allocating too large arrays More... | |
#include <Fit/UnBinData.h>
|
explicit |
constructor from dimension of point and max number of points (to pre-allocate vector)
Definition at line 23 of file UnBinData.cxx.
|
explicit |
constructor from range and default option
Definition at line 39 of file UnBinData.cxx.
ROOT::Fit::UnBinData::UnBinData | ( | const DataOptions & | opt, |
const DataRange & | range, | ||
unsigned int | maxpoints = 0 , |
||
unsigned int | dim = 1 , |
||
bool | isWeighted = false |
||
) |
constructor from options and range
Definition at line 55 of file UnBinData.cxx.
ROOT::Fit::UnBinData::UnBinData | ( | unsigned int | n, |
const double * | dataX | ||
) |
constructor for 1D external data (data are not copied inside)
Definition at line 71 of file UnBinData.cxx.
ROOT::Fit::UnBinData::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 = true)
Definition at line 82 of file UnBinData.cxx.
ROOT::Fit::UnBinData::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 = true)
Definition at line 94 of file UnBinData.cxx.
|
inline |
constructor for multi-dim external data (data are not copied inside) Uses as argument an iterator of a list (or vector) containing the const double * of the data An example could be the std::vector<const double *>::begin In case of weighted data, the external data must have a dim+1 lists of data The apssed dim refers just to the coordinate size
Definition at line 93 of file UnBinData.h.
ROOT::Fit::UnBinData::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)
Definition at line 105 of file UnBinData.cxx.
ROOT::Fit::UnBinData::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 data set + weight.
If is weighted dataY is the pointer to the list of the weights
Definition at line 128 of file UnBinData.cxx.
ROOT::Fit::UnBinData::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 data set + weights.
If is weighted dataZ is the pointer to the list of the weights
Definition at line 152 of file UnBinData.cxx.
|
inline |
constructor for multi-dim external data and a range (data are copied inside according to the range) Uses as argument an iterator of a list (or vector) containing the const double * of the data An example could be the std::vector<const double *>::begin
Definition at line 126 of file UnBinData.h.
|
inlineprivate |
copy constructor (private)
Definition at line 157 of file UnBinData.h.
|
inlinevirtual |
destructor, delete pointer to internal data or external data wrapper
Definition at line 183 of file UnBinData.h.
add one dim coordinate data (unweighted)
Definition at line 199 of file UnBinData.h.
Referenced by FillUnBinData(), ROOT::Math::DistSampler::Generate(), testUnBin1DFit(), and UnBinData().
add 2-dim coordinate data can also be used to add 1-dim data with a weight
Definition at line 215 of file UnBinData.h.
add 3-dim coordinate data can also be used to add 2-dim data with a weight
Definition at line 231 of file UnBinData.h.
add multi-dim coordinate data
Definition at line 247 of file UnBinData.h.
add multi-dim coordinate data + weight
Definition at line 264 of file UnBinData.h.
|
inline |
return pointer to coordinate data
Definition at line 282 of file UnBinData.h.
Referenced by TFitEditor::DoFit(), ROOT::Fit::FitUtil::EvaluateLogL(), ROOT::Fit::FitUtil::EvaluateLogLGradient(), ROOT::Fit::FitUtil::EvaluatePdf(), and printData().
|
inline |
return size of internal data vector (is 0 for external data)
Definition at line 334 of file UnBinData.h.
Referenced by Add(), and ROOT::Math::DistSampler::Generate().
void ROOT::Fit::UnBinData::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 correct dimension (point size) extend the existing one to a total size of maxpoints (equivalent to a Resize)
Definition at line 177 of file UnBinData.cxx.
Referenced by FillUnBinData(), ROOT::Math::DistSampler::Generate(), and Resize().
|
inline |
Definition at line 289 of file UnBinData.h.
Referenced by Resize().
|
inline |
return coordinate data dimension
Definition at line 321 of file UnBinData.h.
Referenced by DoUnBinFit(), and ROOT::Fit::FitUtil::EvaluateLogL().
|
inline |
return number of contained points
Definition at line 311 of file UnBinData.h.
assignment operator (private)
Definition at line 159 of file UnBinData.h.
|
inline |
return point size.
For unweighted data is equivalent to coordinate dimension, for weighted data is NDim()+1
Definition at line 327 of file UnBinData.h.
Referenced by Add(), and ROOT::Math::DistSampler::Generate().
void ROOT::Fit::UnBinData::Resize | ( | unsigned int | npoints | ) |
resize the vector to the given npoints
Definition at line 199 of file UnBinData.cxx.
|
inlineprotected |
Definition at line 341 of file UnBinData.h.
|
inline |
return number of contained points
Definition at line 316 of file UnBinData.h.
Referenced by TFitEditor::DoFit(), DoUnBinFit(), ROOT::Fit::FitUtil::EvaluateLogL(), ROOT::Fit::FitUtil::EvaluateLogLGradient(), and printData().
|
inline |
Definition at line 293 of file UnBinData.h.
Referenced by ROOT::Fit::FitUtil::EvaluateLogL().
|
private |
Definition at line 349 of file UnBinData.h.
Referenced by Add(), Coords(), DataSize(), Initialize(), Resize(), UnBinData(), Weight(), and ~UnBinData().
|
private |
Definition at line 350 of file UnBinData.h.
Referenced by Coords(), UnBinData(), and ~UnBinData().
|
private |
Definition at line 345 of file UnBinData.h.
Referenced by Add(), Initialize(), IsWeighted(), NDim(), Resize(), and Weight().
|
private |
Definition at line 347 of file UnBinData.h.
Referenced by Add(), NPoints(), SetNPoints(), Size(), and UnBinData().
|
private |
Definition at line 346 of file UnBinData.h.
Referenced by Add(), Coords(), Initialize(), IsWeighted(), PointSize(), Resize(), UnBinData(), and Weight().