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