Fork me on GitHub

source: git/external/fastjet/contribs/Nsubjettiness/XConePlugin.hh@ a3784f9

Last change on this file since a3784f9 was 973b92a, checked in by Pavel Demin <pavel.demin@…>, 9 years ago

update FastJet library to 3.1.3 and Nsubjettiness library to 2.2.1

  • Property mode set to 100644
File size: 5.9 KB
Line 
1// Nsubjettiness Package
2// Questions/Comments? jthaler@jthaler.net
3//
4// Copyright (c) 2011-14
5// Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
6//
7// $Id: XConePlugin.hh 748 2014-10-02 06:13:28Z tjwilk $
8//----------------------------------------------------------------------
9// This file is part of FastJet contrib.
10//
11// It is free software; you can redistribute it and/or modify it under
12// the terms of the GNU General Public License as published by the
13// Free Software Foundation; either version 2 of the License, or (at
14// your option) any later version.
15//
16// It is distributed in the hope that it will be useful, but WITHOUT
17// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
19// License for more details.
20//
21// You should have received a copy of the GNU General Public License
22// along with this code. If not, see <http://www.gnu.org/licenses/>.
23//----------------------------------------------------------------------
24
25#ifndef __FASTJET_CONTRIB_XCONEPLUGIN_HH__
26#define __FASTJET_CONTRIB_XCONEPLUGIN_HH__
27
28#include <fastjet/config.h>
29
30#include "NjettinessPlugin.hh"
31
32#include "fastjet/ClusterSequence.hh"
33#include "fastjet/JetDefinition.hh"
34
35#include <string>
36#include <climits>
37
38FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
39
40
41namespace contrib {
42
43///------------------------------------------------------------------------
44/// \class XConePlugin
45/// \brief Implements the XCone Jet Algorithm
46/**
47 * An exclusive jet finder that identifies N jets. First N axes are found, then
48 * particles are assigned to the nearest (approximte DeltaR) axis and for each axis the
49 * corresponding jet is simply the four-momentum sum of these particles.
50 *
51 * The XConePlugin is based on NjettinessPlugin, but with sensible default
52 * values for the AxesDefinition and MeasureDefinition. There are three arguments
53 *
54 * int N: number of exclusive jets to be found
55 * double R0: approximate jet radius
56 * double beta: determines style of jet finding with the recommended values being:
57 * beta = 2: standard "mean" jets where jet momentum/axis align approximately.
58 * beta = 1: recoil-free "median" variant where jet axis points at hardest cluster.
59 *
60 * The AxesDefinition is OnePass_GenET_GenKT_Axes, which uses a generalized kT
61 * clustering algorithm matched to the beta value.
62 *
63 * The MeasureDefinition is the XConeMeasure, which is based on the
64 * ConicalGeometric measure.
65 */
66class XConePlugin : public NjettinessPlugin {
67public:
68
69 /// Constructor with N, R0, and beta as the options. beta = 2.0 is the default
70 /// All this does is use the NjettinessPlugin with OnePass_GenET_GenKT_Axes and the XConeMeasure.
71 /// For more advanced usage, call NjettinessPlugin directly
72 /// Note that the order of the R0 and beta values is reversed from the XConeMeasure to
73 /// standard usage for Plugins.
74 XConePlugin(int N, double R0, double beta = 2.0)
75 : NjettinessPlugin(N,
76 OnePass_GenET_GenKT_Axes(calc_delta(beta), calc_power(beta), R0), // use recommended axes method only
77 XConeMeasure(beta, R0) // use recommended XCone measure.
78 ),
79 _N(N), _R0(R0), _beta(beta)
80 {}
81
82 // The things that are required by base class.
83 virtual std::string description () const;
84 virtual double R() const {return _R0;}
85
86 // run_clustering is done by NjettinessPlugin
87
88 virtual ~XConePlugin() {}
89
90private:
91
92 /// Static call used within the constructor to set the recommended delta value
93 static double calc_delta(double beta) {
94 double delta;
95 if (beta > 1) delta = 1/(beta - 1);
96 else delta = std::numeric_limits<int>::max(); // use winner take all
97 return delta;
98 }
99
100 /// Static call used within the constructor to set the recommended p value
101 static double calc_power(double beta) {
102 return (double) 1.0/beta;
103 }
104
105 double _N; ///< Number of desired jets
106 double _R0; ///< Jet radius
107 double _beta; ///< Angular exponent (beta = 2.0 is dafault, beta = 1.0 is recoil-free)
108
109public:
110
111};
112
113
114/// \class PseudoXConePlugin
115/// \brief Implements a faster, non-optimal version of the XCone Jet Algorithm
116///
117/// A "poor man's" version of XCone with no minimization step
118/// Right now, used just for testing purposes by the developers
119class PseudoXConePlugin : public NjettinessPlugin {
120public:
121
122 /// Constructor with N, R0, and beta as the options. beta = 2.0 is the default
123 /// All this does is use the NjettinessPlugin with GenET_GenKT_Axes and the XConeMeasure.
124 PseudoXConePlugin(int N, double R0, double beta = 2.0)
125 : NjettinessPlugin(N,
126 GenET_GenKT_Axes(calc_delta(beta), calc_power(beta), R0), // poor man's axes
127 XConeMeasure(beta, R0) // use recommended XCone measure.
128 ),
129 _N(N), _R0(R0), _beta(beta)
130 {}
131
132 // The things that are required by base class.
133 virtual std::string description () const;
134 virtual double R() const {return _R0;}
135
136 // run_clustering is done by NjettinessPlugin
137
138 virtual ~PseudoXConePlugin() {}
139
140private:
141
142 /// Static call used within the constructor to set the recommended delta value
143 static double calc_delta(double beta) {
144 double delta;
145 if (beta > 1) delta = 1/(beta - 1);
146 else delta = std::numeric_limits<int>::max(); // use winner take all
147 return delta;
148 }
149
150 /// Static call used within the constructor to set the recommended p value
151 static double calc_power(double beta) {
152 return (double) 1.0/beta;
153 }
154
155 double _N; ///< Number of desired jets
156 double _R0; ///< Jet radius
157 double _beta; ///< Angular exponent (beta = 2.0 is dafault, beta = 1.0 is recoil-free)
158
159public:
160
161};
162
163
164
165} // namespace contrib
166
167FASTJET_END_NAMESPACE
168
169#endif // __FASTJET_CONTRIB_XConePlugin_HH__
Note: See TracBrowser for help on using the repository browser.