Logo ROOT  
Reference Guide
ROOT::Fit::SparseData Class Reference

SparseData class representing the data of a THNSparse histogram The data needs to be converted to a BinData class before fitting using the GetBinData functions.

Definition at line 35 of file SparseData.h.

Public Member Functions

 SparseData (const SparseData &rhs)
 Copy constructor. More...
 
 SparseData (const unsigned int dim, double min[], double max[])
 Constructor with a dimension and two arrays. More...
 
 SparseData (std::vector< double > &min, std::vector< double > &max)
 Constructor with a vector. More...
 
 ~SparseData () override
 Destructor. More...
 
void Add (std::vector< double > &min, std::vector< double > &max, const double content, const double error=1.0)
 Adds a new bin specified by the vectors. More...
 
void GetBinData (BinData &) const
 Transforms the data into a ROOT::Fit::BinData structure. More...
 
void GetBinDataIntegral (BinData &) const
 Same as before, but returning a BinData with integral format (containing bin edges) More...
 
void GetBinDataNoZeros (BinData &) const
 Same as before, but including zero content bins. More...
 
void GetPoint (const unsigned int i, std::vector< double > &min, std::vector< double > &max, double &content, double &error)
 
unsigned int NDim () const
 Returns the dimension of the object (bins) More...
 
unsigned int NPoints () const
 Returns the number of points stored. More...
 
SparseDataoperator= (const SparseData &rhs)
 Assignment operator. More...
 
void PrintList () const
 Debug method to print the list of bins stored. More...
 
- Public Member Functions inherited from ROOT::Fit::FitData
 FitData (const DataOptions &opt, const DataRange &range, unsigned int maxpoints=0, unsigned int dim=1)
 construct passing options 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, 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 (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 DataRange &range, unsigned int maxpoints=0, unsigned int dim=1)
 construct passing range and default options More...
 
 FitData (const FitData &rhs)
 
 FitData (unsigned int maxpoints=0, unsigned int dim=1)
 construct with default option 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...
 
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 passed dim refers just to the coordinate size More...
 
virtual ~FitData ()
 dummy virtual destructor More...
 
void Add (const double *x)
 add multi-dim coordinate data with only value More...
 
void Add (double x)
 add one dim data with only coordinate and values More...
 
void Append (unsigned int newPoints, unsigned int dim=1)
 
const doubleCoords (unsigned int ipoint) const
 return a pointer to the coordinates data for the given fit point More...
 
const doubleGetCoordComponent (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)
 
DataOptionsOpt ()
 
const DataOptionsOpt () const
 access to options More...
 
const DataRangeRange () const
 access to range More...
 
unsigned int Size () const
 return number of fit points More...
 

Private Attributes

std::unique_ptr< ProxyListBoxfList
 

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 ()
 
- Static Protected Member Functions inherited from ROOT::Fit::FitData
static constexpr unsigned VectorPadding (const unsigned)
 If VecCore is not defined, there is no vectorization available and the SIMD vector size will always be one. More...
 
- Protected Attributes inherited from ROOT::Fit::FitData
unsigned int fDim
 
unsigned int fMaxPoints
 
unsigned int fNPoints
 
bool fWrapped
 

#include <Fit/SparseData.h>

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

Constructor & Destructor Documentation

◆ SparseData() [1/3]

ROOT::Fit::SparseData::SparseData ( std::vector< double > &  min,
std::vector< double > &  max 
)

Constructor with a vector.

Definition at line 193 of file SparseData.cxx.

◆ SparseData() [2/3]

ROOT::Fit::SparseData::SparseData ( const unsigned int  dim,
double  min[],
double  max[] 
)

Constructor with a dimension and two arrays.

Definition at line 203 of file SparseData.cxx.

◆ SparseData() [3/3]

ROOT::Fit::SparseData::SparseData ( const SparseData rhs)

Copy constructor.

Definition at line 215 of file SparseData.cxx.

◆ ~SparseData()

ROOT::Fit::SparseData::~SparseData ( )
override

Destructor.

Definition at line 227 of file SparseData.cxx.

Member Function Documentation

◆ Add()

void ROOT::Fit::SparseData::Add ( std::vector< double > &  min,
std::vector< double > &  max,
const double  content,
const double  error = 1.0 
)

Adds a new bin specified by the vectors.

Definition at line 241 of file SparseData.cxx.

◆ GetBinData()

void ROOT::Fit::SparseData::GetBinData ( BinData bd) const

Transforms the data into a ROOT::Fit::BinData structure.

Definition at line 308 of file SparseData.cxx.

◆ GetBinDataIntegral()

void ROOT::Fit::SparseData::GetBinDataIntegral ( BinData bd) const

Same as before, but returning a BinData with integral format (containing bin edges)

Definition at line 330 of file SparseData.cxx.

◆ GetBinDataNoZeros()

void ROOT::Fit::SparseData::GetBinDataNoZeros ( BinData bd) const

Same as before, but including zero content bins.

Definition at line 348 of file SparseData.cxx.

◆ GetPoint()

void ROOT::Fit::SparseData::GetPoint ( const unsigned int  i,
std::vector< double > &  min,
std::vector< double > &  max,
double content,
double error 
)

Definition at line 278 of file SparseData.cxx.

◆ NDim()

unsigned int ROOT::Fit::SparseData::NDim ( ) const

Returns the dimension of the object (bins)

Definition at line 235 of file SparseData.cxx.

◆ NPoints()

unsigned int ROOT::Fit::SparseData::NPoints ( ) const

Returns the number of points stored.

Definition at line 229 of file SparseData.cxx.

◆ operator=()

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

Assignment operator.

Definition at line 220 of file SparseData.cxx.

◆ PrintList()

void ROOT::Fit::SparseData::PrintList ( ) const

Debug method to print the list of bins stored.

Definition at line 301 of file SparseData.cxx.

Member Data Documentation

◆ fList

std::unique_ptr<ProxyListBox> ROOT::Fit::SparseData::fList
private

Definition at line 76 of file SparseData.h.

Libraries for ROOT::Fit::SparseData:
[legend]

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