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__
double rap() const
returns the rapidity or some large value when the rapidity is infinite
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...
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 ...
void set_position(const PseudoJet &jet)
place the range on the jet position
class for holding a range definition specification, given by limits on rapidity and azimuth...
void set_position(const double &rap, const double &phi)
place the range on the rap-phi position
class to provide facilities for giving warnings up to some maximum number of times and to provide glo...
virtual bool is_localizable() const
returns true if the range is localizable (i.e.
base class corresponding to errors that can be thrown by FastJet
bool is_in_range(const PseudoJet &jet) const
return bool according to whether the jet is within the given range
double phi() const
returns phi (in the range 0..2pi)
virtual bool is_in_range(double rap, double phi) const
return bool according to whether a (rap,phi) point is in range
virtual std::string description() const
textual description of range
virtual ~RangeDefinition()
destructor does nothing
Class to contain pseudojets, including minimal information of use to jet-clustering routines...
RangeDefinition()
default constructor
virtual double area() const
area of the range region
RangeDefinition(double rapmax)
constructor for a range definition given by |y|