FastJet 3.0beta1
PseudoJetStructureBase.cc
00001 //STARTHEADER
00002 // $Id: PseudoJetStructureBase.cc 2326 2011-06-30 14:02:09Z salam $
00003 //
00004 // Copyright (c) 2005-2010, Matteo Cacciari, Gavin 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, write to the Free Software
00026 //  Foundation, Inc.:
00027 //      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00028 //----------------------------------------------------------------------
00029 //ENDHEADER
00030 
00031 
00032 #include "fastjet/PseudoJetStructureBase.hh"
00033 #include "fastjet/Error.hh"
00034 #include "fastjet/PseudoJet.hh"
00035 #include "fastjet/ClusterSequence.hh"
00036 #include "fastjet/ClusterSequenceAreaBase.hh"
00037 
00038 using namespace std;
00039 
00040 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
00041 
00042 // PseudoJetStructureBase implementation
00043 //
00044 // Contains any information related to the clustering that should be
00045 // directly accessible to PseudoJet.
00046 //
00047 // By default, this class implements basic access to the
00048 // ClusterSequence related to a PseudoJet (like its constituents or
00049 // its area). But it can be overloaded in order e.g. to give access
00050 // to the jet substructure.
00051 //
00052 // Note that it accesses the underlying ClusterSequence through a
00053 // ClusterSequenceWrapper object so it can check when the former goes
00054 // out of scope.
00055 //
00056 
00057 
00058 //-------------------------------------------------------------
00059 // Direct access to the associated ClusterSequence object.
00060 //
00061 // Get access to the associated ClusterSequence (if any)
00062 //-------------------------------------------------------------
00063 
00064 // get a (const) pointer to the parent ClusterSequence (NULL if
00065 // inexistent)
00066 const ClusterSequence* PseudoJetStructureBase::associated_cluster_sequence() const{
00067   return NULL;
00068 }
00069   
00070 // if the jet has a valid associated cluster sequence then return a
00071 // pointer to it; otherwise throw an error
00072 //
00073 // by default, an Error is thrown
00074 const ClusterSequence * PseudoJetStructureBase::validated_cs() const{
00075   throw Error("This PseudoJet structure is not associated with a valid ClusterSequence");
00076 }
00077 
00078 // if the jet has valid area information then return a pointer to
00079 // the associated ClusterSequenceAreaBase object; otherwise throw an error
00080 //
00081 // by default, an Error is thrown
00082 const ClusterSequenceAreaBase * PseudoJetStructureBase::validated_csab() const{
00083   throw Error("This PseudoJet structure is not associated with a valid cluster sequence with area");
00084 }
00085 
00086 
00087 //-------------------------------------------------------------
00088 // Methods for access to information about jet structure
00089 //
00090 // These allow access to jet constituents, and other jet
00091 // subtructure information. They only work if the jet is associated
00092 // with a ClusterSequence.
00093 //-------------------------------------------------------------
00094 
00095 // check if it has been recombined with another PseudoJet in which
00096 // case, return its partner through the argument. Otherwise,
00097 // 'partner' is set to 0.
00098 //
00099 // by default, an Error is thrown
00100 bool PseudoJetStructureBase::has_partner(const PseudoJet &reference, PseudoJet &partner) const{
00101   throw Error("This PseudoJet structure has no implementation for has_partner");
00102 }
00103 
00104 // check if it has been recombined with another PseudoJet in which
00105 // case, return its child through the argument. Otherwise, 'child'
00106 // is set to 0.
00107 // 
00108 // by default, an Error is thrown
00109 bool PseudoJetStructureBase::has_child(const PseudoJet &reference, PseudoJet &child) const{
00110   throw Error("This PseudoJet structure has no implementation for has_child");
00111 }
00112 
00113 // check if it is the product of a recombination, in which case
00114 // return the 2 parents through the 'parent1' and 'parent2'
00115 // arguments. Otherwise, set these to 0.
00116 //
00117 // by default, an Error is thrown
00118 bool PseudoJetStructureBase::has_parents(const PseudoJet &reference, PseudoJet &parent1, PseudoJet &parent2) const{
00119   throw Error("This PseudoJet structure has no implementation for has_parents");
00120 }
00121 
00122 // check if the reference PseudoJet is contained in the second one
00123 // passed as argument.
00124 //
00125 // by default, an Error is thrown
00126 bool PseudoJetStructureBase::object_in_jet(const PseudoJet &reference, const PseudoJet &jet) const{
00127   throw Error("This PseudoJet structure has no implementation for is_inside");
00128 }
00129 
00130 // retrieve the constituents. 
00131 //
00132 // by default, an Error is thrown
00133 vector<PseudoJet> PseudoJetStructureBase::constituents(const PseudoJet &reference) const{
00134   throw Error("This PseudoJet structure has no implementation for constituents");
00135 }
00136 
00137 // return a vector of all subjets of the current jet (in the sense
00138 // of the exclusive algorithm) that would be obtained when running
00139 // the algorithm with the given dcut. 
00140 //
00141 // Time taken is O(m ln m), where m is the number of subjets that
00142 // are found. If m gets to be of order of the total number of
00143 // constituents in the jet, this could be substantially slower than
00144 // just getting that list of constituents.
00145 //
00146 // by default, an Error is thrown
00147 vector<PseudoJet> PseudoJetStructureBase::exclusive_subjets (const PseudoJet &reference, const double & dcut) const{
00148   throw Error("This PseudoJet structure has no implementation for exclusive_subjets");
00149 }
00150 
00151 // return the size of exclusive_subjets(...); still n ln n with same
00152 // coefficient, but marginally more efficient than manually taking
00153 // exclusive_subjets.size()
00154 //
00155 // by default, an Error is thrown
00156 int PseudoJetStructureBase::n_exclusive_subjets(const PseudoJet &reference, const double & dcut) const{
00157   throw Error("This PseudoJet structure has no implementation for n_exclusive_subjets");
00158 }
00159 
00160 // return the list of subjets obtained by unclustering the supplied
00161 // jet down to n subjets (or all constituents if there are fewer
00162 // than n).
00163 //
00164 // by default, an Error is thrown
00165 vector<PseudoJet> PseudoJetStructureBase::exclusive_subjets_up_to (const PseudoJet &reference, int nsub) const{
00166   throw Error("This PseudoJet structure has no implementation for exclusive_subjets");
00167 }
00168 
00169 // return the dij that was present in the merging nsub+1 -> nsub 
00170 // subjets inside this jet.
00171 //
00172 // by default, an Error is thrown
00173 double PseudoJetStructureBase::exclusive_subdmerge(const PseudoJet &reference, int nsub) const{
00174   throw Error("This PseudoJet structure has no implementation for exclusive_submerge");
00175 }
00176 
00177 // return the maximum dij that occurred in the whole event at the
00178 // stage that the nsub+1 -> nsub merge of subjets occurred inside 
00179 // this jet.
00180 //
00181 // by default, an Error is thrown
00182 double PseudoJetStructureBase::exclusive_subdmerge_max(const PseudoJet &reference, int nsub) const{
00183   throw Error("This PseudoJet structure has no implementation for exclusive_submerge_max");
00184 }
00185 
00186 
00187 // retrieve the pieces building the jet. 
00188 //
00189 // by default, an Error is thrown
00190 std::vector<PseudoJet> PseudoJetStructureBase::pieces(const PseudoJet &reference) const{
00191   throw Error("This PseudoJet structure has no implementation for pieces");  
00192 }
00193 
00194 // the following ones require a computation of the area in the
00195 // parent ClusterSequence (See ClusterSequenceAreaBase for details)
00196 //------------------------------------------------------------------
00197 
00198 // return the jet (scalar) area.
00199 //
00200 // by default, an Error is thrown
00201 double PseudoJetStructureBase::area(const PseudoJet &reference) const{
00202   throw Error("This PseudoJet structure has no implementation for area");
00203 }
00204 
00205 // return the error (uncertainty) associated with the determination
00206 // of the area of this jet.
00207 //
00208 // by default, an Error is thrown
00209 double PseudoJetStructureBase::area_error(const PseudoJet &reference) const{
00210   throw Error("This PseudoJet structure has no implementation for area_error");
00211 }
00212 
00213 // return the jet 4-vector area.
00214 //
00215 // by default, an Error is thrown
00216 PseudoJet PseudoJetStructureBase::area_4vector(const PseudoJet &reference) const{
00217   throw Error("This PseudoJet structure has no implementation for area_4vector");
00218 }
00219 
00220 // true if this jet is made exclusively of ghosts.
00221 //
00222 // by default, an Error is thrown
00223 bool PseudoJetStructureBase::is_pure_ghost(const PseudoJet &reference) const{
00224   throw Error("This PseudoJet structure has no implementation for is_pure_ghost");
00225 }
00226 
00227 FASTJET_END_NAMESPACE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends