13 #ifndef ROOT_Fit_DataRange 14 #define ROOT_Fit_DataRange 38 typedef std::vector<std::pair<double,double> >
RangeSet;
56 DataRange(
double xmin,
double xmax,
double ymin,
double ymax);
60 DataRange(
double xmin,
double xmax,
double ymin,
double ymax,
double zmin,
double zmax);
70 unsigned int Size(
unsigned int icoord = 0)
const {
80 for (
unsigned int icoord = 0; icoord <
fRanges.size(); ++icoord)
81 if (
fRanges[icoord].size() > 0)
return true;
88 const RangeSet &
Ranges(
unsigned int icoord = 0)
const {
97 std::pair<double, double>
operator() (
unsigned int icoord = 0,
unsigned int irange = 0)
const;
103 void GetRange(
unsigned int irange,
unsigned int icoord,
double & xmin,
double & xmax)
const {
106 xmin =
fRanges[icoord][irange].first;
107 xmax =
fRanges[icoord][irange].second;
114 void GetRange(
unsigned int icoord,
double & xmin,
double & xmax)
const {
117 xmin =
fRanges[icoord].front().first;
118 xmax =
fRanges[icoord].front().second;
124 void GetRange(
double & xmin,
double & xmax,
unsigned int irange = 0)
const {
GetRange(irange,0,xmin,xmax); }
128 void GetRange(
double & xmin,
double & xmax,
double & ymin,
double & ymax,
unsigned int irange = 0)
const {
134 void GetRange(
double & xmin,
double & xmax,
double & ymin,
double & ymax,
double & zmin,
double & zmax,
unsigned int irange=0)
const {
140 void GetRange(
double * xmin,
double * xmax,
unsigned int irange = 0)
const {
141 for (
unsigned int i = 0; i <
fRanges.size(); ++i)
158 void AddRange(
unsigned int icoord ,
double xmin,
double xmax );
172 void AddRange(
double xmin,
double xmax,
double ymin,
double ymax,
double zmin,
double zmax ) {
180 void SetRange(
unsigned int icoord ,
double xmin,
double xmax );
194 void SetRange(
double xmin,
double xmax,
double ymin,
double ymax,
double zmin,
double zmax ) {
200 void Clear (
unsigned int icoord = 0 );
205 bool IsInside(
double x,
unsigned int icoord = 0)
const;
212 for (
unsigned int idim = 0; idim <
fRanges.size(); ++idim) {
214 if (!ret)
return ret;
224 void CleanRangeSet(
unsigned int icoord,
double xmin,
double xmax);
void Clear(unsigned int icoord=0)
clear all ranges in one coordinate (is now -inf, +inf)
Namespace for new ROOT classes and functions.
void GetRange(double *xmin, double *xmax, unsigned int irange=0) const
get range for coordinates and fill the vector
void AddRange(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
add a range [xmin,xmax] for the first and [ymin,ymax] for the second coordinate and [zmin...
const RangeSet & Ranges(unsigned int icoord=0) const
return the vector of ranges for the coordinate icoord
void SetRange(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
set a range [xmin,xmax] for the first and [ymin,ymax] for the second coordinate and [zmin...
void SetRange(double xmin, double xmax, double ymin, double ymax)
set a range [xmin,xmax] for the first and [ymin,ymax] for the second coordinate
void CleanRangeSet(unsigned int icoord, double xmin, double xmax)
internal function to remove all the existing ranges between xmin and xmax called when a new range is ...
bool IsInside(double x, unsigned int icoord=0) const
check if a point is inside the range for the given coordinate
void SetRange(double xmin, double xmax)
set a range [xmin,xmax] for the first coordinate icoord
void GetRange(double &xmin, double &xmax, unsigned int irange=0) const
get first range for the x - coordinate
void GetRange(unsigned int irange, unsigned int icoord, double &xmin, double &xmax) const
get the i-th range for given coordinate.
void GetRange(double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax, unsigned int irange=0) const
get range for the x and y and z coordinates
DataRange(unsigned int dim=1)
Default constructor (infinite range)
std::vector< RangeSet > RangeIntervals
void SetRange(unsigned int icoord, double xmin, double xmax)
set a range [xmin,xmax] for the new coordinate icoord If more range exists for other coordinates...
unsigned int Size(unsigned int icoord=0) const
return range size for coordinate icoord (starts from zero) Size == 0 indicates no range is present [-...
void AddRange(double xmin, double xmax, double ymin, double ymax)
add a range [xmin,xmax] for the first and [ymin,ymax] for the second coordinate
std::vector< std::pair< double, double > > RangeSet
* x
Deprecated and error prone model selection interface.
void AddRange(unsigned int icoord, double xmin, double xmax)
add a range [xmin,xmax] for the new coordinate icoord Adding a range does not delete existing one...
class describing the range in the coordinates it supports multiple range in a coordinate.
~DataRange()
Destructor (no operations)
void GetRange(double &xmin, double &xmax, double &ymin, double &ymax, unsigned int irange=0) const
get range for the x and y coordinates
void GetRange(unsigned int icoord, double &xmin, double &xmax) const
get the first range for given coordinate.
unsigned int NDim() const
get range dimension
std::pair< double, double > operator()(unsigned int icoord=0, unsigned int irange=0) const
return the i-th range for the coordinate icoord.
bool IsSet() const
return true if a range has been set in any of the coordinates i.e.
bool IsInside(const double *x) const
check if a multi-dimpoint is inside the range
static void GetInfRange(double &x1, double &x2)
void AddRange(double xmin, double xmax)
add a range [xmin,xmax] for the first coordinate icoord