Logo ROOT   6.12/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 "Fit/BinData.h"
17 #include <vector>
18 
19 namespace ROOT {
20 
21  namespace Fit {
22 
23  // This is a proxy to a std::list<Box>
24  class ProxyListBox;
25 
26  class SparseData : public FitData {
27  public:
28  //Constructor with a vector
29  SparseData(std::vector<double>& min, std::vector<double>& max);
30 
31  //Constructor with a dimension and two arrays
32  SparseData(const unsigned int dim, double min[], double max[]);
33 
34  //Destructor
35  ~SparseData();
36 
37  //Returns the number of points stored
38  unsigned int NPoints() const;
39  //Returns the dimension of the object (bins)
40  unsigned int NDim() const;
41 
42  // Adds a new bin specified by the vectors
43  void Add(std::vector<double>& min, std::vector<double>& max,
44  const double content, const double error = 1.0);
45 
46  void GetPoint(const unsigned int i,
47  std::vector<double>& min, std::vector<double>&max,
48  double& content, double& error);
49 
50  // Debug method to print the list of bins stored
51  void PrintList() const;
52 
53  // Transforms the data into a ROOT::Fit::BinData structure
54  void GetBinData(BinData&) const;
55  // Same as before, but with integral format
56  void GetBinDataIntegral(BinData&) const;
57  // Same as before, but including zero content bins
58  void GetBinDataNoZeros(BinData&) const;
59 
60  private :
61  ProxyListBox *fList;
62  };
63 
64  } // end namespace Fit
65 
66 } // end namespace ROOT
67 
68 
69 
70 #endif /* ROOT_Fit_SparseData */
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
Base class for all the fit data types: Stores the coordinates and the DataOptions.
Definition: FitData.h:66
ProxyListBox * fList
Definition: SparseData.h:61
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:53
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