BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
ROOT::Fit::BinData Class Reference

Description

Class describing the binned data sets : vectors of x coordinates, y values and optionally error on y values and error on coordinates The dimension of the coordinate is free There are 4 different options:

  • only coordinates and values (for binned likelihood fits) : kNoError
  • coordinate, values and error on values (for normal least square fits) : kValueError
  • coordinate, values, error on values and coordinates (for effective least square fits) : kCoordError
  • corrdinate, values, error on coordinates and asymmettric error on valyes : kAsymError

In addition there is the option to construct Bindata 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 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 53 of file BinData.h.

Inheritance diagram for ROOT::Fit::BinData:
[legend]
Collaboration diagram for ROOT::Fit::BinData:
[legend]

Public Types

enum  ErrorType { kNoError , kValueError , kCoordError , kAsymError }
 

Public Member Functions

 BinData (const BinData &rhs)
 
 BinData (const DataOptions &opt, const DataRange &range, unsigned int maxpoints=0, unsigned int dim=1, ErrorType err=kValueError)
 
 BinData (const DataOptions &opt, unsigned int maxpoints=0, unsigned int dim=1, ErrorType err=kValueError)
 
 BinData (unsigned int maxpoints=0, unsigned int dim=1, ErrorType err=kValueError)
 
 BinData (unsigned int n, const double *dataX, const double *dataY, const double *dataZ, const double *val, const double *ex, const double *ey, const double *ez, const double *eval)
 
 BinData (unsigned int n, const double *dataX, const double *dataY, const double *val, const double *ex, const double *ey, const double *eval)
 
 BinData (unsigned int n, const double *dataX, const double *val, const double *ex, const double *eval)
 
virtual ~BinData ()
 
void Add (const double *x, double val)
 
void Add (const double *x, double val, const double *ex, double elval, double ehval)
 
void Add (const double *x, double val, const double *ex, double eval)
 
void Add (const double *x, double val, double eval)
 
void Add (double x, double y)
 
void Add (double x, double y, double ex, double ey)
 
void Add (double x, double y, double ex, double eyl, double eyh)
 
void Add (double x, double y, double ey)
 
void AddBinUpEdge (const double *xup)
 
void Append (unsigned int newPoints, unsigned int dim=1, ErrorType err=kValueError)
 
const double * BinUpEdge (unsigned int ipoint) const
 
const double * CoordErrors (unsigned int ipoint) const
 
double Error (unsigned int ipoint) const
 
const double * ErrorPtr (unsigned int ipoint) const
 
void GetAsymError (unsigned int ipoint, double &lowError, double &highError) const
 
double GetBinUpEdgeComponent (unsigned int ipoint, unsigned int icoord) const
 
double GetCoordErrorComponent (unsigned int ipoint, unsigned int icoord) const
 
ErrorType GetErrorType () const
 
const double * GetPoint (unsigned int ipoint, double &value) const
 
const double * GetPoint (unsigned int ipoint, double &value, double &invError) const
 
const double * GetPointError (unsigned int ipoint, double &errlow, double &errhigh) const
 
const double * GetPointError (unsigned int ipoint, double &errvalue) const
 
bool HasBinEdges () const
 
bool HaveAsymErrors () const
 
bool HaveCoordErrors () const
 
void Initialize (unsigned int newPoints, unsigned int dim=1, ErrorType err=kValueError)
 
double InvError (unsigned int ipoint) const
 
bool IsWeighted () const
 
BinDataLogTransform ()
 
BinDataoperator= (const BinData &rhs)
 
double RefVolume () const
 
void SetRefVolume (double value)
 
double SumOfContent () const
 
double SumOfError2 () const
 
double Value (unsigned int ipoint) const
 
const double * ValuePtr (unsigned int ipoint) const
 

Protected Member Functions

void ComputeSums ()
 
void InitBinEdge ()
 
void InitDataVector ()
 
void InitializeErrors ()
 
void UnWrap ()
 

Private Attributes

std::vector< std::vector< double > > fBinEdge
 
std::vector< std::vector< double > > fCoordErrors
 
std::vector< const double * > fCoordErrorsPtr
 
std::vector< double > fData
 
std::vector< double > fDataError
 
std::vector< double > fDataErrorHigh
 
const double * fDataErrorHighPtr
 
std::vector< double > fDataErrorLow
 
const double * fDataErrorLowPtr
 
const double * fDataErrorPtr
 
const double * fDataPtr
 
ErrorType fErrorType
 
bool fIsWeighted = false
 
double * fpTmpBinEdgeVector
 
double * fpTmpCoordErrorVector
 
double fRefVolume
 
double fSumContent = 0
 
double fSumError2 = 0
 

Member Enumeration Documentation

◆ ErrorType

Enumerator
kNoError 
kValueError 
kCoordError 
kAsymError 

Definition at line 57 of file BinData.h.

Constructor & Destructor Documentation

◆ BinData() [1/7]

ROOT::Fit::BinData::BinData ( unsigned int  maxpoints = 0,
unsigned int  dim = 1,
ErrorType  err = kValueError 
)
explicit

constructor from dimension of point and max number of points (to pre-allocate vector) Give a zero value and then use Initialize later one if the size is not known

◆ BinData() [2/7]

ROOT::Fit::BinData::BinData ( const DataOptions opt,
unsigned int  maxpoints = 0,
unsigned int  dim = 1,
ErrorType  err = kValueError 
)
explicit

constructor from option and default range

◆ BinData() [3/7]

ROOT::Fit::BinData::BinData ( const DataOptions opt,
const DataRange range,
unsigned int  maxpoints = 0,
unsigned int  dim = 1,
ErrorType  err = kValueError 
)

constructor from options and range efault is 1D and value errors

◆ BinData() [4/7]

ROOT::Fit::BinData::BinData ( unsigned int  n,
const double *  dataX,
const double *  val,
const double *  ex,
const double *  eval 
)

constructurs using external data constructor from external data for 1D with errors on coordinate and value

◆ BinData() [5/7]

ROOT::Fit::BinData::BinData ( unsigned int  n,
const double *  dataX,
const double *  dataY,
const double *  val,
const double *  ex,
const double *  ey,
const double *  eval 
)

constructor from external data for 2D with errors on coordinate and value

◆ BinData() [6/7]

ROOT::Fit::BinData::BinData ( unsigned int  n,
const double *  dataX,
const double *  dataY,
const double *  dataZ,
const double *  val,
const double *  ex,
const double *  ey,
const double *  ez,
const double *  eval 
)

constructor from external data for 3D with errors on coordinate and value

◆ ~BinData()

virtual ROOT::Fit::BinData::~BinData ( )
virtual

destructor

◆ BinData() [7/7]

ROOT::Fit::BinData::BinData ( const BinData rhs)

copy constructors

Member Function Documentation

◆ Add() [1/8]

void ROOT::Fit::BinData::Add ( const double *  x,
double  val 
)

add multi-dim coordinate data with only value

◆ Add() [2/8]

void ROOT::Fit::BinData::Add ( const double *  x,
double  val,
const double *  ex,
double  elval,
double  ehval 
)

add multi-dim coordinate data with both error in coordinates and value

◆ Add() [3/8]

void ROOT::Fit::BinData::Add ( const double *  x,
double  val,
const double *  ex,
double  eval 
)

add multi-dim coordinate data with both error in coordinates and value

◆ Add() [4/8]

void ROOT::Fit::BinData::Add ( const double *  x,
double  val,
double  eval 
)

add multi-dim coordinate data with only error in value

◆ Add() [5/8]

void ROOT::Fit::BinData::Add ( double  x,
double  y 
)

add one dim data with only coordinate and values

◆ Add() [6/8]

void ROOT::Fit::BinData::Add ( double  x,
double  y,
double  ex,
double  ey 
)

add one dim data with error in the coordinate (x) in this case store the value (y) error and not the inverse

◆ Add() [7/8]

void ROOT::Fit::BinData::Add ( double  x,
double  y,
double  ex,
double  eyl,
double  eyh 
)

add one dim data with error in the coordinate (x) and asymmetric errors in the value (y) in this case store the y errors and not the inverse

◆ Add() [8/8]

void ROOT::Fit::BinData::Add ( double  x,
double  y,
double  ey 
)

add one dim data with no error in the coordinate (x) in this case store the inverse of the error in the value (y)

◆ AddBinUpEdge()

void ROOT::Fit::BinData::AddBinUpEdge ( const double *  xup)

add the bin width data, a pointer to an array with the bin upper edge information. This is needed when fitting with integral options The information is added for the previously inserted point. BinData::Add must be called before

◆ Append()

void ROOT::Fit::BinData::Append ( unsigned int  newPoints,
unsigned int  dim = 1,
ErrorType  err = kValueError 
)

preallocate a data set with given size , dimension and error type (to get the full point size) If the data set already exists and it is having the compatible point size space for the new points is created in the data sets, while if not compatible the old data are erased and new space of new size is allocated. (i.e if exists initialize is equivalent to a resize( NPoints() + maxpoints)

◆ BinUpEdge()

const double* ROOT::Fit::BinData::BinUpEdge ( unsigned int  ipoint) const
inline

return an array containing the upper edge of the bin for coordinate i In case of empty bin they could be merged in a single larger bin Return a NULL pointer if the bin width is not stored

Definition at line 508 of file BinData.h.

509  {
510  if ( fBinEdge.empty() || ipoint > fBinEdge.front().size() )
511  return 0;
512 
513  assert( fpTmpBinEdgeVector );
514  assert( !fBinEdge.empty() );
515  assert( ipoint < fMaxPoints );
516 
517  for ( unsigned int i=0; i < fDim; i++ )
518  {
519  fpTmpBinEdgeVector[i] = fBinEdge[i][ ipoint ];
520  }
521 
522  return fpTmpBinEdgeVector;
523  }
std::vector< std::vector< double > > fBinEdge
Definition: BinData.h:614
double * fpTmpBinEdgeVector
Definition: BinData.h:617

References fBinEdge, and fpTmpBinEdgeVector.

◆ ComputeSums()

void ROOT::Fit::BinData::ComputeSums ( )
protected

◆ CoordErrors()

const double* ROOT::Fit::BinData::CoordErrors ( unsigned int  ipoint) const
inline

Return a pointer to the errors in the coordinates for the given fit point

Definition at line 401 of file BinData.h.

402  {
403  assert( ipoint < fMaxPoints );
404  assert( fpTmpCoordErrorVector );
405  assert( fErrorType == kCoordError || fErrorType == kAsymError );
406 
407  for ( unsigned int i=0; i < fDim; i++ )
408  {
409  assert( fCoordErrorsPtr[i] );
410  assert( fCoordErrors.empty() || &fCoordErrors[i].front() == fCoordErrorsPtr[i] );
411 
412  fpTmpCoordErrorVector[i] = fCoordErrorsPtr[i][ipoint];
413  }
414 
415  return fpTmpCoordErrorVector;
416  }
std::vector< const double * > fCoordErrorsPtr
Definition: BinData.h:599
ErrorType fErrorType
Definition: BinData.h:585
double * fpTmpCoordErrorVector
Definition: BinData.h:612
std::vector< std::vector< double > > fCoordErrors
Definition: BinData.h:598

References fCoordErrors, fCoordErrorsPtr, fErrorType, fpTmpCoordErrorVector, kAsymError, and kCoordError.

Referenced by GetPointError().

◆ Error()

double ROOT::Fit::BinData::Error ( unsigned int  ipoint) const
inline

Definition at line 251 of file BinData.h.

252  {
253  assert( ipoint < fMaxPoints );
254  assert( kValueError == fErrorType || kCoordError == fErrorType ||
256 
257  if ( fErrorType == kNoError )
258  {
260  assert( fDataError.empty() && fDataErrorHigh.empty() && fDataErrorLow.empty() );
261  return 1.0;
262  }
263 
264  if ( fErrorType == kValueError ) // need to invert (inverror is stored)
265  {
267  assert( fDataErrorHigh.empty() && fDataErrorLow.empty() );
268  assert( fDataError.empty() || &fDataError.front() == fDataErrorPtr );
269 
270  double eval = fDataErrorPtr[ ipoint ];
271 
272  if (fWrapped)
273  return eval;
274  else
275  return (eval != 0.0) ? 1.0/eval : 0.0;
276  }
277 
278  if ( fErrorType == kAsymError )
279  { // return 1/2(el + eh)
281  assert( fDataError.empty() );
282  assert( fDataErrorHigh.empty() || &fDataErrorHigh.front() == fDataErrorHighPtr );
283  assert( fDataErrorLow.empty() || &fDataErrorLow.front() == fDataErrorLowPtr );
284  assert( fDataErrorLow.empty() == fDataErrorHigh.empty() );
285 
286  double eh = fDataErrorHighPtr[ ipoint ];
287  double el = fDataErrorLowPtr[ ipoint ];
288 
289  return (el+eh) / 2.0;
290  }
291 
292  assert( fErrorType == kCoordError );
293  return fDataErrorPtr[ ipoint ];
294  }
const double * fDataErrorHighPtr
Definition: BinData.h:607
std::vector< double > fDataErrorLow
Definition: BinData.h:605
const double * fDataErrorLowPtr
Definition: BinData.h:608
std::vector< double > fDataErrorHigh
Definition: BinData.h:604
const double * fDataErrorPtr
Definition: BinData.h:606
std::vector< double > fDataError
Definition: BinData.h:603

References fDataError, fDataErrorHigh, fDataErrorHighPtr, fDataErrorLow, fDataErrorLowPtr, fDataErrorPtr, fErrorType, kAsymError, kCoordError, kNoError, and kValueError.

Referenced by GetPoint(), and GetPointError().

◆ ErrorPtr()

const double* ROOT::Fit::BinData::ErrorPtr ( unsigned int  ipoint) const
inline

return error on the value for the given fit point Safe (but slower) method returning correctly the error on the value in case of asymm errors return the average 0.5(eu + el)

Definition at line 240 of file BinData.h.

240  {
241  assert( ipoint < fMaxPoints );
242  assert( kValueError == fErrorType || kCoordError == fErrorType ||
244 
245  if ( fErrorType == kNoError )
246  return nullptr;
247  // assert( fErrorType == kCoordError );
248  return &fDataErrorPtr[ ipoint ];
249  }

References fDataErrorPtr, fErrorType, kAsymError, kCoordError, kNoError, and kValueError.

◆ GetAsymError()

void ROOT::Fit::BinData::GetAsymError ( unsigned int  ipoint,
double &  lowError,
double &  highError 
) const
inline

Definition at line 296 of file BinData.h.

297  {
298  assert( fErrorType == kAsymError );
300  assert( fDataError.empty() );
301  assert( fDataErrorHigh.empty() || &fDataErrorHigh.front() == fDataErrorHighPtr );
302  assert( fDataErrorLow.empty() || &fDataErrorLow.front() == fDataErrorLowPtr );
303  assert( fDataErrorLow.empty() == fDataErrorHigh.empty() );
304 
305  lowError = fDataErrorLowPtr[ ipoint ];
306  highError = fDataErrorHighPtr[ ipoint ];
307  }

References fDataError, fDataErrorHigh, fDataErrorHighPtr, fDataErrorLow, fDataErrorLowPtr, fDataErrorPtr, fErrorType, and kAsymError.

◆ GetBinUpEdgeComponent()

double ROOT::Fit::BinData::GetBinUpEdgeComponent ( unsigned int  ipoint,
unsigned int  icoord 
) const
inline

returns a single coordinate error 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 491 of file BinData.h.

492  {
493  assert( icoord < fDim );
494  assert( !fBinEdge.empty() );
495  assert( ipoint < fBinEdge.front().size() );
496 
497  return fBinEdge[icoord][ipoint];
498  }

References fBinEdge.

◆ GetCoordErrorComponent()

double ROOT::Fit::BinData::GetCoordErrorComponent ( unsigned int  ipoint,
unsigned int  icoord 
) const
inline

returns a single coordinate error 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 384 of file BinData.h.

385  {
386  assert( ipoint < fMaxPoints );
387  assert( icoord < fDim );
388  assert( fCoordErrorsPtr.size() == fDim );
389  assert( fCoordErrorsPtr[icoord] );
390  assert( fCoordErrors.empty() || &fCoordErrors[icoord].front() == fCoordErrorsPtr[icoord] );
391 
392  return fCoordErrorsPtr[icoord][ipoint];
393  }

References fCoordErrors, and fCoordErrorsPtr.

◆ GetErrorType()

ErrorType ROOT::Fit::BinData::GetErrorType ( ) const
inline

retrieve the errortype

Definition at line 545 of file BinData.h.

546  {
547  return fErrorType;
548  }

References fErrorType.

◆ GetPoint() [1/2]

const double* ROOT::Fit::BinData::GetPoint ( unsigned int  ipoint,
double &  value 
) const
inline

retrieve at the same time a pointer to the coordinate data and the fit value More efficient than calling Coords(i) and Value(i)

Definition at line 370 of file BinData.h.

371  {
372  assert( ipoint < fMaxPoints );
373  value = Value( ipoint );
374 
375  return Coords( ipoint );
376  }
double Value(unsigned int ipoint) const
Definition: BinData.h:217
Coords
Definition: Tags.h:20

References Value().

Referenced by GetPoint().

Here is the call graph for this function:

◆ GetPoint() [2/2]

const double* ROOT::Fit::BinData::GetPoint ( unsigned int  ipoint,
double &  value,
double &  invError 
) const
inline

retrieve in a single call a pointer to the coordinate data, value and inverse error for the given fit point. To be used only when type is kValueError or kNoError. In the last case the value 1 is returned for the error.

Definition at line 428 of file BinData.h.

429  {
430  assert( ipoint < fMaxPoints );
431  assert( fErrorType == kNoError || fErrorType == kValueError );
432 
433  double e = Error( ipoint );
434 
435  if (fWrapped)
436  invError = e;
437  else
438  invError = ( e != 0.0 ) ? 1.0/e : 1.0;
439 
440  return GetPoint( ipoint, value );
441  }
const double * GetPoint(unsigned int ipoint, double &value) const
Definition: BinData.h:370
double Error(unsigned int ipoint) const
Definition: BinData.h:251

References Error(), fErrorType, GetPoint(), kNoError, and kValueError.

Here is the call graph for this function:

◆ GetPointError() [1/2]

const double* ROOT::Fit::BinData::GetPointError ( unsigned int  ipoint,
double &  errlow,
double &  errhigh 
) const
inline

Get errors on the point (coordinate errors and asymmetric value errors) for the given fit point. It must be called only when the coordinate errors and asymmetric errors are stored otherwise it will produce an assert.

Definition at line 469 of file BinData.h.

470  {
471  assert( ipoint < fMaxPoints );
472  assert( fErrorType == kAsymError );
474  assert( fDataError.empty() );
475  assert( fDataErrorHigh.empty() || &fDataErrorHigh.front() == fDataErrorHighPtr );
476  assert( fDataErrorLow.empty() || &fDataErrorLow.front() == fDataErrorLowPtr );
477  assert( fDataErrorLow.empty() == fDataErrorHigh.empty() );
478 
479  errhigh = fDataErrorHighPtr[ ipoint ];
480  errlow = fDataErrorLowPtr[ ipoint ];
481 
482  return CoordErrors( ipoint );
483  }
const double * CoordErrors(unsigned int ipoint) const
Definition: BinData.h:401

References CoordErrors(), fDataError, fDataErrorHigh, fDataErrorHighPtr, fDataErrorLow, fDataErrorLowPtr, fDataErrorPtr, fErrorType, and kAsymError.

Here is the call graph for this function:

◆ GetPointError() [2/2]

const double* ROOT::Fit::BinData::GetPointError ( unsigned int  ipoint,
double &  errvalue 
) const
inline

Retrieve the errors on the point (coordinate and value) for the given fit point It must be called only when the coordinate errors are stored otherwise it will produce an assert.

Definition at line 451 of file BinData.h.

452  {
453  assert( ipoint < fMaxPoints );
454  assert( fErrorType == kCoordError || fErrorType == kAsymError );
455 
456  errvalue = Error( ipoint );
457  return CoordErrors( ipoint );
458  }

References CoordErrors(), Error(), fErrorType, kAsymError, and kCoordError.

Here is the call graph for this function:

◆ HasBinEdges()

bool ROOT::Fit::BinData::HasBinEdges ( ) const
inline

query if the data store the bin edges instead of the center

Definition at line 528 of file BinData.h.

528  {
529  return fBinEdge.size() == fDim && fBinEdge[0].size() > 0;
530  }

References fBinEdge.

◆ HaveAsymErrors()

bool ROOT::Fit::BinData::HaveAsymErrors ( ) const
inline

flag to control if data provides asymmetric errors on the value

Definition at line 143 of file BinData.h.

143  {
144  assert ( fErrorType == kNoError ||
145  fErrorType == kValueError ||
146  fErrorType == kCoordError ||
147  fErrorType == kAsymError );
148 
149  return fErrorType == kAsymError;
150  }

References fErrorType, kAsymError, kCoordError, kNoError, and kValueError.

◆ HaveCoordErrors()

bool ROOT::Fit::BinData::HaveCoordErrors ( ) const
inline

flag to control if data provides error on the coordinates

Definition at line 131 of file BinData.h.

131  {
132  assert ( fErrorType == kNoError ||
133  fErrorType == kValueError ||
134  fErrorType == kCoordError ||
135  fErrorType == kAsymError );
136 
137  return fErrorType == kCoordError;
138  }

References fErrorType, kAsymError, kCoordError, kNoError, and kValueError.

◆ InitBinEdge()

void ROOT::Fit::BinData::InitBinEdge ( )
protected

◆ InitDataVector()

void ROOT::Fit::BinData::InitDataVector ( )
protected

◆ Initialize()

void ROOT::Fit::BinData::Initialize ( unsigned int  newPoints,
unsigned int  dim = 1,
ErrorType  err = kValueError 
)

◆ InitializeErrors()

void ROOT::Fit::BinData::InitializeErrors ( )
protected

◆ InvError()

double ROOT::Fit::BinData::InvError ( unsigned int  ipoint) const
inline

Return the inverse of error on the value for the given fit point useful when error in the coordinates are not stored and then this is used directly this as the weight in the least square function

Definition at line 314 of file BinData.h.

315  {
316  assert( ipoint < fMaxPoints );
317  assert( kValueError == fErrorType || kCoordError == fErrorType ||
319 
320  if ( fErrorType == kNoError )
321  {
323  assert( fDataError.empty() && fDataErrorHigh.empty() && fDataErrorLow.empty() );
324  return 1.0;
325  }
326 
327  if ( fErrorType == kValueError ) // need to invert (inverror is stored)
328  {
330  assert( fDataErrorHigh.empty() && fDataErrorLow.empty() );
331  assert( fDataError.empty() || &fDataError.front() == fDataErrorPtr );
332 
333  double eval = fDataErrorPtr[ ipoint ];
334 
335  // in case of wrapped data the pointer stores the error and
336  // not the inverse
337  if (fWrapped)
338  return 1.0 / eval;
339  else
340  return (eval != 0.0) ? eval : 0.0;
341  }
342 
343  if ( fErrorType == kAsymError ) {
344  // return inverse of 1/2(el + eh)
346  assert( fDataError.empty() );
347  assert( fDataErrorHigh.empty() || &fDataErrorHigh.front() == fDataErrorHighPtr );
348  assert( fDataErrorLow.empty() || &fDataErrorLow.front() == fDataErrorLowPtr );
349  assert( fDataErrorLow.empty() == fDataErrorHigh.empty() );
350 
351  double eh = fDataErrorHighPtr[ ipoint ];
352  double el = fDataErrorLowPtr[ ipoint ];
353 
354  return 2.0 / (el+eh);
355  }
356 
357  assert( fErrorType == kCoordError );
358  // for coordinate error we store the error and not the inverse
359  return 1.0 / fDataErrorPtr[ ipoint ];
360  }

References fDataError, fDataErrorHigh, fDataErrorHighPtr, fDataErrorLow, fDataErrorLowPtr, fDataErrorPtr, fErrorType, kAsymError, kCoordError, kNoError, and kValueError.

◆ IsWeighted()

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

return true if the data set is weighted We cannot compute ourselfs because sometimes errors are filled with 1 instead of zero (as in ROOT::Fit::FillData )

Definition at line 567 of file BinData.h.

567  {
568  return fIsWeighted;
569  }

References fIsWeighted.

◆ LogTransform()

BinData& ROOT::Fit::BinData::LogTransform ( )

apply a Log transformation of the data values can be used for example when fitting an exponential or gaussian Transform the data in place need to copy if want to preserve original data The data sets must not contain negative values. IN case it does, an empty data set is returned

◆ operator=()

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

◆ RefVolume()

double ROOT::Fit::BinData::RefVolume ( ) const
inline

retrieve the reference volume used to normalize the data when the option bin volume is set

Definition at line 535 of file BinData.h.

535 { return fRefVolume; }
double fRefVolume
Definition: BinData.h:587

References fRefVolume.

◆ SetRefVolume()

void ROOT::Fit::BinData::SetRefVolume ( double  value)
inline

set the reference volume used to normalize the data when the option bin volume is set

Definition at line 540 of file BinData.h.

540 { fRefVolume = value; }

References fRefVolume.

◆ SumOfContent()

double ROOT::Fit::BinData::SumOfContent ( ) const
inline

compute the total sum of the data content (sum of weights in case of weighted data set)

Definition at line 554 of file BinData.h.

554 { return fSumContent; }
double fSumContent
Definition: BinData.h:588

References fSumContent.

◆ SumOfError2()

double ROOT::Fit::BinData::SumOfError2 ( ) const
inline

compute the total sum of the error square (sum of weight square in case of a weighted data set)

Definition at line 560 of file BinData.h.

560 { return fSumError2;}
double fSumError2
Definition: BinData.h:589

References fSumError2.

◆ UnWrap()

void ROOT::Fit::BinData::UnWrap ( )
protected

◆ Value()

double ROOT::Fit::BinData::Value ( unsigned int  ipoint) const
inline

return the value for the given fit point

Definition at line 217 of file BinData.h.

218  {
219  assert( ipoint < fMaxPoints );
220  assert( fDataPtr );
221  assert( fData.empty() || &fData.front() == fDataPtr );
222 
223  return fDataPtr[ipoint];
224  }
const double * fDataPtr
Definition: BinData.h:596
std::vector< double > fData
Definition: BinData.h:595

References fData, and fDataPtr.

Referenced by GetPoint().

◆ ValuePtr()

const double* ROOT::Fit::BinData::ValuePtr ( unsigned int  ipoint) const
inline

return a pointer to the value for the given fit point

Definition at line 229 of file BinData.h.

230  {
231  return &fDataPtr[ipoint];
232  }

References fDataPtr.

Member Data Documentation

◆ fBinEdge

std::vector< std::vector< double > > ROOT::Fit::BinData::fBinEdge
private

Definition at line 614 of file BinData.h.

Referenced by BinUpEdge(), GetBinUpEdgeComponent(), and HasBinEdges().

◆ fCoordErrors

std::vector< std::vector< double > > ROOT::Fit::BinData::fCoordErrors
private

Definition at line 598 of file BinData.h.

Referenced by CoordErrors(), and GetCoordErrorComponent().

◆ fCoordErrorsPtr

std::vector< const double* > ROOT::Fit::BinData::fCoordErrorsPtr
private

Definition at line 599 of file BinData.h.

Referenced by CoordErrors(), and GetCoordErrorComponent().

◆ fData

std::vector< double > ROOT::Fit::BinData::fData
private

Stores the data values the same way as the coordinates.

Definition at line 595 of file BinData.h.

Referenced by Value().

◆ fDataError

std::vector< double > ROOT::Fit::BinData::fDataError
private

Definition at line 603 of file BinData.h.

Referenced by Error(), GetAsymError(), GetPointError(), and InvError().

◆ fDataErrorHigh

std::vector< double > ROOT::Fit::BinData::fDataErrorHigh
private

Definition at line 604 of file BinData.h.

Referenced by Error(), GetAsymError(), GetPointError(), and InvError().

◆ fDataErrorHighPtr

const double* ROOT::Fit::BinData::fDataErrorHighPtr
private

Definition at line 607 of file BinData.h.

Referenced by Error(), GetAsymError(), GetPointError(), and InvError().

◆ fDataErrorLow

std::vector< double > ROOT::Fit::BinData::fDataErrorLow
private

Definition at line 605 of file BinData.h.

Referenced by Error(), GetAsymError(), GetPointError(), and InvError().

◆ fDataErrorLowPtr

const double* ROOT::Fit::BinData::fDataErrorLowPtr
private

Definition at line 608 of file BinData.h.

Referenced by Error(), GetAsymError(), GetPointError(), and InvError().

◆ fDataErrorPtr

const double* ROOT::Fit::BinData::fDataErrorPtr
private

Definition at line 606 of file BinData.h.

Referenced by Error(), ErrorPtr(), GetAsymError(), GetPointError(), and InvError().

◆ fDataPtr

const double* ROOT::Fit::BinData::fDataPtr
private

Definition at line 596 of file BinData.h.

Referenced by Value(), and ValuePtr().

◆ fErrorType

ErrorType ROOT::Fit::BinData::fErrorType
private

◆ fIsWeighted

bool ROOT::Fit::BinData::fIsWeighted = false
private

Definition at line 586 of file BinData.h.

Referenced by IsWeighted().

◆ fpTmpBinEdgeVector

double* ROOT::Fit::BinData::fpTmpBinEdgeVector
private

Definition at line 617 of file BinData.h.

Referenced by BinUpEdge().

◆ fpTmpCoordErrorVector

double* ROOT::Fit::BinData::fpTmpCoordErrorVector
private

Definition at line 612 of file BinData.h.

Referenced by CoordErrors().

◆ fRefVolume

double ROOT::Fit::BinData::fRefVolume
private

Definition at line 587 of file BinData.h.

Referenced by RefVolume(), and SetRefVolume().

◆ fSumContent

double ROOT::Fit::BinData::fSumContent = 0
private

Definition at line 588 of file BinData.h.

Referenced by SumOfContent().

◆ fSumError2

double ROOT::Fit::BinData::fSumError2 = 0
private

Definition at line 589 of file BinData.h.

Referenced by SumOfError2().


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