#ifndef ROOT_Fit_DataRange
#define ROOT_Fit_DataRange
#include <vector>
namespace ROOT { 
   namespace Fit { 
 
class DataRange {
public: 
   typedef std::vector<std::pair<double,double> > RangeSet;
   typedef std::vector< RangeSet >   RangeIntervals; 
    
   explicit DataRange (unsigned int dim = 1) :
      fRanges ( std::vector<RangeSet> (dim) )
   {}
   
   DataRange(double xmin, double xmax);  
   
   DataRange(double xmin, double xmax, double ymin, double ymax);  
   
   DataRange(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax); 
    
   unsigned int NDim() const { return fRanges.size(); }
   
   unsigned int Size(unsigned int icoord) const { 
      return icoord <  fRanges.size() ? fRanges[icoord].size() : 0;
   }
    
   const RangeSet & Ranges(unsigned int icoord) const { 
      
      return fRanges.at(icoord); 
   }
    
   std::pair<double, double> operator() (unsigned int icoord) const {
     return Size(icoord) >  0 ? fRanges[icoord].front() : std::make_pair<double,double>(0,0);     
   }  
   
   void GetRange(unsigned int icoord, double & xmin, double & xmax) const { 
      if (Size(icoord) == 0) { 
         xmin = 0; 
         xmax = 0; 
         return;
      }
      xmin = fRanges[icoord].front().first; 
      xmax = fRanges[icoord].front().second; 
   }
    
   ~DataRange ()  {}  
   
   void AddRange(double xmin, double xmax, unsigned  int  icoord = 0 ); 
   
   void Clear (unsigned  int  icoord = 0 );
   
   bool IsInside(double x, unsigned int icoord = 0) const; 
protected: 
   
   void CleanRangeSet(unsigned int icoord, double xmin, double xmax); 
private: 
   RangeIntervals fRanges;  
}; 
   } 
} 
#endif /* ROOT_Fit_DataRange */
Last change: Tue May 13 17:00:55 2008
Last generated: 2008-05-13 17:00
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.