FastJet  3.0.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
PseudoJetStructureBase.cc
1 //STARTHEADER
2 // $Id: PseudoJetStructureBase.cc 3071 2013-04-01 12:52:46Z cacciari $
3 //
4 // Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
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, see <http://www.gnu.org/licenses/>.
26 //----------------------------------------------------------------------
27 //ENDHEADER
28 
29 
30 #include "fastjet/PseudoJetStructureBase.hh"
31 #include "fastjet/Error.hh"
32 #include "fastjet/PseudoJet.hh"
33 #include "fastjet/ClusterSequence.hh"
34 #ifndef __FJCORE__
35 #include "fastjet/ClusterSequenceAreaBase.hh"
36 #endif // __FJCORE__
37 
38 using namespace std;
39 
40 FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
41 
42 // PseudoJetStructureBase implementation
43 //
44 // Contains any information related to the clustering that should be
45 // directly accessible to PseudoJet.
46 //
47 // By default, this class implements basic access to the
48 // ClusterSequence related to a PseudoJet (like its constituents or
49 // its area). But it can be overloaded in order e.g. to give access
50 // to the jet substructure.
51 //
52 // Note that it accesses the underlying ClusterSequence through a
53 // ClusterSequenceWrapper object so it can check when the former goes
54 // out of scope.
55 //
56 
57 
58 //-------------------------------------------------------------
59 // Direct access to the associated ClusterSequence object.
60 //
61 // Get access to the associated ClusterSequence (if any)
62 //-------------------------------------------------------------
63 
64 // get a (const) pointer to the parent ClusterSequence (NULL if
65 // inexistent)
66 const ClusterSequence* PseudoJetStructureBase::associated_cluster_sequence() const{
67  return NULL;
68 }
69 
70 // if the jet has a valid associated cluster sequence then return a
71 // pointer to it; otherwise throw an error
72 //
73 // by default, an Error is thrown
74 const ClusterSequence * PseudoJetStructureBase::validated_cs() const{
75  throw Error("This PseudoJet structure is not associated with a valid ClusterSequence");
76 }
77 
78 #ifndef __FJCORE__
79 // if the jet has valid area information then return a pointer to
80 // the associated ClusterSequenceAreaBase object; otherwise throw an error
81 //
82 // by default, an Error is thrown
83 const ClusterSequenceAreaBase * PseudoJetStructureBase::validated_csab() const{
84  throw Error("This PseudoJet structure is not associated with a valid cluster sequence with area");
85 }
86 #endif
87 
88 
89 //-------------------------------------------------------------
90 // Methods for access to information about jet structure
91 //
92 // These allow access to jet constituents, and other jet
93 // subtructure information. They only work if the jet is associated
94 // with a ClusterSequence.
95 //-------------------------------------------------------------
96 
97 // check if it has been recombined with another PseudoJet in which
98 // case, return its partner through the argument. Otherwise,
99 // 'partner' is set to 0.
100 //
101 // by default, an Error is thrown
102 bool PseudoJetStructureBase::has_partner(const PseudoJet & /*reference */, PseudoJet & /*partner*/) const{
103  throw Error("This PseudoJet structure has no implementation for has_partner");
104 }
105 
106 // check if it has been recombined with another PseudoJet in which
107 // case, return its child through the argument. Otherwise, 'child'
108 // is set to 0.
109 //
110 // by default, an Error is thrown
111 bool PseudoJetStructureBase::has_child(const PseudoJet & /*reference*/, PseudoJet & /*child*/) const{
112  throw Error("This PseudoJet structure has no implementation for has_child");
113 }
114 
115 // check if it is the product of a recombination, in which case
116 // return the 2 parents through the 'parent1' and 'parent2'
117 // arguments. Otherwise, set these to 0.
118 //
119 // by default, an Error is thrown
120 bool PseudoJetStructureBase::has_parents(const PseudoJet & /*reference*/, PseudoJet &/*parent1*/, PseudoJet &/*parent2*/) const{
121  throw Error("This PseudoJet structure has no implementation for has_parents");
122 }
123 
124 // check if the reference PseudoJet is contained in the second one
125 // passed as argument.
126 //
127 // by default, an Error is thrown
128 bool PseudoJetStructureBase::object_in_jet(const PseudoJet & /*reference*/, const PseudoJet & /*jet*/) const{
129  throw Error("This PseudoJet structure has no implementation for is_inside");
130 }
131 
132 // retrieve the constituents.
133 //
134 // by default, an Error is thrown
135 vector<PseudoJet> PseudoJetStructureBase::constituents(const PseudoJet &/*reference*/) const{
136  throw Error("This PseudoJet structure has no implementation for constituents");
137 }
138 
139 // return a vector of all subjets of the current jet (in the sense
140 // of the exclusive algorithm) that would be obtained when running
141 // the algorithm with the given dcut.
142 //
143 // Time taken is O(m ln m), where m is the number of subjets that
144 // are found. If m gets to be of order of the total number of
145 // constituents in the jet, this could be substantially slower than
146 // just getting that list of constituents.
147 //
148 // by default, an Error is thrown
149 vector<PseudoJet> PseudoJetStructureBase::exclusive_subjets (const PseudoJet & /*reference*/, const double & /*dcut*/) const{
150  throw Error("This PseudoJet structure has no implementation for exclusive_subjets");
151 }
152 
153 // return the size of exclusive_subjets(...); still n ln n with same
154 // coefficient, but marginally more efficient than manually taking
155 // exclusive_subjets.size()
156 //
157 // by default, an Error is thrown
158 int PseudoJetStructureBase::n_exclusive_subjets(const PseudoJet & /*reference*/, const double & /*dcut*/) const{
159  throw Error("This PseudoJet structure has no implementation for n_exclusive_subjets");
160 }
161 
162 // return the list of subjets obtained by unclustering the supplied
163 // jet down to n subjets (or all constituents if there are fewer
164 // than n).
165 //
166 // by default, an Error is thrown
167 vector<PseudoJet> PseudoJetStructureBase::exclusive_subjets_up_to (const PseudoJet & /*reference*/, int /*nsub*/) const{
168  throw Error("This PseudoJet structure has no implementation for exclusive_subjets");
169 }
170 
171 // return the dij that was present in the merging nsub+1 -> nsub
172 // subjets inside this jet.
173 //
174 // by default, an Error is thrown
175 double PseudoJetStructureBase::exclusive_subdmerge(const PseudoJet & /*reference*/, int /*nsub*/) const{
176  throw Error("This PseudoJet structure has no implementation for exclusive_submerge");
177 }
178 
179 // return the maximum dij that occurred in the whole event at the
180 // stage that the nsub+1 -> nsub merge of subjets occurred inside
181 // this jet.
182 //
183 // by default, an Error is thrown
184 double PseudoJetStructureBase::exclusive_subdmerge_max(const PseudoJet & /*reference*/, int /*nsub*/) const{
185  throw Error("This PseudoJet structure has no implementation for exclusive_submerge_max");
186 }
187 
188 
189 // retrieve the pieces building the jet.
190 //
191 // by default, an Error is thrown
192 std::vector<PseudoJet> PseudoJetStructureBase::pieces(const PseudoJet & /*reference*/) const{
193  throw Error("This PseudoJet structure has no implementation for pieces");
194 }
195 
196 // the following ones require a computation of the area in the
197 // parent ClusterSequence (See ClusterSequenceAreaBase for details)
198 //------------------------------------------------------------------
199 #ifndef __FJCORE__
200 
201 // return the jet (scalar) area.
202 //
203 // by default, an Error is thrown
204 double PseudoJetStructureBase::area(const PseudoJet & /*reference*/) const{
205  throw Error("This PseudoJet structure has no implementation for area");
206 }
207 
208 // return the error (uncertainty) associated with the determination
209 // of the area of this jet.
210 //
211 // by default, an Error is thrown
212 double PseudoJetStructureBase::area_error(const PseudoJet & /*reference*/) const{
213  throw Error("This PseudoJet structure has no implementation for area_error");
214 }
215 
216 // return the jet 4-vector area.
217 //
218 // by default, an Error is thrown
219 PseudoJet PseudoJetStructureBase::area_4vector(const PseudoJet & /*reference*/) const{
220  throw Error("This PseudoJet structure has no implementation for area_4vector");
221 }
222 
223 // true if this jet is made exclusively of ghosts.
224 //
225 // by default, an Error is thrown
226 bool PseudoJetStructureBase::is_pure_ghost(const PseudoJet & /*reference*/) const{
227  throw Error("This PseudoJet structure has no implementation for is_pure_ghost");
228 }
229 #endif // __FJCORE__
230 
231 FASTJET_END_NAMESPACE
deals with clustering
base class that sets interface for extensions of ClusterSequence that provide information about the a...
base class corresponding to errors that can be thrown by FastJet
Definition: Error.hh:41
Class to contain pseudojets, including minimal information of use to jet-clustering routines...
Definition: PseudoJet.hh:65