FastJet 3.0beta1
D0RunIIConePlugin.hh
00001 #ifndef __D0RUNIICONEPLUGIN_HH__
00002 #define __D0RUNIICONEPLUGIN_HH__
00003 
00004 //STARTHEADER
00005 // $Id: D0RunIIConePlugin.hh 1761 2010-09-16 10:43:18Z soyez $
00006 //
00007 // Copyright (c) 2005-2006, Matteo Cacciari and Gavin Salam
00008 //
00009 //----------------------------------------------------------------------
00010 // This file is part of FastJet.
00011 //
00012 //  FastJet is free software; you can redistribute it and/or modify
00013 //  it under the terms of the GNU General Public License as published by
00014 //  the Free Software Foundation; either version 2 of the License, or
00015 //  (at your option) any later version.
00016 //
00017 //  The algorithms that underlie FastJet have required considerable
00018 //  development and are described in hep-ph/0512210. If you use
00019 //  FastJet as part of work towards a scientific publication, please
00020 //  include a citation to the FastJet paper.
00021 //
00022 //  FastJet is distributed in the hope that it will be useful,
00023 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00024 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00025 //  GNU General Public License for more details.
00026 //
00027 //  You should have received a copy of the GNU General Public License
00028 //  along with FastJet; if not, write to the Free Software
00029 //  Foundation, Inc.:
00030 //      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00031 //----------------------------------------------------------------------
00032 //ENDHEADER
00033 
00034 #include "fastjet/JetDefinition.hh"
00035 
00036 // questionable whether this should be in fastjet namespace or not...
00037 
00038 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
00039 
00040 //----------------------------------------------------------------------
00041 //
00042 /// @ingroup plugins
00043 /// \class D0RunIIConePlugin
00044 /// Implementation of the D0 Run II Cone (plugin for fastjet v2.1 upwards)
00045 /// 
00046 /// D0RunIIConePlugin is a plugin for fastjet (v2.1 upwards) that
00047 /// provides an interface to the D0 version of Run-II iterative cone
00048 /// algorithm with midpoint seeds (also known as the Iterative Legacy
00049 /// Cone Algorithm, ILCA).
00050 ///
00051 /// The D0 code has been taken from Lars Sonnenschein's web-space
00052 /// http://www-d0.fnal.gov/~sonne/D0RunIIcone.tgz
00053 ///
00054 /// The version of the D0 Run II code distributed
00055 /// here has been modified by the FastJet authors, so as to provide
00056 /// access to the contents of the jets (as is necessary for the
00057 /// plugin). This does not modify the results of the clustering.
00058 //
00059 //----------------------------------------------------------------------
00060 class D0RunIIConePlugin : public JetDefinition::Plugin {
00061 public:
00062 
00063   //
00064   /// A D0RunIIConePlugin constructor which sets the "free" parameters of the
00065   /// algorithm:
00066   ///
00067   ///  - the cone_radius has the usual meaning
00068   ///
00069   ///  - the min_jet_Et causes cones to be discarded at if at any
00070   ///    iteration they have pt < Et_min_ratio * min_jet_Et. Two
00071   ///    values have been used by D0 for min_jet_Et: 8 GeV in earlier
00072   ///    Run II publicatinos, 6 GeV in later publications
00073   ///
00074   ///  - split_ratio is equivalent to the overlap threshold during the split/merge step. 
00075   ///    Default: 0.5.
00076   ///
00077   /// The remaining parameters of the algorithm are not to be modified if the algorithm
00078   /// is to correspond to the one actually used by D0.
00079   //
00080   D0RunIIConePlugin (double cone_radius, 
00081                      double min_jet_Et , 
00082                      double split_ratio = _DEFAULT_split_ratio) :
00083     _cone_radius            (cone_radius            ),
00084     _min_jet_Et             (min_jet_Et             ),
00085     _split_ratio            (split_ratio            ),
00086     _far_ratio              (_DEFAULT_far_ratio              ),
00087     _Et_min_ratio           (_DEFAULT_Et_min_ratio           ),
00088     _kill_duplicate         (_DEFAULT_kill_duplicate         ),
00089     _duplicate_dR           (_DEFAULT_duplicate_dR           ),
00090     _duplicate_dPT          (_DEFAULT_duplicate_dPT          ),
00091     _search_factor          (_DEFAULT_search_factor          ),
00092     _pT_min_leading_protojet(_DEFAULT_pT_min_leading_protojet),
00093     _pT_min_second_protojet (_DEFAULT_pT_min_second_protojet ),
00094     _merge_max              (_DEFAULT_merge_max              ),
00095     _pT_min_nomerge         (_DEFAULT_pT_min_nomerge         )
00096   {
00097     // nothing to be done here!
00098   }
00099 
00100   // some functions to return info about parameters
00101   inline double cone_radius            () const { return _cone_radius            ;} //= 0.5;
00102   inline double min_jet_Et             () const { return _min_jet_Et             ;} //= 8.0;
00103   inline double split_ratio            () const { return _split_ratio            ;} //= 0.5;
00104   inline double far_ratio              () const { return _far_ratio              ;} // =0.5;
00105   inline double Et_min_ratio           () const { return _Et_min_ratio           ;} // =0.5;
00106   inline bool   kill_duplicate         () const { return _kill_duplicate         ;} // =true;
00107   inline double duplicate_dR           () const { return _duplicate_dR           ;} // =0.005; 
00108   inline double duplicate_dPT          () const { return _duplicate_dPT          ;} // =0.01; 
00109   inline double search_factor          () const { return _search_factor          ;} // =1.0; 
00110   inline double pT_min_leading_protojet() const { return _pT_min_leading_protojet;} // =0.; 
00111   inline double pT_min_second_protojet () const { return _pT_min_second_protojet ;} // =0.;
00112   inline int    merge_max              () const { return _merge_max              ;} // =10000; 
00113   inline double pT_min_nomerge         () const { return _pT_min_nomerge         ;} // =0.;
00114 
00115 
00116   /// access the split_ratio() also by the name overlap_threshold()
00117   inline double overlap_threshold() const {return split_ratio();}
00118 
00119   // the things that are required by base class
00120   virtual std::string description () const;
00121   virtual void run_clustering(ClusterSequence &) const;
00122   /// the plugin mechanism's standard way of accessing the jet radius
00123   virtual double R() const {return cone_radius();}
00124   
00125 
00126 private:
00127 
00128   double _cone_radius ;//= 0.5;
00129   double _min_jet_Et  ;//= 8.0;
00130   double _split_ratio ;//= 0.5; // overlap threshold
00131         
00132   //the parameters below have been found to be set to the values given below 
00133   //in the original implementation, shouldn't be altered
00134   double _far_ratio              ; // =0.5;
00135   double _Et_min_ratio           ; // =0.5;
00136   bool   _kill_duplicate         ; // =true;
00137   double _duplicate_dR           ; // =0.005; 
00138   double _duplicate_dPT          ; // =0.01; 
00139   double _search_factor          ; // =1.0; 
00140   double _pT_min_leading_protojet; // =0.; 
00141   double _pT_min_second_protojet ; // =0.;
00142   int    _merge_max              ; // =10000; 
00143   double _pT_min_nomerge         ; // =0.;
00144 
00145   // here are the variables for the default parameters of the D0 Run II Cone algorithm.
00146   // They are set in the .cc file 
00147   const static double _DEFAULT_split_ratio             ;// = 0.5  ; // overlap threshold
00148   const static double _DEFAULT_far_ratio               ;// = 0.5  ;
00149   const static double _DEFAULT_Et_min_ratio            ;// = 0.5  ;
00150   const static bool   _DEFAULT_kill_duplicate          ;// = true ;
00151   const static double _DEFAULT_duplicate_dR            ;// = 0.005; 
00152   const static double _DEFAULT_duplicate_dPT           ;// = 0.01 ; 
00153   const static double _DEFAULT_search_factor           ;// = 1.0  ; 
00154   const static double _DEFAULT_pT_min_leading_protojet ;// = 0.   ; 
00155   const static double _DEFAULT_pT_min_second_protojet  ;// = 0.   ;
00156   const static int    _DEFAULT_merge_max               ;// = 10000; 
00157   const static double _DEFAULT_pT_min_nomerge          ;// = 0.   ;
00158 
00159 };
00160 
00161 FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
00162 
00163 #endif // __D0RUNIICONEPLUGIN_HH__
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends