[d7d2da3] | 1 | //STARTHEADER
|
---|
| 2 | // $Id$
|
---|
| 3 | //
|
---|
| 4 | // Copyright (c) 2005-2011, 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 and are described in hep-ph/0512210. If you use
|
---|
| 16 | // FastJet as part of work towards a scientific publication, please
|
---|
| 17 | // include a citation to the FastJet paper.
|
---|
| 18 | //
|
---|
| 19 | // FastJet is distributed in the hope that it will be useful,
|
---|
| 20 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 21 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 22 | // GNU General Public License for more details.
|
---|
| 23 | //
|
---|
| 24 | // You should have received a copy of the GNU General Public License
|
---|
| 25 | // along with FastJet. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 26 | //----------------------------------------------------------------------
|
---|
| 27 | //ENDHEADER
|
---|
| 28 |
|
---|
| 29 | #include <fastjet/FunctionOfPseudoJet.hh>
|
---|
| 30 | #include <string>
|
---|
| 31 | #include <sstream>
|
---|
| 32 |
|
---|
| 33 | using namespace std;
|
---|
| 34 |
|
---|
| 35 | FASTJET_BEGIN_NAMESPACE
|
---|
| 36 |
|
---|
| 37 | // //----------------------------------------------------------------------
|
---|
| 38 | // /// helper for the selector "FunctionOfPJ(jet) > ref"
|
---|
| 39 | // class SW_FofPJ_larger : public SelectorWorker {
|
---|
| 40 | // public:
|
---|
| 41 | // /// ctor with specification of the number of objects to keep
|
---|
| 42 | // SW_FofPJ_larger(const FunctionOfPseudoJet<double> & fn, const double &ref)
|
---|
| 43 | // : _fn(fn), _ref(ref){}
|
---|
| 44 | //
|
---|
| 45 | // /// return true if the jet is a pure-ghost jet
|
---|
| 46 | // virtual bool pass(const PseudoJet & jet) const { return _fn(jet) > _ref; }
|
---|
| 47 | //
|
---|
| 48 | // /// returns a description of the worker
|
---|
| 49 | // virtual string description() const {
|
---|
| 50 | // ostringstream oss;
|
---|
| 51 | // oss << "(" << _fn.description() << " > " << _ref << ")";
|
---|
| 52 | // return oss.str();
|
---|
| 53 | // }
|
---|
| 54 | //
|
---|
| 55 | // protected:
|
---|
| 56 | // const FunctionOfPseudoJet<double> & _fn;
|
---|
| 57 | // double _ref;
|
---|
| 58 | // };
|
---|
| 59 | //
|
---|
| 60 | //
|
---|
| 61 | // // select objects that are (or are only made of) ghosts
|
---|
| 62 | // Selector operator >(const FunctionOfPseudoJet<double> & fn, const double & ref){
|
---|
| 63 | // return Selector(new SW_FofPJ_larger(fn, ref));
|
---|
| 64 | // }
|
---|
| 65 | //
|
---|
| 66 | //
|
---|
| 67 | //
|
---|
| 68 | // //----------------------------------------------------------------------
|
---|
| 69 | // /// helper for the selector "FunctionOfPJ(jet) < ref"
|
---|
| 70 | // class SW_FofPJ_smaller : public SelectorWorker {
|
---|
| 71 | // public:
|
---|
| 72 | // /// ctor with specification of the number of objects to keep
|
---|
| 73 | // SW_FofPJ_smaller(const FunctionOfPseudoJet<double> & fn, const double &ref)
|
---|
| 74 | // : _fn(fn), _ref(ref){}
|
---|
| 75 | //
|
---|
| 76 | // /// return true if the jet is a pure-ghost jet
|
---|
| 77 | // virtual bool pass(const PseudoJet & jet) const { return _fn(jet) < _ref; }
|
---|
| 78 | //
|
---|
| 79 | // /// returns a description of the worker
|
---|
| 80 | // virtual string description() const {
|
---|
| 81 | // ostringstream oss;
|
---|
| 82 | // oss << "(" << _fn.description() << " < " << _ref << ")";
|
---|
| 83 | // return oss.str();
|
---|
| 84 | // }
|
---|
| 85 | //
|
---|
| 86 | // protected:
|
---|
| 87 | // const FunctionOfPseudoJet<double> & _fn;
|
---|
| 88 | // double _ref;
|
---|
| 89 | // };
|
---|
| 90 | //
|
---|
| 91 | //
|
---|
| 92 | // // select objects that are (or are only made of) ghosts
|
---|
| 93 | // Selector operator <(const FunctionOfPseudoJet<double> & fn, const double & ref){
|
---|
| 94 | // return Selector(new SW_FofPJ_smaller(fn, ref));
|
---|
| 95 | // }
|
---|
| 96 | //
|
---|
| 97 | //
|
---|
| 98 | // //----------------------------------------------------------------------
|
---|
| 99 | // /// helper for the selector "FunctionOfPJ(jet) >= ref"
|
---|
| 100 | // class SW_FofPJ_larger_equal : public SelectorWorker {
|
---|
| 101 | // public:
|
---|
| 102 | // /// ctor with specification of the number of objects to keep
|
---|
| 103 | // SW_FofPJ_larger_equal(const FunctionOfPseudoJet<double> & fn, const double &ref)
|
---|
| 104 | // : _fn(fn), _ref(ref){}
|
---|
| 105 | //
|
---|
| 106 | // /// return true if the jet is a pure-ghost jet
|
---|
| 107 | // virtual bool pass(const PseudoJet & jet) const { return _fn(jet) >= _ref; }
|
---|
| 108 | //
|
---|
| 109 | // /// returns a description of the worker
|
---|
| 110 | // virtual string description() const {
|
---|
| 111 | // ostringstream oss;
|
---|
| 112 | // oss << "(" << _fn.description() << " >= " << _ref << ")";
|
---|
| 113 | // return oss.str();
|
---|
| 114 | // }
|
---|
| 115 | //
|
---|
| 116 | // protected:
|
---|
| 117 | // const FunctionOfPseudoJet<double> & _fn;
|
---|
| 118 | // double _ref;
|
---|
| 119 | // };
|
---|
| 120 | //
|
---|
| 121 | //
|
---|
| 122 | // // select objects that are (or are only made of) ghosts
|
---|
| 123 | // Selector operator >=(const FunctionOfPseudoJet<double> & fn, const double & ref){
|
---|
| 124 | // return Selector(new SW_FofPJ_larger_equal(fn, ref));
|
---|
| 125 | // }
|
---|
| 126 | //
|
---|
| 127 | //
|
---|
| 128 | //
|
---|
| 129 | // //----------------------------------------------------------------------
|
---|
| 130 | // /// helper for the selector "FunctionOfPJ(jet) <= ref"
|
---|
| 131 | // class SW_FofPJ_smaller_equal : public SelectorWorker {
|
---|
| 132 | // public:
|
---|
| 133 | // /// ctor with specification of the number of objects to keep
|
---|
| 134 | // SW_FofPJ_smaller_equal(const FunctionOfPseudoJet<double> & fn, const double &ref)
|
---|
| 135 | // : _fn(fn), _ref(ref){}
|
---|
| 136 | //
|
---|
| 137 | // /// return true if the jet is a pure-ghost jet
|
---|
| 138 | // virtual bool pass(const PseudoJet & jet) const { return _fn(jet) <= _ref; }
|
---|
| 139 | //
|
---|
| 140 | // /// returns a description of the worker
|
---|
| 141 | // virtual string description() const {
|
---|
| 142 | // ostringstream oss;
|
---|
| 143 | // oss << "(" << _fn.description() << " <= " << _ref << ")";
|
---|
| 144 | // return oss.str();
|
---|
| 145 | // }
|
---|
| 146 | //
|
---|
| 147 | // protected:
|
---|
| 148 | // const FunctionOfPseudoJet<double> & _fn;
|
---|
| 149 | // double _ref;
|
---|
| 150 | // };
|
---|
| 151 | //
|
---|
| 152 | //
|
---|
| 153 | // // select objects that are (or are only made of) ghosts
|
---|
| 154 | // Selector operator <=(const FunctionOfPseudoJet<double> & fn, const double & ref){
|
---|
| 155 | // return Selector(new SW_FofPJ_smaller_equal(fn, ref));
|
---|
| 156 | // }
|
---|
| 157 | //
|
---|
| 158 |
|
---|
| 159 | FASTJET_END_NAMESPACE
|
---|