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"
41 FASTJET_BEGIN_NAMESPACE
57 assert ( rapmax > 0.0 );
62 _total_area = 2.0*rapmax*twopi;
63 _phispan = _phimax-_phimin; }
71 double phimin = 0.0,
double phimax = twopi) {
73 assert ( rapmin < rapmax);
74 assert ( phimin < phimax);
75 assert ( phimin > -twopi );
76 assert ( phimax < 2*twopi);
81 if (_phimax-_phimin > twopi)
82 _total_area = (_rapmax - _rapmin)*twopi;
84 _total_area = (_rapmax - _rapmin)*(_phimax - _phimin);
85 _phispan = _phimax-_phimin; }
105 if (! is_localizable() ) {
106 std::ostringstream err;
107 err << description() <<
108 "\nThis range is not localizable. set_position() should not be used on it.";
109 throw Error(err.str());
118 set_position(jet.
rap(),jet.
phi());
123 double rap = jet.
rap();
124 double phi = jet.
phi();
125 return is_in_range(rap,phi);
130 double dphi=phi-_phimin;
131 if (dphi >= twopi) dphi -= twopi;
132 if (dphi < 0) dphi += twopi;
133 return ( rap >= _rapmin &&
146 virtual inline double area()
const {
return _total_area; }
150 std::ostringstream ostr;
151 ostr <<
"Range: " << _rapmin <<
" <= y <= " << _rapmax <<
", "
152 << _phimin <<
" <= phi <= " << _phimax ;
163 void _numerical_total_area(
double rapmax,
int npoints) ;
164 double _rapjet,_phijet;
167 double _rapmin,_rapmax,_phimin,_phimax,_phispan;
176 void _warn_deprecated()
const;
179 FASTJET_END_NAMESPACE
181 #endif // __FASTJET_RANGEDEFINITION_HH__