This file is indexed.

/usr/include/fastjet/ClusterSequenceAreaBase.hh is in libfastjet-dev 3.0.6+dfsg-3build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
//STARTHEADER
// $Id: ClusterSequenceAreaBase.hh 2687 2011-11-14 11:17:51Z soyez $
//
// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
//
//----------------------------------------------------------------------
// This file is part of FastJet.
//
//  FastJet is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//
//  The algorithms that underlie FastJet have required considerable
//  development and are described in hep-ph/0512210. If you use
//  FastJet as part of work towards a scientific publication, please
//  include a citation to the FastJet paper.
//
//  FastJet is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
//----------------------------------------------------------------------
//ENDHEADER

#ifndef __FASTJET_CLUSTERSEQUENCEAREABASE_HH__
#define __FASTJET_CLUSTERSEQUENCEAREABASE_HH__

#include "fastjet/ClusterSequence.hh"
#include "fastjet/LimitedWarning.hh"
#include "fastjet/Selector.hh"

FASTJET_BEGIN_NAMESPACE

/// @ingroup area_classes
/// \class ClusterSequenceAreaBase
/// base class that sets interface for extensions of ClusterSequence
/// that provide information about the area of each jet
///
/// the virtual functions here all return 0, since no area determination
/// is implemented.
class ClusterSequenceAreaBase : public ClusterSequence {
public:
  
  /// a constructor which just carries out the construction of the
  /// parent class
  template<class L> ClusterSequenceAreaBase
         (const std::vector<L> & pseudojets, 
	  const JetDefinition & jet_def_in,
	  const bool & writeout_combinations = false) :
           ClusterSequence(pseudojets, jet_def_in, writeout_combinations) {}


  /// default constructor
  ClusterSequenceAreaBase() {}


  /// destructor
  virtual ~ClusterSequenceAreaBase() {}


  /// return the area associated with the given jet; this base class
  /// returns 0.
  virtual double area       (const PseudoJet & ) const {return 0.0;}

  /// return the error (uncertainty) associated with the determination
  /// of the area of this jet; this base class returns 0.
  virtual double area_error (const PseudoJet & ) const {return 0.0;}

  /// return a PseudoJet whose 4-vector is defined by the following integral
  ///
  ///       \int drap d\phi PseudoJet("rap,phi,pt=one") *
  ///                           * Theta("rap,phi inside jet boundary")
  ///
  /// where PseudoJet("rap,phi,pt=one") is a 4-vector with the given
  /// rapidity (rap), azimuth (phi) and pt=1, while Theta("rap,phi
  /// inside jet boundary") is a function that is 1 when rap,phi
  /// define a direction inside the jet boundary and 0 otherwise.
  ///
  /// This base class returns a null 4-vector.
  virtual PseudoJet area_4vector(const PseudoJet & ) const {
    return PseudoJet(0.0,0.0,0.0,0.0);}

  /// true if a jet is made exclusively of ghosts
  ///
  /// NB: most area classes do not give any explicit ghost jets, but
  /// some do, and they should replace this function with their own
  /// version.
  virtual bool is_pure_ghost(const PseudoJet & ) const {
    return false;
  }

  /// returns true if ghosts are explicitly included within 
  /// jets for this ClusterSequence; 
  ///
  /// Derived classes that do include explicit ghosts should provide
  /// an alternative version of this routine and set it properly.
  virtual bool has_explicit_ghosts() const {
    return false;
  }

  /// return the total area, corresponding to the given Selector, that
  /// is free of jets, in general based on the inclusive jets.
  /// 
  /// The selector passed as an argument has to have a finite area and
  /// apply jet-by-jet (see the BackgroundEstimator and Subtractor
  /// tools for more generic usages)
  virtual double empty_area(const Selector & selector) const;

  /// return the total area, corresponding to the given Selector, that
  /// is free of jets, based on the supplied all_jets
  /// 
  /// The selector passed as an argument has to have a finite area and
  /// apply jet-by-jet (see the BackgroundEstimator and Subtractor
  /// tools for more generic usages)
  double empty_area_from_jets(const std::vector<PseudoJet> & all_jets,
			      const Selector & selector) const;

  /// return something similar to the number of pure ghost jets
  /// in the given selector's range in an active area case.
  /// For the local implementation we return empty_area/(0.55 pi R^2),
  /// based on measured properties of ghost jets with kt and cam
  /// (cf arXiv:0802.1188).
  ///
  /// Note that the number returned is a double.
  /// 
  /// The selector passed as an argument has to have a finite area and
  /// apply jet-by-jet (see the BackgroundEstimator and Subtractor
  /// tools for more generic usages)
  virtual double n_empty_jets(const Selector & selector) const {
    double R = jet_def().R();
    return empty_area(selector)/(0.55*pi*R*R);
  }

  /// the median of (pt/area) for jets contained within the selector
  /// range, making use also of the info on n_empty_jets
  /// 
  /// The selector passed as an argument has to have a finite area and
  /// apply jet-by-jet (see the BackgroundEstimator and Subtractor
  /// tools for more generic usages)
  double median_pt_per_unit_area(const Selector & selector) const;

  /// the median of (pt/area_4vector) for jets contained within the
  /// selector range, making use also of the info on n_empty_jets
  /// 
  /// The selector passed as an argument has to have a finite area and
  /// apply jet-by-jet
  double median_pt_per_unit_area_4vector(const Selector & selector) const;
  
  /// the function that does the work for median_pt_per_unit_area and 
  /// median_pt_per_unit_area_4vector: 
  /// - something_is_area_4vect = false -> use plain area
  /// - something_is_area_4vect = true  -> use 4-vector area
  double median_pt_per_unit_something(
                    const Selector & selector, bool use_area_4vector) const;

  /// using jets withing the selector range (and with 4-vector areas if
  /// use_area_4vector), calculate the median pt/area, as well as an
  /// "error" (uncertainty), which is defined as the 1-sigma
  /// half-width of the distribution of pt/A, obtained by looking for
  /// the point below which we have (1-0.6827)/2 of the jets
  /// (including empty jets).
  ///
  /// The subtraction for a jet with uncorrected pt pt^U and area A is
  ///
  ///   pt^S = pt^U - median*A +- sigma*sqrt(A)
  ///
  /// where the error is only that associated with the fluctuations
  /// in the noise and not that associated with the noise having 
  /// caused changes in the hard-particle content of the jet.
  /// 
  /// The selector passed as an argument has to have a finite area and
  /// apply jet-by-jet (see the BackgroundEstimator and Subtractor
  /// tools for more generic usages)
  ///
  /// NB: subtraction may also be done with 4-vector area of course,
  /// and this is recommended for jets with larger values of R, as
  /// long as rho has also been determined with a 4-vector area;
  /// using a scalar area causes one to neglect terms of relative
  /// order $R^2/8$ in the jet $p_t$.
  virtual void get_median_rho_and_sigma(const Selector & selector, 
                                        bool use_area_4vector,
                                        double & median, double & sigma,
                                        double & mean_area) const;

  /// a more advanced version of get_median_rho_and_sigma, which allows
  /// one to use any "view" of the event containing all jets (so that, 
  /// e.g. one might use Cam on a different resolution scale without
  /// have to rerun the algorithm).
  ///
  /// By default it will assume that "all" are not inclusive jets, 
  /// so that in dealing with empty area it has to calculate
  /// the number of empty jets based on the empty area and the
  /// the observed <area> of jets rather than a surmised area
  ///
  /// Note that for small effective radii, this can cause problems
  /// because the harder jets get an area >> <ghost-jet-area>
  /// and so the estimate comes out all wrong. In these situations
  /// it is highly advisable to use an area with explicit ghosts, since
  /// then the "empty" jets are actually visible.
  /// 
  /// The selector passed as an argument has to have a finite area and
  /// apply jet-by-jet (see the BackgroundEstimator and Subtractor
  /// tools for more generic usages)
  virtual void get_median_rho_and_sigma(const std::vector<PseudoJet> & all_jets,
					const Selector & selector, 
                                        bool use_area_4vector,
                                        double & median, double & sigma,
                                        double & mean_area,
					bool all_are_inclusive = false) const;

  /// same as the full version of get_median_rho_and_error, but without
  /// access to the mean_area
  /// 
  /// The selector passed as an argument has to have a finite area and
  /// apply jet-by-jet (see the BackgroundEstimator and Subtractor
  /// tools for more generic usages)
  virtual void get_median_rho_and_sigma(const Selector & selector, 
                                bool use_area_4vector,
                                double & median, double & sigma) const {
    double mean_area;
    get_median_rho_and_sigma(selector,  use_area_4vector,
                             median,  sigma, mean_area);
  }
  

  /// fits a form pt_per_unit_area(y) = a + b*y^2 in the selector range. 
  /// exclude_above allows one to exclude large values of pt/area from fit. 
  ///               (if negative, the cut is discarded)
  /// use_area_4vector = true uses the 4vector areas.
  /// 
  /// The selector passed as an argument has to have a finite area and
  /// apply jet-by-jet (see the BackgroundEstimator and Subtractor
  /// tools for more generic usages)
  virtual void parabolic_pt_per_unit_area(double & a, double & b, 
                                          const Selector & selector, 
                                          double exclude_above=-1.0, 
                                          bool use_area_4vector=false) const;

  /// return a vector of all subtracted jets, using area_4vector, given rho.
  /// Only inclusive_jets above ptmin are subtracted and returned.
  /// the ordering is the same as that of sorted_by_pt(cs.inclusive_jets()),
  /// i.e. not necessarily ordered in pt once subtracted
  std::vector<PseudoJet> subtracted_jets(const double rho,
                                         const double ptmin=0.0) const;

  /// return a vector of subtracted jets, using area_4vector.
  /// Only inclusive_jets above ptmin are subtracted and returned.
  /// the ordering is the same as that of sorted_by_pt(cs.inclusive_jets()),
  /// i.e. not necessarily ordered in pt once subtracted
  /// 
  /// The selector passed as an argument has to have a finite area and
  /// apply jet-by-jet (see the BackgroundEstimator and Subtractor
  /// tools for more generic usages)
  std::vector<PseudoJet> subtracted_jets(const Selector & selector, 
                                         const double ptmin=0.0) const;

  /// return a subtracted jet, using area_4vector, given rho
  PseudoJet subtracted_jet(const PseudoJet & jet,
                           const double rho) const;

  /// return a subtracted jet, using area_4vector; note
  /// that this is potentially inefficient if repeatedly used for many
  /// different jets, because rho will be recalculated each time
  /// around.
  /// 
  /// The selector passed as an argument has to have a finite area and
  /// apply jet-by-jet (see the BackgroundEstimator and Subtractor
  /// tools for more generic usages)
  PseudoJet subtracted_jet(const PseudoJet & jet,
                           const Selector & selector) const;

  /// return the subtracted pt, given rho
  double subtracted_pt(const PseudoJet & jet,
                       const double rho,
	               bool use_area_4vector=false) const;

  /// return the subtracted pt; note that this is
  /// potentially inefficient if repeatedly used for many different
  /// jets, because rho will be recalculated each time around.
  /// 
  /// The selector passed as an argument has to have a finite area and
  /// apply jet-by-jet (see the BackgroundEstimator and Subtractor
  /// tools for more generic usages)
  double subtracted_pt(const PseudoJet & jet,
                       const Selector & selector,
	               bool use_area_4vector=false) const;

protected:
  /// check the selector is suited for the computations i.e. applies jet by jet and has a finite area
  void _check_selector_good_for_median(const Selector &selector) const;


private:
  /// handle warning messages
  static LimitedWarning _warnings;
  static LimitedWarning _warnings_zero_area;
  static LimitedWarning _warnings_empty_area;

  /// check the jet algorithm is suitable (and if not issue a warning)
  void _check_jet_alg_good_for_median() const;
  
};



FASTJET_END_NAMESPACE

#endif // __FASTJET_CLUSTERSEQUENCEAREABASE_HH__