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 Clear(unsigned int icoord=0)
clear all ranges in one coordinate (is now -inf, +inf)
const RangeSet & Ranges(unsigned int icoord=0) const
return the vector of ranges for the coordinate icoord
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...
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
bool IsSet() const
return true if a range has been set in any of the coordinates i.e.
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 ...
void SetRange(double xmin, double xmax)
set a range [xmin,xmax] for the first coordinate icoord
static const double x2[5]
std::pair< double, double > operator()(unsigned int icoord=0, unsigned int irange=0) const
return the i-th range for the coordinate icoord.
DataRange(unsigned int dim=1)
Default constructor (infinite range)
std::vector< RangeSet > RangeIntervals
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 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) const
get first range for coordinates and fill the vector
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
unsigned int NDim() const
get range dimension
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(double &xmin, double &xmax, double &ymin, double &ymax) const
get first range for the x and y coordinates
void GetRange(double &xmin, double &xmax) const
get first range for the x - coordinate
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
static void GetInfRange(double &x1, double &x2)
void GetRange(unsigned int icoord, double &xmin, double &xmax) const
get the first range for given coordinate.
bool IsInside(double x, unsigned int icoord=0) const
check if a point is inside the range for the given coordinate
void AddRange(double xmin, double xmax)
add a range [xmin,xmax] for the first coordinate icoord