FastJet  3.0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
PxConePlugin.hh
1 //STARTHEADER
2 // $Id: PxConePlugin.hh 2758 2011-11-24 08:31:58Z soyez $
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 #ifndef __PXCONEPLUGIN_HH__
30 #define __PXCONEPLUGIN_HH__
31 
32 #include "fastjet/JetDefinition.hh"
33 
34 // questionable whether this should be in fastjet namespace or not...
35 
36 FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
37 
38 //----------------------------------------------------------------------
39 //
40 /// @ingroup plugins
41 /// \class PxConePlugin
42 /// Implementation of the PxCone algorithm (plugin for fastjet v2.1 upwards)
43 ///
44 /// PxConePlugin is a plugin for fastjet (v2.1 upwards) that provides
45 /// an interface to the fortran pxcone iterative cone algorithm with
46 /// midpoint seeds.
47 ///
48 /// Pxcone was written by Luis del Pozo and Michael H. Seymour. It is
49 /// not a "supported" program, so if you encounter problems, you are
50 /// on your own...
51 ///
52 /// Note that pxcone sometimes encounters non-stable iterations; in
53 /// such cases it returns an error -- the plugin propagates this by
54 /// throwing a fastjet::Error exception; if the user wishes to have
55 /// robust code, they should catch this exception.
56 ///
57 /// Pxcone has a hard-coded limit (by default 4000) on the maximum
58 /// number of particles and protojets; if the number of particles or
59 /// protojets exceeds this, again a fastjet::Error exception will be
60 /// thrown.
61 ///
62 /// The functionality of pxcone is described at
63 /// http://www.hep.man.ac.uk/u/wplano/ConeJet.ps
64 //
65 //----------------------------------------------------------------------
67 public:
68 
69  /// constructor for the PxConePlugin, whose arguments have the
70  /// following meaning:
71  ///
72  /// - the cone_radius is as usual in cone algorithms
73  ///
74  /// - stables cones (protojets) below min_jet_energy are discarded
75  /// before calling the splitting procedure to resolve overlaps
76  /// (called epslon in pxcone).
77  ///
78  /// - when two protojets overlap, if
79  /// (overlapping_Et)/(Et_of_softer_protojet) < overlap_threshold
80  /// the overlapping energy is split between the two protojets;
81  /// otherwise the less energetic protojet is discarded. Called
82  /// ovlim in pxcone.
83  ///
84  /// - pxcone carries out p-scheme recombination, and the resulting
85  /// jets are massless; setting E_scheme_jets = true (default
86  /// false) doesn't change the jet composition, but the final
87  /// momentum sum for the jets is carried out by direct
88  /// four-vector addition instead of p-scheme recombination.
89  ///
90  PxConePlugin (double cone_radius_in ,
91  double min_jet_energy_in = 5.0 ,
92  double overlap_threshold_in = 0.5,
93  bool E_scheme_jets_in = false) :
94  _cone_radius (cone_radius_in ),
95  _min_jet_energy (min_jet_energy_in ),
96  _overlap_threshold (overlap_threshold_in),
97  _E_scheme_jets (E_scheme_jets_in ) {}
98 
99 
100  // some functions to return info about parameters ----------------
101 
102  /// the cone radius
103  double cone_radius () const {return _cone_radius ;}
104 
105  /// minimum jet energy (protojets below this are thrown own before
106  /// merging/splitting) -- called epslon in pxcone
107  double min_jet_energy () const {return _min_jet_energy ;}
108 
109  /// Maximum fraction of overlap energy in a jet -- called ovlim in pxcone.
110  double overlap_threshold () const {return _overlap_threshold ;}
111 
112  /// if true then the final jets are returned as the E-scheme recombination
113  /// of the particle momenta (by default, pxcone returns massless jets with
114  /// a mean phi,eta type of recombination); regardless of what is
115  /// returned, the internal pxcone jet-finding procedure is
116  /// unaffected.
117  bool E_scheme_jets() const {return _E_scheme_jets ;}
118 
119 
120  // the things that are required by base class
121  virtual std::string description () const;
122  virtual void run_clustering(ClusterSequence &) const;
123  /// the plugin mechanism's standard way of accessing the jet radius
124  virtual double R() const {return cone_radius();}
125 
126 private:
127 
128  double _cone_radius ;
129  double _min_jet_energy ;
130  double _overlap_threshold ;
131 
132  bool _E_scheme_jets;
133 
134  static bool _first_time;
135 
136  /// print a banner for reference to the 3rd-party code
137  void _print_banner(std::ostream *ostr) const;
138 };
139 
140 FASTJET_END_NAMESPACE // defined in fastjet/internal/base.hh
141 
142 #endif // __PXCONEPLUGIN_HH__