13 #ifndef ROOT_Fit_DataRange 14 #define ROOT_Fit_DataRange 38 typedef std::vector<std::pair<double,double> >
RangeSet;
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 icoord,
double & xmin,
double & xmax)
const {
106 xmin =
fRanges[icoord].front().first;
107 xmax =
fRanges[icoord].front().second;
117 void GetRange(
double & xmin,
double & xmax,
double & ymin,
double & ymax)
const {
123 void GetRange(
double & xmin,
double & xmax,
double & ymin,
double & ymax,
double & zmin,
double & zmax)
const {
129 void GetRange(
double * xmin,
double * xmax)
const {
130 for (
unsigned int i = 0; i <
fRanges.size(); ++i)
147 void AddRange(
unsigned int icoord ,
double xmin,
double xmax );
161 void AddRange(
double xmin,
double xmax,
double ymin,
double ymax,
double zmin,
double zmax ) {
169 void SetRange(
unsigned int icoord ,
double xmin,
double xmax );
183 void SetRange(
double xmin,
double xmax,
double ymin,
double ymax,
double zmin,
double zmax ) {
189 void Clear (
unsigned int icoord = 0 );
194 bool IsInside(
double x,
unsigned int icoord = 0)
const;
201 void CleanRangeSet(
unsigned int icoord,
double xmin,
double xmax);
void GetRange(double &xmin, double &xmax) const
get first range for the x - coordinate
void Clear(unsigned int icoord=0)
clear all ranges in one coordinate (is now -inf, +inf)
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
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
static const double x2[5]
void GetRange(double *xmin, double *xmax) const
get first range for coordinates and fill the vector
DataRange(unsigned int dim=1)
Default constructor (infinite range)
std::vector< RangeSet > RangeIntervals
void GetRange(double &xmin, double &xmax, double &ymin, double &ymax) const
get first range for the x and y coordinates
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...
void GetRange(double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax) const
get first range for the x and y and z 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
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...
static const double x1[5]
class describing the range in the coordinates it supports multiple range in a coordinate.
~DataRange()
Destructor (no operations)
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
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.
static void GetInfRange(double &x1, double &x2)
void AddRange(double xmin, double xmax)
add a range [xmin,xmax] for the first coordinate icoord