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,
00065 NlnN = 2,
00068 NlnN3pi = 3,
00070 NlnN4pi = 4,
00074 NlnNCam4pi = 14,
00078 NlnNCam2pi2R = 13,
00082 NlnNCam = 12,
00084 plugin_strategy = 999
00085 };
00086
00087
00088
00091 enum JetAlgorithm {
00093 kt_algorithm=0,
00096 cambridge_algorithm=1,
00100 antikt_algorithm=2,
00105 genkt_algorithm=3,
00108 cambridge_for_passive_algorithm=11,
00111 genkt_for_passive_algorithm=13,
00112
00114 ee_kt_algorithm=50,
00116 ee_genkt_algorithm=53,
00117
00119 plugin_algorithm = 99
00120 };
00121
00124 typedef JetAlgorithm JetFinder;
00125
00127 const JetAlgorithm aachen_algorithm = cambridge_algorithm;
00128 const JetAlgorithm cambridge_aachen_algorithm = cambridge_algorithm;
00129
00130
00132 enum RecombinationScheme {
00134 E_scheme=0,
00137 pt_scheme=1,
00140 pt2_scheme=2,
00143 Et_scheme=3,
00146 Et2_scheme=4,
00149 BIpt_scheme=5,
00152 BIpt2_scheme=6,
00154 external_scheme = 99
00155 };
00156
00157
00158
00159
00160
00161
00162 class ClusterSequence;
00163
00164
00165
00166
00167
00172 class JetDefinition {
00173
00174 public:
00175
00178 class Plugin;
00179
00180
00181
00182
00183 class Recombiner;
00184
00185
00186
00190 JetDefinition(JetAlgorithm jet_algorithm,
00191 double R,
00192 RecombinationScheme recomb_scheme = E_scheme,
00193 Strategy strategy = Best) {
00194 *this = JetDefinition(jet_algorithm, R, strategy, recomb_scheme, 1);
00195 }
00196
00199 JetDefinition(JetAlgorithm jet_algorithm,
00200 RecombinationScheme recomb_scheme = E_scheme,
00201 Strategy strategy = Best) {
00202 double dummyR = 0.0;
00203 *this = JetDefinition(jet_algorithm, dummyR, strategy, recomb_scheme, 0);
00204 }
00205
00208 JetDefinition(JetAlgorithm jet_algorithm,
00209 double R,
00210 double xtra_param,
00211 RecombinationScheme recomb_scheme = E_scheme,
00212 Strategy strategy = Best) {
00213 *this = JetDefinition(jet_algorithm, R, strategy, recomb_scheme, 2);
00214 set_extra_param(xtra_param);
00215 }
00216
00217
00221 JetDefinition(JetAlgorithm jet_algorithm,
00222 double R,
00223 const Recombiner * recombiner,
00224 Strategy strategy = Best) {
00225 *this = JetDefinition(jet_algorithm, R, external_scheme, strategy);
00226 _recombiner = recombiner;
00227 }
00228
00229
00232 JetDefinition(JetAlgorithm jet_algorithm,
00233 const Recombiner * recombiner,
00234 Strategy strategy = Best) {
00235 *this = JetDefinition(jet_algorithm, external_scheme, strategy);
00236 _recombiner = recombiner;
00237 }
00238
00241 JetDefinition(JetAlgorithm jet_algorithm,
00242 double R,
00243 double xtra_param,
00244 const Recombiner * recombiner,
00245 Strategy strategy = Best) {
00246 *this = JetDefinition(jet_algorithm, R, external_scheme, strategy);
00247 _recombiner = recombiner;
00248 set_extra_param(xtra_param);
00249 }
00250
00252 JetDefinition() {
00253 *this = JetDefinition(kt_algorithm, 1.0);
00254 }
00255
00259 JetDefinition(const Plugin * plugin) {
00260 _plugin = plugin;
00261 _strategy = plugin_strategy;
00262 _Rparam = _plugin->R();
00263 _jet_algorithm = plugin_algorithm;
00264 set_recombination_scheme(E_scheme);
00265 }
00266
00267
00273 JetDefinition(JetAlgorithm jet_algorithm,
00274 double R,
00275 Strategy strategy,
00276 RecombinationScheme recomb_scheme = E_scheme,
00277 int nparameters = 1);
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00292 void set_recombination_scheme(RecombinationScheme);
00293
00295 void set_recombiner(const Recombiner * recomb) {
00296 _recombiner = recomb;
00297 _default_recombiner = DefaultRecombiner(external_scheme);
00298 }
00299
00301 const Plugin * plugin() const {return _plugin;};
00302
00304 JetAlgorithm jet_algorithm () const {return _jet_algorithm ;}
00306 JetAlgorithm jet_finder () const {return _jet_algorithm ;}
00307 double R () const {return _Rparam ;}
00308
00309
00310 double extra_param () const {return _extra_param ;}
00311 Strategy strategy () const {return _strategy ;}
00312 RecombinationScheme recombination_scheme() const {
00313 return _default_recombiner.scheme();}
00314
00316 void set_jet_algorithm(JetAlgorithm njf) {_jet_algorithm = njf;}
00318 void set_jet_finder(JetAlgorithm njf) {_jet_algorithm = njf;}
00320 void set_extra_param(double xtra_param) {_extra_param = xtra_param;}
00321
00332 const Recombiner * recombiner() const {
00333 return _recombiner == 0 ? & _default_recombiner : _recombiner;}
00334
00336 std::string description() const;
00337
00338
00339 public:
00340
00345 class Recombiner {
00346 public:
00349 virtual std::string description() const = 0;
00350
00352 virtual void recombine(const PseudoJet & pa, const PseudoJet & pb,
00353 PseudoJet & pab) const = 0;
00354
00357 virtual void preprocess(PseudoJet & ) const {};
00358
00360 virtual ~Recombiner() {};
00361
00364 inline void plus_equal(PseudoJet & pa, const PseudoJet & pb) const {
00365
00366
00367
00368 PseudoJet pres;
00369 recombine(pa,pb,pres);
00370 pa = pres;
00371 }
00372
00373 };
00374
00375
00376
00385 class DefaultRecombiner : public Recombiner {
00386 public:
00387 DefaultRecombiner(RecombinationScheme recomb_scheme = E_scheme) :
00388 _recomb_scheme(recomb_scheme) {}
00389
00390 virtual std::string description() const;
00391
00393 virtual void recombine(const PseudoJet & pa, const PseudoJet & pb,
00394 PseudoJet & pab) const;
00395
00396 virtual void preprocess(PseudoJet & p) const;
00397
00399 RecombinationScheme scheme() const {return _recomb_scheme;}
00400
00401 private:
00402 RecombinationScheme _recomb_scheme;
00403 };
00404
00405
00406
00414 class Plugin{
00415 public:
00418 virtual std::string description() const = 0;
00419
00426 virtual void run_clustering(ClusterSequence &) const = 0;
00427
00428 virtual double R() const = 0;
00429
00434 virtual bool supports_ghosted_passive_areas() const {return false;}
00435
00439 virtual void set_ghost_separation_scale(double scale) const;
00440 virtual double ghost_separation_scale() const {return 0.0;}
00441
00445 virtual bool exclusive_sequence_meaningful() const {return false;}
00446
00448 virtual ~Plugin() {};
00449 };
00450
00451 private:
00452
00453
00454 JetAlgorithm _jet_algorithm;
00455 double _Rparam;
00456 double _extra_param ;
00457 Strategy _strategy ;
00458
00459 const Plugin * _plugin;
00460
00461
00462
00463 DefaultRecombiner _default_recombiner;
00464 const Recombiner * _recombiner;
00465
00466 };
00467
00468
00469
00470
00471
00472
00473 FASTJET_END_NAMESPACE
00474
00475 #endif // __FASTJET_JETDEFINITION_HH__