Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Fit::DataRange Class Reference

class describing the range in the coordinates it supports multiple range in a coordinate.

The range dimension is the dimension of the coordinate, its size is the number of interval for each coordinate. Default range is -inf, inf Range can be modified with the add range method

Definition at line 35 of file DataRange.h.

Public Types

typedef std::vector< RangeSetRangeIntervals
 
typedef std::vector< std::pair< double, double > > RangeSet
 

Public Member Functions

 DataRange (double xmin, double xmax)
 construct a range for [xmin, xmax]
 
 DataRange (double xmin, double xmax, double ymin, double ymax)
 construct a range for [xmin, xmax] , [ymin, ymax]
 
 DataRange (double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
 construct a range for [xmin, xmax] , [ymin, ymax] , [zmin, zmax]
 
 DataRange (unsigned int dim=1)
 Default constructor (infinite range)
 
 ~DataRange ()
 Destructor (no operations)
 
void AddRange (double xmin, double xmax)
 add a range [xmin,xmax] for the first coordinate icoord
 
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
 
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,zmax] for the third coordinate
 
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, but takes the OR with existing ranges.
 
void Clear (unsigned int icoord=0)
 clear all ranges in one coordinate (is now -inf, +inf)
 
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
 
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 (double &xmin, double &xmax, unsigned int irange=0) const
 get first range for the x - coordinate
 
void GetRange (double *xmin, double *xmax, unsigned int irange=0) const
 get range for coordinates and fill the vector
 
void GetRange (unsigned int icoord, double &xmin, double &xmax) const
 get the first range for given coordinate.
 
void GetRange (unsigned int irange, unsigned int icoord, double &xmin, double &xmax) const
 get the i-th range for given coordinate.
 
bool IsInside (const double *x) const
 check if a multi-dimpoint is inside the range
 
bool IsInside (double x, unsigned int icoord=0) const
 check if a point is inside the range for the given coordinate
 
bool IsSet () const
 return true if a range has been set in any of the coordinates i.e.
 
unsigned int NDim () const
 get range dimension
 
std::pair< double, doubleoperator() (unsigned int icoord=0, unsigned int irange=0) const
 return the i-th range for the coordinate icoord.
 
const RangeSetRanges (unsigned int icoord=0) const
 return the vector of ranges for the coordinate icoord
 
void SetRange (double xmin, double xmax)
 set a range [xmin,xmax] for the first coordinate icoord
 
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 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,zmax] for the third coordinate
 
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, delete the existing one and use it the new one Use Add range if want to keep the union of the existing ranges
 
unsigned int Size (unsigned int icoord=0) const
 return range size for coordinate icoord (starts from zero) Size == 0 indicates no range is present [-inf, + inf]
 

Protected Member Functions

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 inserted
 

Static Protected Member Functions

static void GetInfRange (double &x1, double &x2)
 

Private Attributes

RangeIntervals fRanges
 list of all ranges
 

#include <Fit/DataRange.h>

Member Typedef Documentation

◆ RangeIntervals

Definition at line 40 of file DataRange.h.

◆ RangeSet

typedef std::vector<std::pair<double,double> > ROOT::Fit::DataRange::RangeSet

Definition at line 39 of file DataRange.h.

Constructor & Destructor Documentation

◆ DataRange() [1/4]

ROOT::Fit::DataRange::DataRange ( unsigned int  dim = 1)
inlineexplicit

Default constructor (infinite range)

Definition at line 45 of file DataRange.h.

◆ DataRange() [2/4]

ROOT::Fit::DataRange::DataRange ( double  xmin,
double  xmax 
)

construct a range for [xmin, xmax]

Definition at line 23 of file DataRange.cxx.

◆ DataRange() [3/4]

ROOT::Fit::DataRange::DataRange ( double  xmin,
double  xmax,
double  ymin,
double  ymax 
)

construct a range for [xmin, xmax] , [ymin, ymax]

Definition at line 35 of file DataRange.cxx.

◆ DataRange() [4/4]

ROOT::Fit::DataRange::DataRange ( double  xmin,
double  xmax,
double  ymin,
double  ymax,
double  zmin,
double  zmax 
)

construct a range for [xmin, xmax] , [ymin, ymax] , [zmin, zmax]

Definition at line 52 of file DataRange.cxx.

◆ ~DataRange()

ROOT::Fit::DataRange::~DataRange ( )
inline

Destructor (no operations)

Definition at line 149 of file DataRange.h.

Member Function Documentation

◆ AddRange() [1/4]

void ROOT::Fit::DataRange::AddRange ( double  xmin,
double  xmax 
)
inline

add a range [xmin,xmax] for the first coordinate icoord

Definition at line 164 of file DataRange.h.

◆ AddRange() [2/4]

void ROOT::Fit::DataRange::AddRange ( double  xmin,
double  xmax,
double  ymin,
double  ymax 
)
inline

add a range [xmin,xmax] for the first and [ymin,ymax] for the second coordinate

Definition at line 168 of file DataRange.h.

◆ AddRange() [3/4]

void ROOT::Fit::DataRange::AddRange ( double  xmin,
double  xmax,
double  ymin,
double  ymax,
double  zmin,
double  zmax 
)
inline

add a range [xmin,xmax] for the first and [ymin,ymax] for the second coordinate and [zmin,zmax] for the third coordinate

Definition at line 173 of file DataRange.h.

◆ AddRange() [4/4]

void ROOT::Fit::DataRange::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, but takes the OR with existing ranges.

if want to replace range use method SetRange, which replace range with existing one

Definition at line 94 of file DataRange.cxx.

◆ CleanRangeSet()

void ROOT::Fit::DataRange::CleanRangeSet ( unsigned int  icoord,
double  xmin,
double  xmax 
)
protected

internal function to remove all the existing ranges between xmin and xmax called when a new range is inserted

Definition at line 165 of file DataRange.cxx.

◆ Clear()

void ROOT::Fit::DataRange::Clear ( unsigned int  icoord = 0)

clear all ranges in one coordinate (is now -inf, +inf)

Definition at line 158 of file DataRange.cxx.

◆ GetInfRange()

void ROOT::Fit::DataRange::GetInfRange ( double x1,
double x2 
)
staticprotected

Definition at line 182 of file DataRange.cxx.

◆ GetRange() [1/6]

void ROOT::Fit::DataRange::GetRange ( double xmin,
double xmax,
double ymin,
double ymax,
double zmin,
double zmax,
unsigned int  irange = 0 
) const
inline

get range for the x and y and z coordinates

Definition at line 135 of file DataRange.h.

◆ GetRange() [2/6]

void ROOT::Fit::DataRange::GetRange ( double xmin,
double xmax,
double ymin,
double ymax,
unsigned int  irange = 0 
) const
inline

get range for the x and y coordinates

Definition at line 129 of file DataRange.h.

◆ GetRange() [3/6]

void ROOT::Fit::DataRange::GetRange ( double xmin,
double xmax,
unsigned int  irange = 0 
) const
inline

get first range for the x - coordinate

Definition at line 125 of file DataRange.h.

◆ GetRange() [4/6]

void ROOT::Fit::DataRange::GetRange ( double xmin,
double xmax,
unsigned int  irange = 0 
) const
inline

get range for coordinates and fill the vector

Definition at line 141 of file DataRange.h.

◆ GetRange() [5/6]

void ROOT::Fit::DataRange::GetRange ( unsigned int  icoord,
double xmin,
double xmax 
) const
inline

get the first range for given coordinate.

If range does not exist return -inf, +inf

Definition at line 115 of file DataRange.h.

◆ GetRange() [6/6]

void ROOT::Fit::DataRange::GetRange ( unsigned int  irange,
unsigned int  icoord,
double xmin,
double xmax 
) const
inline

get the i-th range for given coordinate.

If range does not exist return -inf, +inf

Definition at line 104 of file DataRange.h.

◆ IsInside() [1/2]

bool ROOT::Fit::DataRange::IsInside ( const double x) const
inline

check if a multi-dimpoint is inside the range

Definition at line 211 of file DataRange.h.

◆ IsInside() [2/2]

bool ROOT::Fit::DataRange::IsInside ( double  x,
unsigned int  icoord = 0 
) const

check if a point is inside the range for the given coordinate

Definition at line 146 of file DataRange.cxx.

◆ IsSet()

bool ROOT::Fit::DataRange::IsSet ( ) const
inline

return true if a range has been set in any of the coordinates i.e.

when it is not [-inf,+inf] for all coordinates Avoid in case of multi-dim to loop on all the coordinated and ask the size

Definition at line 80 of file DataRange.h.

◆ NDim()

unsigned int ROOT::Fit::DataRange::NDim ( ) const
inline

get range dimension

Definition at line 65 of file DataRange.h.

◆ operator()()

std::pair< double, double > ROOT::Fit::DataRange::operator() ( unsigned int  icoord = 0,
unsigned int  irange = 0 
) const

return the i-th range for the coordinate icoord.

Useful method when only one range is present for the given coordinate

Definition at line 78 of file DataRange.cxx.

◆ Ranges()

const RangeSet & ROOT::Fit::DataRange::Ranges ( unsigned int  icoord = 0) const
inline

return the vector of ranges for the coordinate icoord

Definition at line 89 of file DataRange.h.

◆ SetRange() [1/4]

void ROOT::Fit::DataRange::SetRange ( double  xmin,
double  xmax 
)
inline

set a range [xmin,xmax] for the first coordinate icoord

Definition at line 186 of file DataRange.h.

◆ SetRange() [2/4]

void ROOT::Fit::DataRange::SetRange ( double  xmin,
double  xmax,
double  ymin,
double  ymax 
)
inline

set a range [xmin,xmax] for the first and [ymin,ymax] for the second coordinate

Definition at line 190 of file DataRange.h.

◆ SetRange() [3/4]

void ROOT::Fit::DataRange::SetRange ( double  xmin,
double  xmax,
double  ymin,
double  ymax,
double  zmin,
double  zmax 
)
inline

set a range [xmin,xmax] for the first and [ymin,ymax] for the second coordinate and [zmin,zmax] for the third coordinate

Definition at line 195 of file DataRange.h.

◆ SetRange() [4/4]

void ROOT::Fit::DataRange::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, delete the existing one and use it the new one Use Add range if want to keep the union of the existing ranges

Definition at line 124 of file DataRange.cxx.

◆ Size()

unsigned int ROOT::Fit::DataRange::Size ( unsigned int  icoord = 0) const
inline

return range size for coordinate icoord (starts from zero) Size == 0 indicates no range is present [-inf, + inf]

Definition at line 71 of file DataRange.h.

Member Data Documentation

◆ fRanges

RangeIntervals ROOT::Fit::DataRange::fRanges
private

list of all ranges

Definition at line 232 of file DataRange.h.

Libraries for ROOT::Fit::DataRange:

The documentation for this class was generated from the following files: