ROOT  6.06/09
Reference Guide
SparseData.h
Go to the documentation of this file.
1 // @(#)root/mathcore:$Id$
2 // Author: David Gonzalez Maline Wed Aug 28 15:23:43 2009
3 
4 /**********************************************************************
5  * *
6  * Copyright (c) 2006 LCG ROOT Math Team, CERN/PH-SFT *
7  * *
8  * *
9  **********************************************************************/
10 
11 // Header file for class SparseData
12 
13 #ifndef ROOT_Fit_SparseData
14 #define ROOT_Fit_SparseData
15 
16 #include <vector>
17 
18 #ifndef ROOT_Fit_DataVector
19 #include "Fit/DataVector.h"
20 #endif
21 #ifndef ROOT_Fit_BinData
22 #include "Fit/BinData.h"
23 #endif
24 
25 namespace ROOT {
26 
27  namespace Fit {
28 
29  // This is a proxy to a std::list<Box>
30  class ProxyListBox;
31 
32  class SparseData : public FitData {
33  public:
34  //Constructor with a vector
35  SparseData(std::vector<double>& min, std::vector<double>& max);
36 
37  //Constructor with a dimension and two arrays
38  SparseData(const unsigned int dim, double min[], double max[]);
39 
40  //Destructor
41  ~SparseData();
42 
43  //Returns the number of points stored
44  unsigned int NPoints() const;
45  //Returns the dimension of the object (bins)
46  unsigned int NDim() const;
47 
48  // Adds a new bin specified by the vectors
49  void Add(std::vector<double>& min, std::vector<double>& max,
50  const double content, const double error = 1.0);
51 
52  void GetPoint(const unsigned int i,
53  std::vector<double>& min, std::vector<double>&max,
54  double& content, double& error);
55 
56  // Debug method to print the list of bins stored
57  void PrintList() const;
58 
59  // Transforms the data into a ROOT::Fit::BinData structure
60  void GetBinData(BinData&) const;
61  // Same as before, but with integral format
62  void GetBinDataIntegral(BinData&) const;
63  // Same as before, but including zero content bins
64  void GetBinDataNoZeros(BinData&) const;
65 
66  private :
67  ProxyListBox *fList;
68  };
69 
70  } // end namespace Fit
71 
72 } // end namespace ROOT
73 
74 
75 
76 #endif /* ROOT_Fit_SparseData */
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
Definition: vector.h:433
Namespace for new ROOT classes and functions.
Definition: ROOT.py:1
Base class for all the fit data types.
Definition: DataVector.h:67
unsigned int NDim() const
Definition: SparseData.cxx:224
ProxyListBox * fList
Definition: SparseData.h:67
unsigned int NPoints() const
Definition: SparseData.cxx:218
SparseData(std::vector< double > &min, std::vector< double > &max)
Definition: SparseData.cxx:193
void GetBinDataNoZeros(BinData &) const
Definition: SparseData.cxx:337
void GetBinDataIntegral(BinData &) const
Definition: SparseData.cxx:319
void PrintList() const
Definition: SparseData.cxx:290
Class describing the binned data sets : vectors of x coordinates, y values and optionally error on y ...
Definition: BinData.h:61
void GetBinData(BinData &) const
Definition: SparseData.cxx:297
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
Definition: HFitImpl.cxx:132
void GetPoint(const unsigned int i, std::vector< double > &min, std::vector< double > &max, double &content, double &error)
Definition: SparseData.cxx:267
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
Definition: vector.h:440
void Add(std::vector< double > &min, std::vector< double > &max, const double content, const double error=1.0)
Definition: SparseData.cxx:230