32 #ifndef __FASTJET_CIRCULARRANGE_HH__
33 #define __FASTJET_CIRCULARRANGE_HH__
35 #include "fastjet/RangeDefinition.hh"
36 #include "fastjet/Error.hh"
40 #warning This file includes fastjet/CircularRange.hh, \
41 a deprecated FastJet header provided only for backward compatibility. \
42 This is not guaranteed to work in future releases of FastJet. \
43 From FastJet 3.0 onwards, please consider using Selector, defined in \
44 fastjet/Selector.hh, instead of RangeDefinition and, in particular, \
45 SelectorCircle instead of CircularRange.
47 FASTJET_BEGIN_NAMESPACE
52 CircularRange() {_set_invalid_rapphi();}
59 _total_area = fastjet::pi*_distance*_distance; }
62 CircularRange(
double rap,
double phi,
double distance) {
66 _total_area = fastjet::pi*_distance*_distance; }
69 CircularRange(
double distance) {
70 _set_invalid_rapphi();
72 _total_area = fastjet::pi*_distance*_distance; }
75 virtual ~CircularRange() {}
79 std::ostringstream ostr;
80 ostr <<
"CircularRange: within distance "<< _distance <<
" of given jet or point." ;
88 virtual inline bool is_in_range(
double rap,
double phi)
const {
89 if (! _rapphi_are_valid()) {
90 throw Error(
"Circular range used without a center having being defined (use set_position())");
92 double deltaphi = _phijet - phi;
93 if ( deltaphi > pi) { deltaphi -= twopi; }
94 else if ( deltaphi < -pi) { deltaphi += twopi; }
95 bool inrange = ( (rap-_rapjet)*(rap-_rapjet) +
96 deltaphi*deltaphi <= _distance*_distance );
100 virtual inline void get_rap_limits(
double & rapmin,
double & rapmax)
const {
101 rapmin = _rapjet - _distance;
102 rapmax = _rapjet + _distance; }
108 const static double _invalid_phi = -1000.0;
110 void _set_invalid_rapphi() {_phijet = _invalid_phi;}
112 bool _rapphi_are_valid()
const {
return _phijet != _invalid_phi;}
115 FASTJET_END_NAMESPACE
117 #endif // __FASTJET_CIRCULARRANGE_HH__
double rap() const
returns the rapidity or some large value when the rapidity is infinite
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 derive...
class for holding a range definition specification, given by limits on rapidity and azimuth...
virtual bool is_localizable() const
returns true if the range is localizable (i.e.
bool is_in_range(const PseudoJet &jet) const
return bool according to whether the jet is within the given range
double phi() const
returns phi (in the range 0..2pi)
virtual std::string description() const
textual description of range
Class to contain pseudojets, including minimal information of use to jet-clustering routines...