1 | //STARTHEADER |
---|
2 | // $Id: CDFJetCluPlugin.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 __CDFJETCLUPLUGIN_HH__ |
---|
30 | #define __CDFJETCLUPLUGIN_HH__ |
---|
31 | |
---|
32 | #include "fastjet/JetDefinition.hh" |
---|
33 | #include "fastjet/PseudoJet.hh" |
---|
34 | #include <map> |
---|
35 | |
---|
36 | // questionable whether this should be in fastjet namespace or not... |
---|
37 | |
---|
38 | FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh |
---|
39 | |
---|
40 | /// @ingroup plugins |
---|
41 | /// \class CDFJetCluPlugin |
---|
42 | /// Implementation of the JetClu algorithm from CDF (plugin for |
---|
43 | /// fastjet-v2.1 upwards) |
---|
44 | class CDFJetCluPlugin : public JetDefinition::Plugin { |
---|
45 | public: |
---|
46 | /// a compact constructor |
---|
47 | CDFJetCluPlugin (double cone_radius_in, |
---|
48 | double overlap_threshold_in, |
---|
49 | double seed_threshold_in = 1.0, |
---|
50 | int iratch_in = 1) : |
---|
51 | _seed_threshold ( seed_threshold_in ), |
---|
52 | _cone_radius ( cone_radius_in ), |
---|
53 | _adjacency_cut ( 2 ), |
---|
54 | _max_iterations ( 100 ), |
---|
55 | _iratch ( iratch_in ), |
---|
56 | _overlap_threshold ( overlap_threshold_in ) {} |
---|
57 | |
---|
58 | /// a constructor that looks like the one provided by CDF |
---|
59 | CDFJetCluPlugin (double seed_threshold_in , |
---|
60 | double cone_radius_in , |
---|
61 | int adjacency_cut_in , |
---|
62 | int max_iterations_in , |
---|
63 | int iratch_in , |
---|
64 | double overlap_threshold_in) : |
---|
65 | _seed_threshold (seed_threshold_in ), |
---|
66 | _cone_radius (cone_radius_in ), |
---|
67 | _adjacency_cut (adjacency_cut_in ), |
---|
68 | _max_iterations (max_iterations_in ), |
---|
69 | _iratch (iratch_in ), |
---|
70 | _overlap_threshold (overlap_threshold_in ) {} |
---|
71 | |
---|
72 | // some functions to return info about parameters |
---|
73 | double seed_threshold () const {return _seed_threshold ;} |
---|
74 | double cone_radius () const {return _cone_radius ;} |
---|
75 | int adjacency_cut () const {return _adjacency_cut ;} |
---|
76 | int max_iterations () const {return _max_iterations ;} |
---|
77 | int iratch () const {return _iratch ;} |
---|
78 | double overlap_threshold () const {return _overlap_threshold ;} |
---|
79 | |
---|
80 | |
---|
81 | // the things that are required by base class |
---|
82 | virtual std::string description () const; |
---|
83 | virtual void run_clustering(ClusterSequence &) const; |
---|
84 | /// the plugin mechanism's standard way of accessing the jet radius |
---|
85 | virtual double R() const {return cone_radius();} |
---|
86 | |
---|
87 | private: |
---|
88 | |
---|
89 | double _seed_threshold ; |
---|
90 | double _cone_radius ; |
---|
91 | int _adjacency_cut ; |
---|
92 | int _max_iterations ; |
---|
93 | int _iratch ; |
---|
94 | double _overlap_threshold; |
---|
95 | |
---|
96 | /// given a jet try inserting its energy into the map -- if that |
---|
97 | /// energy entry already exists, modify the jet infinitesimally so |
---|
98 | /// as ensure that the jet energy is unique |
---|
99 | void _insert_unique (PseudoJet & jet, std::map<double,int> & jetmap) const; |
---|
100 | |
---|
101 | static bool _first_time; |
---|
102 | |
---|
103 | /// print a banner for reference to the 3rd-party code |
---|
104 | void _print_banner(std::ostream *ostr) const; |
---|
105 | }; |
---|
106 | |
---|
107 | FASTJET_END_NAMESPACE // defined in fastjet/internal/base.hh |
---|
108 | |
---|
109 | #endif // __CDFJETCLUPLUGIN_HH__ |
---|