Fork me on GitHub

source: git/external/fastjet/contribs/Nsubjettiness/Nsubjettiness.hh@ 3d963d5

ImprovedOutputFile Timing dual_readout llp
Last change on this file since 3d963d5 was 35cdc46, checked in by Pavel Demin <demin@…>, 10 years ago

upgrade FastJet to version 3.1.0-beta.1, upgrade Nsubjettiness to version 2.1.0, add SoftKiller version 1.0.0

  • Property mode set to 100644
File size: 9.0 KB
RevLine 
[9687203]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//
[35cdc46]7// $Id: Nsubjettiness.hh 670 2014-06-06 01:24:42Z jthaler $
[9687203]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_NSUBJETTINESS_HH__
26#define __FASTJET_CONTRIB_NSUBJETTINESS_HH__
27
28#include <fastjet/internal/base.hh>
29
30#include "Njettiness.hh"
31
32#include "fastjet/FunctionOfPseudoJet.hh"
33#include <string>
34#include <climits>
35
36FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
37
38namespace contrib {
39
40//------------------------------------------------------------------------
41/// \class Nsubjettiness
42/// Nsubjettiness extends the concept of Njettiness to a jet shape, but other
43/// than the set of particles considered, they are identical. This class
44/// wraps the core Njettiness code to provide the fastjet::FunctionOfPseudoJet
45/// interface for convenience in larger analyses. See NjettinessPlugin.hh for
46/// definitions of tau_N and the constructor options.
47class Nsubjettiness : public FunctionOfPseudoJet<double> {
48
49public:
50
[35cdc46]51
52 // Main constructor, which takes N, the AxesDefiniation, and the MeasureDefinition.
53 // The Definitions are given in NjettinessDefinition.hh
54 //
55 // The recommended AxesDefinitions are (more are available as listed in the README
56 // and defined in NjettinessDefinition.hh):
57 // KT_Axes : exclusive kt axes
58 // WTA_KT_Axes : exclusive kt with winner-take-all recombination
59 // OnePass_KT_Axes : one-pass minimization from kt starting point
60 // OnePass_WTA_KT_Axes : one-pass min. from wta_kt starting point
61 //
62 // The recommended measure definitions are (with the corresponding parameters)
63 // NormalizedMeasure(beta,R0)
64 // : This was the original N-subjettiness measure (dimensionless)
65 // UnnormalizedMeasure(beta)
66 // : This is the new recommended default, same as above but without
67 // : the normalization factor, and hence has units of GeV
68 // NormalizedCutoffMeasure(beta,R0,Rcutoff)
69 // : Same as normalized_measure, but cuts off at Rcutoff
70 // UnnormalizedCutoffMeasure(beta,Rcutoff)
71 // : Same as unnormalized_measure, but cuts off at Rcutoff
72 Nsubjettiness(int N,
73 const AxesDefinition& axes_def,
74 const MeasureDefinition& measure_def)
75 : _njettinessFinder(axes_def,measure_def), _N(N) {}
76
77
78 // Alternative constructors that define the measure via enums and parameters
79 // These constructors are likely be removed
80 // Zero parameter arguments
81 // (Currently, no measure uses this)
82 Nsubjettiness(int N,
83 Njettiness::AxesMode axes_mode,
84 Njettiness::MeasureMode measure_mode)
85 : _njettinessFinder(axes_mode, measure_mode, 0), _N(N) {}
86
87 // One parameter argument
88 // (for unnormalized_measure, para1=beta)
[9687203]89 Nsubjettiness(int N,
90 Njettiness::AxesMode axes_mode,
91 Njettiness::MeasureMode measure_mode,
[35cdc46]92 double para1)
93 : _njettinessFinder(axes_mode, measure_mode, 1, para1), _N(N) {}
94
95 // Two parameter arguments
96 // (for normalized_measure, para1=beta, para2=R0)
97 // (for unnormalized_cutoff_measure, para1=beta, para2=Rcutoff)
98 Nsubjettiness(int N,
99 Njettiness::AxesMode axes_mode,
100 Njettiness::MeasureMode measure_mode,
101 double para1,
102 double para2)
103 : _njettinessFinder(axes_mode, measure_mode, 2, para1, para2), _N(N) {}
104
105 // Three parameter arguments
106 // (for unnormalized_cutoff_measure, para1=beta, para2=R0, para3=Rcutoff)
107 Nsubjettiness(int N,
108 Njettiness::AxesMode axes_mode,
109 Njettiness::MeasureMode measure_mode,
110 double para1,
111 double para2,
112 double para3)
113 : _njettinessFinder(axes_mode, measure_mode, 3, para1, para2, para3), _N(N) {}
[9687203]114
115 // Old constructor for backwards compatibility with v1.0,
116 // where normalized_cutoff_measure was the only option
117 Nsubjettiness(int N,
118 Njettiness::AxesMode axes_mode,
119 double beta,
120 double R0,
121 double Rcutoff=std::numeric_limits<double>::max())
[35cdc46]122 : _njettinessFinder(axes_mode, NormalizedCutoffMeasure(beta,R0,Rcutoff)), _N(N) {}
123
[9687203]124 /// returns tau_N, measured on the constituents of this jet
125 double result(const PseudoJet& jet) const;
126
127 /// returns components of tau_N, so that user can find individual tau values.
128 TauComponents component_result(const PseudoJet& jet) const;
129
130 /// returns current axes found by result() calculation
131 std::vector<fastjet::PseudoJet> currentAxes() const {
132 return _njettinessFinder.currentAxes();
133 }
134
135 /// returns seed axes used for onepass minimization (otherwise same as currentAxes)
136 std::vector<fastjet::PseudoJet> seedAxes() const {
137 return _njettinessFinder.seedAxes();
138 }
139
[35cdc46]140 /// returns subjet regions found by result() calculation (these have valid constituents)
141 /// Note that the axes and the subjets are not the same
142 std::vector<fastjet::PseudoJet> currentSubjets() const {
143 return _njettinessFinder.currentJets();
144 }
145
146 /// returns components of tau_N without recalculating anything
147 TauComponents currentTauComponents() const {
148 return _njettinessFinder.currentTauComponents();
149 }
150
[9687203]151 // To set axes for manual use
[35cdc46]152 void setAxes(const std::vector<fastjet::PseudoJet> & myAxes) {
[9687203]153 // Cross check that manual axes are being used is in Njettiness
154 _njettinessFinder.setAxes(myAxes);
155 }
156
157
158private:
159
[35cdc46]160 Njettiness _njettinessFinder; // TODO: should muck with this so result can be const without this mutable
[9687203]161 int _N;
162
163};
164
165
166//------------------------------------------------------------------------
167/// \class NsubjettinessRatio
168// NsubjettinessRatio uses the results from Nsubjettiness to calculate the ratio
169// tau_N/tau_M, where N and M are specified by the user. The ratio of different tau values
170// is often used in analyses, so this class is helpful to streamline code.
171class NsubjettinessRatio : public FunctionOfPseudoJet<double> {
172public:
173
174 // Main constructor. Apart from specifying both N and M, the same options as Nsubjettiness
[35cdc46]175 NsubjettinessRatio(int N,
176 int M,
177 const AxesDefinition & axes_def,
178 const MeasureDefinition & measure_def)
179 : _nsub_numerator(N,axes_def,measure_def),
180 _nsub_denominator(M,axes_def,measure_def) {}
181
182 // Alternative constructor with enums and parameters
183 // Again, likely to be removed
184 NsubjettinessRatio(int N,
185 int M,
186 Njettiness::AxesMode axes_mode,
187 Njettiness::MeasureMode measure_mode)
188 : _nsub_numerator(N, axes_mode, measure_mode),
189 _nsub_denominator(M, axes_mode, measure_mode) {}
190
191
[9687203]192 NsubjettinessRatio(int N,
193 int M,
194 Njettiness::AxesMode axes_mode,
195 Njettiness::MeasureMode measure_mode,
[35cdc46]196 double para1)
197 : _nsub_numerator(N, axes_mode, measure_mode, para1),
198 _nsub_denominator(M, axes_mode, measure_mode, para1) {}
199
200 NsubjettinessRatio(int N,
201 int M,
202 Njettiness::AxesMode axes_mode,
203 Njettiness::MeasureMode measure_mode,
204 double para1,
205 double para2)
206 : _nsub_numerator(N, axes_mode, measure_mode, para1, para2),
207 _nsub_denominator(M, axes_mode, measure_mode, para1, para2) {}
208
209 NsubjettinessRatio(int N,
210 int M,
211 Njettiness::AxesMode axes_mode,
212 Njettiness::MeasureMode measure_mode,
213 double para1,
214 double para2,
215 double para3)
216 : _nsub_numerator(N, axes_mode, measure_mode, para1, para2, para3),
217 _nsub_denominator(M, axes_mode, measure_mode, para1, para2, para3) {}
218
219 //returns tau_N/tau_M based off the input jet using result function from Nsubjettiness
[9687203]220 double result(const PseudoJet& jet) const;
221
222private:
223
224 Nsubjettiness _nsub_numerator;
225 Nsubjettiness _nsub_denominator;
226
227};
228
229} // namespace contrib
230
231FASTJET_END_NAMESPACE
232
233#endif // __FASTJET_CONTRIB_NSUBJETTINESS_HH__
Note: See TracBrowser for help on using the repository browser.