Fork me on GitHub

source: git/external/fastjet/CircularRange.hh@ b1fd38d

ImprovedOutputFile Timing dual_readout llp
Last change on this file since b1fd38d was 1d208a2, checked in by Pavel Demin <pavel.demin@…>, 8 years ago

update FastJet library to 3.2.1 and Nsubjettiness library to 2.2.4

  • Property mode set to 100644
File size: 4.9 KB
Line 
1//FJSTARTHEADER
2// $Id: CircularRange.hh 4074 2016-03-08 09:09:25Z soyez $
3//
4// Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
5//
6//----------------------------------------------------------------------
7// This file is part of FastJet.
8//
9// FastJet is free software; you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation; either version 2 of the License, or
12// (at your option) any later version.
13//
14// The algorithms that underlie FastJet have required considerable
15// development. They are described in the original FastJet paper,
16// hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
17// FastJet as part of work towards a scientific publication, please
18// quote the version you use and include a citation to the manual and
19// optionally also to hep-ph/0512210.
20//
21// FastJet is distributed in the hope that it will be useful,
22// but WITHOUT ANY WARRANTY; without even the implied warranty of
23// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24// GNU General Public License for more details.
25//
26// You should have received a copy of the GNU General Public License
27// along with FastJet. If not, see <http://www.gnu.org/licenses/>.
28//----------------------------------------------------------------------
29//FJENDHEADER
30
31
32#ifndef __FASTJET_CIRCULARRANGE_HH__
33#define __FASTJET_CIRCULARRANGE_HH__
34
35#include "fastjet/RangeDefinition.hh"
36#include "fastjet/Error.hh"
37#include "fastjet/internal/deprecated.hh"
38
39// for backwards compatibility: one should now use SelectorCircle,
40// defined in fastjet/Selector.hh, instead CircularRange
41#warning This file includes fastjet/CircularRange.hh, \
42a deprecated FastJet header provided only for backward compatibility. \
43This is not guaranteed to work in future releases of FastJet. \
44From FastJet 3.0 onwards, please consider using Selector, defined in \
45fastjet/Selector.hh, instead of RangeDefinition and, in particular, \
46SelectorCircle instead of CircularRange.
47
48FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
49
50class CircularRange : public fastjet::RangeDefinition {
51public:
52 /// constructor
53 FASTJET_DEPRECATED_MSG("CircularRange is deprecated since FastJet 3.0. Use SelectorCircle instead")
54 CircularRange() {_set_invalid_rapphi();}
55
56 /// initialise CircularRange with a jet
57 FASTJET_DEPRECATED_MSG("CircularRange is deprecated since FastJet 3.0. Use SelectorCircle instead")
58 CircularRange(const fastjet::PseudoJet & jet, double distance) {
59 _distance = distance;
60 _rapjet = jet.rap();
61 _phijet = jet.phi();
62 _total_area = fastjet::pi*_distance*_distance; }
63
64 /// initialise CircularRange with a (rap,phi) point
65 FASTJET_DEPRECATED_MSG("CircularRange is deprecated since FastJet 3.0. Use SelectorCircle instead")
66 CircularRange(double rap, double phi, double distance) {
67 _distance = distance;
68 _rapjet = rap;
69 _phijet = phi;
70 _total_area = fastjet::pi*_distance*_distance; }
71
72 /// initialise CircularRange with just the radius parameter
73 FASTJET_DEPRECATED_MSG("CircularRange is deprecated since FastJet 3.0. Use SelectorCircle instead")
74 CircularRange(double distance) {
75 _set_invalid_rapphi();
76 _distance = distance;
77 _total_area = fastjet::pi*_distance*_distance; }
78
79 /// destructor
80 virtual ~CircularRange() {}
81
82 /// return description of range
83 virtual inline std::string description() const FASTJET_OVERRIDE {
84 std::ostringstream ostr;
85 ostr << "CircularRange: within distance "<< _distance << " of given jet or point." ;
86 return ostr.str(); }
87
88 /// returns true since this range is localizable (i.e. set_position
89 /// does something meaningful)
90 virtual inline bool is_localizable() const FASTJET_OVERRIDE { return true; }
91
92 /// return bool according to whether (rap,phi) is in range
93 virtual inline bool is_in_range(double rap, double phi) const FASTJET_OVERRIDE {
94 if (! _rapphi_are_valid()) {
95 throw Error("Circular range used without a center having being defined (use set_position())");
96 }
97 double deltaphi = _phijet - phi;
98 if ( deltaphi > pi) { deltaphi -= twopi; }
99 else if ( deltaphi < -pi) { deltaphi += twopi; }
100 bool inrange = ( (rap-_rapjet)*(rap-_rapjet) +
101 deltaphi*deltaphi <= _distance*_distance );
102 return inrange; }
103
104 /// return the minimal and maximal rapidity of this range
105 virtual inline void get_rap_limits(double & rapmin, double & rapmax) const FASTJET_OVERRIDE {
106 rapmin = _rapjet - _distance;
107 rapmax = _rapjet + _distance; }
108
109private:
110 double _distance;
111
112 /// value for phi that marks it as invalid
113 const static double _invalid_phi = -1000.0;
114 /// set internal phi so as to mark things as invalid
115 void _set_invalid_rapphi() {_phijet = _invalid_phi;}
116 /// true if rap,phi are valid (tests only phi)
117 bool _rapphi_are_valid() const {return _phijet != _invalid_phi;}
118};
119
120FASTJET_END_NAMESPACE
121
122#endif // __FASTJET_CIRCULARRANGE_HH__
Note: See TracBrowser for help on using the repository browser.