Fork me on GitHub

source: svn/trunk/Utilities/Fastjet/include/fastjet/ClusterSequenceAreaBase.hh@ 736

Last change on this file since 736 was 11, checked in by severine ovyn, 16 years ago

Fastjet added; CDFCones directory has been changed

File size: 8.8 KB
Line 
1//STARTHEADER
2// $Id: ClusterSequenceAreaBase.hh,v 1.1 2008-11-06 14:32:08 ovyn Exp $
3//
4// Copyright (c) 2005-2006, Matteo Cacciari and Gavin Salam
5//
6//----------------------------------------------------------------------
7// This file is part of FastJet.
8//
9// FastJet is free software; you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation; either version 2 of the License, or
12// (at your option) any later version.
13//
14// The algorithms that underlie FastJet have required considerable
15// development and are described in hep-ph/0512210. If you use
16// FastJet as part of work towards a scientific publication, please
17// include a citation to the FastJet paper.
18//
19// FastJet is distributed in the hope that it will be useful,
20// but WITHOUT ANY WARRANTY; without even the implied warranty of
21// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22// GNU General Public License for more details.
23//
24// You should have received a copy of the GNU General Public License
25// along with FastJet; if not, write to the Free Software
26// Foundation, Inc.:
27// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28//----------------------------------------------------------------------
29//ENDHEADER
30
31#ifndef __FASTJET_CLUSTERSEQUENCEAREABASE_HH__
32#define __FASTJET_CLUSTERSEQUENCEAREABASE_HH__
33
34#include "Utilities/Fastjet/include/fastjet/ClusterSequence.hh"
35#include "Utilities/Fastjet/include/fastjet/internal/LimitedWarning.hh"
36#include "Utilities/Fastjet/include/fastjet/RangeDefinition.hh"
37
38FASTJET_BEGIN_NAMESPACE
39
40/// base class that sets interface for extensions of ClusterSequence
41/// that provide information about the area of each jet;
42///
43/// the virtual functions here all return 0, since no area determination
44/// is implemented.
45class ClusterSequenceAreaBase : public ClusterSequence {
46public:
47
48 /// a constructor which just carries out the construction of the
49 /// parent class
50 template<class L> ClusterSequenceAreaBase
51 (const std::vector<L> & pseudojets,
52 const JetDefinition & jet_def,
53 const bool & writeout_combinations = false) :
54 ClusterSequence(pseudojets, jet_def, writeout_combinations) {}
55
56
57 /// default constructor
58 ClusterSequenceAreaBase() {}
59
60
61 /// destructor
62 virtual ~ClusterSequenceAreaBase() {}
63
64
65 /// return the area associated with the given jet; this base class
66 /// returns 0.
67 virtual double area (const PseudoJet & jet) const {return 0.0;}
68
69 /// return the error (uncertainty) associated with the determination
70 /// of the area of this jet; this base class returns 0.
71 virtual double area_error (const PseudoJet & jet) const {return 0.0;}
72
73 /// return a PseudoJet whose 4-vector is defined by the following integral
74 ///
75 /// \int drap d\phi PseudoJet("rap,phi,pt=one") *
76 /// * Theta("rap,phi inside jet boundary")
77 ///
78 /// where PseudoJet("rap,phi,pt=one") is a 4-vector with the given
79 /// rapidity (rap), azimuth (phi) and pt=1, while Theta("rap,phi
80 /// inside jet boundary") is a function that is 1 when rap,phi
81 /// define a direction inside the jet boundary and 0 otherwise.
82 ///
83 /// This base class returns a null 4-vector.
84 virtual PseudoJet area_4vector(const PseudoJet & jet) const {
85 return PseudoJet(0.0,0.0,0.0,0.0);}
86
87 /// true if a jet is made exclusively of ghosts
88 ///
89 /// NB: most area classes do not give any explicit ghost jets, but
90 /// some do, and they should replace this function with their own
91 /// version.
92 virtual bool is_pure_ghost(const PseudoJet & jet) const {
93 return false;
94 }
95
96 /// return the total area, within range, that is free of jets
97 virtual double empty_area(const RangeDefinition & range) const;
98
99 /// return something similar to the number of pure ghost jets
100 /// in the given range in an active area case.
101 /// For the local implementation we return empty_area/(0.55 pi R^2),
102 /// based on measured properties of ghost jets with kt and cam. Note
103 /// that the number returned is a double.
104 virtual double n_empty_jets(const RangeDefinition & range) const {
105 double R = jet_def().R();
106 return empty_area(range)/(0.55*pi*R*R);
107 }
108
109 /// the median of (pt/area) for jets contained within range,
110 /// making use also of the info on n_empty_jets
111 double median_pt_per_unit_area(const RangeDefinition & range) const;
112
113 /// the median of (pt/area_4vector) for jets contained within
114 /// making use also of the info on n_empty_jets
115 double median_pt_per_unit_area_4vector(const RangeDefinition & range) const;
116
117 /// the function that does the work for median_pt_per_unit_area and
118 /// median_pt_per_unit_area_4vector:
119 /// - something_is_area_4vect = false -> use plain area
120 /// - something_is_area_4vect = true -> use 4-vector area
121 double median_pt_per_unit_something(
122 const RangeDefinition & range, bool use_area_4vector) const;
123
124 /// using jets withing range (and with 4-vector areas if
125 /// use_area_4vector), calculate the median pt/area, as well as an
126 /// "error" (uncertainty), which is defined as the 1-sigma
127 /// half-width of the distribution of pt/A, obtained by looking for
128 /// the point below which we have (1-0.6827)/2 of the jets
129 /// (including empty jets).
130 ///
131 /// The subtraction for a jet with uncorrected pt pt^U and area A is
132 ///
133 /// pt^S = pt^U - median*A +- sigma*sqrt(A)
134 ///
135 /// where the error is only that associated with the fluctuations
136 /// in the noise and not that associated with the noise having
137 /// caused changes in the hard-particle content of the jet.
138 ///
139 /// (NB: subtraction may also be done with 4-vector area of course)
140 virtual void get_median_rho_and_sigma(const RangeDefinition & range,
141 bool use_area_4vector,
142 double & median, double & sigma,
143 double & mean_area) const;
144
145 /// same as the full version of get_median_rho_and_error, but without
146 /// access to the mean_area
147 virtual void get_median_rho_and_sigma(const RangeDefinition & range,
148 bool use_area_4vector,
149 double & median, double & sigma) const {
150 double mean_area;
151 get_median_rho_and_sigma(range, use_area_4vector,
152 median, sigma, mean_area);
153 }
154
155
156 /// fits a form pt_per_unit_area(y) = a + b*y^2 in the range "range".
157 /// exclude_above allows one to exclude large values of pt/area from fit.
158 /// use_area_4vector = true uses the 4vector areas.
159 virtual void parabolic_pt_per_unit_area(double & a, double & b,
160 const RangeDefinition & range,
161 double exclude_above=-1.0,
162 bool use_area_4vector=false) const;
163
164
165 /// return a vector of all subtracted jets, using area_4vector, given rho.
166 /// Only inclusive_jets above ptmin are subtracted and returned.
167 /// the ordering is the same as that of sorted_by_pt(cs.inclusive_jets()),
168 /// i.e. not necessarily ordered in pt once subtracted
169 std::vector<PseudoJet> subtracted_jets(const double rho,
170 const double ptmin=0.0) const;
171
172 /// return a vector of subtracted jets, using area_4vector.
173 /// Only inclusive_jets above ptmin are subtracted and returned.
174 /// the ordering is the same as that of sorted_by_pt(cs.inclusive_jets()),
175 /// i.e. not necessarily ordered in pt once subtracted
176 std::vector<PseudoJet> subtracted_jets(const RangeDefinition & range,
177 const double ptmin=0.0) const;
178
179 /// return a subtracted jet, using area_4vector, given rho
180 PseudoJet subtracted_jet(const PseudoJet & jet,
181 const double rho) const;
182
183 /// return a subtracted jet, using area_4vector; note
184 /// that this is potentially inefficient if repeatedly used for many
185 /// different jets, because rho will be recalculated each time
186 /// around.
187 PseudoJet subtracted_jet(const PseudoJet & jet,
188 const RangeDefinition & range) const;
189
190 /// return the subtracted pt, given rho
191 double subtracted_pt(const PseudoJet & jet,
192 const double rho,
193 bool use_area_4vector=false) const;
194
195 /// return the subtracted pt; note that this is
196 /// potentially inefficient if repeatedly used for many different
197 /// jets, because rho will be recalculated each time around.
198 double subtracted_pt(const PseudoJet & jet,
199 const RangeDefinition & range,
200 bool use_area_4vector=false) const;
201
202
203private:
204 /// handle warning messages
205 static LimitedWarning _warnings;
206
207 /// check the jet algorithm is suitable (and if not issue a warning)
208 void _check_jet_alg_good_for_median() const;
209
210};
211
212
213
214FASTJET_END_NAMESPACE
215
216#endif // __FASTJET_CLUSTERSEQUENCEAREABASE_HH__
Note: See TracBrowser for help on using the repository browser.