Logo ROOT   6.08/07
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 */
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
Definition: StringConv.hxx:21
Base class for all the fit data types.
Definition: DataVector.h:67
ProxyListBox * fList
Definition: SparseData.h:67
unsigned int NDim() const
Definition: SparseData.cxx:225
SparseData(std::vector< double > &min, std::vector< double > &max)
Definition: SparseData.cxx:194
void GetBinDataIntegral(BinData &) const
Definition: SparseData.cxx:320
void PrintList() const
Definition: SparseData.cxx:291
Class describing the binned data sets : vectors of x coordinates, y values and optionally error on y ...
Definition: BinData.h:61
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
Definition: HFitImpl.cxx:134
void GetBinData(BinData &) const
Definition: SparseData.cxx:298
void GetPoint(const unsigned int i, std::vector< double > &min, std::vector< double > &max, double &content, double &error)
Definition: SparseData.cxx:268
unsigned int NPoints() const
Definition: SparseData.cxx:219
void GetBinDataNoZeros(BinData &) const
Definition: SparseData.cxx:338
void Add(std::vector< double > &min, std::vector< double > &max, const double content, const double error=1.0)
Definition: SparseData.cxx:231