29 #ifndef __FASTJET_RANGEDEFINITION_HH__
30 #define __FASTJET_RANGEDEFINITION_HH__
32 #include "fastjet/PseudoJet.hh"
33 #include "fastjet/Error.hh"
34 #include "fastjet/LimitedWarning.hh"
39 FASTJET_BEGIN_NAMESPACE
55 assert ( rapmax > 0.0 );
60 _total_area = 2.0*rapmax*twopi;
61 _phispan = _phimax-_phimin; }
69 double phimin = 0.0,
double phimax = twopi) {
71 assert ( rapmin < rapmax);
72 assert ( phimin < phimax);
73 assert ( phimin > -twopi );
74 assert ( phimax < 2*twopi);
79 if (_phimax-_phimin > twopi)
80 _total_area = (_rapmax - _rapmin)*twopi;
82 _total_area = (_rapmax - _rapmin)*(_phimax - _phimin);
83 _phispan = _phimax-_phimin; }
103 if (! is_localizable() ) {
104 std::ostringstream err;
105 err << description() <<
106 "\nThis range is not localizable. set_position() should not be used on it.";
107 throw Error(err.str());
116 set_position(jet.
rap(),jet.
phi());
121 double rap = jet.
rap();
122 double phi = jet.
phi();
123 return is_in_range(rap,phi);
128 double dphi=phi-_phimin;
129 if (dphi >= twopi) dphi -= twopi;
130 if (dphi < 0) dphi += twopi;
131 return ( rap >= _rapmin &&
144 virtual inline double area()
const {
return _total_area; }
148 std::ostringstream ostr;
149 ostr <<
"Range: " << _rapmin <<
" <= y <= " << _rapmax <<
", "
150 << _phimin <<
" <= phi <= " << _phimax ;
161 void _numerical_total_area(
double rapmax,
int npoints) ;
162 double _rapjet,_phijet;
165 double _rapmin,_rapmax,_phimin,_phimax,_phispan;
174 void _warn_deprecated()
const;
177 FASTJET_END_NAMESPACE
179 #endif // __FASTJET_RANGEDEFINITION_HH__