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__
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|