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

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.
 SparseData (const unsigned int dim, double min[], double max[])
 Constructor with a dimension and two arrays.
 SparseData (std::vector< double > &min, std::vector< double > &max)
 Constructor with a vector.
 ~SparseData () override
 Destructor.
void Add (const double *x)
 add multi-dim coordinate data with only value
void Add (double x)
 add one dim data with only coordinate and values
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.
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
void GetBinData (BinData &) const
 Transforms the data into a ROOT::Fit::BinData structure.
void GetBinDataIntegral (BinData &) const
 Same as before, but returning a BinData with integral format (containing bin edges).
void GetBinDataNoZeros (BinData &) const
 Same as before, but including zero content bins.
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
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).
unsigned int NPoints () const
 Returns the number of points stored.
SparseDataoperator= (const SparseData &rhs)
 Assignment operator.
DataOptionsOpt ()
const DataOptionsOpt () const
 access to options
void PrintList () const
 Debug method to print the list of bins stored.
const DataRangeRange () const
 access to range
unsigned int Size () const
 return number of fit points

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
std::unique_ptr< ProxyListBoxfList
DataOptions fOptions
doublefpTmpCoordVector
DataRange fRange

#include <Fit/SparseData.h>

Inheritance diagram for ROOT::Fit::SparseData:
ROOT::Fit::FitData

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() [1/3]

void ROOT::Fit::FitData::Add ( const double * x)
inlineinherited

add multi-dim coordinate data with only value

Definition at line 268 of file FitData.h.

◆ Add() [2/3]

void ROOT::Fit::FitData::Add ( double x)
inlineinherited

add one dim data with only coordinate and values

Definition at line 253 of file FitData.h.

◆ Add() [3/3]

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.

◆ Append()

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

Definition at line 251 of file FitData.cxx.

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

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

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

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

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

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

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

◆ PrintList()

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

Debug method to print the list of bins stored.

Definition at line 301 of file SparseData.cxx.

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

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.

◆ fList

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

Definition at line 76 of file SparseData.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.

◆ 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: