Logo ROOT   6.10/09
Reference Guide
List of all members | Public 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 42 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 Add (double x)
 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, 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...
 
void Append (unsigned int newPoints, unsigned int dim=1, bool isWeighted=false)
 
bool IsWeighted () const
 
unsigned int NDim () const
 return coordinate data dimension More...
 
double Weight (unsigned int ipoint) const
 return weight More...
 
const double * WeightsPtr (unsigned int ipoint) const
 
- Public Member Functions inherited from ROOT::Fit::FitData
 FitData (unsigned int maxpoints=0, unsigned int dim=1)
 construct with default option and data range More...
 
 FitData (const DataOptions &opt, unsigned int maxpoints=0, unsigned int dim=1)
 construct passing options and default data range More...
 
 FitData (const DataRange &range, unsigned int maxpoints=0, unsigned int dim=1)
 construct passing range and default options More...
 
 FitData (const DataOptions &opt, const DataRange &range, unsigned int maxpoints=0, unsigned int dim=1)
 construct passing options and data range More...
 
 FitData (unsigned int n, const double *dataX)
 constructor from external data for 1D data More...
 
 FitData (unsigned int n, const double *dataX, const double *dataY)
 constructor from external data for 2D data More...
 
 FitData (unsigned int n, const double *dataX, const double *dataY, const double *dataZ)
 constructor from external data for 3D data More...
 
 FitData (const DataRange &range, unsigned int maxpoints, const double *dataX)
 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...
 
 FitData (const DataRange &range, unsigned int maxpoints, const double *dataX, const double *dataY)
 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...
 
 FitData (const DataRange &range, unsigned int maxpoints, const double *dataX, const double *dataY, const double *dataZ)
 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...
 
template<class Iterator >
 FitData (unsigned int n, unsigned int dim, Iterator dataItr)
 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...
 
template<class Iterator >
 FitData (const DataRange &range, unsigned int maxpoints, unsigned int dim, Iterator dataItr)
 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...
 
 FitData (const FitData &rhs)
 
virtual ~FitData ()
 dummy virtual destructor More...
 
void Add (double x)
 add one dim data with only coordinate and values More...
 
void Add (const double *x)
 add multi-dim coordinate data with only value More...
 
void Append (unsigned int newPoints, unsigned int dim=1)
 
const double * Coords (unsigned int ipoint) const
 return a pointer to the coordinates data for the given fit point More...
 
const double * GetCoordComponent (unsigned int ipoint, unsigned int icoord) const
 returns a single coordinate component of a point. More...
 
const std::vector< const double *> & GetCoordDataPtrs () const
 direct access to coord data ptrs More...
 
unsigned int NDim () const
 return coordinate data dimension More...
 
unsigned int NPoints () const
 return number of fit points More...
 
FitDataoperator= (const FitData &rhs)
 
const DataOptionsOpt () const
 access to options More...
 
DataOptionsOpt ()
 
const DataRangeRange () const
 access to range More...
 
unsigned int Size () const
 return number of fit points More...
 

Private Member Functions

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

Private Attributes

bool fWeighted
 

Additional Inherited Members

- Protected Member Functions inherited from ROOT::Fit::FitData
void InitCoordsVector ()
 initializer routines to set the corresponding pointers right The vectors must NOT be resized after this initialization without setting the corresponding pointers in the same moment ( has to be an atomic operation in case of multithreading ). More...
 
template<class Iterator >
void InitFromRange (Iterator dataItr)
 
void UnWrap ()
 
- Protected Attributes inherited from ROOT::Fit::FitData
unsigned int fDim
 
unsigned int fMaxPoints
 
unsigned int fNPoints
 
bool fWrapped
 

#include <Fit/UnBinData.h>

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

Constructor & Destructor Documentation

◆ UnBinData() [1/12]

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

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

Definition at line 50 of file UnBinData.h.

◆ UnBinData() [2/12]

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

constructor from range and default option

Definition at line 63 of file UnBinData.h.

◆ UnBinData() [3/12]

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

constructor from options and range

Definition at line 75 of file UnBinData.h.

◆ UnBinData() [4/12]

ROOT::Fit::UnBinData::UnBinData ( unsigned int  n,
const double *  dataX 
)
inline

constructor for 1D external data (data are not copied inside)

Definition at line 87 of file UnBinData.h.

◆ UnBinData() [5/12]

ROOT::Fit::UnBinData::UnBinData ( unsigned int  n,
const double *  dataX,
const double *  dataY,
bool  isWeighted = false 
)
inline

constructor for 2D external data (data are not copied inside) or 1D data with a weight (if isWeighted = true)

Definition at line 97 of file UnBinData.h.

◆ UnBinData() [6/12]

ROOT::Fit::UnBinData::UnBinData ( unsigned int  n,
const double *  dataX,
const double *  dataY,
const double *  dataZ,
bool  isWeighted = false 
)
inline

constructor for 3D external data (data are not copied inside) or 2D data with a weight (if isWeighted = true)

Definition at line 108 of file UnBinData.h.

◆ UnBinData() [7/12]

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 123 of file UnBinData.h.

◆ UnBinData() [8/12]

ROOT::Fit::UnBinData::UnBinData ( unsigned int  maxpoints,
const double *  dataX,
const DataRange range 
)
inline

constructor for 1D data and a range (data are copied inside according to the given range)

Definition at line 135 of file UnBinData.h.

◆ UnBinData() [9/12]

ROOT::Fit::UnBinData::UnBinData ( unsigned int  maxpoints,
const double *  dataX,
const double *  dataY,
const DataRange range,
bool  isWeighted = false 
)
inline

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 146 of file UnBinData.h.

◆ UnBinData() [10/12]

ROOT::Fit::UnBinData::UnBinData ( unsigned int  maxpoints,
const double *  dataX,
const double *  dataY,
const double *  dataZ,
const DataRange range,
bool  isWeighted = false 
)
inline

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 157 of file UnBinData.h.

◆ UnBinData() [11/12]

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 170 of file UnBinData.h.

◆ UnBinData() [12/12]

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

copy constructor (private)

Definition at line 178 of file UnBinData.h.

◆ ~UnBinData()

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

destructor, delete pointer to internal data or external data wrapper

Definition at line 186 of file UnBinData.h.

Member Function Documentation

◆ Add() [1/5]

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

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)

add one dim coordinate data (unweighted)

Definition at line 200 of file UnBinData.h.

◆ Add() [2/5]

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 212 of file UnBinData.h.

◆ Add() [3/5]

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 224 of file UnBinData.h.

◆ Add() [4/5]

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

add multi-dim coordinate data

Definition at line 235 of file UnBinData.h.

◆ Add() [5/5]

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

add multi-dim coordinate data + weight

Definition at line 243 of file UnBinData.h.

◆ Append()

void ROOT::Fit::UnBinData::Append ( unsigned int  newPoints,
unsigned int  dim = 1,
bool  isWeighted = false 
)
inline

Definition at line 288 of file UnBinData.h.

◆ IsWeighted()

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

Definition at line 283 of file UnBinData.h.

◆ NDim()

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

return coordinate data dimension

Definition at line 280 of file UnBinData.h.

◆ operator=()

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

assignment operator (private)

Definition at line 180 of file UnBinData.h.

◆ Weight()

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

return weight

Definition at line 257 of file UnBinData.h.

◆ WeightsPtr()

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

Definition at line 265 of file UnBinData.h.

Member Data Documentation

◆ fWeighted

bool ROOT::Fit::UnBinData::fWeighted
private

Definition at line 298 of file UnBinData.h.


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