00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef __FASTJET_JETDEFINITION_HH__
00032 #define __FASTJET_JETDEFINITION_HH__
00033
00034 #include<cassert>
00035 #include "fastjet/internal/numconsts.hh"
00036 #include "fastjet/PseudoJet.hh"
00037 #include<string>
00038 #include<memory>
00039
00040 FASTJET_BEGIN_NAMESPACE
00041
00043
00044
00045 std::string fastjet_version_string();
00046
00047
00050 enum Strategy {
00052 N2MinHeapTiled = -4,
00054 N2Tiled = -3,
00056 N2PoorTiled = -2,
00058 N2Plain = -1,
00060 N3Dumb = 0,
00062 Best = 1,
00064 NlnN = 2,
00066 NlnN3pi = 3,
00068 NlnN4pi = 4,
00071 NlnNCam4pi = 14,
00072 NlnNCam2pi2R = 13,
00073 NlnNCam = 12,
00075 plugin_strategy = 999
00076 };
00077
00078
00079
00081 enum JetAlgorithm {
00083 kt_algorithm=0,
00086 cambridge_algorithm=1,
00090 antikt_algorithm=2,
00094 genkt_algorithm=3,
00097 cambridge_for_passive_algorithm=11,
00100 genkt_for_passive_algorithm=13,
00102 plugin_algorithm = 99
00103 };
00104
00107 typedef JetAlgorithm JetFinder;
00108
00110 const JetAlgorithm aachen_algorithm = cambridge_algorithm;
00111 const JetAlgorithm cambridge_aachen_algorithm = cambridge_algorithm;
00112
00113
00115 enum RecombinationScheme {
00117 E_scheme=0,
00120 pt_scheme=1,
00123 pt2_scheme=2,
00126 Et_scheme=3,
00129 Et2_scheme=4,
00132 BIpt_scheme=5,
00135 BIpt2_scheme=6,
00137 external_scheme = 99
00138 };
00139
00140
00141
00142
00143
00144
00145 class ClusterSequence;
00146
00147
00148
00149
00150
00153 class JetDefinition {
00154
00155 public:
00156
00159 class Plugin;
00160
00161
00162
00163
00164 class Recombiner;
00165
00169 JetDefinition(JetAlgorithm jet_algorithm,
00170 double R,
00171 Strategy strategy,
00172 RecombinationScheme recomb_scheme = E_scheme) :
00173 _jet_algorithm(jet_algorithm), _Rparam(R), _strategy(strategy) {
00174
00175 assert(_Rparam <= 0.5*pi);
00176 assert(_jet_algorithm != plugin_algorithm &&
00177 _strategy != plugin_strategy);
00178 _plugin = NULL;
00179 set_recombination_scheme(recomb_scheme);
00180 }
00181
00182
00186 JetDefinition(JetAlgorithm jet_algorithm = kt_algorithm,
00187 double R = 1.0,
00188 RecombinationScheme recomb_scheme = E_scheme,
00189 Strategy strategy = Best) {
00190 *this = JetDefinition(jet_algorithm, R, strategy, recomb_scheme);
00191 }
00192
00193
00197 JetDefinition(JetAlgorithm jet_algorithm,
00198 double R,
00199 const Recombiner * recombiner,
00200 Strategy strategy = Best) {
00201 *this = JetDefinition(jet_algorithm, R, strategy, external_scheme);
00202 _recombiner = recombiner;
00203 }
00204
00208 JetDefinition(const Plugin * plugin) {
00209 _plugin = plugin;
00210 _strategy = plugin_strategy;
00211 _Rparam = _plugin->R();
00212 _jet_algorithm = plugin_algorithm;
00213 set_recombination_scheme(E_scheme);
00214 }
00215
00217 void set_recombination_scheme(RecombinationScheme);
00218
00220 void set_recombiner(const Recombiner * recomb) {
00221 _recombiner = recomb;
00222 _default_recombiner = DefaultRecombiner(external_scheme);
00223 }
00224
00226 const Plugin * plugin() const {return _plugin;};
00227
00229 JetAlgorithm jet_algorithm () const {return _jet_algorithm ;}
00231 JetAlgorithm jet_finder () const {return _jet_algorithm ;}
00232 double R () const {return _Rparam ;}
00233
00234
00235 double extra_param () const {return _extra_param ;}
00236 Strategy strategy () const {return _strategy ;}
00237 RecombinationScheme recombination_scheme() const {
00238 return _default_recombiner.scheme();}
00239
00241 void set_jet_algorithm(JetAlgorithm njf) {_jet_algorithm = njf;}
00243 void set_jet_finder(JetAlgorithm njf) {_jet_algorithm = njf;}
00245 void set_extra_param(double xtra_param) {_extra_param = xtra_param;}
00246
00249 const Recombiner * recombiner() const {
00250 return _recombiner == 0 ? & _default_recombiner : _recombiner;}
00251
00253 std::string description() const;
00254
00255
00256 public:
00257
00260 class Recombiner {
00261 public:
00264 virtual std::string description() const = 0;
00265
00267 virtual void recombine(const PseudoJet & pa, const PseudoJet & pb,
00268 PseudoJet & pab) const = 0;
00269
00272 virtual void preprocess(PseudoJet & p) const {};
00273
00275 virtual ~Recombiner() {};
00276
00279 inline void plus_equal(PseudoJet & pa, const PseudoJet & pb) const {
00280
00281
00282
00283 PseudoJet pres;
00284 recombine(pa,pb,pres);
00285 pa = pres;
00286 }
00287
00288 };
00289
00290
00291
00294 class DefaultRecombiner : public Recombiner {
00295 public:
00296 DefaultRecombiner(RecombinationScheme recomb_scheme = E_scheme) :
00297 _recomb_scheme(recomb_scheme) {}
00298
00299 virtual std::string description() const;
00300
00302 virtual void recombine(const PseudoJet & pa, const PseudoJet & pb,
00303 PseudoJet & pab) const;
00304
00305 virtual void preprocess(PseudoJet & p) const;
00306
00308 RecombinationScheme scheme() const {return _recomb_scheme;}
00309
00310 private:
00311 RecombinationScheme _recomb_scheme;
00312 };
00313
00314
00315
00318 class Plugin{
00319 public:
00322 virtual std::string description() const = 0;
00323
00330 virtual void run_clustering(ClusterSequence &) const = 0;
00331
00332 virtual double R() const = 0;
00333
00338 virtual bool supports_ghosted_passive_areas() const {return false;}
00339
00343 virtual void set_ghost_separation_scale(double scale) const;
00344 virtual double ghost_separation_scale() const {return 0.0;}
00345
00347 virtual ~Plugin() {};
00348 };
00349
00350 private:
00351
00352
00353 JetAlgorithm _jet_algorithm;
00354 double _Rparam;
00355 double _extra_param ;
00356 Strategy _strategy ;
00357
00358 const Plugin * _plugin;
00359
00360
00361
00362 DefaultRecombiner _default_recombiner;
00363 const Recombiner * _recombiner;
00364
00365 };
00366
00367
00368
00369
00370
00371
00372 FASTJET_END_NAMESPACE
00373
00374 #endif // __FASTJET_JETDEFINITION_HH__