fastjet 2.4.5
|
class for holding a range definition specification, given by limits on rapidity and azimuth. More...
#include <RangeDefinition.hh>
Public Member Functions | |
RangeDefinition () | |
default constructor | |
RangeDefinition (double rapmax) | |
constructor for a range definition given by |y|<rapmax | |
virtual | ~RangeDefinition () |
destructor does nothing | |
RangeDefinition (double rapmin, double rapmax, double phimin=0.0, double phimax=twopi) | |
constructor for a range definition given by rapmin <= y <= rapmax, phimin <= phi <= phimax | |
virtual bool | is_localizable () const |
returns true if the range is localizable (i.e. | |
void | set_position (const double &rap, const double &phi) |
place the range on the rap-phi position | |
void | set_position (const PseudoJet &jet) |
place the range on the jet position | |
bool | is_in_range (const PseudoJet &jet) const |
return bool according to whether the jet is within the given range | |
virtual bool | is_in_range (double rap, double phi) const |
return bool according to whether a (rap,phi) point is in range | |
virtual void | get_rap_limits (double &rapmin, double &rapmax) const |
return the minimal and maximal rapidity of this range; remember to replace this if you write a derived class with more complex ranges; | |
virtual double | area () const |
area of the range region | |
virtual std::string | description () const |
textual description of range | |
Protected Member Functions | |
void | _numerical_total_area (double rapmax, int npoints) |
calculate, and set _total_area, by calculating which of points on a grid (npoints * npoints from -rapmax..rapmax,0..2pi) are contained in the range; it takes a reasonable time with rapmax = 10, npoints = 100. | |
Protected Attributes | |
double | _total_area |
double | _rapjet |
double | _phijet |
Private Attributes | |
double | _rapmin |
double | _rapmax |
double | _phimin |
double | _phimax |
double | _phispan |
class for holding a range definition specification, given by limits on rapidity and azimuth.
Definition at line 47 of file RangeDefinition.hh.
fastjet::RangeDefinition::RangeDefinition | ( | ) | [inline] |
fastjet::RangeDefinition::RangeDefinition | ( | double | rapmax | ) | [inline] |
virtual fastjet::RangeDefinition::~RangeDefinition | ( | ) | [inline, virtual] |
fastjet::RangeDefinition::RangeDefinition | ( | double | rapmin, |
double | rapmax, | ||
double | phimin = 0.0 , |
||
double | phimax = twopi |
||
) | [inline] |
constructor for a range definition given by rapmin <= y <= rapmax, phimin <= phi <= phimax
Definition at line 67 of file RangeDefinition.hh.
References twopi.
{ assert ( rapmin < rapmax); assert ( phimin < phimax); assert ( phimin > -twopi ); assert ( phimax < 2*twopi); _rapmax = rapmax; _rapmin = rapmin; _phimin = phimin; _phimax = phimax; if (_phimax-_phimin > twopi) _total_area = (_rapmax - _rapmin)*twopi; else _total_area = (_rapmax - _rapmin)*(_phimax - _phimin); _phispan = _phimax-_phimin; }
void fastjet::RangeDefinition::_numerical_total_area | ( | double | rapmax, |
int | npoints | ||
) | [protected] |
calculate, and set _total_area, by calculating which of points on a grid (npoints * npoints from -rapmax..rapmax,0..2pi) are contained in the range; it takes a reasonable time with rapmax = 10, npoints = 100.
calculate, and set in _total_area, the area with a numerical test takes a reasonable time with rapmax = 10, npoints = 100
Definition at line 39 of file RangeDefinition.cc.
References fastjet::d0::inline_maths::phi(), and twopi.
{ int count = 0; double deltaphi = twopi/double(npoints); double deltarap = 2.0*rapmax/double(npoints); double phi = 0.0; for(int i = 0; i < npoints; i++) { double rap = -rapmax; for (int j = 0; j < npoints; j++) { if ( is_in_range(rap,phi) ) { count++; } rap += deltarap; } phi += deltaphi; } _total_area = double(count)/double(npoints*npoints)*2.0*twopi*rapmax; }
virtual double fastjet::RangeDefinition::area | ( | ) | const [inline, virtual] |
area of the range region
Definition at line 142 of file RangeDefinition.hh.
Referenced by fastjet::ClusterSequenceAreaBase::empty_area_from_jets().
{ return _total_area; }
virtual std::string fastjet::RangeDefinition::description | ( | ) | const [inline, virtual] |
textual description of range
Reimplemented in fastjet::CircularRange.
Definition at line 145 of file RangeDefinition.hh.
virtual void fastjet::RangeDefinition::get_rap_limits | ( | double & | rapmin, |
double & | rapmax | ||
) | const [inline, virtual] |
return the minimal and maximal rapidity of this range; remember to replace this if you write a derived class with more complex ranges;
Reimplemented in fastjet::CircularRange.
Definition at line 136 of file RangeDefinition.hh.
Referenced by fastjet::ClusterSequenceArea::_warn_if_range_unsuitable().
virtual bool fastjet::RangeDefinition::is_in_range | ( | double | rap, |
double | phi | ||
) | const [inline, virtual] |
return bool according to whether a (rap,phi) point is in range
Reimplemented in fastjet::CircularRange.
Definition at line 125 of file RangeDefinition.hh.
References twopi.
bool fastjet::RangeDefinition::is_in_range | ( | const PseudoJet & | jet | ) | const [inline] |
return bool according to whether the jet is within the given range
Definition at line 118 of file RangeDefinition.hh.
References fastjet::PseudoJet::phi(), fastjet::d0::inline_maths::phi(), and fastjet::PseudoJet::rap().
Referenced by fastjet::ClusterSequenceActiveAreaExplicitGhosts::empty_area(), fastjet::ClusterSequenceActiveArea::empty_area(), fastjet::ClusterSequenceAreaBase::empty_area_from_jets(), fastjet::ClusterSequenceActiveArea::n_empty_jets(), and fastjet::ClusterSequenceAreaBase::parabolic_pt_per_unit_area().
{ double rap = jet.rap(); double phi = jet.phi(); return is_in_range(rap,phi); }
virtual bool fastjet::RangeDefinition::is_localizable | ( | ) | const [inline, virtual] |
returns true if the range is localizable (i.e.
set_position is meant to do something meaningful).
This version of the class is not localizable and so it returns false.
For localizable classes override this function with a function that returns true
Reimplemented in fastjet::CircularRange.
Definition at line 91 of file RangeDefinition.hh.
{ return false; }
void fastjet::RangeDefinition::set_position | ( | const PseudoJet & | jet | ) | [inline] |
place the range on the jet position
Definition at line 113 of file RangeDefinition.hh.
References fastjet::PseudoJet::phi(), and fastjet::PseudoJet::rap().
{ set_position(jet.rap(),jet.phi()); }
void fastjet::RangeDefinition::set_position | ( | const double & | rap, |
const double & | phi | ||
) | [inline] |
place the range on the rap-phi position
THIS DOES NOT DO ANYTHING FOR THIS CLASS AND IS ONLY THERE TO FACILITATE DERIVED CLASSES
DON'T NECESSARILY COUNT ON IT IN THE FUTURE EITHER???
Definition at line 100 of file RangeDefinition.hh.
References fastjet::d0::inline_maths::phi().
{ if (! is_localizable() ) { std::ostringstream err; err << description() << "\nThis range is not localizable. set_position() should not be used on it."; throw fastjet::Error(err.str()); } else { _rapjet = rap; _phijet = phi; } }
double fastjet::RangeDefinition::_phijet [protected] |
Definition at line 160 of file RangeDefinition.hh.
double fastjet::RangeDefinition::_phimax [private] |
Definition at line 163 of file RangeDefinition.hh.
double fastjet::RangeDefinition::_phimin [private] |
Definition at line 163 of file RangeDefinition.hh.
double fastjet::RangeDefinition::_phispan [private] |
Definition at line 163 of file RangeDefinition.hh.
double fastjet::RangeDefinition::_rapjet [protected] |
Definition at line 160 of file RangeDefinition.hh.
double fastjet::RangeDefinition::_rapmax [private] |
Definition at line 163 of file RangeDefinition.hh.
double fastjet::RangeDefinition::_rapmin [private] |
Definition at line 163 of file RangeDefinition.hh.
double fastjet::RangeDefinition::_total_area [protected] |
Definition at line 153 of file RangeDefinition.hh.