File indexing completed on 2025-01-18 09:57:17
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 #ifndef __FASTJET_CIRCULARRANGE_HH__
0033 #define __FASTJET_CIRCULARRANGE_HH__
0034
0035 #include "fastjet/RangeDefinition.hh"
0036 #include "fastjet/Error.hh"
0037 #include "fastjet/internal/deprecated.hh"
0038
0039
0040
0041 #warning This file includes fastjet/CircularRange.hh, \
0042 a deprecated FastJet header provided only for backward compatibility. \
0043 This is not guaranteed to work in future releases of FastJet. \
0044 From FastJet 3.0 onwards, please consider using Selector, defined in \
0045 fastjet/Selector.hh, instead of RangeDefinition and, in particular, \
0046 SelectorCircle instead of CircularRange.
0047
0048 FASTJET_BEGIN_NAMESPACE
0049
0050 class CircularRange : public fastjet::RangeDefinition {
0051 public:
0052
0053 FASTJET_DEPRECATED_MSG("CircularRange is deprecated since FastJet 3.0. Use SelectorCircle instead",
0054 CircularRange()) {_set_invalid_rapphi();}
0055
0056
0057 FASTJET_DEPRECATED_MSG("CircularRange is deprecated since FastJet 3.0. Use SelectorCircle instead",
0058 CircularRange(const fastjet::PseudoJet & jet, double distance)) {
0059 _distance = distance;
0060 _rapjet = jet.rap();
0061 _phijet = jet.phi();
0062 _total_area = fastjet::pi*_distance*_distance; }
0063
0064
0065 FASTJET_DEPRECATED_MSG("CircularRange is deprecated since FastJet 3.0. Use SelectorCircle instead",
0066 CircularRange(double rap, double phi, double distance)) {
0067 _distance = distance;
0068 _rapjet = rap;
0069 _phijet = phi;
0070 _total_area = fastjet::pi*_distance*_distance; }
0071
0072
0073 FASTJET_DEPRECATED_MSG("CircularRange is deprecated since FastJet 3.0. Use SelectorCircle instead",
0074 CircularRange(double distance)) {
0075 _set_invalid_rapphi();
0076 _distance = distance;
0077 _total_area = fastjet::pi*_distance*_distance; }
0078
0079
0080 virtual ~CircularRange() {}
0081
0082
0083 virtual inline std::string description() const FASTJET_OVERRIDE {
0084 std::ostringstream ostr;
0085 ostr << "CircularRange: within distance "<< _distance << " of given jet or point." ;
0086 return ostr.str(); }
0087
0088
0089
0090 virtual inline bool is_localizable() const FASTJET_OVERRIDE { return true; }
0091
0092
0093 virtual inline bool is_in_range(double rap, double phi) const FASTJET_OVERRIDE {
0094 if (! _rapphi_are_valid()) {
0095 throw Error("Circular range used without a center having being defined (use set_position())");
0096 }
0097 double deltaphi = _phijet - phi;
0098 if ( deltaphi > pi) { deltaphi -= twopi; }
0099 else if ( deltaphi < -pi) { deltaphi += twopi; }
0100 bool inrange = ( (rap-_rapjet)*(rap-_rapjet) +
0101 deltaphi*deltaphi <= _distance*_distance );
0102 return inrange; }
0103
0104
0105 virtual inline void get_rap_limits(double & rapmin, double & rapmax) const FASTJET_OVERRIDE {
0106 rapmin = _rapjet - _distance;
0107 rapmax = _rapjet + _distance; }
0108
0109 private:
0110 double _distance;
0111
0112
0113 const static double _invalid_phi = -1000.0;
0114
0115 void _set_invalid_rapphi() {_phijet = _invalid_phi;}
0116
0117 bool _rapphi_are_valid() const {return _phijet != _invalid_phi;}
0118 };
0119
0120 FASTJET_END_NAMESPACE
0121
0122 #endif