Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef __D0RUNIICONEPLUGIN_HH__
0002 #define __D0RUNIICONEPLUGIN_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 #include "fastjet/JetDefinition.hh"
0035 #include "fastjet/internal/thread_safety_helpers.hh"  // helpers to write transparent code w&wo C++11 features
0036 
0037 // questionable whether this should be in fastjet namespace or not...
0038 
0039 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
0040 
0041 //----------------------------------------------------------------------
0042 //
0043 /// @ingroup plugins
0044 /// \class D0RunIIConePlugin
0045 /// Implementation of the D0 Run II Cone (plugin for fastjet v2.1 upwards)
0046 /// 
0047 /// D0RunIIConePlugin is a plugin for fastjet (v2.1 upwards) that
0048 /// provides an interface to the D0 version of Run-II iterative cone
0049 /// algorithm with midpoint seeds (also known as the Iterative Legacy
0050 /// Cone Algorithm, ILCA).
0051 ///
0052 /// The D0 code has been taken from Lars Sonnenschein's web-space
0053 /// http://www-d0.fnal.gov/~sonne/D0RunIIcone.tgz
0054 ///
0055 /// The version of the D0 Run II code distributed
0056 /// here has been modified by the FastJet authors, so as to provide
0057 /// access to the contents of the jets (as is necessary for the
0058 /// plugin). This does not modify the results of the clustering.
0059 //
0060 //----------------------------------------------------------------------
0061 class D0RunIIConePlugin : public JetDefinition::Plugin {
0062 public:
0063 
0064   //
0065   /// A D0RunIIConePlugin constructor which sets the "free" parameters of the
0066   /// algorithm:
0067   ///
0068   ///  - the cone_radius has the usual meaning
0069   ///
0070   ///  - the min_jet_Et causes cones to be discarded at if at any
0071   ///    iteration they have pt < Et_min_ratio * min_jet_Et. Two
0072   ///    values have been used by D0 for min_jet_Et: 8 GeV in earlier
0073   ///    Run II publicatinos, 6 GeV in later publications
0074   ///
0075   ///  - split_ratio is equivalent to the overlap threshold during the split/merge step. 
0076   ///    Default: 0.5.
0077   ///
0078   /// The remaining parameters of the algorithm are not to be modified if the algorithm
0079   /// is to correspond to the one actually used by D0.
0080   //
0081   D0RunIIConePlugin (double cone_radius_in, 
0082                      double min_jet_Et_in , 
0083                      double split_ratio_in = _DEFAULT_split_ratio) :
0084     _cone_radius            (cone_radius_in                  ),
0085     _min_jet_Et             (min_jet_Et_in                   ),
0086     _split_ratio            (split_ratio_in                  ),
0087     _far_ratio              (_DEFAULT_far_ratio              ),
0088     _Et_min_ratio           (_DEFAULT_Et_min_ratio           ),
0089     _kill_duplicate         (_DEFAULT_kill_duplicate         ),
0090     _duplicate_dR           (_DEFAULT_duplicate_dR           ),
0091     _duplicate_dPT          (_DEFAULT_duplicate_dPT          ),
0092     _search_factor          (_DEFAULT_search_factor          ),
0093     _pT_min_leading_protojet(_DEFAULT_pT_min_leading_protojet),
0094     _pT_min_second_protojet (_DEFAULT_pT_min_second_protojet ),
0095     _merge_max              (_DEFAULT_merge_max              ),
0096     _pT_min_nomerge         (_DEFAULT_pT_min_nomerge         )
0097   {
0098     // nothing to be done here!
0099   }
0100 
0101   // some functions to return info about parameters
0102   inline double cone_radius            () const { return _cone_radius            ;} //= 0.5;
0103   inline double min_jet_Et             () const { return _min_jet_Et             ;} //= 8.0;
0104   inline double split_ratio            () const { return _split_ratio            ;} //= 0.5;
0105   inline double far_ratio              () const { return _far_ratio              ;} // =0.5;
0106   inline double Et_min_ratio           () const { return _Et_min_ratio           ;} // =0.5;
0107   inline bool   kill_duplicate         () const { return _kill_duplicate         ;} // =true;
0108   inline double duplicate_dR           () const { return _duplicate_dR           ;} // =0.005; 
0109   inline double duplicate_dPT          () const { return _duplicate_dPT          ;} // =0.01; 
0110   inline double search_factor          () const { return _search_factor          ;} // =1.0; 
0111   inline double pT_min_leading_protojet() const { return _pT_min_leading_protojet;} // =0.; 
0112   inline double pT_min_second_protojet () const { return _pT_min_second_protojet ;} // =0.;
0113   inline int    merge_max              () const { return _merge_max              ;} // =10000; 
0114   inline double pT_min_nomerge         () const { return _pT_min_nomerge         ;} // =0.;
0115 
0116 
0117   /// access the split_ratio() also by the name overlap_threshold()
0118   inline double overlap_threshold() const {return split_ratio();}
0119 
0120   // the things that are required by base class
0121   virtual std::string description () const;
0122   virtual void run_clustering(ClusterSequence &) const;
0123   /// the plugin mechanism's standard way of accessing the jet radius
0124   virtual double R() const {return cone_radius();}
0125   
0126 
0127 private:
0128 
0129   double _cone_radius ;//= 0.5;
0130   double _min_jet_Et  ;//= 8.0;
0131   double _split_ratio ;//= 0.5; // overlap threshold
0132         
0133   //the parameters below have been found to be set to the values given below 
0134   //in the original implementation, shouldn't be altered
0135   double _far_ratio              ; // =0.5;
0136   double _Et_min_ratio           ; // =0.5;
0137   bool   _kill_duplicate         ; // =true;
0138   double _duplicate_dR           ; // =0.005; 
0139   double _duplicate_dPT          ; // =0.01; 
0140   double _search_factor          ; // =1.0; 
0141   double _pT_min_leading_protojet; // =0.; 
0142   double _pT_min_second_protojet ; // =0.;
0143   int    _merge_max              ; // =10000; 
0144   double _pT_min_nomerge         ; // =0.;
0145 
0146   // here are the variables for the default parameters of the D0 Run II Cone algorithm.
0147   // They are set in the .cc file 
0148   const static double _DEFAULT_split_ratio             ;// = 0.5  ; // overlap threshold
0149   const static double _DEFAULT_far_ratio               ;// = 0.5  ;
0150   const static double _DEFAULT_Et_min_ratio            ;// = 0.5  ;
0151   const static bool   _DEFAULT_kill_duplicate          ;// = true ;
0152   const static double _DEFAULT_duplicate_dR            ;// = 0.005; 
0153   const static double _DEFAULT_duplicate_dPT           ;// = 0.01 ; 
0154   const static double _DEFAULT_search_factor           ;// = 1.0  ; 
0155   const static double _DEFAULT_pT_min_leading_protojet ;// = 0.   ; 
0156   const static double _DEFAULT_pT_min_second_protojet  ;// = 0.   ;
0157   const static int    _DEFAULT_merge_max               ;// = 10000; 
0158   const static double _DEFAULT_pT_min_nomerge          ;// = 0.   ;
0159 
0160   static thread_safety_helpers::FirstTimeTrue _first_time;
0161 
0162   /// print a banner for reference to the 3rd-party code
0163   void _print_banner(std::ostream *ostr) const;
0164 };
0165 
0166 FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
0167 
0168 #endif // __D0RUNIICONEPLUGIN_HH__