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