Fork me on GitHub

source: git/external/fastjet/JetDefinition.hh@ c04eb8a

ImprovedOutputFile Timing dual_readout llp
Last change on this file since c04eb8a was 273e668, checked in by Pavel Demin <pavel.demin@…>, 10 years ago

upgrade FastJet to version 3.1.0

  • Property mode set to 100644
File size: 25.6 KB
RevLine 
[35cdc46]1#ifndef __FASTJET_JETDEFINITION_HH__
2#define __FASTJET_JETDEFINITION_HH__
3
4//FJSTARTHEADER
[273e668]5// $Id: JetDefinition.hh 3677 2014-09-09 22:45:25Z soyez $
[d7d2da3]6//
[35cdc46]7// Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
[d7d2da3]8//
9//----------------------------------------------------------------------
10// This file is part of FastJet.
11//
12// FastJet is free software; you can redistribute it and/or modify
13// it under the terms of the GNU General Public License as published by
14// the Free Software Foundation; either version 2 of the License, or
15// (at your option) any later version.
16//
17// The algorithms that underlie FastJet have required considerable
[35cdc46]18// development. They are described in the original FastJet paper,
19// hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
[d7d2da3]20// FastJet as part of work towards a scientific publication, please
[35cdc46]21// quote the version you use and include a citation to the manual and
22// optionally also to hep-ph/0512210.
[d7d2da3]23//
24// FastJet is distributed in the hope that it will be useful,
25// but WITHOUT ANY WARRANTY; without even the implied warranty of
26// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27// GNU General Public License for more details.
28//
29// You should have received a copy of the GNU General Public License
30// along with FastJet. If not, see <http://www.gnu.org/licenses/>.
31//----------------------------------------------------------------------
[35cdc46]32//FJENDHEADER
[d7d2da3]33
34#include<cassert>
35#include "fastjet/internal/numconsts.hh"
36#include "fastjet/PseudoJet.hh"
37#include<string>
38#include<memory>
39
40FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
41
42/// return a string containing information about the release
43// NB: (implemented in ClusterSequence.cc but defined here because
44// this is a visible location)
45std::string fastjet_version_string();
46
47//======================================================================
48/// the various options for the algorithmic strategy to adopt in
49/// clustering events with kt and cambridge style algorithms.
50enum Strategy {
[35cdc46]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.
[d7d2da3]90 N2MinHeapTiled = -4,
91 /// fastest from about 50..500
92 N2Tiled = -3,
93 /// legacy
94 N2PoorTiled = -2,
95 /// fastest below 50
96 N2Plain = -1,
97 /// worse even than the usual N^3 algorithms
98 N3Dumb = 0,
[35cdc46]99 /// automatic selection of the best (based on N), including
100 /// the LazyTiled strategies that are new to FJ3.1
[d7d2da3]101 Best = 1,
102 /// best of the NlnN variants -- best overall for N>10^4.
103 /// (Does not work for R>=2pi)
104 NlnN = 2,
105 /// legacy N ln N using 3pi coverage of cylinder.
106 /// (Does not work for R>=2pi)
107 NlnN3pi = 3,
108 /// legacy N ln N using 4pi coverage of cylinder
109 NlnN4pi = 4,
110 /// Chan's closest pair method (in a variant with 4pi coverage),
111 /// for use exclusively with the Cambridge algorithm.
112 /// (Does not work for R>=2pi)
113 NlnNCam4pi = 14,
114 /// Chan's closest pair method (in a variant with 2pi+2R coverage),
115 /// for use exclusively with the Cambridge algorithm.
116 /// (Does not work for R>=2pi)
117 NlnNCam2pi2R = 13,
118 /// Chan's closest pair method (in a variant with 2pi+minimal extra
119 /// variant), for use exclusively with the Cambridge algorithm.
120 /// (Does not work for R>=2pi)
121 NlnNCam = 12, // 2piMultD
[35cdc46]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,
[d7d2da3]125 /// the plugin has been used...
126 plugin_strategy = 999
127};
128
129
130//======================================================================
131/// \enum JetAlgorithm
132/// the various families of jet-clustering algorithm
[35cdc46]133//
134// [Remember to update the "is_spherical()" routine if any further
135// spherical algorithms are added to the list below]
[d7d2da3]136enum JetAlgorithm {
137 /// the longitudinally invariant kt algorithm
138 kt_algorithm=0,
139 /// the longitudinally invariant variant of the cambridge algorithm
140 /// (aka Aachen algoithm).
141 cambridge_algorithm=1,
142 /// like the k_t but with distance measures
143 /// dij = min(1/kti^2,1/ktj^2) Delta R_{ij}^2 / R^2
144 /// diB = 1/kti^2
145 antikt_algorithm=2,
146 /// like the k_t but with distance measures
147 /// dij = min(kti^{2p},ktj^{2p}) Delta R_{ij}^2 / R^2
148 /// diB = 1/kti^{2p}
149 /// where p = extra_param()
150 genkt_algorithm=3,
[35cdc46]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.
[d7d2da3]155 cambridge_for_passive_algorithm=11,
156 /// a version of genkt with a special distance measure for particles
157 /// whose pt is < extra_param() [relevant for passive areas when p<=0]
[35cdc46]158 /// ***** NB: THERE IS CURRENTLY NO IMPLEMENTATION FOR THIS ALG *******
[d7d2da3]159 genkt_for_passive_algorithm=13,
160 //.................................................................
161 /// the e+e- kt algorithm
162 ee_kt_algorithm=50,
163 /// the e+e- genkt algorithm (R > 2 and p=1 gives ee_kt)
164 ee_genkt_algorithm=53,
165 //.................................................................
166 /// any plugin algorithm supplied by the user
167 plugin_algorithm = 99,
168 //.................................................................
169 /// the value for the jet algorithm in a JetDefinition for which
170 /// no algorithm has yet been defined
171 undefined_jet_algorithm = 999
172};
173
174/// make standard Les Houches nomenclature JetAlgorithm (algorithm is general
175/// recipe without the parameters) backward-compatible with old JetFinder
176typedef JetAlgorithm JetFinder;
177
178/// provide other possible names for the Cambridge/Aachen algorithm
179const JetAlgorithm aachen_algorithm = cambridge_algorithm;
180const JetAlgorithm cambridge_aachen_algorithm = cambridge_algorithm;
181
182//======================================================================
[273e668]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///
[d7d2da3]192enum RecombinationScheme {
193 /// summing the 4-momenta
194 E_scheme=0,
195 /// pt weighted recombination of y,phi (and summing of pt's)
196 /// with preprocessing to make things massless by rescaling E=|\vec p|
197 pt_scheme=1,
198 /// pt^2 weighted recombination of y,phi (and summing of pt's)
199 /// with preprocessing to make things massless by rescaling E=|\vec p|
200 pt2_scheme=2,
201 /// pt weighted recombination of y,phi (and summing of pt's)
202 /// with preprocessing to make things massless by rescaling |\vec p|->=E
203 Et_scheme=3,
204 /// pt^2 weighted recombination of y,phi (and summing of pt's)
205 /// with preprocessing to make things massless by rescaling |\vec p|->=E
206 Et2_scheme=4,
207 /// pt weighted recombination of y,phi (and summing of pt's), with
208 /// no preprocessing
209 BIpt_scheme=5,
210 /// pt^2 weighted recombination of y,phi (and summing of pt's)
211 /// no preprocessing
212 BIpt2_scheme=6,
[273e668]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,
[d7d2da3]231 /// for the user's external scheme
232 external_scheme = 99
233};
234
235
236
237// forward declaration, needed in order to specify interface for the
238// plugin.
239class ClusterSequence;
240
241
242
243
244//======================================================================
245/// @ingroup basic_classes
246/// \class JetDefinition
247/// class that is intended to hold a full definition of the jet
248/// clusterer
249class JetDefinition {
250
251public:
252
253 /// forward declaration of a class that allows the user to introduce
254 /// their own plugin
255 class Plugin;
256
257 // forward declaration of a class that will provide the
258 // recombination scheme facilities and/or allow a user to
259 // extend these facilities
260 class Recombiner;
261
262
263 /// constructor with alternative ordering or arguments -- note that
264 /// we have not provided a default jet finder, to avoid ambiguous
265 /// JetDefinition() constructor.
266 JetDefinition(JetAlgorithm jet_algorithm_in,
267 double R_in,
268 RecombinationScheme recomb_scheme_in = E_scheme,
269 Strategy strategy_in = Best) {
270 *this = JetDefinition(jet_algorithm_in, R_in, strategy_in, recomb_scheme_in, 1);
271 }
272
273 /// constructor for algorithms that have no free parameters
274 /// (e.g. ee_kt_algorithm)
275 JetDefinition(JetAlgorithm jet_algorithm_in,
276 RecombinationScheme recomb_scheme_in = E_scheme,
277 Strategy strategy_in = Best) {
278 double dummyR = 0.0;
279 *this = JetDefinition(jet_algorithm_in, dummyR, strategy_in, recomb_scheme_in, 0);
280 }
281
282 /// constructor for algorithms that require R + one extra parameter to be set
283 /// (the gen-kt series for example)
284 JetDefinition(JetAlgorithm jet_algorithm_in,
285 double R_in,
286 double xtra_param_in,
287 RecombinationScheme recomb_scheme_in = E_scheme,
288 Strategy strategy_in = Best) {
289 *this = JetDefinition(jet_algorithm_in, R_in, strategy_in, recomb_scheme_in, 2);
290 set_extra_param(xtra_param_in);
291 }
292
293
294 /// constructor in a form that allows the user to provide a pointer
295 /// to an external recombiner class (which must remain valid for the
296 /// life of the JetDefinition object).
297 JetDefinition(JetAlgorithm jet_algorithm_in,
298 double R_in,
299 const Recombiner * recombiner_in,
300 Strategy strategy_in = Best) {
301 *this = JetDefinition(jet_algorithm_in, R_in, external_scheme, strategy_in);
302 _recombiner = recombiner_in;
303 }
304
305
306 /// constructor for case with 0 parameters (ee_kt_algorithm) and
307 /// and external recombiner
308 JetDefinition(JetAlgorithm jet_algorithm_in,
309 const Recombiner * recombiner_in,
310 Strategy strategy_in = Best) {
311 *this = JetDefinition(jet_algorithm_in, external_scheme, strategy_in);
312 _recombiner = recombiner_in;
313 }
314
315 /// constructor allowing the extra parameter to be set and a pointer to
316 /// a recombiner
317 JetDefinition(JetAlgorithm jet_algorithm_in,
318 double R_in,
319 double xtra_param_in,
320 const Recombiner * recombiner_in,
321 Strategy strategy_in = Best) {
[35cdc46]322 *this = JetDefinition(jet_algorithm_in, R_in, xtra_param_in, external_scheme, strategy_in);
[d7d2da3]323 _recombiner = recombiner_in;
324 }
325
326 /// a default constructor which creates a jet definition that is in
327 /// a well-defined internal state, but not actually usable for jet
328 /// clustering.
329 JetDefinition() {
330 *this = JetDefinition(undefined_jet_algorithm, 1.0);
331 }
332
333
334 // /// a default constructor
335 // JetDefinition() {
336 // *this = JetDefinition(kt_algorithm, 1.0);
337 // }
338
339 /// constructor based on a pointer to a user's plugin; the object
340 /// pointed to must remain valid for the whole duration of existence
341 /// of the JetDefinition and any related ClusterSequences
342 JetDefinition(const Plugin * plugin_in) {
343 _plugin = plugin_in;
344 _strategy = plugin_strategy;
345 _Rparam = _plugin->R();
346 _jet_algorithm = plugin_algorithm;
347 set_recombination_scheme(E_scheme);
348 }
349
350
351 /// constructor to fully specify a jet-definition (together with
352 /// information about how algorithically to run it).
353 ///
354 /// the ordering of arguments here is old and deprecated (except
355 /// as the common constructor for internal use)
356 JetDefinition(JetAlgorithm jet_algorithm_in,
357 double R_in,
358 Strategy strategy_in,
359 RecombinationScheme recomb_scheme_in = E_scheme,
360 int nparameters_in = 1);
[35cdc46]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;
[d7d2da3]368
369 /// R values larger than max_allowable_R are not allowed.
370 ///
371 /// We use a value of 1000, substantially smaller than
372 /// numeric_limits<double>::max(), to leave room for the convention
373 /// within PseudoJet of setting unphysical (infinite) rapidities to
374 /// +-(MaxRap + abs(pz())), where MaxRap is 10^5.
375 static const double max_allowable_R; //= 1000.0;
376
377 /// set the recombination scheme to the one provided
378 void set_recombination_scheme(RecombinationScheme);
379
380 /// set the recombiner class to the one provided
[35cdc46]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.
[d7d2da3]389 void set_recombiner(const Recombiner * recomb) {
[35cdc46]390 if (_shared_recombiner()) _shared_recombiner.reset(recomb);
[d7d2da3]391 _recombiner = recomb;
392 _default_recombiner = DefaultRecombiner(external_scheme);
393 }
394
[35cdc46]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
[d7d2da3]404 /// calling this tells the JetDefinition to handle the deletion of
[35cdc46]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).
[d7d2da3]409 void delete_recombiner_when_unused();
410
411 /// return a pointer to the plugin
412 const Plugin * plugin() const {return _plugin;};
413
[35cdc46]414 /// calling this causes the JetDefinition to handle the deletion of the
[d7d2da3]415 /// plugin when it is no longer used
416 void delete_plugin_when_unused();
417
418 /// return information about the definition...
419 JetAlgorithm jet_algorithm () const {return _jet_algorithm ;}
420 /// same as above for backward compatibility
421 JetAlgorithm jet_finder () const {return _jet_algorithm ;}
422 double R () const {return _Rparam ;}
423 // a general purpose extra parameter, whose meaning depends on
424 // the algorithm, and may often be unused.
425 double extra_param () const {return _extra_param ;}
426 Strategy strategy () const {return _strategy ;}
427 RecombinationScheme recombination_scheme() const {
428 return _default_recombiner.scheme();}
429
430 /// (re)set the jet finder
431 void set_jet_algorithm(JetAlgorithm njf) {_jet_algorithm = njf;}
432 /// same as above for backward compatibility
433 void set_jet_finder(JetAlgorithm njf) {_jet_algorithm = njf;}
434 /// (re)set the general purpose extra parameter
435 void set_extra_param(double xtra_param) {_extra_param = xtra_param;}
436
[35cdc46]437 /// returns a pointer to the currently defined recombiner.
[d7d2da3]438 ///
439 /// Warning: the pointer may be to an internal recombiner (for
440 /// default recombination schemes), in which case if the
441 /// JetDefinition becomes invalid (e.g. is deleted), the pointer
442 /// will then point to an object that no longer exists.
443 ///
444 /// Note also that if you copy a JetDefinition with a default
445 /// recombination scheme, then the two copies will have distinct
446 /// recombiners, and return different recombiner() pointers.
447 const Recombiner * recombiner() const {
448 return _recombiner == 0 ? & _default_recombiner : _recombiner;}
449
450 /// returns true if the current jet definitions shares the same
[35cdc46]451 /// recombiner as the one passed as an argument
[d7d2da3]452 bool has_same_recombiner(const JetDefinition &other_jd) const;
453
[35cdc46]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;
459
[d7d2da3]460 /// return a textual description of the current jet definition
461 std::string description() const;
462
[35cdc46]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);
[d7d2da3]471
472public:
473 //======================================================================
474 /// @ingroup advanced_usage
475 /// \class Recombiner
476 /// An abstract base class that will provide the recombination scheme
477 /// facilities and/or allow a user to extend these facilities
478 class Recombiner {
479 public:
480 /// return a textual description of the recombination scheme
481 /// implemented here
482 virtual std::string description() const = 0;
483
484 /// recombine pa and pb and put result into pab
485 virtual void recombine(const PseudoJet & pa, const PseudoJet & pb,
486 PseudoJet & pab) const = 0;
487
488 /// routine called to preprocess each input jet (to make all input
489 /// jets compatible with the scheme requirements (e.g. massless).
490 virtual void preprocess(PseudoJet & ) const {};
491
492 /// a destructor to be replaced if necessary in derived classes...
493 virtual ~Recombiner() {};
494
495 /// pa += pb in the given recombination scheme. Not virtual -- the
496 /// user should have no reason to want to redefine this!
497 inline void plus_equal(PseudoJet & pa, const PseudoJet & pb) const {
498 // put result in a temporary location in case the recombiner
499 // does something funny (ours doesn't, but who knows about the
500 // user's)
501 PseudoJet pres;
502 recombine(pa,pb,pres);
503 pa = pres;
504 }
505
506 };
507
508
509 //======================================================================
510 /// @ingroup advanced_usage
511 /// \class DefaultRecombiner
512 /// A class that will provide the recombination scheme facilities and/or
513 /// allow a user to extend these facilities
514 ///
515 /// This class is derived from the (abstract) class Recombiner. It
516 /// simply "sums" PseudoJets using a specified recombination scheme
517 /// (E-scheme by default)
518 class DefaultRecombiner : public Recombiner {
519 public:
520 DefaultRecombiner(RecombinationScheme recomb_scheme = E_scheme) :
521 _recomb_scheme(recomb_scheme) {}
522
523 virtual std::string description() const;
524
525 /// recombine pa and pb and put result into pab
526 virtual void recombine(const PseudoJet & pa, const PseudoJet & pb,
527 PseudoJet & pab) const;
528
529 virtual void preprocess(PseudoJet & p) const;
530
531 /// return the index of the recombination scheme
532 RecombinationScheme scheme() const {return _recomb_scheme;}
533
534 private:
535 RecombinationScheme _recomb_scheme;
536 };
537
538
539 //======================================================================
540 /// @ingroup advanced_usage
541 /// \class Plugin
542 /// a class that allows a user to introduce their own "plugin" jet
543 /// finder
544 ///
545 /// Note that all the plugins provided with FastJet are derived from
546 /// this class
547 class Plugin{
548 public:
549 /// return a textual description of the jet-definition implemented
550 /// in this plugin
551 virtual std::string description() const = 0;
552
553 /// given a ClusterSequence that has been filled up with initial
554 /// particles, the following function should fill up the rest of the
555 /// ClusterSequence, using the following member functions of
556 /// ClusterSequence:
557 /// - plugin_do_ij_recombination(...)
558 /// - plugin_do_iB_recombination(...)
559 virtual void run_clustering(ClusterSequence &) const = 0;
560
561 virtual double R() const = 0;
562
563 /// return true if there is specific support for the measurement
564 /// of passive areas, in the sense that areas determined from all
565 /// particles below the ghost separation scale will be a passive
566 /// area. [If you don't understand this, ignore it!]
567 virtual bool supports_ghosted_passive_areas() const {return false;}
568
569 /// set the ghost separation scale for passive area determinations
570 /// in future runs (strictly speaking that makes the routine
571 /// a non const, so related internal info must be stored as a mutable)
572 virtual void set_ghost_separation_scale(double scale) const;
573 virtual double ghost_separation_scale() const {return 0.0;}
574
575 /// if this returns false then a warning will be given
576 /// whenever the user requests "exclusive" jets from the
577 /// cluster sequence
578 virtual bool exclusive_sequence_meaningful() const {return false;}
579
[35cdc46]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
[d7d2da3]586 /// a destructor to be replaced if necessary in derived classes...
587 virtual ~Plugin() {};
588 };
589
590private:
591
592
593 JetAlgorithm _jet_algorithm;
594 double _Rparam;
595 double _extra_param ; ///< parameter whose meaning varies according to context
596 Strategy _strategy ;
597
598 const Plugin * _plugin;
599 SharedPtr<const Plugin> _plugin_shared;
600
601 // when we use our own recombiner it's useful to point to it here
602 // so that we don't have to worry about deleting it etc...
603 DefaultRecombiner _default_recombiner;
604 const Recombiner * _recombiner;
[35cdc46]605 SharedPtr<const Recombiner> _shared_recombiner;
[d7d2da3]606
607};
608
609
610//-------------------------------------------------------------------------------
611// helper functions to build a jet made of pieces
612//
613// These functions include an options recombiner used to compute the
614// total composite jet momentum
615// -------------------------------------------------------------------------------
616
617/// build a "CompositeJet" from the vector of its pieces
618///
619/// In this case, E-scheme recombination is assumed to compute the
620/// total momentum
621PseudoJet join(const std::vector<PseudoJet> & pieces, const JetDefinition::Recombiner & recombiner);
622
623/// build a MergedJet from a single PseudoJet
624PseudoJet join(const PseudoJet & j1,
625 const JetDefinition::Recombiner & recombiner);
626
627/// build a MergedJet from 2 PseudoJet
628PseudoJet join(const PseudoJet & j1, const PseudoJet & j2,
629 const JetDefinition::Recombiner & recombiner);
630
631/// build a MergedJet from 3 PseudoJet
632PseudoJet join(const PseudoJet & j1, const PseudoJet & j2, const PseudoJet & j3,
633 const JetDefinition::Recombiner & recombiner);
634
635/// build a MergedJet from 4 PseudoJet
636PseudoJet join(const PseudoJet & j1, const PseudoJet & j2, const PseudoJet & j3, const PseudoJet & j4,
637 const JetDefinition::Recombiner & recombiner);
638
639
[35cdc46]640FASTJET_END_NAMESPACE
[d7d2da3]641
[35cdc46]642// include ClusterSequence which includes the implementation of the
643// templated JetDefinition::operator()(...) member
644#include "fastjet/ClusterSequence.hh"
[d7d2da3]645
646
647#endif // __FASTJET_JETDEFINITION_HH__
Note: See TracBrowser for help on using the repository browser.