SparseData.h

Go to the documentation of this file.
00001 // @(#)root/mathcore:$Id: SparseData.h 35349 2010-09-17 09:25:00Z moneta $
00002 // Author: David Gonzalez Maline Wed Aug 28 15:23:43 2009
00003 
00004 /**********************************************************************
00005  *                                                                    *
00006  * Copyright (c) 2006  LCG ROOT Math Team, CERN/PH-SFT                *
00007  *                                                                    *
00008  *                                                                    *
00009  **********************************************************************/
00010 
00011 // Header file for class SparseData
00012 
00013 #ifndef ROOT_Fit_SparseData
00014 #define ROOT_Fit_SparseData
00015 
00016 #include <vector>
00017 
00018 #ifndef ROOT_Fit_DataVector
00019 #include "Fit/DataVector.h"
00020 #include "Fit/BinData.h"
00021 #endif
00022 
00023 
00024 namespace ROOT { 
00025 
00026    namespace Fit { 
00027 
00028       // This is a proxy to a list<Box>
00029       class ProxyListBox;
00030 
00031       class SparseData : public FitData  { 
00032       public:
00033          //Constructor with a vector
00034          SparseData(std::vector<double>& min, std::vector<double>& max);
00035          
00036          //Constructor with a dimension and two arrays
00037          SparseData(const unsigned int dim, double min[], double max[]);
00038 
00039          //Destructor
00040          ~SparseData();
00041 
00042          //Returns the number of points stored
00043          unsigned int NPoints() const;
00044          //Returns the dimension of the object (bins)
00045          unsigned int NDim() const;
00046 
00047          // Adds a new bin specified by the vectors
00048          void Add(std::vector<double>& min, std::vector<double>& max, 
00049                   const double content, const double error = 1.0);
00050          
00051          void GetPoint(const unsigned int i, 
00052                        std::vector<double>& min, std::vector<double>&max,
00053                        double& content, double& error);
00054 
00055          // Debug method to print the list of bins stored
00056          void PrintList() const;
00057 
00058          // Transforms the data into a ROOT::Fit::BinData structure
00059          void GetBinData(BinData&) const;
00060          // Same as before, but with integral format
00061          void GetBinDataIntegral(BinData&) const;
00062          // Same as before, but including zero content bins
00063          void GetBinDataNoZeros(BinData&) const;
00064          
00065       private : 
00066          ProxyListBox *fList;
00067       };
00068       
00069    } // end namespace Fit
00070    
00071 } // end namespace ROOT
00072 
00073 
00074 
00075 #endif /* ROOT_Fit_SparseData */

Generated on Tue Jul 5 14:25:00 2011 for ROOT_528-00b_version by  doxygen 1.5.1