Logo ROOT   6.13/01
Reference Guide
BinData.h
Go to the documentation of this file.
1 // @(#)root/mathcore:$Id$
2 // Author: L. Moneta Wed Aug 30 11:15:23 2006
3 
4 /**********************************************************************
5  * *
6  * Copyright (c) 2006 LCG ROOT Math Team, CERN/PH-SFT *
7  * *
8  * *
9  **********************************************************************/
10 
11 // Header file for class BinData
12 
13 #ifndef ROOT_Fit_BinData
14 #define ROOT_Fit_BinData
15 
16 #include "Fit/FitData.h"
17 #include "Math/Error.h"
18 #include <cmath>
19 
20 
21 
22 namespace ROOT {
23 
24  namespace Fit {
25 
26 
27 
28 //___________________________________________________________________________________
29 /**
30  Class describing the binned data sets :
31  vectors of x coordinates, y values and optionally error on y values and error on coordinates
32  The dimension of the coordinate is free
33  There are 4 different options:
34  - only coordinates and values (for binned likelihood fits) : kNoError
35  - coordinate, values and error on values (for normal least square fits) : kValueError
36  - coordinate, values, error on values and coordinates (for effective least square fits) : kCoordError
37  - corrdinate, values, error on coordinates and asymmettric error on valyes : kAsymError
38 
39  In addition there is the option to construct Bindata copying the data in (using the DataVector class)
40  or using pointer to external data (DataWrapper) class.
41  In general is found to be more efficient to copy the data.
42  In case of really large data sets for limiting memory consumption then the other option can be used
43  Specialized constructor exists for data up to 3 dimensions.
44 
45  When the data are copying in the number of points can be set later (or re-set) using Initialize and
46  the data are inserted one by one using the Add method.
47  It is mandatory to set the size before using the Add method.
48 
49  @ingroup FitData
50 */
51 
52 
53 class BinData : public FitData {
54 
55 public :
56 
58 
59  /**
60  constructor from dimension of point and max number of points (to pre-allocate vector)
61  Give a zero value and then use Initialize later one if the size is not known
62  */
63 
64  explicit BinData(unsigned int maxpoints = 0, unsigned int dim = 1,
65  ErrorType err = kValueError);
66 
67 
68  /**
69  constructor from option and default range
70  */
71  explicit BinData (const DataOptions & opt, unsigned int maxpoints = 0,
72  unsigned int dim = 1, ErrorType err = kValueError);
73 
74  /**
75  constructor from options and range
76  efault is 1D and value errors
77  */
78  BinData (const DataOptions & opt, const DataRange & range,
79  unsigned int maxpoints = 0, unsigned int dim = 1, ErrorType err = kValueError );
80 
81  /** constructurs using external data */
82 
83  /**
84  constructor from external data for 1D with errors on coordinate and value
85  */
86  BinData(unsigned int n, const double * dataX, const double * val,
87  const double * ex , const double * eval );
88 
89  /**
90  constructor from external data for 2D with errors on coordinate and value
91  */
92  BinData(unsigned int n, const double * dataX, const double * dataY,
93  const double * val, const double * ex , const double * ey,
94  const double * eval );
95 
96  /**
97  constructor from external data for 3D with errors on coordinate and value
98  */
99  BinData(unsigned int n, const double * dataX, const double * dataY,
100  const double * dataZ, const double * val, const double * ex ,
101  const double * ey , const double * ez , const double * eval );
102 
103  /**
104  destructor
105  */
106  virtual ~BinData();
107 
108  /**
109  copy constructors
110  */
111  BinData(const BinData & rhs);
112 
113  BinData & operator= ( const BinData & rhs );
114 
115 
116  /**
117  preallocate a data set with given size , dimension and error type (to get the full point size)
118  If the data set already exists and it is having the compatible point size space for the new points
119  is created in the data sets, while if not compatible the old data are erased and new space of
120  new size is allocated.
121  (i.e if exists initialize is equivalent to a resize( NPoints() + maxpoints)
122  */
123 
124  void Append( unsigned int newPoints, unsigned int dim = 1, ErrorType err = kValueError );
125 
126  void Initialize( unsigned int newPoints, unsigned int dim = 1, ErrorType err = kValueError );
127 
128  /**
129  flag to control if data provides error on the coordinates
130  */
131  bool HaveCoordErrors() const {
132  assert ( fErrorType == kNoError ||
133  fErrorType == kValueError ||
134  fErrorType == kCoordError ||
135  fErrorType == kAsymError );
136 
137  return fErrorType == kCoordError;
138  }
139 
140  /**
141  flag to control if data provides asymmetric errors on the value
142  */
143  bool HaveAsymErrors() const {
144  assert ( fErrorType == kNoError ||
145  fErrorType == kValueError ||
146  fErrorType == kCoordError ||
147  fErrorType == kAsymError );
148 
149  return fErrorType == kAsymError;
150  }
151 
152 
153  /**
154  apply a Log transformation of the data values
155  can be used for example when fitting an exponential or gaussian
156  Transform the data in place need to copy if want to preserve original data
157  The data sets must not contain negative values. IN case it does,
158  an empty data set is returned
159  */
160  BinData & LogTransform();
161 
162 
163  /**
164  add one dim data with only coordinate and values
165  */
166  void Add( double x, double y );
167 
168  /**
169  add one dim data with no error in the coordinate (x)
170  in this case store the inverse of the error in the value (y)
171  */
172  void Add( double x, double y, double ey );
173 
174  /**
175  add one dim data with error in the coordinate (x)
176  in this case store the value (y) error and not the inverse
177  */
178  void Add( double x, double y, double ex, double ey );
179 
180  /**
181  add one dim data with error in the coordinate (x) and asymmetric errors in the value (y)
182  in this case store the y errors and not the inverse
183  */
184  void Add( double x, double y, double ex, double eyl, double eyh );
185 
186  /**
187  add multi-dim coordinate data with only value
188  */
189  void Add( const double* x, double val );
190 
191  /**
192  add multi-dim coordinate data with only error in value
193  */
194  void Add( const double* x, double val, double eval );
195 
196  /**
197  add multi-dim coordinate data with both error in coordinates and value
198  */
199  void Add( const double* x, double val, const double* ex, double eval );
200 
201  /**
202  add multi-dim coordinate data with both error in coordinates and value
203  */
204  void Add( const double* x, double val, const double* ex, double elval, double ehval );
205 
206  /**
207  add the bin width data, a pointer to an array with the bin upper edge information.
208  This is needed when fitting with integral options
209  The information is added for the previously inserted point.
210  BinData::Add must be called before
211  */
212  void AddBinUpEdge( const double* xup );
213 
214  /**
215  return the value for the given fit point
216  */
217  double Value( unsigned int ipoint ) const
218  {
219  assert( ipoint < fMaxPoints );
220  assert( fDataPtr );
221  assert( fData.empty() || &fData.front() == fDataPtr );
222 
223  return fDataPtr[ipoint];
224  }
225 
226  /**
227  return a pointer to the value for the given fit point
228  */
229  const double *ValuePtr( unsigned int ipoint ) const
230  {
231  return &fDataPtr[ipoint];
232  }
233 
234  /**
235  return error on the value for the given fit point
236  Safe (but slower) method returning correctly the error on the value
237  in case of asymm errors return the average 0.5(eu + el)
238  */
239 
240  const double * ErrorPtr(unsigned int ipoint) const{
241  assert( ipoint < fMaxPoints );
242  assert( kValueError == fErrorType || kCoordError == fErrorType ||
243  kAsymError == fErrorType || kNoError == fErrorType );
244 
245  if ( fErrorType == kNoError )
246  return nullptr;
247  // assert( fErrorType == kCoordError );
248  return &fDataErrorPtr[ ipoint ];
249  }
250 
251  double Error( unsigned int ipoint ) const
252  {
253  assert( ipoint < fMaxPoints );
254  assert( kValueError == fErrorType || kCoordError == fErrorType ||
255  kAsymError == fErrorType || kNoError == 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  }
295 
296  void GetAsymError( unsigned int ipoint, double& lowError, double& highError ) const
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  }
308 
309  /**
310  Return the inverse of error on the value for the given fit point
311  useful when error in the coordinates are not stored and then this is used directly this as the weight in
312  the least square function
313  */
314  double InvError( unsigned int ipoint ) const
315  {
316  assert( ipoint < fMaxPoints );
317  assert( kValueError == fErrorType || kCoordError == fErrorType ||
318  kAsymError == fErrorType || kNoError == 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  }
361 
362 
363  /**
364  retrieve at the same time a pointer to the coordinate data and the fit value
365  More efficient than calling Coords(i) and Value(i)
366  */
367  // not threadsafe, to be replaced with never constructs!
368  // for example: just return std::array or std::vector, there's
369  // is going to be only minor overhead in c++11.
370  const double * GetPoint( unsigned int ipoint, double & value ) const
371  {
372  assert( ipoint < fMaxPoints );
373  value = Value( ipoint );
374 
375  return Coords( ipoint );
376  }
377 
378  /**
379  returns a single coordinate error component of a point.
380  This function is threadsafe in contrast to Coords(...)
381  and can easily get vectorized by the compiler in loops
382  running over the ipoint-index.
383  */
384  double GetCoordErrorComponent( unsigned int ipoint, unsigned int icoord ) const
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  }
394 
395  /**
396  Return a pointer to the errors in the coordinates for the given fit point
397  */
398  // not threadsafe, to be replaced with never constructs!
399  // for example: just return std::array or std::vector, there's
400  // is going to be only minor overhead in c++11.
401  const double* CoordErrors( unsigned int ipoint ) const
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  }
417 
418 
419  /**
420  retrieve in a single call a pointer to the coordinate data, value and inverse error for
421  the given fit point.
422  To be used only when type is kValueError or kNoError. In the last case the value 1 is returned
423  for the error.
424  */
425  // not threadsafe, to be replaced with never constructs!
426  // for example: just return std::array or std::vector, there's
427  // is going to be only minor overhead in c++11.
428  const double* GetPoint( unsigned int ipoint, double & value, double & invError ) const
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  }
442 
443  /**
444  Retrieve the errors on the point (coordinate and value) for the given fit point
445  It must be called only when the coordinate errors are stored otherwise it will produce an
446  assert.
447  */
448  // not threadsafe, to be replaced with never constructs!
449  // for example: just return std::array or std::vector, there's
450  // is going to be only minor overhead in c++11.
451  const double* GetPointError(unsigned int ipoint, double & errvalue) const
452  {
453  assert( ipoint < fMaxPoints );
454  assert( fErrorType == kCoordError || fErrorType == kAsymError );
455 
456  errvalue = Error( ipoint );
457  return CoordErrors( ipoint );
458  }
459 
460  /**
461  Get errors on the point (coordinate errors and asymmetric value errors) for the
462  given fit point.
463  It must be called only when the coordinate errors and asymmetric errors are stored
464  otherwise it will produce an assert.
465  */
466  // not threadsafe, to be replaced with never constructs!
467  // for example: just return std::array or std::vector, there's
468  // is going to be only minor overhead in c++11.
469  const double* GetPointError(unsigned int ipoint, double & errlow, double & errhigh) const
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  }
484 
485  /**
486  returns a single coordinate error component of a point.
487  This function is threadsafe in contrast to Coords(...)
488  and can easily get vectorized by the compiler in loops
489  running over the ipoint-index.
490  */
491  double GetBinUpEdgeComponent( unsigned int ipoint, unsigned int icoord ) const
492  {
493  assert( icoord < fDim );
494  assert( !fBinEdge.empty() );
495  assert( ipoint < fBinEdge.front().size() );
496 
497  return fBinEdge[icoord][ipoint];
498  }
499 
500  /**
501  return an array containing the upper edge of the bin for coordinate i
502  In case of empty bin they could be merged in a single larger bin
503  Return a NULL pointer if the bin width is not stored
504  */
505  // not threadsafe, to be replaced with never constructs!
506  // for example: just return std::array or std::vector, there's
507  // is going to be only minor overhead in c++11.
508  const double* BinUpEdge( unsigned int ipoint ) const
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  }
524 
525  /**
526  query if the data store the bin edges instead of the center
527  */
528  bool HasBinEdges() const {
529  return fBinEdge.size() == fDim && fBinEdge[0].size() > 0;
530  }
531 
532  /**
533  retrieve the reference volume used to normalize the data when the option bin volume is set
534  */
535  double RefVolume() const { return fRefVolume; }
536 
537  /**
538  set the reference volume used to normalize the data when the option bin volume is set
539  */
540  void SetRefVolume(double value) { fRefVolume = value; }
541 
542  /**
543  retrieve the errortype
544  */
546  {
547  return fErrorType;
548  }
549 
550  /**
551  compute the total sum of the data content
552  (sum of weights in case of weighted data set)
553  */
554  double SumOfContent() const { return fSumContent; }
555 
556  /**
557  compute the total sum of the error square
558  (sum of weight square in case of a weighted data set)
559  */
560  double SumOfError2() const { return fSumError2;}
561 
562  /**
563  return true if the data set is weighted
564  We cannot compute ourselfs because sometimes errors are filled with 1
565  instead of zero (as in ROOT::Fit::FillData )
566  */
567  bool IsWeighted() const {
568  return fIsWeighted;
569  }
570 
571 protected:
572  void InitDataVector ();
573 
574  void InitializeErrors();
575 
576  void InitBinEdge();
577 
578  void UnWrap( );
579 
580  // compute sum of content and error squares
581  void ComputeSums();
582 
583 private:
584 
586  bool fIsWeighted = false; // flag to indicate weighted data
587  double fRefVolume; // reference bin volume - used to normalize the bins in case of variable bins data
588  double fSumContent = 0; // total sum of the bin data content
589  double fSumError2 = 0; // total sum square of the errors
590 
591  /**
592  * Stores the data values the same way as the coordinates.
593  *
594  */
595  std::vector< double > fData;
596  const double* fDataPtr;
597 
598  std::vector< std::vector< double > > fCoordErrors;
599  std::vector< const double* > fCoordErrorsPtr;
600  // This vector contains the coordinate errors
601  // in the same way as fCoords.
602 
603  std::vector< double > fDataError;
604  std::vector< double > fDataErrorHigh;
605  std::vector< double > fDataErrorLow;
606  const double* fDataErrorPtr;
607  const double* fDataErrorHighPtr;
608  const double* fDataErrorLowPtr;
609  // This vector contains the data error.
610  // Either only fDataError or fDataErrorHigh and fDataErrorLow are used.
611 
612  double* fpTmpCoordErrorVector; // not threadsafe stuff!
613 
614  std::vector< std::vector< double > > fBinEdge;
615  // vector containing the bin upper edge (coordinate will contain low edge)
616 
617  double* fpTmpBinEdgeVector; // not threadsafe stuff!
618 };
619 
620 
621  } // end namespace Fit
622 
623 } // end namespace ROOT
624 
625 
626 
627 #endif /* ROOT_Fit_BinData */
void GetAsymError(unsigned int ipoint, double &lowError, double &highError) const
Definition: BinData.h:296
bool HaveAsymErrors() const
flag to control if data provides asymmetric errors on the value
Definition: BinData.h:143
bool HasBinEdges() const
query if the data store the bin edges instead of the center
Definition: BinData.h:528
Namespace for new ROOT classes and functions.
Definition: TFoamSampler.h:19
double * fpTmpBinEdgeVector
Definition: BinData.h:617
ErrorType GetErrorType() const
retrieve the errortype
Definition: BinData.h:545
Base class for all the fit data types: Stores the coordinates and the DataOptions.
Definition: FitData.h:66
void InitDataVector()
Definition: BinData.cxx:659
const double * ValuePtr(unsigned int ipoint) const
return a pointer to the value for the given fit point
Definition: BinData.h:229
const double * fDataPtr
Definition: BinData.h:596
const double * CoordErrors(unsigned int ipoint) const
Return a pointer to the errors in the coordinates for the given fit point.
Definition: BinData.h:401
const double * fDataErrorPtr
Definition: BinData.h:606
void AddBinUpEdge(const double *xup)
add the bin width data, a pointer to an array with the bin upper edge information.
Definition: BinData.cxx:627
you should not use this method at all Int_t y
Definition: TRolke.cxx:630
std::vector< const double *> fCoordErrorsPtr
Definition: BinData.h:599
double SumOfError2() const
compute the total sum of the error square (sum of weight square in case of a weighted data set) ...
Definition: BinData.h:560
const double * Coords(unsigned int ipoint) const
return a pointer to the coordinates data for the given fit point
Definition: FitData.h:246
double * fpTmpCoordErrorVector
Definition: BinData.h:612
ErrorType fErrorType
Definition: BinData.h:585
const double * GetPoint(unsigned int ipoint, double &value) const
retrieve at the same time a pointer to the coordinate data and the fit value More efficient than call...
Definition: BinData.h:370
std::vector< double > fData
Stores the data values the same way as the coordinates.
Definition: BinData.h:595
std::vector< std::vector< double > > fBinEdge
Definition: BinData.h:614
double fSumError2
Definition: BinData.h:589
double RefVolume() const
retrieve the reference volume used to normalize the data when the option bin volume is set ...
Definition: BinData.h:535
void Initialize(unsigned int newPoints, unsigned int dim=1, ErrorType err=kValueError)
Definition: BinData.cxx:349
double fSumContent
Definition: BinData.h:588
double Error(unsigned int ipoint) const
Definition: BinData.h:251
const double * GetPoint(unsigned int ipoint, double &value, double &invError) const
retrieve in a single call a pointer to the coordinate data, value and inverse error for the given fit...
Definition: BinData.h:428
DataOptions : simple structure holding the options on how the data are filled.
Definition: DataOptions.h:28
void InitializeErrors()
Definition: BinData.cxx:665
double GetCoordErrorComponent(unsigned int ipoint, unsigned int icoord) const
returns a single coordinate error component of a point.
Definition: BinData.h:384
const double * BinUpEdge(unsigned int ipoint) const
return an array containing the upper edge of the bin for coordinate i In case of empty bin they could...
Definition: BinData.h:508
double fRefVolume
Definition: BinData.h:587
std::vector< double > fDataError
Definition: BinData.h:603
std::vector< double > fDataErrorHigh
Definition: BinData.h:604
virtual ~BinData()
destructor
Definition: BinData.cxx:190
Class describing the binned data sets : vectors of x coordinates, y values and optionally error on y ...
Definition: BinData.h:53
void SetRefVolume(double value)
set the reference volume used to normalize the data when the option bin volume is set ...
Definition: BinData.h:540
double GetBinUpEdgeComponent(unsigned int ipoint, unsigned int icoord) const
returns a single coordinate error component of a point.
Definition: BinData.h:491
bool HaveCoordErrors() const
flag to control if data provides error on the coordinates
Definition: BinData.h:131
* x
Deprecated and error prone model selection interface.
Definition: TRolke.cxx:630
BinData(unsigned int maxpoints=0, unsigned int dim=1, ErrorType err=kValueError)
constructor from dimension of point and max number of points (to pre-allocate vector) Give a zero val...
Definition: BinData.cxx:26
const double * ErrorPtr(unsigned int ipoint) const
return error on the value for the given fit point Safe (but slower) method returning correctly the er...
Definition: BinData.h:240
class describing the range in the coordinates it supports multiple range in a coordinate.
Definition: DataRange.h:34
const double * fDataErrorLowPtr
Definition: BinData.h:608
void Add(double x, double y)
add one dim data with only coordinate and values
Definition: BinData.cxx:422
std::vector< double > fDataErrorLow
Definition: BinData.h:605
std::vector< std::vector< double > > fCoordErrors
Definition: BinData.h:598
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Definition: TRolke.cxx:630
BinData & operator=(const BinData &rhs)
Definition: BinData.cxx:229
BinData & LogTransform()
apply a Log transformation of the data values can be used for example when fitting an exponential or ...
Definition: BinData.cxx:363
double Value(unsigned int ipoint) const
return the value for the given fit point
Definition: BinData.h:217
double SumOfContent() const
compute the total sum of the data content (sum of weights in case of weighted data set) ...
Definition: BinData.h:554
void 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...
Definition: BinData.cxx:328
unsigned int fDim
Definition: FitData.h:396
bool IsWeighted() const
return true if the data set is weighted We cannot compute ourselfs because sometimes errors are fille...
Definition: BinData.h:567
unsigned int fMaxPoints
Definition: FitData.h:394
const double * GetPointError(unsigned int ipoint, double &errvalue) const
Retrieve the errors on the point (coordinate and value) for the given fit point It must be called onl...
Definition: BinData.h:451
const double * fDataErrorHighPtr
Definition: BinData.h:607
double InvError(unsigned int ipoint) const
Return the inverse of error on the value for the given fit point useful when error in the coordinates...
Definition: BinData.h:314
const double * GetPointError(unsigned int ipoint, double &errlow, double &errhigh) const
Get errors on the point (coordinate errors and asymmetric value errors) for the given fit point...
Definition: BinData.h:469