Changeset 35cdc46 in git for external/fastjet/JetDefinition.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/JetDefinition.hh
r5b5a56b r35cdc46 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 3523 2014-08-02 13:15:21Z salam $ 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 //................................................................. … … 244 294 const Recombiner * recombiner_in, 245 295 Strategy strategy_in = Best) { 246 *this = JetDefinition(jet_algorithm_in, R_in, external_scheme, strategy_in);296 *this = JetDefinition(jet_algorithm_in, R_in, xtra_param_in, external_scheme, strategy_in); 247 297 _recombiner = recombiner_in; 248 set_extra_param(xtra_param_in);249 298 } 250 299 … … 284 333 RecombinationScheme recomb_scheme_in = E_scheme, 285 334 int nparameters_in = 1); 335 336 /// cluster the supplied particles and returns a vector of resulting 337 /// jets, sorted by pt (or energy in the case of spherical, 338 /// i.e. e+e-, algorithms). This routine currently only makes 339 /// sense for "inclusive" type algorithms. 340 template <class L> 341 std::vector<PseudoJet> operator()(const std::vector<L> & particles) const; 286 342 287 343 /// R values larger than max_allowable_R are not allowed. … … 297 353 298 354 /// set the recombiner class to the one provided 355 /// 356 /// Note that in order to associate to a jet definition a recombiner 357 /// from another jet definition, it is strongly recommended to use 358 /// the set_recombiner(const JetDefinition &) method below. The 359 /// latter correctly handles the situations where the jet definition 360 /// owns the recombiner (i.e. where delete_recombiner_when_unused 361 /// has been called). In such cases, using set_recombiner(const 362 /// Recombiner *) may lead to memory corruption. 299 363 void set_recombiner(const Recombiner * recomb) { 300 if (_ recombiner_shared()) _recombiner_shared.reset(recomb);364 if (_shared_recombiner()) _shared_recombiner.reset(recomb); 301 365 _recombiner = recomb; 302 366 _default_recombiner = DefaultRecombiner(external_scheme); 303 367 } 304 368 369 /// set the recombiner to be the same as the one of 'other_jet_def' 370 /// 371 /// Note that this is the recommended method to associate to a jet 372 /// definition the recombiner from another jet definition. Compared 373 /// to the set_recombiner(const Recombiner *) above, it correctly 374 /// handles the case where the jet definition owns the recombiner 375 /// (i.e. where delete_recombiner_when_unused has been called) 376 void set_recombiner(const JetDefinition &other_jet_def); 377 305 378 /// calling this tells the JetDefinition to handle the deletion of 306 /// the recombiner when it is no longer used 379 /// the recombiner when it is no longer used. (Should not be called 380 /// if the recombiner was initialised from a JetDef whose recombiner 381 /// was already scheduled to delete itself - memory handling will 382 /// already be automatic across both JetDef's in that case). 307 383 void delete_recombiner_when_unused(); 308 384 … … 310 386 const Plugin * plugin() const {return _plugin;}; 311 387 312 /// allows to let the JetDefinitionhandle the deletion of the388 /// calling this causes the JetDefinition to handle the deletion of the 313 389 /// plugin when it is no longer used 314 390 void delete_plugin_when_unused(); … … 333 409 void set_extra_param(double xtra_param) {_extra_param = xtra_param;} 334 410 335 /// return a pointer to the currently defined recombiner.411 /// returns a pointer to the currently defined recombiner. 336 412 /// 337 413 /// Warning: the pointer may be to an internal recombiner (for … … 347 423 348 424 /// returns true if the current jet definitions shares the same 349 /// recombiner as t ehone passed as an argument425 /// recombiner as the one passed as an argument 350 426 bool has_same_recombiner(const JetDefinition &other_jd) const; 427 428 /// returns true if the jet definition involves an algorithm 429 /// intended for use on a spherical geometry (e.g. e+e- algorithms, 430 /// as opposed to most pp algorithms, which use a cylindrical, 431 /// rapidity-phi geometry). 432 bool is_spherical() const; 351 433 352 434 /// return a textual description of the current jet definition 353 435 std::string description() const; 354 436 437 /// returns a description not including the recombiner information 438 std::string description_no_recombiner() const; 439 440 /// a short textual description of the algorithm jet_alg 441 static std::string algorithm_description(const JetAlgorithm jet_alg); 442 443 /// the number of parameters associated to a given jet algorithm 444 static unsigned int n_parameters_for_algorithm(const JetAlgorithm jet_alg); 355 445 356 446 public: … … 462 552 virtual bool exclusive_sequence_meaningful() const {return false;} 463 553 554 /// returns true if the plugin implements an algorithm intended 555 /// for use on a spherical geometry (e.g. e+e- algorithms, as 556 /// opposed to most pp algorithms, which use a cylindrical, 557 /// rapidity-phi geometry). 558 virtual bool is_spherical() const {return false;} 559 464 560 /// a destructor to be replaced if necessary in derived classes... 465 561 virtual ~Plugin() {}; … … 481 577 DefaultRecombiner _default_recombiner; 482 578 const Recombiner * _recombiner; 483 SharedPtr<const Recombiner> _ recombiner_shared;579 SharedPtr<const Recombiner> _shared_recombiner; 484 580 485 581 }; … … 516 612 517 613 518 519 520 521 614 FASTJET_END_NAMESPACE 522 615 616 // include ClusterSequence which includes the implementation of the 617 // templated JetDefinition::operator()(...) member 618 #include "fastjet/ClusterSequence.hh" 619 620 523 621 #endif // __FASTJET_JETDEFINITION_HH__
Note:
See TracChangeset
for help on using the changeset viewer.