Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //FJSTARTHEADER
0002 // $Id$
0003 //
0004 // Copyright (c) 2005-2021, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
0005 //
0006 //----------------------------------------------------------------------
0007 // This file is part of FastJet.
0008 //
0009 //  FastJet is free software; you can redistribute it and/or modify
0010 //  it under the terms of the GNU General Public License as published by
0011 //  the Free Software Foundation; either version 2 of the License, or
0012 //  (at your option) any later version.
0013 //
0014 //  The algorithms that underlie FastJet have required considerable
0015 //  development. They are described in the original FastJet paper,
0016 //  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
0017 //  FastJet as part of work towards a scientific publication, please
0018 //  quote the version you use and include a citation to the manual and
0019 //  optionally also to hep-ph/0512210.
0020 //
0021 //  FastJet is distributed in the hope that it will be useful,
0022 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
0023 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0024 //  GNU General Public License for more details.
0025 //
0026 //  You should have received a copy of the GNU General Public License
0027 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
0028 //----------------------------------------------------------------------
0029 //FJENDHEADER
0030 
0031 #ifndef __CDFJETCLUPLUGIN_HH__
0032 #define __CDFJETCLUPLUGIN_HH__
0033 
0034 #include "fastjet/JetDefinition.hh"
0035 #include "fastjet/PseudoJet.hh"
0036 #include <map>
0037 #include "fastjet/internal/thread_safety_helpers.hh"  // helpers to write transparent code w&wo C++11 features
0038 
0039 // questionable whether this should be in fastjet namespace or not...
0040 
0041 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
0042 
0043 /// @ingroup plugins
0044 /// \class CDFJetCluPlugin
0045 /// Implementation of the JetClu algorithm from CDF (plugin for
0046 /// fastjet-v2.1 upwards)
0047 class CDFJetCluPlugin : public JetDefinition::Plugin {
0048 public:
0049   /// a compact constructor
0050   CDFJetCluPlugin (double   cone_radius_in, 
0051            double   overlap_threshold_in, 
0052            double   seed_threshold_in = 1.0,
0053            int      iratch_in = 1) : 
0054     _seed_threshold    ( seed_threshold_in    ),    
0055     _cone_radius       ( cone_radius_in       ),
0056     _adjacency_cut     (   2                  ),
0057     _max_iterations    ( 100                  ),
0058     _iratch            ( iratch_in            ),
0059     _overlap_threshold ( overlap_threshold_in )  {}
0060 
0061   /// a constructor that looks like the one provided by CDF
0062   CDFJetCluPlugin (double seed_threshold_in   ,  
0063            double cone_radius_in      ,
0064            int    adjacency_cut_in    ,
0065            int    max_iterations_in   ,
0066            int    iratch_in           ,
0067            double overlap_threshold_in) :
0068     _seed_threshold    (seed_threshold_in    ),    
0069     _cone_radius       (cone_radius_in       ),
0070     _adjacency_cut     (adjacency_cut_in     ),
0071     _max_iterations    (max_iterations_in    ),
0072     _iratch            (iratch_in            ),
0073     _overlap_threshold (overlap_threshold_in )  {}
0074 
0075   // some functions to return info about parameters
0076   double seed_threshold    () const {return _seed_threshold    ;}
0077   double cone_radius       () const {return _cone_radius       ;}
0078   int    adjacency_cut     () const {return _adjacency_cut     ;}
0079   int    max_iterations    () const {return _max_iterations    ;}
0080   int    iratch            () const {return _iratch            ;}
0081   double overlap_threshold () const {return _overlap_threshold ;}
0082 
0083 
0084   // the things that are required by base class
0085   virtual std::string description () const;
0086   virtual void run_clustering(ClusterSequence &) const;
0087   /// the plugin mechanism's standard way of accessing the jet radius
0088   virtual double R() const {return cone_radius();}
0089                       
0090 private:
0091 
0092   double _seed_threshold   ;
0093   double _cone_radius      ;
0094   int    _adjacency_cut    ;
0095   int    _max_iterations   ;
0096   int    _iratch           ;
0097   double _overlap_threshold;
0098 
0099   /// given a jet try inserting its energy into the map -- if that
0100   /// energy entry already exists, modify the jet infinitesimally so
0101   /// as ensure that the jet energy is unique
0102   void _insert_unique (PseudoJet & jet, std::map<double,int> & jetmap) const;
0103 
0104   static thread_safety_helpers::FirstTimeTrue _first_time;
0105 
0106   /// print a banner for reference to the 3rd-party code
0107   void _print_banner(std::ostream *ostr) const;
0108 };
0109 
0110 FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
0111 
0112 #endif // __CDFJETCLUPLUGIN_HH__