ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
ROOT::Fit::UnBinData Class Reference

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 doubleCoords (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 DataOptionsOpt () const
 access to options More...
 
DataOptionsOpt ()
 
const DataRangeRange () const
 access to range More...
 

Protected Member Functions

void SetNPoints (unsigned int n)
 

Private Member Functions

 UnBinData (const UnBinData &)
 copy constructor (private) More...
 
UnBinDataoperator= (const UnBinData &)
 assignment operator (private) More...
 

Private Attributes

unsigned int fDim
 
unsigned int fPointSize
 
unsigned int fNPoints
 
DataVectorfDataVector
 
DataWrapperfDataWrapper
 

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>

Inheritance diagram for ROOT::Fit::UnBinData:
[legend]

Constructor & Destructor Documentation

ROOT::Fit::UnBinData::UnBinData ( unsigned int  maxpoints = 0,
unsigned int  dim = 1,
bool  isWeighted = false 
)
explicit

constructor from dimension of point and max number of points (to pre-allocate vector)

Definition at line 24 of file UnBinData.cxx.

ROOT::Fit::UnBinData::UnBinData ( const DataRange range,
unsigned int  maxpoints = 0,
unsigned int  dim = 1,
bool  isWeighted = false 
)
explicit

constructor from range and default option

Definition at line 40 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 56 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 72 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 83 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 95 of file UnBinData.cxx.

template<class Iterator >
ROOT::Fit::UnBinData::UnBinData ( unsigned int  n,
unsigned int  dim,
Iterator  dataItr,
bool  isWeighted = false 
)
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 106 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 129 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 153 of file UnBinData.cxx.

template<class Iterator >
ROOT::Fit::UnBinData::UnBinData ( unsigned int  maxpoints,
unsigned int  dim,
Iterator  dataItr,
const DataRange range,
bool  isWeighted = false 
)
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.

ROOT::Fit::UnBinData::UnBinData ( const UnBinData )
inlineprivate

copy constructor (private)

Definition at line 157 of file UnBinData.h.

virtual ROOT::Fit::UnBinData::~UnBinData ( )
inlinevirtual

destructor, delete pointer to internal data or external data wrapper

Definition at line 183 of file UnBinData.h.

Member Function Documentation

void ROOT::Fit::UnBinData::Add ( double  x)
inline

add one dim coordinate data (unweighted)

Definition at line 199 of file UnBinData.h.

Referenced by FillUnBinData(), ROOT::Math::DistSampler::Generate(), testUnBin1DFit(), and UnBinData().

void ROOT::Fit::UnBinData::Add ( double  x,
double  y 
)
inline

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.

void ROOT::Fit::UnBinData::Add ( double  x,
double  y,
double  z 
)
inline

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.

void ROOT::Fit::UnBinData::Add ( const double x)
inline

add multi-dim coordinate data

Definition at line 247 of file UnBinData.h.

void ROOT::Fit::UnBinData::Add ( const double x,
double  w 
)
inline

add multi-dim coordinate data + weight

Definition at line 264 of file UnBinData.h.

const double* ROOT::Fit::UnBinData::Coords ( unsigned int  ipoint) const
inline
unsigned int ROOT::Fit::UnBinData::DataSize ( ) const
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 178 of file UnBinData.cxx.

Referenced by FillUnBinData(), ROOT::Math::DistSampler::Generate(), and Resize().

bool ROOT::Fit::UnBinData::IsWeighted ( ) const
inline

Definition at line 289 of file UnBinData.h.

Referenced by Resize().

unsigned int ROOT::Fit::UnBinData::NDim ( ) const
inline

return coordinate data dimension

Definition at line 321 of file UnBinData.h.

Referenced by DoUnBinFit(), and ROOT::Fit::FitUtil::EvaluateLogL().

unsigned int ROOT::Fit::UnBinData::NPoints ( ) const
inline

return number of contained points

Definition at line 311 of file UnBinData.h.

UnBinData& ROOT::Fit::UnBinData::operator= ( const UnBinData )
inlineprivate

assignment operator (private)

Definition at line 159 of file UnBinData.h.

unsigned int ROOT::Fit::UnBinData::PointSize ( ) const
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 200 of file UnBinData.cxx.

void ROOT::Fit::UnBinData::SetNPoints ( unsigned int  n)
inlineprotected

Definition at line 341 of file UnBinData.h.

unsigned int ROOT::Fit::UnBinData::Size ( ) const
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().

double ROOT::Fit::UnBinData::Weight ( unsigned int  ipoint) const
inline

Definition at line 293 of file UnBinData.h.

Referenced by ROOT::Fit::FitUtil::EvaluateLogL().

Member Data Documentation

DataVector* ROOT::Fit::UnBinData::fDataVector
private

Definition at line 349 of file UnBinData.h.

Referenced by Add(), Coords(), DataSize(), Initialize(), Resize(), UnBinData(), Weight(), and ~UnBinData().

DataWrapper* ROOT::Fit::UnBinData::fDataWrapper
private

Definition at line 350 of file UnBinData.h.

Referenced by Coords(), UnBinData(), and ~UnBinData().

unsigned int ROOT::Fit::UnBinData::fDim
private

Definition at line 345 of file UnBinData.h.

Referenced by Add(), Initialize(), IsWeighted(), NDim(), Resize(), and Weight().

unsigned int ROOT::Fit::UnBinData::fNPoints
private

Definition at line 347 of file UnBinData.h.

Referenced by Add(), NPoints(), SetNPoints(), Size(), and UnBinData().

unsigned int ROOT::Fit::UnBinData::fPointSize
private

Definition at line 346 of file UnBinData.h.

Referenced by Add(), Coords(), Initialize(), IsWeighted(), PointSize(), Resize(), UnBinData(), and Weight().

Collaboration diagram for ROOT::Fit::UnBinData:
[legend]

The documentation for this class was generated from the following files: