31 #ifndef __FASTJET_RANGEDEFINITION_HH__
32 #define __FASTJET_RANGEDEFINITION_HH__
34 #include "fastjet/PseudoJet.hh"
35 #include "fastjet/Error.hh"
36 #include "fastjet/LimitedWarning.hh"
37 #include "fastjet/internal/deprecated.hh"
42 FASTJET_BEGIN_NAMESPACE
54 FASTJET_DEPRECATED_MSG(
"RangeDefinition is deprecated since FastJet 3.0. Use the Selector mechanism instead")
58 FASTJET_DEPRECATED_MSG(
"RangeDefinition is deprecated since FastJet 3.0. Use the Selector mechanism instead")
60 assert ( rapmax > 0.0 );
65 _total_area = 2.0*rapmax*twopi;
66 _phispan = _phimax-_phimin; }
74 double phimin = 0.0,
double phimax = twopi) {
76 assert ( rapmin < rapmax);
77 assert ( phimin < phimax);
78 assert ( phimin > -twopi );
79 assert ( phimax < 2*twopi);
84 if (_phimax-_phimin > twopi)
85 _total_area = (_rapmax - _rapmin)*twopi;
87 _total_area = (_rapmax - _rapmin)*(_phimax - _phimin);
88 _phispan = _phimax-_phimin; }
108 if (! is_localizable() ) {
109 std::ostringstream err;
110 err << description() <<
111 "\nThis range is not localizable. set_position() should not be used on it.";
112 throw Error(err.str());
121 set_position(jet.
rap(),jet.
phi());
126 double rap = jet.
rap();
127 double phi = jet.
phi();
128 return is_in_range(rap,phi);
133 double dphi=phi-_phimin;
134 if (dphi >= twopi) dphi -= twopi;
135 if (dphi < 0) dphi += twopi;
136 return ( rap >= _rapmin &&
149 virtual inline double area()
const {
return _total_area; }
153 std::ostringstream ostr;
154 ostr <<
"Range: " << _rapmin <<
" <= y <= " << _rapmax <<
", "
155 << _phimin <<
" <= phi <= " << _phimax ;
166 void _numerical_total_area(
double rapmax,
int npoints) ;
167 double _rapjet,_phijet;
170 double _rapmin,_rapmax,_phimin,_phimax,_phispan;
179 void _warn_deprecated()
const;
182 FASTJET_END_NAMESPACE
184 #endif // __FASTJET_RANGEDEFINITION_HH__
virtual double area() const
area of the range region
virtual bool is_in_range(double rap, double phi) const
return bool according to whether a (rap,phi) point is in range
virtual ~RangeDefinition()
destructor does nothing
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...
virtual std::string description() const
textual description of range
void set_position(const PseudoJet &jet)
place the range on the jet position
double rap() const
returns the rapidity or some large value when the rapidity is infinite
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
double phi() const
returns phi (in the range 0..2pi)
void set_position(const double &rap, const double &phi)
place the range on the rap-phi position
bool is_in_range(const PseudoJet &jet) const
return bool according to whether the jet is within the given range
virtual bool is_localizable() const
returns true if the range is localizable (i.e.