FastJet 3.4.1
CDFJetCluPlugin.hh
1//FJSTARTHEADER
2// $Id$
3//
4// Copyright (c) 2005-2023, 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. They are described in the original FastJet paper,
16// hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
17// FastJet as part of work towards a scientific publication, please
18// quote the version you use and include a citation to the manual and
19// optionally also to hep-ph/0512210.
20//
21// FastJet is distributed in the hope that it will be useful,
22// but WITHOUT ANY WARRANTY; without even the implied warranty of
23// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24// GNU General Public License for more details.
25//
26// You should have received a copy of the GNU General Public License
27// along with FastJet. If not, see <http://www.gnu.org/licenses/>.
28//----------------------------------------------------------------------
29//FJENDHEADER
30
31#ifndef __CDFJETCLUPLUGIN_HH__
32#define __CDFJETCLUPLUGIN_HH__
33
34#include "fastjet/JetDefinition.hh"
35#include "fastjet/PseudoJet.hh"
36#include <map>
37#include "fastjet/internal/thread_safety_helpers.hh" // helpers to write transparent code w&wo C++11 features
38
39// questionable whether this should be in fastjet namespace or not...
40
41FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
42
43/// @ingroup plugins
44/// \class CDFJetCluPlugin
45/// Implementation of the JetClu algorithm from CDF (plugin for
46/// fastjet-v2.1 upwards)
48public:
49 /// a compact constructor
50 CDFJetCluPlugin (double cone_radius_in,
51 double overlap_threshold_in,
52 double seed_threshold_in = 1.0,
53 int iratch_in = 1) :
54 _seed_threshold ( seed_threshold_in ),
55 _cone_radius ( cone_radius_in ),
56 _adjacency_cut ( 2 ),
57 _max_iterations ( 100 ),
58 _iratch ( iratch_in ),
59 _overlap_threshold ( overlap_threshold_in ) {}
60
61 /// a constructor that looks like the one provided by CDF
62 CDFJetCluPlugin (double seed_threshold_in ,
63 double cone_radius_in ,
64 int adjacency_cut_in ,
65 int max_iterations_in ,
66 int iratch_in ,
67 double overlap_threshold_in) :
68 _seed_threshold (seed_threshold_in ),
69 _cone_radius (cone_radius_in ),
70 _adjacency_cut (adjacency_cut_in ),
71 _max_iterations (max_iterations_in ),
72 _iratch (iratch_in ),
73 _overlap_threshold (overlap_threshold_in ) {}
74
75 // some functions to return info about parameters
76 double seed_threshold () const {return _seed_threshold ;}
77 double cone_radius () const {return _cone_radius ;}
78 int adjacency_cut () const {return _adjacency_cut ;}
79 int max_iterations () const {return _max_iterations ;}
80 int iratch () const {return _iratch ;}
81 double overlap_threshold () const {return _overlap_threshold ;}
82
83
84 // the things that are required by base class
85 virtual std::string description () const;
86 virtual void run_clustering(ClusterSequence &) const;
87 /// the plugin mechanism's standard way of accessing the jet radius
88 virtual double R() const {return cone_radius();}
89
90private:
91
92 double _seed_threshold ;
93 double _cone_radius ;
94 int _adjacency_cut ;
95 int _max_iterations ;
96 int _iratch ;
97 double _overlap_threshold;
98
99 /// given a jet try inserting its energy into the map -- if that
100 /// energy entry already exists, modify the jet infinitesimally so
101 /// as ensure that the jet energy is unique
102 void _insert_unique (PseudoJet & jet, std::map<double,int> & jetmap) const;
103
104 static thread_safety_helpers::FirstTimeTrue _first_time;
105
106 /// print a banner for reference to the 3rd-party code
107 void _print_banner(std::ostream *ostr) const;
108};
109
110FASTJET_END_NAMESPACE // defined in fastjet/internal/base.hh
111
112#endif // __CDFJETCLUPLUGIN_HH__
Implementation of the JetClu algorithm from CDF (plugin for fastjet-v2.1 upwards)
CDFJetCluPlugin(double cone_radius_in, double overlap_threshold_in, double seed_threshold_in=1.0, int iratch_in=1)
a compact constructor
virtual double R() const
the plugin mechanism's standard way of accessing the jet radius
CDFJetCluPlugin(double seed_threshold_in, double cone_radius_in, int adjacency_cut_in, int max_iterations_in, int iratch_in, double overlap_threshold_in)
a constructor that looks like the one provided by CDF
a class that allows a user to introduce their own "plugin" jet finder
Class to contain pseudojets, including minimal information of use to jet-clustering routines.
Definition: PseudoJet.hh:68
provides an object wich will return "true" the first time () is called and false afterwards