BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Range Class Reference

to specify 1-dim region or range by two floats More...

#include <Range.h>

Public Member Functions

 Range ()
 Constructor.
 Range (const Range &)
 Copy constructor.
 Range (float low, float high)
 Constructor.
virtual float low (void) const
 returns lower limit.
virtual float high (void) const
 returns higher limit.
virtual float center (void) const
 returns center.
virtual float width (void) const
 returns width.
virtual float low (float lowIn)
 sets lower limit.
virtual float high (float highIn)
 sets higher limit.
virtual Rangeset (float low, float high)
 sets range.
virtual RangesetByCenter (float center, float width)
 sets range by center and width.
Rangeoperator= (const Range &)
 Copy operator.
bool operator== (const Range &) const
 returns true if range is the same.
bool operator!= (const Range &) const
 returns true if range is different.
bool operator& (const Range &) const
 returns true if two are overlaped each other.
bool within (const float value) const
 returns true if given value is within a range.
bool within2 (const float value) const
 returns true if given value is within a range.
bool within (const Range &) const
 returns true if given Range is within(included in) a range.
virtual int dump (void) const
 displays debug information.
 Range ()
 Constructor.
 Range (const Range &)
 Copy constructor.
 Range (float low, float high)
 Constructor.
virtual float low (void) const
 returns lower limit.
virtual float high (void) const
 returns higher limit.
virtual float center (void) const
 returns center.
virtual float width (void) const
 returns width.
virtual float low (float lowIn)
 sets lower limit.
virtual float high (float highIn)
 sets higher limit.
virtual Rangeset (float low, float high)
 sets range.
virtual RangesetByCenter (float center, float width)
 sets range by center and width.
Rangeoperator= (const Range &)
 Copy operator.
bool operator== (const Range &) const
 returns true if range is the same.
bool operator!= (const Range &) const
 returns true if range is different.
bool operator& (const Range &) const
 returns true if two are overlaped each other.
bool within (const float value) const
 returns true if given value is within a range.
bool within2 (const float value) const
 returns true if given value is within a range.
bool within (const Range &) const
 returns true if given Range is within(included in) a range.
virtual int dump (void) const
 displays debug information.
 Range ()
 Constructor.
 Range (const Range &)
 Copy constructor.
 Range (float low, float high)
 Constructor.
virtual float low (void) const
 returns lower limit.
virtual float high (void) const
 returns higher limit.
virtual float center (void) const
 returns center.
virtual float width (void) const
 returns width.
virtual float low (float lowIn)
 sets lower limit.
virtual float high (float highIn)
 sets higher limit.
virtual Rangeset (float low, float high)
 sets range.
virtual RangesetByCenter (float center, float width)
 sets range by center and width.
Rangeoperator= (const Range &)
 Copy operator.
bool operator== (const Range &) const
 returns true if range is the same.
bool operator!= (const Range &) const
 returns true if range is different.
bool operator& (const Range &) const
 returns true if two are overlaped each other.
bool within (const float value) const
 returns true if given value is within a range.
bool within2 (const float value) const
 returns true if given value is within a range.
bool within (const Range &) const
 returns true if given Range is within(included in) a range.
virtual int dump (void) const
 displays debug information.

Detailed Description

to specify 1-dim region or range by two floats

Definition at line 19 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/Range.h.

Constructor & Destructor Documentation

◆ Range() [1/9]

Range::Range ( )

Constructor.

Definition at line 16 of file Range.cxx.

16 {
17 _low = -999.;
18 _high = -999.;
19}

Referenced by operator!=(), operator&(), operator=(), operator==(), Range(), set(), setByCenter(), and within().

◆ Range() [2/9]

Range::Range ( const Range & ib)

Copy constructor.

Definition at line 21 of file Range.cxx.

21 {
22 _low = ib.low();
23 _high = ib.high();
24}
virtual float high(void) const
returns higher limit.
virtual float low(void) const
returns lower limit.

◆ Range() [3/9]

Range::Range ( float low,
float high )

Constructor.

Definition at line 26 of file Range.cxx.

26 {
27 if ( iHigh > iLow )
28 {
29 _low = iLow;
30 _high = iHigh;
31 }
32 else
33 {
34 _low = iHigh;
35 _high = iLow;
36 }
37}

◆ Range() [4/9]

Range::Range ( )

Constructor.

◆ Range() [5/9]

Range::Range ( const Range & )

Copy constructor.

◆ Range() [6/9]

Range::Range ( float low,
float high )

Constructor.

◆ Range() [7/9]

Range::Range ( )

Constructor.

◆ Range() [8/9]

Range::Range ( const Range & )

Copy constructor.

◆ Range() [9/9]

Range::Range ( float low,
float high )

Constructor.

Member Function Documentation

◆ center() [1/3]

float Range::center ( void ) const
inlinevirtual

returns center.

Definition at line 115 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/Range.h.

115{ return ( _low + _high ) / 2.; }

Referenced by setByCenter().

◆ center() [2/3]

virtual float Range::center ( void ) const
virtual

returns center.

◆ center() [3/3]

virtual float Range::center ( void ) const
virtual

returns center.

◆ dump() [1/3]

int Range::dump ( void ) const
virtual

displays debug information.

Definition at line 45 of file Range.cxx.

45 {
46 std::cout << _low << "~" << _high;
47 return 0;
48}

◆ dump() [2/3]

virtual int Range::dump ( void ) const
virtual

displays debug information.

◆ dump() [3/3]

virtual int Range::dump ( void ) const
virtual

displays debug information.

◆ high() [1/6]

float Range::high ( float highIn)
inlinevirtual

sets higher limit.

Definition at line 110 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/Range.h.

110 {
111 if ( i < _low ) i = _low;
112 return _high = i;
113}

◆ high() [2/6]

virtual float Range::high ( float highIn)
virtual

sets higher limit.

◆ high() [3/6]

virtual float Range::high ( float highIn)
virtual

sets higher limit.

◆ high() [4/6]

float Range::high ( void ) const
inlinevirtual

returns higher limit.

Definition at line 108 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/Range.h.

108{ return _high; }

Referenced by operator&(), operator=(), operator==(), Range(), Range(), set(), and within().

◆ high() [5/6]

virtual float Range::high ( void ) const
virtual

returns higher limit.

◆ high() [6/6]

virtual float Range::high ( void ) const
virtual

returns higher limit.

◆ low() [1/6]

float Range::low ( float lowIn)
inlinevirtual

sets lower limit.

Definition at line 103 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/Range.h.

103 {
104 if ( i > _high ) i = _high;
105 return _low = i;
106}

◆ low() [2/6]

virtual float Range::low ( float lowIn)
virtual

sets lower limit.

◆ low() [3/6]

virtual float Range::low ( float lowIn)
virtual

sets lower limit.

◆ low() [4/6]

float Range::low ( void ) const
inlinevirtual

returns lower limit.

Definition at line 101 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/Range.h.

101{ return _low; }

Referenced by operator&(), operator=(), operator==(), Range(), Range(), set(), and within().

◆ low() [5/6]

virtual float Range::low ( void ) const
virtual

returns lower limit.

◆ low() [6/6]

virtual float Range::low ( void ) const
virtual

returns lower limit.

◆ operator!=() [1/3]

bool Range::operator!= ( const Range & a) const
inline

returns true if range is different.

Definition at line 175 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/Range.h.

175 {
176 if ( ( *this ) == a ) return false;
177 return true;
178}

◆ operator!=() [2/3]

bool Range::operator!= ( const Range & ) const

returns true if range is different.

◆ operator!=() [3/3]

bool Range::operator!= ( const Range & ) const

returns true if range is different.

◆ operator&() [1/3]

bool Range::operator& ( const Range & a) const
inline

returns true if two are overlaped each other.

Definition at line 180 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/Range.h.

180 {
181 if ( within( a.low() ) ) return true;
182 if ( within( a.high() ) ) return true;
183 if ( a.within( low() ) ) return true;
184 if ( a.within( high() ) ) return true;
185 return false;
186}
bool within(const float value) const
returns true if given value is within a range.

◆ operator&() [2/3]

bool Range::operator& ( const Range & ) const

returns true if two are overlaped each other.

◆ operator&() [3/3]

bool Range::operator& ( const Range & ) const

returns true if two are overlaped each other.

◆ operator=() [1/3]

Range & Range::operator= ( const Range & ib)
inline

Copy operator.

Definition at line 139 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/Range.h.

139 {
140 _low = ib.low();
141 _high = ib.high();
142 return *this;
143}

◆ operator=() [2/3]

Range & Range::operator= ( const Range & )

Copy operator.

◆ operator=() [3/3]

Range & Range::operator= ( const Range & )

Copy operator.

◆ operator==() [1/3]

bool Range::operator== ( const Range & a) const

returns true if range is the same.

Definition at line 39 of file Range.cxx.

39 {
40 if ( _low != a.low() ) return false;
41 if ( _high != a.high() ) return false;
42 return true;
43}

◆ operator==() [2/3]

bool Range::operator== ( const Range & ) const

returns true if range is the same.

◆ operator==() [3/3]

bool Range::operator== ( const Range & ) const

returns true if range is the same.

◆ set() [1/3]

Range & Range::set ( float low,
float high )
inlinevirtual

sets range.

Definition at line 119 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/Range.h.

119 {
120 if ( iHigh > iLow )
121 {
122 _low = iLow;
123 _high = iHigh;
124 }
125 else
126 {
127 _low = iHigh;
128 _high = iLow;
129 }
130 return *this;
131}

◆ set() [2/3]

virtual Range & Range::set ( float low,
float high )
virtual

sets range.

◆ set() [3/3]

virtual Range & Range::set ( float low,
float high )
virtual

sets range.

◆ setByCenter() [1/3]

Range & Range::setByCenter ( float center,
float width )
inlinevirtual

sets range by center and width.

Definition at line 133 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/Range.h.

133 {
134 _low = center - width;
135 _high = center + width;
136 return *this;
137}
virtual float width(void) const
returns width.
virtual float center(void) const
returns center.

◆ setByCenter() [2/3]

virtual Range & Range::setByCenter ( float center,
float width )
virtual

sets range by center and width.

◆ setByCenter() [3/3]

virtual Range & Range::setByCenter ( float center,
float width )
virtual

sets range by center and width.

◆ width() [1/3]

float Range::width ( void ) const
inlinevirtual

returns width.

Definition at line 117 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/Range.h.

117{ return ( _high - _low ); }

Referenced by setByCenter().

◆ width() [2/3]

virtual float Range::width ( void ) const
virtual

returns width.

◆ width() [3/3]

virtual float Range::width ( void ) const
virtual

returns width.

◆ within() [1/6]

bool Range::within ( const float value) const
inline

returns true if given value is within a range.

Definition at line 145 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/Range.h.

145 {
146 if ( _low == -999. && _high == -999. ) { return false; }
147 if ( _low == -999. )
148 {
149 if ( f <= _high ) return true;
150 return false;
151 }
152 if ( _high == -999. )
153 {
154 if ( f >= _low ) return true;
155 }
156 if ( f >= _low && f <= _high ) return true;
157 return false;
158}
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")

Referenced by operator&(), and within().

◆ within() [2/6]

bool Range::within ( const float value) const

returns true if given value is within a range.

◆ within() [3/6]

bool Range::within ( const float value) const

returns true if given value is within a range.

◆ within() [4/6]

bool Range::within ( const Range & a) const
inline

returns true if given Range is within(included in) a range.

Definition at line 188 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/Range.h.

188 {
189 if ( within( a.low() ) && within( a.high() ) ) return true;
190 return false;
191}

◆ within() [5/6]

bool Range::within ( const Range & ) const

returns true if given Range is within(included in) a range.

◆ within() [6/6]

bool Range::within ( const Range & ) const

returns true if given Range is within(included in) a range.

◆ within2() [1/3]

bool Range::within2 ( const float value) const
inline

returns true if given value is within a range.

Definition at line 160 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/Range.h.

160 {
161 if ( _low == -999. && _high == -999. ) { return true; }
162 if ( _low == -999. )
163 {
164 if ( f <= _high ) return true;
165 return false;
166 }
167 if ( _high == -999. )
168 {
169 if ( f >= _low ) return true;
170 }
171 if ( f >= _low && f <= _high ) return true;
172 return false;
173}

◆ within2() [2/3]

bool Range::within2 ( const float value) const

returns true if given value is within a range.

◆ within2() [3/3]

bool Range::within2 ( const float value) const

returns true if given value is within a range.


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