FastJet 3.0.0
PseudoJetStructureBase.cc
00001 //STARTHEADER
00002 // $Id: PseudoJetStructureBase.cc 2577 2011-09-13 15:11:38Z salam $
00003 //
00004 // Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
00005 //
00006 //----------------------------------------------------------------------
00007 // This file is part of FastJet.
00008 //
00009 //  FastJet is free software; you can redistribute it and/or modify
00010 //  it under the terms of the GNU General Public License as published by
00011 //  the Free Software Foundation; either version 2 of the License, or
00012 //  (at your option) any later version.
00013 //
00014 //  The algorithms that underlie FastJet have required considerable
00015 //  development and are described in hep-ph/0512210. If you use
00016 //  FastJet as part of work towards a scientific publication, please
00017 //  include a citation to the FastJet paper.
00018 //
00019 //  FastJet is distributed in the hope that it will be useful,
00020 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00021 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022 //  GNU General Public License for more details.
00023 //
00024 //  You should have received a copy of the GNU General Public License
00025 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
00026 //----------------------------------------------------------------------
00027 //ENDHEADER
00028 
00029 
00030 #include "fastjet/PseudoJetStructureBase.hh"
00031 #include "fastjet/Error.hh"
00032 #include "fastjet/PseudoJet.hh"
00033 #include "fastjet/ClusterSequence.hh"
00034 #include "fastjet/ClusterSequenceAreaBase.hh"
00035 
00036 using namespace std;
00037 
00038 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
00039 
00040 // PseudoJetStructureBase implementation
00041 //
00042 // Contains any information related to the clustering that should be
00043 // directly accessible to PseudoJet.
00044 //
00045 // By default, this class implements basic access to the
00046 // ClusterSequence related to a PseudoJet (like its constituents or
00047 // its area). But it can be overloaded in order e.g. to give access
00048 // to the jet substructure.
00049 //
00050 // Note that it accesses the underlying ClusterSequence through a
00051 // ClusterSequenceWrapper object so it can check when the former goes
00052 // out of scope.
00053 //
00054 
00055 
00056 //-------------------------------------------------------------
00057 // Direct access to the associated ClusterSequence object.
00058 //
00059 // Get access to the associated ClusterSequence (if any)
00060 //-------------------------------------------------------------
00061 
00062 // get a (const) pointer to the parent ClusterSequence (NULL if
00063 // inexistent)
00064 const ClusterSequence* PseudoJetStructureBase::associated_cluster_sequence() const{
00065   return NULL;
00066 }
00067   
00068 // if the jet has a valid associated cluster sequence then return a
00069 // pointer to it; otherwise throw an error
00070 //
00071 // by default, an Error is thrown
00072 const ClusterSequence * PseudoJetStructureBase::validated_cs() const{
00073   throw Error("This PseudoJet structure is not associated with a valid ClusterSequence");
00074 }
00075 
00076 // if the jet has valid area information then return a pointer to
00077 // the associated ClusterSequenceAreaBase object; otherwise throw an error
00078 //
00079 // by default, an Error is thrown
00080 const ClusterSequenceAreaBase * PseudoJetStructureBase::validated_csab() const{
00081   throw Error("This PseudoJet structure is not associated with a valid cluster sequence with area");
00082 }
00083 
00084 
00085 //-------------------------------------------------------------
00086 // Methods for access to information about jet structure
00087 //
00088 // These allow access to jet constituents, and other jet
00089 // subtructure information. They only work if the jet is associated
00090 // with a ClusterSequence.
00091 //-------------------------------------------------------------
00092 
00093 // check if it has been recombined with another PseudoJet in which
00094 // case, return its partner through the argument. Otherwise,
00095 // 'partner' is set to 0.
00096 //
00097 // by default, an Error is thrown
00098 bool PseudoJetStructureBase::has_partner(const PseudoJet &reference, PseudoJet &partner) const{
00099   throw Error("This PseudoJet structure has no implementation for has_partner");
00100 }
00101 
00102 // check if it has been recombined with another PseudoJet in which
00103 // case, return its child through the argument. Otherwise, 'child'
00104 // is set to 0.
00105 // 
00106 // by default, an Error is thrown
00107 bool PseudoJetStructureBase::has_child(const PseudoJet &reference, PseudoJet &child) const{
00108   throw Error("This PseudoJet structure has no implementation for has_child");
00109 }
00110 
00111 // check if it is the product of a recombination, in which case
00112 // return the 2 parents through the 'parent1' and 'parent2'
00113 // arguments. Otherwise, set these to 0.
00114 //
00115 // by default, an Error is thrown
00116 bool PseudoJetStructureBase::has_parents(const PseudoJet &reference, PseudoJet &parent1, PseudoJet &parent2) const{
00117   throw Error("This PseudoJet structure has no implementation for has_parents");
00118 }
00119 
00120 // check if the reference PseudoJet is contained in the second one
00121 // passed as argument.
00122 //
00123 // by default, an Error is thrown
00124 bool PseudoJetStructureBase::object_in_jet(const PseudoJet &reference, const PseudoJet &jet) const{
00125   throw Error("This PseudoJet structure has no implementation for is_inside");
00126 }
00127 
00128 // retrieve the constituents. 
00129 //
00130 // by default, an Error is thrown
00131 vector<PseudoJet> PseudoJetStructureBase::constituents(const PseudoJet &reference) const{
00132   throw Error("This PseudoJet structure has no implementation for constituents");
00133 }
00134 
00135 // return a vector of all subjets of the current jet (in the sense
00136 // of the exclusive algorithm) that would be obtained when running
00137 // the algorithm with the given dcut. 
00138 //
00139 // Time taken is O(m ln m), where m is the number of subjets that
00140 // are found. If m gets to be of order of the total number of
00141 // constituents in the jet, this could be substantially slower than
00142 // just getting that list of constituents.
00143 //
00144 // by default, an Error is thrown
00145 vector<PseudoJet> PseudoJetStructureBase::exclusive_subjets (const PseudoJet &reference, const double & dcut) const{
00146   throw Error("This PseudoJet structure has no implementation for exclusive_subjets");
00147 }
00148 
00149 // return the size of exclusive_subjets(...); still n ln n with same
00150 // coefficient, but marginally more efficient than manually taking
00151 // exclusive_subjets.size()
00152 //
00153 // by default, an Error is thrown
00154 int PseudoJetStructureBase::n_exclusive_subjets(const PseudoJet &reference, const double & dcut) const{
00155   throw Error("This PseudoJet structure has no implementation for n_exclusive_subjets");
00156 }
00157 
00158 // return the list of subjets obtained by unclustering the supplied
00159 // jet down to n subjets (or all constituents if there are fewer
00160 // than n).
00161 //
00162 // by default, an Error is thrown
00163 vector<PseudoJet> PseudoJetStructureBase::exclusive_subjets_up_to (const PseudoJet &reference, int nsub) const{
00164   throw Error("This PseudoJet structure has no implementation for exclusive_subjets");
00165 }
00166 
00167 // return the dij that was present in the merging nsub+1 -> nsub 
00168 // subjets inside this jet.
00169 //
00170 // by default, an Error is thrown
00171 double PseudoJetStructureBase::exclusive_subdmerge(const PseudoJet &reference, int nsub) const{
00172   throw Error("This PseudoJet structure has no implementation for exclusive_submerge");
00173 }
00174 
00175 // return the maximum dij that occurred in the whole event at the
00176 // stage that the nsub+1 -> nsub merge of subjets occurred inside 
00177 // this jet.
00178 //
00179 // by default, an Error is thrown
00180 double PseudoJetStructureBase::exclusive_subdmerge_max(const PseudoJet &reference, int nsub) const{
00181   throw Error("This PseudoJet structure has no implementation for exclusive_submerge_max");
00182 }
00183 
00184 
00185 // retrieve the pieces building the jet. 
00186 //
00187 // by default, an Error is thrown
00188 std::vector<PseudoJet> PseudoJetStructureBase::pieces(const PseudoJet &reference) const{
00189   throw Error("This PseudoJet structure has no implementation for pieces");  
00190 }
00191 
00192 // the following ones require a computation of the area in the
00193 // parent ClusterSequence (See ClusterSequenceAreaBase for details)
00194 //------------------------------------------------------------------
00195 
00196 // return the jet (scalar) area.
00197 //
00198 // by default, an Error is thrown
00199 double PseudoJetStructureBase::area(const PseudoJet &reference) const{
00200   throw Error("This PseudoJet structure has no implementation for area");
00201 }
00202 
00203 // return the error (uncertainty) associated with the determination
00204 // of the area of this jet.
00205 //
00206 // by default, an Error is thrown
00207 double PseudoJetStructureBase::area_error(const PseudoJet &reference) const{
00208   throw Error("This PseudoJet structure has no implementation for area_error");
00209 }
00210 
00211 // return the jet 4-vector area.
00212 //
00213 // by default, an Error is thrown
00214 PseudoJet PseudoJetStructureBase::area_4vector(const PseudoJet &reference) const{
00215   throw Error("This PseudoJet structure has no implementation for area_4vector");
00216 }
00217 
00218 // true if this jet is made exclusively of ghosts.
00219 //
00220 // by default, an Error is thrown
00221 bool PseudoJetStructureBase::is_pure_ghost(const PseudoJet &reference) const{
00222   throw Error("This PseudoJet structure has no implementation for is_pure_ghost");
00223 }
00224 
00225 FASTJET_END_NAMESPACE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends