Changeset 49234af in git for external/fastjet/JetDefinition.hh
- Timestamp:
- Dec 9, 2014, 1:27:13 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 37deb3b, 9e991f8
- Parents:
- f6b6ee7 (diff), e7e90df (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/fastjet/JetDefinition.hh
rf6b6ee7 r49234af 1 //STARTHEADER 2 // $Id: JetDefinition.hh 2687 2011-11-14 11:17:51Z soyez $ 3 // 4 // Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez 1 #ifndef __FASTJET_JETDEFINITION_HH__ 2 #define __FASTJET_JETDEFINITION_HH__ 3 4 //FJSTARTHEADER 5 // $Id: JetDefinition.hh 3677 2014-09-09 22:45:25Z soyez $ 6 // 7 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez 5 8 // 6 9 //---------------------------------------------------------------------- … … 13 16 // 14 17 // The algorithms that underlie FastJet have required considerable 15 // 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 16 20 // FastJet as part of work towards a scientific publication, please 17 // 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. 18 23 // 19 24 // FastJet is distributed in the hope that it will be useful, … … 25 30 // along with FastJet. If not, see <http://www.gnu.org/licenses/>. 26 31 //---------------------------------------------------------------------- 27 //ENDHEADER 28 29 #ifndef __FASTJET_JETDEFINITION_HH__ 30 #define __FASTJET_JETDEFINITION_HH__ 32 //FJENDHEADER 31 33 32 34 #include<cassert> … … 47 49 /// clustering events with kt and cambridge style algorithms. 48 50 enum Strategy { 49 /// fastest form about 500..10^4 51 /// Like N2MHTLazy9 in a number of respects, but does not calculate 52 /// ghost-ghost distances and so does not carry out ghost-ghost 53 /// recombination. 54 /// 55 /// If you want active ghosted areas, then this is only suitable for 56 /// use with the anti-kt algorithm (or genkt with negative p), and 57 /// does not produce any pure ghost jets. If used with active areas 58 /// with Kt or Cam algorithms it will actually produce a passive 59 /// area. 60 /// 61 /// Particles are deemed to be ghosts if their pt is below a 62 /// threshold (currently 1e-50, hard coded as ghost_limit in 63 /// LazyTiling9SeparateGhosts). 64 /// 65 /// Currently for events with a couple of thousand normal particles 66 /// and O(10k) ghosts, this can be quicker than N2MHTLazy9, which 67 /// would otherwise be the best strategy. 68 /// 69 /// New in FJ3.1 70 N2MHTLazy9AntiKtSeparateGhosts = -10, 71 /// only looks into a neighbouring tile for a particle's nearest 72 /// neighbour (NN) if that particle's in-tile NN is further than the 73 /// distance to the edge of the neighbouring tile. Uses tiles of 74 /// size R and a 3x3 tile grid around the particle. 75 /// New in FJ3.1 76 N2MHTLazy9 = -7, 77 /// Similar to N2MHTLazy9, but uses tiles of size R/2 and a 5x5 tile 78 /// grid around the particle. 79 /// New in FJ3.1 80 N2MHTLazy25 = -6, 81 /// Like to N2MHTLazy9 but uses slightly different optimizations, 82 /// e.g. for calculations of distance to nearest tile; as of 83 /// 2014-07-18 it is slightly slower and not recommended for 84 /// production use. To considered deprecated. 85 /// New in FJ3.1 86 N2MHTLazy9Alt = -5, 87 /// faster that N2Tiled above about 500 particles; differs from it 88 /// by retainig the di(closest j) distances in a MinHeap (sort of 89 /// priority queue) rather than a simple vector. 50 90 N2MinHeapTiled = -4, 51 91 /// fastest from about 50..500 … … 57 97 /// worse even than the usual N^3 algorithms 58 98 N3Dumb = 0, 59 /// automatic selection of the best (based on N) 99 /// automatic selection of the best (based on N), including 100 /// the LazyTiled strategies that are new to FJ3.1 60 101 Best = 1, 61 102 /// best of the NlnN variants -- best overall for N>10^4. … … 79 120 /// (Does not work for R>=2pi) 80 121 NlnNCam = 12, // 2piMultD 122 /// the automatic strategy choice that was being made in FJ 3.0 123 /// (restricted to strategies that were present in FJ 3.0) 124 BestFJ30 = 21, 81 125 /// the plugin has been used... 82 126 plugin_strategy = 999 … … 87 131 /// \enum JetAlgorithm 88 132 /// the various families of jet-clustering algorithm 133 // 134 // [Remember to update the "is_spherical()" routine if any further 135 // spherical algorithms are added to the list below] 89 136 enum JetAlgorithm { 90 137 /// the longitudinally invariant kt algorithm … … 102 149 /// where p = extra_param() 103 150 genkt_algorithm=3, 104 /// a version of cambridge with a special distance measure for particles 105 /// whose pt is < extra_param() 151 /// a version of cambridge with a special distance measure for 152 /// particles whose pt is < extra_param(); this is not usually 153 /// intended for end users, but is instead automatically selected 154 /// when requesting a passive Cambridge area. 106 155 cambridge_for_passive_algorithm=11, 107 156 /// a version of genkt with a special distance measure for particles 108 157 /// whose pt is < extra_param() [relevant for passive areas when p<=0] 158 /// ***** NB: THERE IS CURRENTLY NO IMPLEMENTATION FOR THIS ALG ******* 109 159 genkt_for_passive_algorithm=13, 110 160 //................................................................. … … 131 181 132 182 //====================================================================== 133 /// the various recombination schemes 183 /// The various recombination schemes 184 /// 185 /// Note that the schemes that recombine with non-linear weighting of 186 /// the directions (e.g. pt2, winner-takes-all) are collinear safe 187 /// only for algorithms with a suitable ordering of the 188 /// recombinations: orderings in which, for particles of comparable 189 /// energies, small-angle clusterings take place before large-angle 190 /// clusterings. This property is satisfied by all gen-kt algorithms. 191 /// 134 192 enum RecombinationScheme { 135 193 /// summing the 4-momenta … … 153 211 /// no preprocessing 154 212 BIpt2_scheme=6, 213 /// pt-based Winner-Takes-All (WTA) recombination: the 214 /// result of the recombination has the rapidity, azimuth and mass 215 /// of the the PseudoJet with the larger pt, and a pt equal to the 216 /// sum of the two pt's 217 WTA_pt_scheme=7, 218 /// mod-p-based Winner-Takes-All (WTA) recombination: the result of 219 /// the recombination gets the 3-vector direction and mass of the 220 /// PseudoJet with the larger |3-momentum| (modp), and a 221 /// |3-momentum| equal to the scalar sum of the two |3-momenta|. 222 WTA_modp_scheme=8, 223 // Energy-ordering can lead to dangerous situations with particles at 224 // rest. We instead implement the WTA_modp_scheme 225 // 226 // // energy-based Winner-Takes-All (WTA) recombination: the result of 227 // // the recombination gets the 3-vector direction and mass of the 228 // // PseudoJet with the larger energy, and an energy equal to the 229 // // to the sum of the two energies 230 // WTA_E_scheme=8, 155 231 /// for the user's external scheme 156 232 external_scheme = 99 … … 244 320 const Recombiner * recombiner_in, 245 321 Strategy strategy_in = Best) { 246 *this = JetDefinition(jet_algorithm_in, R_in, external_scheme, strategy_in);322 *this = JetDefinition(jet_algorithm_in, R_in, xtra_param_in, external_scheme, strategy_in); 247 323 _recombiner = recombiner_in; 248 set_extra_param(xtra_param_in);249 324 } 250 325 … … 284 359 RecombinationScheme recomb_scheme_in = E_scheme, 285 360 int nparameters_in = 1); 361 362 /// cluster the supplied particles and returns a vector of resulting 363 /// jets, sorted by pt (or energy in the case of spherical, 364 /// i.e. e+e-, algorithms). This routine currently only makes 365 /// sense for "inclusive" type algorithms. 366 template <class L> 367 std::vector<PseudoJet> operator()(const std::vector<L> & particles) const; 286 368 287 369 /// R values larger than max_allowable_R are not allowed. … … 297 379 298 380 /// set the recombiner class to the one provided 381 /// 382 /// Note that in order to associate to a jet definition a recombiner 383 /// from another jet definition, it is strongly recommended to use 384 /// the set_recombiner(const JetDefinition &) method below. The 385 /// latter correctly handles the situations where the jet definition 386 /// owns the recombiner (i.e. where delete_recombiner_when_unused 387 /// has been called). In such cases, using set_recombiner(const 388 /// Recombiner *) may lead to memory corruption. 299 389 void set_recombiner(const Recombiner * recomb) { 300 if (_ recombiner_shared()) _recombiner_shared.reset(recomb);390 if (_shared_recombiner()) _shared_recombiner.reset(recomb); 301 391 _recombiner = recomb; 302 392 _default_recombiner = DefaultRecombiner(external_scheme); 303 393 } 304 394 395 /// set the recombiner to be the same as the one of 'other_jet_def' 396 /// 397 /// Note that this is the recommended method to associate to a jet 398 /// definition the recombiner from another jet definition. Compared 399 /// to the set_recombiner(const Recombiner *) above, it correctly 400 /// handles the case where the jet definition owns the recombiner 401 /// (i.e. where delete_recombiner_when_unused has been called) 402 void set_recombiner(const JetDefinition &other_jet_def); 403 305 404 /// calling this tells the JetDefinition to handle the deletion of 306 /// the recombiner when it is no longer used 405 /// the recombiner when it is no longer used. (Should not be called 406 /// if the recombiner was initialised from a JetDef whose recombiner 407 /// was already scheduled to delete itself - memory handling will 408 /// already be automatic across both JetDef's in that case). 307 409 void delete_recombiner_when_unused(); 308 410 … … 310 412 const Plugin * plugin() const {return _plugin;}; 311 413 312 /// allows to let the JetDefinitionhandle the deletion of the414 /// calling this causes the JetDefinition to handle the deletion of the 313 415 /// plugin when it is no longer used 314 416 void delete_plugin_when_unused(); … … 333 435 void set_extra_param(double xtra_param) {_extra_param = xtra_param;} 334 436 335 /// return a pointer to the currently defined recombiner.437 /// returns a pointer to the currently defined recombiner. 336 438 /// 337 439 /// Warning: the pointer may be to an internal recombiner (for … … 347 449 348 450 /// returns true if the current jet definitions shares the same 349 /// recombiner as t ehone passed as an argument451 /// recombiner as the one passed as an argument 350 452 bool has_same_recombiner(const JetDefinition &other_jd) const; 453 454 /// returns true if the jet definition involves an algorithm 455 /// intended for use on a spherical geometry (e.g. e+e- algorithms, 456 /// as opposed to most pp algorithms, which use a cylindrical, 457 /// rapidity-phi geometry). 458 bool is_spherical() const; 351 459 352 460 /// return a textual description of the current jet definition 353 461 std::string description() const; 354 462 463 /// returns a description not including the recombiner information 464 std::string description_no_recombiner() const; 465 466 /// a short textual description of the algorithm jet_alg 467 static std::string algorithm_description(const JetAlgorithm jet_alg); 468 469 /// the number of parameters associated to a given jet algorithm 470 static unsigned int n_parameters_for_algorithm(const JetAlgorithm jet_alg); 355 471 356 472 public: … … 462 578 virtual bool exclusive_sequence_meaningful() const {return false;} 463 579 580 /// returns true if the plugin implements an algorithm intended 581 /// for use on a spherical geometry (e.g. e+e- algorithms, as 582 /// opposed to most pp algorithms, which use a cylindrical, 583 /// rapidity-phi geometry). 584 virtual bool is_spherical() const {return false;} 585 464 586 /// a destructor to be replaced if necessary in derived classes... 465 587 virtual ~Plugin() {}; … … 481 603 DefaultRecombiner _default_recombiner; 482 604 const Recombiner * _recombiner; 483 SharedPtr<const Recombiner> _ recombiner_shared;605 SharedPtr<const Recombiner> _shared_recombiner; 484 606 485 607 }; … … 516 638 517 639 518 519 520 521 640 FASTJET_END_NAMESPACE 522 641 642 // include ClusterSequence which includes the implementation of the 643 // templated JetDefinition::operator()(...) member 644 #include "fastjet/ClusterSequence.hh" 645 646 523 647 #endif // __FASTJET_JETDEFINITION_HH__
Note:
See TracChangeset
for help on using the changeset viewer.