ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Attributes | List of all members
ROOT::Fit::DataRange Class Reference

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

The rnage 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 34 of file DataRange.h.

Public Types

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

Public Member Functions

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

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 More...
 

Static Protected Member Functions

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

Private Attributes

RangeIntervals fRanges
 

#include <Fit/DataRange.h>

Member Typedef Documentation

Definition at line 39 of file DataRange.h.

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

Definition at line 38 of file DataRange.h.

Constructor & Destructor Documentation

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

Default constructor (infinite range)

Definition at line 44 of file DataRange.h.

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

construct a range for [xmin, xmax]

Definition at line 23 of file DataRange.cxx.

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.

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.

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

Destructor (no operations)

Definition at line 137 of file DataRange.h.

Member Function Documentation

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.

Referenced by AddRange(), THnBase::Fit(), HFit::GetDrawingRange(), HFit::GetFunctionRange(), and TFitEditor::GetRanges().

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

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

Definition at line 152 of file DataRange.h.

Referenced by AddRange().

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 156 of file DataRange.h.

Referenced by AddRange().

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 161 of file DataRange.h.

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.

Referenced by AddRange().

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.

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

Definition at line 182 of file DataRange.cxx.

Referenced by GetRange(), and operator()().

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

get first range for the x - coordinate

Definition at line 113 of file DataRange.h.

Referenced by GetRange().

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

get first range for the x and y coordinates

Definition at line 117 of file DataRange.h.

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

get first range for the x and y and z coordinates

Definition at line 123 of file DataRange.h.

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

get first range for coordinates and fill the vector

Definition at line 129 of file DataRange.h.

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.

Referenced by ROOT::Fit::BinPoint::IsInRange(), and ROOT::Fit::UnBinData::UnBinData().

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 79 of file DataRange.h.

Referenced by TUnuranSampler::DoInitND().

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

get range dimension

Definition at line 64 of file DataRange.h.

Referenced by TUnuranSampler::DoInitND(), ROOT::Math::DistSampler::DoSetFunction(), and ROOT::Fit::BinPoint::IsInRange().

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.

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

return the vector of ranges for the coordinate icoord

Definition at line 88 of file DataRange.h.

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.

Referenced by combinedFit(), ROOT::Math::DistSampler::SetRange(), and SetRange().

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

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

Definition at line 174 of file DataRange.h.

Referenced by SetRange().

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 178 of file DataRange.h.

Referenced by SetRange().

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 183 of file DataRange.h.

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 70 of file DataRange.h.

Referenced by Clear(), ROOT::Fit::DoFillData(), TUnuranSampler::DoInit1D(), TUnuranSampler::DoInitDiscrete1D(), ROOT::Fit::FillData(), HFit::Fit(), ROOT::Math::DistSampler::Generate(), HFit::GetDrawingRange(), HFit::GetFunctionRange(), GetRange(), IsInside(), operator()(), and HFit::StoreAndDrawFitFunction().

Member Data Documentation

RangeIntervals ROOT::Fit::DataRange::fRanges
private
Collaboration diagram for ROOT::Fit::DataRange:
[legend]

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