Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // $Id: FlavorCone.hh 1056 2017-09-06 20:59:06Z philten $
0002 //
0003 // Copyright (c) 2017, Philip Ilten, Nicholas Rodd, Jesse Thaler, 
0004 // and Michael Williams
0005 //
0006 //----------------------------------------------------------------------
0007 // This file is part of FastJet contrib.
0008 //
0009 // It is free software; you can redistribute it and/or modify it under
0010 // the terms of the GNU General Public License as published by the
0011 // Free Software Foundation; either version 2 of the License, or (at
0012 // your option) any later version.
0013 //
0014 // It is distributed in the hope that it will be useful, but WITHOUT
0015 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
0016 // or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
0017 // License for more details.
0018 //
0019 // You should have received a copy of the GNU General Public License
0020 // along with this code. If not, see <http://www.gnu.org/licenses/>.
0021 //----------------------------------------------------------------------
0022 
0023 #ifndef __FASTJET_CONTRIB_FLAVORCONE_HH__
0024 #define __FASTJET_CONTRIB_FLAVORCONE_HH__
0025 
0026 #include <fastjet/internal/base.hh>
0027 #include <fastjet/JetDefinition.hh>
0028 #include <fastjet/ClusterSequence.hh>
0029 #include <fastjet/LimitedWarning.hh>
0030 
0031 FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
0032 
0033 namespace contrib{
0034 
0035   /** \mainpage FlavorCone contrib
0036    
0037    The FlavorCone contrib is a lightweight tool to cluster jets of
0038    fixed radius around a given number of seeds, where overlapping jets
0039    are partitioned by nearest neighbor.  The contrib consists of the
0040    following files:
0041    - contrib::FlavorConePlugin
0042    - contrib::FlavorConePlugin::Extras
0043    - example.cc provides usage examples
0044    */
0045   
0046   
0047 //----------------------------------------------------------------------
0048 /// \class FlavorConePlugin
0049 ///
0050 /// Plugin to take input seeds and particles and create FlavorCone
0051 /// jets.
0052 ///
0053 /// On construction, one must supply seeds and an rcut value. To obtain
0054 /// the jets call ClusterSequence::inclusive_jets(). The seed for
0055 /// each jet can be accessed via ClusterSequence::extras() with the
0056 /// method FlavorConeExtras::seed(jet), where jet is from the returned
0057 /// jet vector.
0058 class FlavorConePlugin : public JetDefinition::Plugin {
0059 public:
0060   //--------------------------------------------------------------------
0061   /// \class Extras
0062   ///
0063   /// Hold extras for FlavorConePlugin.
0064   ///
0065   /// Access the seed for a given jet constructed with the
0066   /// FlavorConePlugin.
0067   class Extras : public ClusterSequence::Extras {
0068   public:
0069     /// Main constructor for the FlavorCone Extras class.
0070     Extras();
0071     /// Return the seed for a jet. A seed returned with an energy of
0072     /// -1 indicates the jet has no valid seed.
0073     const PseudoJet& seed(const PseudoJet &jet) const;
0074     
0075   private:
0076     /// Map which holds the seed for each jet.
0077     std::map<int, PseudoJet> _seeds;
0078     /// Stored jet to return when no seed is found.
0079     const PseudoJet _invalid_seed;
0080     /// Warning when no seed is found.
0081     static LimitedWarning _warn_seed;
0082     friend class FlavorConePlugin;
0083   };
0084 
0085   /// Main constructor for the FlavorCone Plugin class.
0086   FlavorConePlugin(const std::vector<PseudoJet> &seeds, double rcut);
0087 
0088   /// Copy constructor.
0089   FlavorConePlugin(const FlavorConePlugin & plugin);
0090 
0091   // Methods required by base class.
0092   /// Brief description of FlavorCone for self-documentation (gives
0093   /// number of seeds and rcut).
0094   virtual std::string description() const;
0095   /// Run the FlavorCone clustering.
0096   virtual void run_clustering(ClusterSequence &cs) const;
0097   /// Returns rcut value.
0098   virtual double R() const;
0099   /// Exclusive sequence is not meaningful for this algorithm.
0100   virtual bool exclusive_sequence_meaningful() const;
0101   /// At the moment, FlavorCone only works for pp, not e+e-.
0102   virtual bool is_spherical() const;
0103 
0104 private:
0105   double                 _rcut;  ///< Jet radius cut.
0106   std::vector<PseudoJet> _seeds; ///< Vector of seeds.
0107 };
0108 
0109 } // namespace contrib
0110 
0111 FASTJET_END_NAMESPACE
0112 
0113 #endif  // __FASTJET_CONTRIB_FLAVORCONE_HH__