Changeset 35cdc46 in git for external/fastjet/tools/Filter.hh
- Timestamp:
- Sep 3, 2014, 3:18:54 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- be2222c
- Parents:
- 5b5a56b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/fastjet/tools/Filter.hh
r5b5a56b r35cdc46 2 2 #define __FASTJET_TOOLS_FILTER_HH__ 3 3 4 // STARTHEADER5 // $Id: Filter.hh 2694 2011-11-14 22:27:51Z salam$6 // 7 // Copyright (c) 2005-201 1, Matteo Cacciari, Gavin P. Salam and Gregory Soyez4 //FJSTARTHEADER 5 // $Id: Filter.hh 3494 2014-07-30 20:38:48Z soyez $ 6 // 7 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez 8 8 // 9 9 //---------------------------------------------------------------------- … … 16 16 // 17 17 // The algorithms that underlie FastJet have required considerable 18 // development and are described in hep-ph/0512210. If you use 18 // development. They are described in the original FastJet paper, 19 // hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use 19 20 // FastJet as part of work towards a scientific publication, please 20 // include a citation to the FastJet paper. 21 // quote the version you use and include a citation to the manual and 22 // optionally also to hep-ph/0512210. 21 23 // 22 24 // FastJet is distributed in the hope that it will be useful, … … 28 30 // along with FastJet. If not, see <http://www.gnu.org/licenses/>. 29 31 //---------------------------------------------------------------------- 30 // ENDHEADER32 //FJENDHEADER 31 33 32 34 #include <fastjet/ClusterSequence.hh> … … 98 100 /// Note: this is just for derived classes 99 101 /// a Filter initialised through this constructor will not work! 100 Filter() : _Rfiltfunc(0) {};102 Filter() : _Rfiltfunc(0), _initialised(false){}; 101 103 102 104 /// define a filter that decomposes a jet into subjets using a … … 113 115 /// ghosts 114 116 Filter(JetDefinition subjet_def, Selector selector, double rho = 0.0) : 115 _subjet_def(subjet_def), _Rfiltfunc(0), _Rfilt(-1), _selector(selector), _rho(rho), _subtractor(0) {}117 _subjet_def(subjet_def), _Rfiltfunc(0), _Rfilt(-1), _selector(selector), _rho(rho), _subtractor(0), _initialised(true) {} 116 118 117 119 /// Same as the full constructor (see above) but just specifying the radius … … 121 123 /// \param Rfilt the filtering radius 122 124 Filter(double Rfilt, Selector selector, double rho = 0.0) : 123 _Rfiltfunc(0), _Rfilt(Rfilt), _selector(selector), _rho(rho), _subtractor(0) {125 _Rfiltfunc(0), _Rfilt(Rfilt), _selector(selector), _rho(rho), _subtractor(0), _initialised(true) { 124 126 if (_Rfilt<0) 125 127 throw Error("Attempt to create a Filter with a negative filtering radius"); … … 133 135 /// \param Rfilt_func the filtering radius function of a PseudoJet 134 136 Filter(FunctionOfPseudoJet<double> *Rfilt_func, Selector selector, double rho = 0.0) : 135 _Rfiltfunc(Rfilt_func), _Rfilt(-1), _selector(selector), _rho(rho), _subtractor(0) {}137 _Rfiltfunc(Rfilt_func), _Rfilt(-1), _selector(selector), _rho(rho), _subtractor(0), _initialised(true) {} 136 138 137 139 /// default dtor … … 140 142 /// Set a subtractor that is applied to all individual subjets before 141 143 /// deciding which ones to keep. It takes precedence over a non-zero rho. 142 void set_subtractor(const Transformer* subtractor) {_subtractor = subtractor;}144 void set_subtractor(const FunctionOfPseudoJet<PseudoJet> * subtractor) {_subtractor = subtractor;} 143 145 144 146 /// runs the filtering and sets kept and rejected to be the jets of interest … … 159 161 /// It also sets the subjet_def to be used in joining things (the bit of 160 162 /// subjet def that is of interest for later is the recombiner). 161 void _set_filtered_elements(const PseudoJet & jet,162 std::vector<PseudoJet> & filtered_elements,163 JetDefinition & subjet_def,164 bool & discard_area) const;163 /// 164 /// this returns true if teh optimisation trick for C/A reclustering has been used 165 bool _set_filtered_elements(const PseudoJet & jet, 166 std::vector<PseudoJet> & filtered_elements) const; 165 167 166 /// set the filtered elements in the simple case of C/A+C/A167 void _set_filtered_elements_cafilt(const PseudoJet & jet,168 std::vector<PseudoJet> & filtered_elements,169 double Rfilt) const;170 171 /// set the filtered elements in the generic re-clustering case172 void _set_filtered_elements_generic(const PseudoJet & jet,173 std::vector<PseudoJet> & filtered_elements,174 const JetDefinition & subjet_def,175 bool do_areas) const;176 177 168 /// gather the information about what is kept and rejected under the 178 169 /// form of a PseudoJet with a special ClusterSequenceInfo 170 /// 171 /// The last argument (ca_optimisation_used) should be true if the 172 /// optimisation trick for C/A reclustering has been used (in which 173 /// case some extra tests have to be run for non-explicit-ghost 174 /// areas) 179 175 PseudoJet _finalise(const PseudoJet & jet, 180 176 std::vector<PseudoJet> & kept, 181 177 std::vector<PseudoJet> & rejected, 182 const JetDefinition & subjet_def, 183 const bool discard_area) const; 184 185 // a series of checks 186 //-------------------------------------------------------------------- 187 /// get the pieces down to the fundamental pieces 188 bool _get_all_pieces(const PseudoJet &jet, std::vector<PseudoJet> &all_pieces) const; 189 190 /// get the common recombiner to all pieces (NULL if none) 191 const JetDefinition::Recombiner* _get_common_recombiner(const std::vector<PseudoJet> &all_pieces) const; 192 193 /// check if one can apply the simplified trick for C/A subjets 194 bool _check_ca(const std::vector<PseudoJet> &all_pieces) const; 195 196 /// check if the jet (or all its pieces) have explicit ghosts 197 /// (assuming the jet has area support 198 /// 199 /// Note that if the jet has an associated cluster sequence that is no 200 /// longer valid, an error will be thrown 201 bool _check_explicit_ghosts(const std::vector<PseudoJet> &all_pieces) const; 178 bool ca_optimisation_used) const; 202 179 203 180 bool _uses_subtraction() const {return (_subtractor || _rho != 0);} … … 209 186 Selector _selector; ///< the subjet selection criterium 210 187 double _rho; ///< the background density (used for subtraction when possible) 211 const Transformer * _subtractor; ///< for subtracting bkgd density from subjets 188 const FunctionOfPseudoJet<PseudoJet> * _subtractor; ///< for subtracting bkgd density from subjets 189 190 bool _initialised; ///< true when the Filter has been properly intialised 212 191 }; 213 192
Note:
See TracChangeset
for help on using the changeset viewer.