Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:57:18

0001 #ifndef __FASTJET_PSEUDOJET_STRUCTURE_BASE_HH__
0002 #define __FASTJET_PSEUDOJET_STRUCTURE_BASE_HH__
0003 
0004 //FJSTARTHEADER
0005 // $Id$
0006 //
0007 // Copyright (c) 2005-2021, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
0008 //
0009 //----------------------------------------------------------------------
0010 // This file is part of FastJet.
0011 //
0012 //  FastJet is free software; you can redistribute it and/or modify
0013 //  it under the terms of the GNU General Public License as published by
0014 //  the Free Software Foundation; either version 2 of the License, or
0015 //  (at your option) any later version.
0016 //
0017 //  The algorithms that underlie FastJet have required considerable
0018 //  development. They are described in the original FastJet paper,
0019 //  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
0020 //  FastJet as part of work towards a scientific publication, please
0021 //  quote the version you use and include a citation to the manual and
0022 //  optionally also to hep-ph/0512210.
0023 //
0024 //  FastJet is distributed in the hope that it will be useful,
0025 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
0026 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0027 //  GNU General Public License for more details.
0028 //
0029 //  You should have received a copy of the GNU General Public License
0030 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
0031 //----------------------------------------------------------------------
0032 //FJENDHEADER
0033 
0034 
0035 #include "fastjet/internal/base.hh"
0036 
0037 #include <vector>
0038 #include <string>
0039 
0040 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
0041 
0042 class PseudoJet;
0043 class ClusterSequence;
0044 #ifndef __FJCORE__
0045 class ClusterSequenceAreaBase;
0046 #endif  // __FJCORE__
0047 
0048 /// @ingroup extra_info
0049 /// \class PseudoJetStructureBase
0050 ///
0051 /// Contains any information related to the clustering that should be
0052 /// directly accessible to PseudoJet.
0053 ///
0054 /// By default, this class implements basic access to the
0055 /// ClusterSequence related to a PseudoJet (like its constituents or
0056 /// its area). But it can be overloaded in order e.g. to give access
0057 /// to the jet substructure.
0058 ///
0059 class PseudoJetStructureBase{
0060 public:
0061   /// default ctor
0062   PseudoJetStructureBase(){};
0063 
0064   /// default (virtual) dtor
0065   virtual ~PseudoJetStructureBase(){};
0066 
0067   /// description
0068   virtual std::string description() const{ return "PseudoJet with an unknown structure"; }
0069 
0070   //-------------------------------------------------------------
0071   /// @name Direct access to the associated ClusterSequence object.
0072   ///
0073   /// Get access to the associated ClusterSequence (if any)
0074   //\{
0075   //-------------------------------------------------------------
0076   /// returns true if there is an associated ClusterSequence
0077   virtual bool has_associated_cluster_sequence() const { return false;}
0078 
0079   /// get a (const) pointer to the parent ClusterSequence (NULL if
0080   /// inexistent)
0081   virtual const ClusterSequence* associated_cluster_sequence() const;
0082   
0083   /// returns true if this PseudoJet has an associated and still
0084   /// valid ClusterSequence.
0085   virtual bool has_valid_cluster_sequence() const {return false;}
0086 
0087   /// if the jet has a valid associated cluster sequence then return a
0088   /// pointer to it; otherwise throw an error
0089   virtual const ClusterSequence * validated_cs() const;
0090 
0091 #ifndef __FJCORE__
0092   /// if the jet has valid area information then return a pointer to
0093   /// the associated ClusterSequenceAreaBase object; otherwise throw an error
0094   virtual const ClusterSequenceAreaBase * validated_csab() const;
0095 #endif
0096 
0097   //\}
0098 
0099   //-------------------------------------------------------------
0100   /// @name Methods for access to information about jet structure
0101   ///
0102   /// These allow access to jet constituents, and other jet
0103   /// subtructure information. They only work if the jet is associated
0104   /// with a ClusterSequence.
0105   //-------------------------------------------------------------
0106   //\{
0107 
0108   /// check if it has been recombined with another PseudoJet in which
0109   /// case, return its partner through the argument. Otherwise,
0110   /// 'partner' is set to 0.
0111   ///
0112   /// By default, throws an Error
0113   virtual bool has_partner(const PseudoJet &reference, PseudoJet &partner) const;
0114 
0115   /// check if it has been recombined with another PseudoJet in which
0116   /// case, return its child through the argument. Otherwise, 'child'
0117   /// is set to 0.
0118   /// 
0119   /// By default, throws an Error
0120   virtual bool has_child(const PseudoJet &reference, PseudoJet &child) const;
0121 
0122   /// check if it is the product of a recombination, in which case
0123   /// return the 2 parents through the 'parent1' and 'parent2'
0124   /// arguments. Otherwise, set these to 0.
0125   ///
0126   /// By default, throws an Error
0127   virtual bool has_parents(const PseudoJet &reference, PseudoJet &parent1, PseudoJet &parent2) const;
0128 
0129   /// check if the reference PseudoJet is contained the second one
0130   /// passed as argument.
0131   ///
0132   /// By default, throws an Error
0133   virtual bool object_in_jet(const PseudoJet &reference, const PseudoJet &jet) const;
0134 
0135 
0136   /// return true if the structure supports constituents. 
0137   ///
0138   /// false by default
0139   virtual bool has_constituents() const {return false;}
0140 
0141   /// retrieve the constituents. 
0142   ///
0143   /// By default, throws an Error
0144   virtual std::vector<PseudoJet> constituents(const PseudoJet &reference) const;
0145 
0146 
0147   /// return true if the structure supports exclusive_subjets. 
0148   virtual bool has_exclusive_subjets() const {return false;}
0149 
0150   /// return a vector of all subjets of the current jet (in the sense
0151   /// of the exclusive algorithm) that would be obtained when running
0152   /// the algorithm with the given dcut. 
0153   ///
0154   /// Time taken is O(m ln m), where m is the number of subjets that
0155   /// are found. If m gets to be of order of the total number of
0156   /// constituents in the jet, this could be substantially slower than
0157   /// just getting that list of constituents.
0158   ///
0159   /// By default, throws an Error
0160   ///
0161   /// Note: in a future major release of FastJet (4 or higher), 
0162   /// "const double & dcut" may be replaced with "const double dcut",
0163   /// requiring a modification of derived classes that overload
0164   /// this function.
0165   virtual std::vector<PseudoJet> exclusive_subjets(const PseudoJet &reference, const double & dcut) const;
0166 
0167   /// return the size of exclusive_subjets(...); still n ln n with same
0168   /// coefficient, but marginally more efficient than manually taking
0169   /// exclusive_subjets.size()
0170   ///
0171   /// By default, throws an Error
0172   ///
0173   /// Note: in a future major release of FastJet (4 or higher), 
0174   /// "const double & dcut" may be replaced with "const double dcut",
0175   /// requiring a modification of derived classes that overload
0176   /// this function.
0177   virtual int n_exclusive_subjets(const PseudoJet &reference, const double & dcut) const;
0178 
0179   /// return the list of subjets obtained by unclustering the supplied
0180   /// jet down to nsub subjets (or all constituents if there are fewer
0181   /// than nsub).
0182   ///
0183   /// By default, throws an Error
0184   virtual std::vector<PseudoJet> exclusive_subjets_up_to (const PseudoJet &reference, int nsub) const;
0185 
0186   /// return the dij that was present in the merging nsub+1 -> nsub 
0187   /// subjets inside this jet.
0188   ///
0189   /// By default, throws an Error
0190   virtual double exclusive_subdmerge(const PseudoJet &reference, int nsub) const;
0191 
0192   /// return the maximum dij that occurred in the whole event at the
0193   /// stage that the nsub+1 -> nsub merge of subjets occurred inside 
0194   /// this jet.
0195   ///
0196   /// By default, throws an Error
0197   virtual double exclusive_subdmerge_max(const PseudoJet &reference, int nsub) const;
0198 
0199 
0200   //-------------------------------------------------------------------
0201   // information related to the pieces of the jet
0202   //-------------------------------------------------------------------
0203   /// return true if the structure supports pieces. 
0204   ///
0205   /// false by default
0206   /// NB: "reference" is commented to avoid unused-variable compiler warnings
0207   virtual bool has_pieces(const PseudoJet & /* reference */) const {
0208     return false;}
0209 
0210   /// retrieve the pieces building the jet. 
0211   ///
0212   /// By default, throws an Error.
0213   /// NB: "reference" is commented to avoid unused-variable compiler warnings
0214   virtual std::vector<PseudoJet> pieces(const PseudoJet & /* reference */
0215                                         ) const;
0216 
0217 
0218   // the following ones require a computation of the area in the
0219   // parent ClusterSequence (See ClusterSequenceAreaBase for details)
0220   //------------------------------------------------------------------
0221 #ifndef __FJCORE__
0222 
0223   /// check if it has a defined area
0224   ///
0225   /// false by default
0226   virtual bool has_area() const {return false;}
0227 
0228   /// return the jet (scalar) area.
0229   ///
0230   /// By default, throws an Error
0231   virtual double area(const PseudoJet &reference) const;
0232 
0233   /// return the error (uncertainty) associated with the determination
0234   /// of the area of this jet.
0235   ///
0236   /// By default, throws an Error
0237   virtual double area_error(const PseudoJet &reference) const;
0238 
0239   /// return the jet 4-vector area.
0240   ///
0241   /// By default, throws an Error
0242   virtual PseudoJet area_4vector(const PseudoJet &reference) const;
0243 
0244   /// true if this jet is made exclusively of ghosts.
0245   ///
0246   /// By default, throws an Error
0247   virtual bool is_pure_ghost(const PseudoJet &reference) const;
0248 
0249 #endif  // __FJCORE__
0250   //\} --- end of jet structure -------------------------------------
0251 };
0252 
0253 FASTJET_END_NAMESPACE
0254 
0255 #endif  //  __FASTJET_PSEUDOJET_STRUCTURE_BASE_HH__