Fork me on GitHub

source: svn/trunk/external/fastjet/contribs/Nsubjettiness/Nsubjettiness.hh

Last change on this file was 1368, checked in by Michele Selvaggi, 11 years ago

added nsubjettiness

File size: 5.0 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//----------------------------------------------------------------------
8// This file is part of FastJet contrib.
9//
10// It is free software; you can redistribute it and/or modify it under
11// the terms of the GNU General Public License as published by the
12// Free Software Foundation; either version 2 of the License, or (at
13// your option) any later version.
14//
15// It is distributed in the hope that it will be useful, but WITHOUT
16// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
18// License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with this code. If not, see <http://www.gnu.org/licenses/>.
22//----------------------------------------------------------------------
23
24#ifndef __FASTJET_CONTRIB_NSUBJETTINESS_HH__
25#define __FASTJET_CONTRIB_NSUBJETTINESS_HH__
26
27#include <fastjet/internal/base.hh>
28
29#include "Njettiness.hh"
30
31#include "fastjet/FunctionOfPseudoJet.hh"
32#include <string>
33#include <climits>
34
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
51 // Main constructor, which takes N, axes/measure modes,
52 // and up to four parameters for parameters (i.e. beta, Rcutoff, etc depending on measure)
53 Nsubjettiness(int N,
54 Njettiness::AxesMode axes_mode,
55 Njettiness::MeasureMode measure_mode,
56 double para1 = NAN,
57 double para2 = NAN,
58 double para3 = NAN,
59 double para4 = NAN)
60 : _njettinessFinder(axes_mode, measure_mode, para1, para2, para3, para4), _N(N) {}
61
62 // Old constructor for backwards compatibility with v1.0,
63 // where normalized_cutoff_measure was the only option
64 Nsubjettiness(int N,
65 Njettiness::AxesMode axes_mode,
66 double beta,
67 double R0,
68 double Rcutoff=std::numeric_limits<double>::max())
69 : _njettinessFinder(axes_mode, Njettiness::normalized_cutoff_measure, beta, R0, Rcutoff), _N(N) {}
70
71
72 /// returns tau_N, measured on the constituents of this jet
73 double result(const PseudoJet& jet) const;
74
75 /// returns components of tau_N, so that user can find individual tau values.
76 TauComponents component_result(const PseudoJet& jet) const;
77
78 /// returns current axes found by result() calculation
79 std::vector<fastjet::PseudoJet> currentAxes() const {
80 return _njettinessFinder.currentAxes();
81 }
82
83 /// returns seed axes used for onepass minimization (otherwise same as currentAxes)
84 std::vector<fastjet::PseudoJet> seedAxes() const {
85 return _njettinessFinder.seedAxes();
86 }
87
88 // To set axes for manual use
89 void setAxes(std::vector<fastjet::PseudoJet> myAxes) {
90 // Cross check that manual axes are being used is in Njettiness
91 _njettinessFinder.setAxes(myAxes);
92 }
93
94
95private:
96
97 mutable Njettiness _njettinessFinder; // TODO: should muck with this so result can be const without this mutable
98 int _N;
99
100};
101
102
103//------------------------------------------------------------------------
104/// \class NsubjettinessRatio
105// NsubjettinessRatio uses the results from Nsubjettiness to calculate the ratio
106// tau_N/tau_M, where N and M are specified by the user. The ratio of different tau values
107// is often used in analyses, so this class is helpful to streamline code.
108class NsubjettinessRatio : public FunctionOfPseudoJet<double> {
109public:
110
111 // Main constructor. Apart from specifying both N and M, the same options as Nsubjettiness
112 NsubjettinessRatio(int N,
113 int M,
114 Njettiness::AxesMode axes_mode,
115 Njettiness::MeasureMode measure_mode,
116 double para1 = NAN,
117 double para2 = NAN,
118 double para3 = NAN,
119 double para4 = NAN)
120 : _nsub_numerator(N, axes_mode, measure_mode, para1, para2, para3, para4),
121 _nsub_denominator(M, axes_mode, measure_mode, para1, para2, para3, para4) {}
122
123 //returns tau_N/tau_M based off the input jet using result function from Nsubjettiness
124 double result(const PseudoJet& jet) const;
125
126private:
127
128 Nsubjettiness _nsub_numerator;
129 Nsubjettiness _nsub_denominator;
130
131};
132
133} // namespace contrib
134
135FASTJET_END_NAMESPACE
136
137#endif // __FASTJET_CONTRIB_NSUBJETTINESS_HH__
Note: See TracBrowser for help on using the repository browser.