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,
00095 genkt_algorithm=3,
00098 cambridge_for_passive_algorithm=11,
00101 genkt_for_passive_algorithm=13,
00102
00104 ee_kt_algorithm=50,
00106 ee_genkt_algorithm=53,
00107
00109 plugin_algorithm = 99
00110 };
00111
00114 typedef JetAlgorithm JetFinder;
00115
00117 const JetAlgorithm aachen_algorithm = cambridge_algorithm;
00118 const JetAlgorithm cambridge_aachen_algorithm = cambridge_algorithm;
00119
00120
00122 enum RecombinationScheme {
00124 E_scheme=0,
00127 pt_scheme=1,
00130 pt2_scheme=2,
00133 Et_scheme=3,
00136 Et2_scheme=4,
00139 BIpt_scheme=5,
00142 BIpt2_scheme=6,
00144 external_scheme = 99
00145 };
00146
00147
00148
00149
00150
00151
00152 class ClusterSequence;
00153
00154
00155
00156
00157
00160 class JetDefinition {
00161
00162 public:
00163
00166 class Plugin;
00167
00168
00169
00170
00171 class Recombiner;
00172
00173
00174
00178 JetDefinition(JetAlgorithm jet_algorithm,
00179 double R,
00180 RecombinationScheme recomb_scheme = E_scheme,
00181 Strategy strategy = Best) {
00182 *this = JetDefinition(jet_algorithm, R, strategy, recomb_scheme, 1);
00183 }
00184
00187 JetDefinition(JetAlgorithm jet_algorithm,
00188 RecombinationScheme recomb_scheme = E_scheme,
00189 Strategy strategy = Best) {
00190 double dummyR = 0.0;
00191 *this = JetDefinition(jet_algorithm, dummyR, strategy, recomb_scheme, 0);
00192 }
00193
00196 JetDefinition(JetAlgorithm jet_algorithm,
00197 double R,
00198 double xtra_param,
00199 RecombinationScheme recomb_scheme = E_scheme,
00200 Strategy strategy = Best) {
00201 *this = JetDefinition(jet_algorithm, R, strategy, recomb_scheme, 2);
00202 set_extra_param(xtra_param);
00203 }
00204
00205
00209 JetDefinition(JetAlgorithm jet_algorithm,
00210 double R,
00211 const Recombiner * recombiner,
00212 Strategy strategy = Best) {
00213 *this = JetDefinition(jet_algorithm, R, external_scheme, strategy);
00214 _recombiner = recombiner;
00215 }
00216
00217
00220 JetDefinition(JetAlgorithm jet_algorithm,
00221 const Recombiner * recombiner,
00222 Strategy strategy = Best) {
00223 *this = JetDefinition(jet_algorithm, external_scheme, strategy);
00224 _recombiner = recombiner;
00225 }
00226
00229 JetDefinition(JetAlgorithm jet_algorithm,
00230 double R,
00231 double xtra_param,
00232 const Recombiner * recombiner,
00233 Strategy strategy = Best) {
00234 *this = JetDefinition(jet_algorithm, R, external_scheme, strategy);
00235 _recombiner = recombiner;
00236 set_extra_param(xtra_param);
00237 }
00238
00240 JetDefinition() {
00241 *this = JetDefinition(kt_algorithm, 1.0);
00242 }
00243
00247 JetDefinition(const Plugin * plugin) {
00248 _plugin = plugin;
00249 _strategy = plugin_strategy;
00250 _Rparam = _plugin->R();
00251 _jet_algorithm = plugin_algorithm;
00252 set_recombination_scheme(E_scheme);
00253 }
00254
00255
00261 JetDefinition(JetAlgorithm jet_algorithm,
00262 double R,
00263 Strategy strategy,
00264 RecombinationScheme recomb_scheme = E_scheme,
00265 int nparameters = 1);
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00280 void set_recombination_scheme(RecombinationScheme);
00281
00283 void set_recombiner(const Recombiner * recomb) {
00284 _recombiner = recomb;
00285 _default_recombiner = DefaultRecombiner(external_scheme);
00286 }
00287
00289 const Plugin * plugin() const {return _plugin;};
00290
00292 JetAlgorithm jet_algorithm () const {return _jet_algorithm ;}
00294 JetAlgorithm jet_finder () const {return _jet_algorithm ;}
00295 double R () const {return _Rparam ;}
00296
00297
00298 double extra_param () const {return _extra_param ;}
00299 Strategy strategy () const {return _strategy ;}
00300 RecombinationScheme recombination_scheme() const {
00301 return _default_recombiner.scheme();}
00302
00304 void set_jet_algorithm(JetAlgorithm njf) {_jet_algorithm = njf;}
00306 void set_jet_finder(JetAlgorithm njf) {_jet_algorithm = njf;}
00308 void set_extra_param(double xtra_param) {_extra_param = xtra_param;}
00309
00312 const Recombiner * recombiner() const {
00313 return _recombiner == 0 ? & _default_recombiner : _recombiner;}
00314
00316 std::string description() const;
00317
00318
00319 public:
00320
00323 class Recombiner {
00324 public:
00327 virtual std::string description() const = 0;
00328
00330 virtual void recombine(const PseudoJet & pa, const PseudoJet & pb,
00331 PseudoJet & pab) const = 0;
00332
00335 virtual void preprocess(PseudoJet & ) const {};
00336
00338 virtual ~Recombiner() {};
00339
00342 inline void plus_equal(PseudoJet & pa, const PseudoJet & pb) const {
00343
00344
00345
00346 PseudoJet pres;
00347 recombine(pa,pb,pres);
00348 pa = pres;
00349 }
00350
00351 };
00352
00353
00354
00357 class DefaultRecombiner : public Recombiner {
00358 public:
00359 DefaultRecombiner(RecombinationScheme recomb_scheme = E_scheme) :
00360 _recomb_scheme(recomb_scheme) {}
00361
00362 virtual std::string description() const;
00363
00365 virtual void recombine(const PseudoJet & pa, const PseudoJet & pb,
00366 PseudoJet & pab) const;
00367
00368 virtual void preprocess(PseudoJet & p) const;
00369
00371 RecombinationScheme scheme() const {return _recomb_scheme;}
00372
00373 private:
00374 RecombinationScheme _recomb_scheme;
00375 };
00376
00377
00378
00381 class Plugin{
00382 public:
00385 virtual std::string description() const = 0;
00386
00393 virtual void run_clustering(ClusterSequence &) const = 0;
00394
00395 virtual double R() const = 0;
00396
00401 virtual bool supports_ghosted_passive_areas() const {return false;}
00402
00406 virtual void set_ghost_separation_scale(double scale) const;
00407 virtual double ghost_separation_scale() const {return 0.0;}
00408
00412 virtual bool exclusive_sequence_meaningful() const {return false;}
00413
00415 virtual ~Plugin() {};
00416 };
00417
00418 private:
00419
00420
00421 JetAlgorithm _jet_algorithm;
00422 double _Rparam;
00423 double _extra_param ;
00424 Strategy _strategy ;
00425
00426 const Plugin * _plugin;
00427
00428
00429
00430 DefaultRecombiner _default_recombiner;
00431 const Recombiner * _recombiner;
00432
00433 };
00434
00435
00436
00437
00438
00439
00440 FASTJET_END_NAMESPACE
00441
00442 #endif // __FASTJET_JETDEFINITION_HH__