32 #ifndef __FASTJET_CIRCULARRANGE_HH__ 33 #define __FASTJET_CIRCULARRANGE_HH__ 35 #include "fastjet/RangeDefinition.hh" 36 #include "fastjet/Error.hh" 37 #include "fastjet/internal/deprecated.hh" 41 #warning This file includes fastjet/CircularRange.hh, \ 42 a deprecated FastJet header provided only for backward compatibility. \ 43 This is not guaranteed to work in future releases of FastJet. \ 44 From FastJet 3.0 onwards, please consider using Selector, defined in \ 45 fastjet/Selector.hh, instead of RangeDefinition and, in particular, \ 46 SelectorCircle instead of CircularRange. 48 FASTJET_BEGIN_NAMESPACE
53 FASTJET_DEPRECATED_MSG(
"CircularRange is deprecated since FastJet 3.0. Use SelectorCircle instead")
54 CircularRange() {_set_invalid_rapphi();}
57 FASTJET_DEPRECATED_MSG(
"CircularRange is deprecated since FastJet 3.0. Use SelectorCircle instead")
58 CircularRange(const
fastjet::PseudoJet & jet,
double distance) {
62 _total_area = fastjet::pi*_distance*_distance; }
65 FASTJET_DEPRECATED_MSG(
"CircularRange is deprecated since FastJet 3.0. Use SelectorCircle instead")
66 CircularRange(
double rap,
double phi,
double distance) {
70 _total_area = fastjet::pi*_distance*_distance; }
73 FASTJET_DEPRECATED_MSG(
"CircularRange is deprecated since FastJet 3.0. Use SelectorCircle instead")
74 CircularRange(
double distance) {
75 _set_invalid_rapphi();
77 _total_area = fastjet::pi*_distance*_distance; }
80 virtual ~CircularRange() {}
83 virtual inline std::string
description() const FASTJET_OVERRIDE {
84 std::ostringstream ostr;
85 ostr <<
"CircularRange: within distance "<< _distance <<
" of given jet or point." ;
90 virtual inline bool is_localizable() const FASTJET_OVERRIDE {
return true; }
93 virtual inline bool is_in_range(
double rap,
double phi)
const FASTJET_OVERRIDE {
94 if (! _rapphi_are_valid()) {
95 throw Error(
"Circular range used without a center having being defined (use set_position())");
97 double deltaphi = _phijet - phi;
98 if ( deltaphi > pi) { deltaphi -= twopi; }
99 else if ( deltaphi < -pi) { deltaphi += twopi; }
100 bool inrange = ( (rap-_rapjet)*(rap-_rapjet) +
101 deltaphi*deltaphi <= _distance*_distance );
105 virtual inline void get_rap_limits(
double & rapmin,
double & rapmax)
const FASTJET_OVERRIDE {
106 rapmin = _rapjet - _distance;
107 rapmax = _rapjet + _distance; }
113 const static double _invalid_phi = -1000.0;
115 void _set_invalid_rapphi() {_phijet = _invalid_phi;}
117 bool _rapphi_are_valid()
const {
return _phijet != _invalid_phi;}
120 FASTJET_END_NAMESPACE
122 #endif // __FASTJET_CIRCULARRANGE_HH__ 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
virtual std::string description() const
textual description of range