Fork me on GitHub

source: git/external/fastjet/contribs/RecursiveTools/IteratedSoftDrop.hh@ d4fb268

Last change on this file since d4fb268 was b7b836a, checked in by Pavel Demin <pavel-demin@…>, 6 years ago

update FastJet library to 3.3.1 and FastJet Contrib library to 1.036

  • Property mode set to 100644
File size: 9.0 KB
RevLine 
[b7b836a]1// $Id: IteratedSoftDrop.hh 1086 2017-10-11 08:07:26Z gsoyez $
2//
3// Copyright (c) 2017-, Jesse Thaler, Kevin Zhou, Gavin P. Salam,
4// Gregory Soyez
5//
6// based on arXiv:1704.06266 by Christopher Frye, Andrew J. Larkoski,
7// Jesse Thaler, Kevin Zhou
8//
9//----------------------------------------------------------------------
10// This file is part of FastJet contrib.
11//
12// It is free software; you can redistribute it and/or modify it under
13// the terms of the GNU General Public License as published by the
14// Free Software Foundation; either version 2 of the License, or (at
15// your option) any later version.
16//
17// It is distributed in the hope that it will be useful, but WITHOUT
18// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
20// License for more details.
21//
22// You should have received a copy of the GNU General Public License
23// along with this code. If not, see <http://www.gnu.org/licenses/>.
24//----------------------------------------------------------------------
25
26#ifndef __FASTJET_CONTRIB_ITERATEDSOFTDROP_HH__
27#define __FASTJET_CONTRIB_ITERATEDSOFTDROP_HH__
28
29#include "RecursiveSoftDrop.hh"
30
31FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
32
33namespace contrib{
34
35//------------------------------------------------------------------------
36/// \class IteratedSoftDropInfo
37/// helper class that carries all the relevant information one can get
38/// from running IteratedSoftDrop on a given jet (or vector of jets)
39///
40class IteratedSoftDropInfo{
41public:
42 /// ctor without initialisation
43 IteratedSoftDropInfo(){}
44
45 /// ctor with initialisation
46 IteratedSoftDropInfo(std::vector<std::pair<double,double> > zg_thetag_in)
47 : _all_zg_thetag(zg_thetag_in){}
48
49 /// get the raw list of (angular-ordered) zg and thetag
50 const std::vector<std::pair<double,double> > &all_zg_thetag() const{
51 return _all_zg_thetag;
52 }
53
54 /// overloadd the () operator so that it also returns the full (zg,thetag) list
55 const std::vector<std::pair<double,double> > & operator()() const{
56 return _all_zg_thetag;
57 }
58
59 /// overloadd the [] operator to access the ith (zg,thetag) pair
60 const std::pair<double,double> & operator[](unsigned int i) const{
61 return _all_zg_thetag[i];
62 }
63
64 /// returns the angularity with angular exponent alpha and z
65 /// exponent kappa calculated on the zg's and thetag's found by
66 /// iterated SoftDrop
67 ///
68 /// returns 0 if no substructure was found
69 double angularity(double alpha, double kappa=1.0) const;
70
71 /// returns the Iterated SoftDrop multiplicity
72 unsigned int multiplicity() const{ return _all_zg_thetag.size(); }
73
74 /// returns the Iterated SoftDrop multiplicity (i.e. size)
75 unsigned int size() const{ return _all_zg_thetag.size(); }
76
77protected:
78 /// the real information: angular-ordered list of all the zg and
79 /// thetag that passed the (recursive) SD conddition
80 std::vector<std::pair<double,double> > _all_zg_thetag;
81};
82
83
84
85//------------------------------------------------------------------------
86/// \class IteratedSoftDrop
87/// implementation of the IteratedSoftDrop procedure
88///
89/// This class provides an implementation of the IteratedSoftDrop
90/// procedure. It is based on the SoftDrop procedure can be used to
91/// define a 'groomed symmetry factor', equal to the symmetry factor
92/// of the two subjets of the resulting groomed jet. The Iterated
93/// Soft Drop procedure recursively performs Soft Drop on the harder
94/// branch of the groomed jet, halting at a specified angular cut
95/// \f$\theta_{\rm cut}\f$, returning a list of symmetry factors which
96/// can be used to define observables.
97///
98/// Like SoftDrop, the cut applied recursively is
99/// \f[
100/// z > z_{\rm cut} (\theta/R_0)^\beta
101/// \f]
102/// with z the asymmetry measure and \f$\theta\f$ the geometrical
103/// distance between the two subjets. The procedure halts when
104/// \f$\theta < \theta_{\rm cut}\f$.
105///
106/// By default, this implementation returs the IteratedSoftDropInfo
107/// obtained after running IteratedSoftDrop on a jet
108///
109/// Although all these quantities can be obtained from the returned
110/// IteratedSoftDropInfo, we also provide helpers to directly get the
111/// multiplicity, some (generalised) angularity, or the raw list of
112/// (angular-ordered) (zg, thetag) pairs that passed the (recursive)
113/// SoftDrop condition.
114///
115/// We stress the fact that IteratedSoftDrop is _not_ a Transformer
116/// since it returns an IteratedSoftDropInfo and not a modified
117/// PseudoJet
118///
119class IteratedSoftDrop : public FunctionOfPseudoJet<IteratedSoftDropInfo> {
120public:
121 /// Constructor. Takes in the standard Soft Drop parameters, an angular cut \f$\theta_{\rm cut}\f$,
122 /// and a choice of angular and symmetry measure.
123 ///
124 /// \param beta the Soft Drop beta parameter
125 /// \param symmetry_cut the Soft Drop symmetry cut
126 /// \param angular_cut the angular cutoff to halt Iterated Soft Drop
127 /// \param R0 the angular distance normalization
128 /// \param subtractor an optional pointer to a pileup subtractor (ignored if zero)
129 IteratedSoftDrop(double beta, double symmetry_cut, double angular_cut, double R0 = 1.0,
130 const FunctionOfPseudoJet<PseudoJet> * subtractor = 0);
131
132 /// Full constructor, which takes the following parameters:
133 ///
134 /// \param beta the value of the beta parameter
135 /// \param symmetry_cut the value of the cut on the symmetry measure
136 /// \param symmetry_measure the choice of measure to use to estimate the symmetry
137 /// \param angular_cut the angular cutoff to halt Iterated Soft Drop
138 /// \param R0 the angular distance normalisation [1 by default]
139 /// \param mu_cut the maximal allowed value of mass drop variable mu = m_heavy/m_parent
140 /// \param recursion_choice the strategy used to decide which subjet to recurse into
141 /// \param subtractor an optional pointer to a pileup subtractor (ignored if zero)
142 ///
143 /// Notes:
144 ///
145 /// - by default, SoftDrop will recluster the jet with the
146 /// Cambridge/Aachen algorithm if it is not already the case. This
147 /// behaviour can be changed using the "set_reclustering" method
148 /// defined below
149 ///
150 IteratedSoftDrop(double beta,
151 double symmetry_cut,
152 RecursiveSoftDrop::SymmetryMeasure symmetry_measure,
153 double angular_cut,
154 double R0 = 1.0,
155 double mu_cut = std::numeric_limits<double>::infinity(),
156 RecursiveSoftDrop::RecursionChoice recursion_choice = RecursiveSoftDrop::larger_pt,
157 const FunctionOfPseudoJet<PseudoJet> * subtractor = 0);
158
159 /// default destructor
160 virtual ~IteratedSoftDrop(){}
161
162 //----------------------------------------------------------------------
163 // behaviour tweaks (inherited from RecursiveSoftDrop and RecursiveSymmetryCutBase)
164
165 /// switch to using a dynamical R0 (see RecursiveSoftDrop)
166 void set_dynamical_R0(bool value=true) { _rsd.set_dynamical_R0(value); }
167 bool use_dynamical_R0() const { return _rsd.use_dynamical_R0(); }
168
169 /// an alternative way to set the subtractor (see RecursiveSymmetryCutBase)
170 void set_subtractor(const FunctionOfPseudoJet<PseudoJet> * subtractor_) {_rsd.set_subtractor(subtractor_);}
171 const FunctionOfPseudoJet<PseudoJet> * subtractor() const {return _rsd.subtractor();}
172
173 /// returns the IteratedSoftDropInfo associated with the jet "jet"
174 IteratedSoftDropInfo result(const PseudoJet& jet) const;
175
176 /// Tells the tagger whether to assume that the input jet has
177 /// already been subtracted (relevant only with a non-null
178 /// subtractor, see RecursiveSymmetryCutBase)
179 void set_input_jet_is_subtracted(bool is_subtracted) { _rsd.set_input_jet_is_subtracted(is_subtracted);}
180 bool input_jet_is_subtracted() const {return _rsd.input_jet_is_subtracted();}
181
182 /// configure the reclustering prior to the recursive de-clustering
183 void set_reclustering(bool do_reclustering=true, const Recluster *recluster=0){
184 _rsd.set_reclustering(do_reclustering, recluster);
185 }
186
187 //----------------------------------------------------------------------
188 // actions on jets
189 /// returns vector of ISD symmetry factors and splitting angles
190 std::vector<std::pair<double,double> > all_zg_thetag(const PseudoJet& jet) const{
191 return result(jet).all_zg_thetag();
192 }
193
194 /// returns the angularity with angular exponent alpha and z
195 /// exponent kappa calculated on the zg's and thetag's found by
196 /// iterated SoftDrop
197 ///
198 /// returns 0 if no substructure was found
199 double angularity(const PseudoJet& jet, double alpha, double kappa=1.0) const{
200 return result(jet).angularity(alpha, kappa);
201 }
202
203 /// returns the Iterated SoftDrop multiplicity
204 double multiplicity(const PseudoJet& jet) const{ return result(jet).multiplicity(); }
205
206 /// description of the class
207 std::string description() const;
208
209protected:
210 RecursiveSoftDrop _rsd;
211};
212
213
214
215} // namespace contrib
216
217FASTJET_END_NAMESPACE
218
219#endif // __FASTJET_CONTRIB_ITERATEDSOFTDROP_HH__
Note: See TracBrowser for help on using the repository browser.