Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches

Class describing the un-binned data sets (just x coordinates values) of any dimensions.

There is the option to construct UnBindata copying the data inside (in the base FitData class) or using a pointer to external data, depending on which constructor of the UnBinData class is used. It is recommended to copy the input data inside, since this will be more efficient and less error prone, since the input provided data will have to be kept alive for all the time the Fit classes will be used. In case of really large data sets for limiting memory consumption then the other option can be used with special care. 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 46 of file UnBinData.h.

Public Member Functions

 UnBinData (const DataOptions &opt, const DataRange &range, unsigned int maxpoints=0, unsigned int dim=1, bool isWeighted=false)
 constructor from options and range
 UnBinData (const DataRange &range, unsigned int maxpoints=0, unsigned int dim=1, bool isWeighted=false)
 constructor from range and default option
 UnBinData (const UnBinData &)
 copy constructor
 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 (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.
 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.
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
 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, const double *dataX)
 constructor for 1D external data (data are not copied inside)
 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)
 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)
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 passed dim refers just to the coordinate size
 ~UnBinData () override
 destructor, delete pointer to internal data or external data wrapper
void Add (const double *x)
 add multi-dim coordinate data
void Add (const double *x, double w)
 add multi-dim coordinate data + weight
void Add (double x)
 add one dim coordinate data (unweighted)
void Add (double x, double y)
 add 2-dim coordinate data can also be used to add 1-dim data with a weight
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
void Append (unsigned int newPoints, unsigned int dim=1)
void Append (unsigned int newPoints, unsigned int dim=1, bool isWeighted=false)
const doubleCoords (unsigned int ipoint) const
 return a pointer to the coordinates data for the given fit point
const doubleGetCoordComponent (unsigned int ipoint, unsigned int icoord) const
 returns a single coordinate component of a point.
const std::vector< const double * > & GetCoordDataPtrs () const
 direct access to coord data ptrs
bool IsWeighted () const
unsigned int NDim () const
 return coordinate data dimension
unsigned int NPoints () const
 return number of fit points
UnBinDataoperator= (const UnBinData &)
 assignment operator
DataOptionsOpt ()
const DataOptionsOpt () const
 access to options
const DataRangeRange () const
 access to range
unsigned int Size () const
 return number of fit points
double Weight (unsigned int ipoint) const
 return weight
const doubleWeightsPtr (unsigned int ipoint) const

Protected Member Functions

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 ).
template<class Iterator>
void InitFromRange (Iterator dataItr)
void UnWrap ()

Static Protected Member Functions

static constexpr unsigned VectorPadding (const unsigned)
 If std::experimental::simd is not available, there is no vectorization available and the SIMD vector size will always be one.

Protected Attributes

unsigned int fDim
unsigned int fMaxPoints
unsigned int fNPoints
bool fWrapped

Private Attributes

std::vector< std::vector< double > > fCoords
 This vector stores the vectorizable data: The inner vectors contain the coordinates data fCoords[0] is the vector for the x-coords fCoords[1] is the vector for the y-coords etc.
std::vector< const double * > fCoordsPtr
DataOptions fOptions
doublefpTmpCoordVector
DataRange fRange
bool fWeighted

#include <Fit/UnBinData.h>

Inheritance diagram for ROOT::Fit::UnBinData:
ROOT::Fit::FitData

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 54 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 67 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 79 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 91 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 101 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 112 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 passed dim refers just to the coordinate size

Definition at line 127 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 139 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 150 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 161 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 174 of file UnBinData.h.

◆ UnBinData() [12/12]

ROOT::Fit::UnBinData::UnBinData ( const UnBinData & rhs)

copy constructor

Definition at line 24 of file UnBinData.cxx.

◆ ~UnBinData()

ROOT::Fit::UnBinData::~UnBinData ( )
inlineoverride

destructor, delete pointer to internal data or external data wrapper

Definition at line 189 of file UnBinData.h.

Member Function Documentation

◆ Add() [1/5]

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

add multi-dim coordinate data

Definition at line 230 of file UnBinData.h.

◆ Add() [2/5]

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

add multi-dim coordinate data + weight

Definition at line 238 of file UnBinData.h.

◆ Add() [3/5]

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

add one dim coordinate data (unweighted)

Definition at line 195 of file UnBinData.h.

◆ Add() [4/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 207 of file UnBinData.h.

◆ Add() [5/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 219 of file UnBinData.h.

◆ Append() [1/2]

void ROOT::Fit::FitData::Append ( unsigned int newPoints,
unsigned int dim = 1 )
inherited

Definition at line 251 of file FitData.cxx.

◆ Append() [2/2]

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

Definition at line 283 of file UnBinData.h.

◆ Coords()

const double * ROOT::Fit::FitData::Coords ( unsigned int ipoint) const
inlineinherited

return a pointer to the coordinates data for the given fit point

Definition at line 235 of file FitData.h.

◆ GetCoordComponent()

const double * ROOT::Fit::FitData::GetCoordComponent ( unsigned int ipoint,
unsigned int icoord ) const
inlineinherited

returns a single coordinate component of a point.

This function is threadsafe in contrast to Coords(...) and can easily get vectorized by the compiler in loops running over the ipoint-index.

Definition at line 218 of file FitData.h.

◆ GetCoordDataPtrs()

const std::vector< const double * > & ROOT::Fit::FitData::GetCoordDataPtrs ( ) const
inlineinherited

direct access to coord data ptrs

Definition at line 328 of file FitData.h.

◆ InitCoordsVector()

void ROOT::Fit::FitData::InitCoordsVector ( )
inlineprotectedinherited

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 ).

Definition at line 170 of file FitData.h.

◆ InitFromRange()

template<class Iterator>
void ROOT::Fit::FitData::InitFromRange ( Iterator dataItr)
inlineprotectedinherited

Definition at line 189 of file FitData.h.

◆ IsWeighted()

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

Definition at line 278 of file UnBinData.h.

◆ NDim()

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

return coordinate data dimension

Definition at line 275 of file UnBinData.h.

◆ NPoints()

unsigned int ROOT::Fit::FitData::NPoints ( ) const
inlineinherited

return number of fit points

Definition at line 284 of file FitData.h.

◆ operator=()

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

assignment operator

Definition at line 30 of file UnBinData.cxx.

◆ Opt() [1/2]

DataOptions & ROOT::Fit::FitData::Opt ( )
inlineinherited

Definition at line 312 of file FitData.h.

◆ Opt() [2/2]

const DataOptions & ROOT::Fit::FitData::Opt ( ) const
inlineinherited

access to options

Definition at line 308 of file FitData.h.

◆ Range()

const DataRange & ROOT::Fit::FitData::Range ( ) const
inlineinherited

access to range

Definition at line 320 of file FitData.h.

◆ Size()

unsigned int ROOT::Fit::FitData::Size ( ) const
inlineinherited

return number of fit points

Definition at line 292 of file FitData.h.

◆ UnWrap()

void ROOT::Fit::FitData::UnWrap ( )
inlineprotectedinherited

Definition at line 335 of file FitData.h.

◆ VectorPadding()

constexpr unsigned ROOT::Fit::FitData::VectorPadding ( const unsigned )
inlinestaticconstexprprotectedinherited

If std::experimental::simd is not available, there is no vectorization available and the SIMD vector size will always be one.

Then, as every number is a multiple of SIMD vector size, the padding will always be zero.

Definition at line 371 of file FitData.h.

◆ Weight()

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

return weight

Definition at line 252 of file UnBinData.h.

◆ WeightsPtr()

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

Definition at line 260 of file UnBinData.h.

Member Data Documentation

◆ fCoords

std::vector< std::vector< double > > ROOT::Fit::FitData::fCoords
privateinherited

This vector stores the vectorizable data: The inner vectors contain the coordinates data fCoords[0] is the vector for the x-coords fCoords[1] is the vector for the y-coords etc.

The vector of pointers stores the pointers to the first elements of the corresponding elements

If fWrapped is true, fCoords is empty. the data can only be accessed by using fCoordsPtr.

Definition at line 402 of file FitData.h.

◆ fCoordsPtr

std::vector< const double * > ROOT::Fit::FitData::fCoordsPtr
privateinherited

Definition at line 403 of file FitData.h.

◆ fDim

unsigned int ROOT::Fit::FitData::fDim
protectedinherited

Definition at line 385 of file FitData.h.

◆ fMaxPoints

unsigned int ROOT::Fit::FitData::fMaxPoints
protectedinherited

Definition at line 383 of file FitData.h.

◆ fNPoints

unsigned int ROOT::Fit::FitData::fNPoints
protectedinherited

Definition at line 384 of file FitData.h.

◆ fOptions

DataOptions ROOT::Fit::FitData::fOptions
privateinherited

Definition at line 379 of file FitData.h.

◆ fpTmpCoordVector

double* ROOT::Fit::FitData::fpTmpCoordVector
privateinherited

Definition at line 405 of file FitData.h.

◆ fRange

DataRange ROOT::Fit::FitData::fRange
privateinherited

Definition at line 380 of file FitData.h.

◆ fWeighted

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

Definition at line 293 of file UnBinData.h.

◆ fWrapped

bool ROOT::Fit::FitData::fWrapped
protectedinherited

Definition at line 375 of file FitData.h.


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