FastJet 3.0.4
D0RunIBaseConePlugin.hh
00001 #ifndef __D0RUNIBASECONEPLUGIN_HH__
00002 #define __D0RUNIBASECONEPLUGIN_HH__
00003 
00004 //STARTHEADER
00005 // $Id: D0RunIBaseConePlugin.hh 1778 2010-10-25 10:02:58Z soyez $
00006 //
00007 // Copyright (c) 2009-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
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, see <http://www.gnu.org/licenses/>.
00029 //----------------------------------------------------------------------
00030 //ENDHEADER
00031 
00032 #include "fastjet/JetDefinition.hh"
00033 
00034 // questionable whether this should be in fastjet namespace or not...
00035 
00036 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
00037 
00038 //----------------------------------------------------------------------
00039 //
00040 /// @ingroup internal
00041 /// \class D0RunIBaseConePlugin
00042 ///
00043 /// D0RunIBaseConePlugin is base class for a plugin for FastJet (v3.0 or later) 
00044 /// that provides an interface to the D0 version of Run-I cone algorithm
00045 ///
00046 /// Note that this base class is purely virtual and thus needs to be
00047 /// overloaded. In practice this means that you should use one of
00048 /// D0RunIConePlugin or D0RunIpre96ConePlugin.
00049 ///
00050 /// The D0 code has been obtained from Lars Sonnenschein's web-space
00051 /// http://www-d0.fnal.gov/~sonne/D0RunIcone.tgz
00052 ///
00053 /// The version of the D0 Run I code distributed here has been
00054 /// modified by the FastJet authors, so as to provide access to the
00055 /// contents of the jets (as is necessary for the plugin). This does
00056 /// not modify the results of the clustering.
00057 //
00058 //----------------------------------------------------------------------
00059 class D0RunIBaseConePlugin : public JetDefinition::Plugin {
00060 public:
00061   /// A D0RunIConePlugin constructor which sets the "free" parameters of the
00062   /// algorithm:
00063   ///
00064   ///  \param CONErad is the cone radius
00065   ///
00066   ///  \param JETmne is a minimum ET requirement on every iteration
00067   ///    (jet dropped if Et < JETmne * Et_min_ratio ).
00068   ///    The value that has been used by D0 for JETmne: 8 GeV 
00069   ///    (and Et_min_ratio is 0.5)
00070   ///
00071   ///  \param SPlifr is the shared Et fraction splitting threshold, and
00072   ///    a value of 0.5 was usually used by D0
00073   ///
00074   /// The remaining parameters of the algorithm are not to be modified if the algorithm
00075   /// is to correspond to the one actually used by D0.
00076   D0RunIBaseConePlugin (double CONErad_in, 
00077                         double JETmne_in, 
00078                         double SPLifr_in = _DEFAULT_SPLifr) :
00079     _CONErad           (CONErad_in                 ),
00080     _JETmne            (JETmne_in                  ),
00081     _SPLifr            (SPLifr_in                  ),
00082     _TWOrad            (_DEFAULT_TWOrad            ),
00083     _D0_Angle          (_DEFAULT_D0_Angle          ),
00084     _Increase_Delta_R  (_DEFAULT_Increase_Delta_R  ),
00085     _Kill_Far_Clusters (_DEFAULT_Kill_Far_Clusters ),
00086     _Jet_Et_Min_On_Iter(_DEFAULT_Jet_Et_Min_On_Iter),
00087     _Far_Ratio         (_DEFAULT_Far_Ratio         ),
00088     _Eitem_Negdrop     (_DEFAULT_Eitem_Negdrop     ),
00089     _Et_Min_Ratio      (_DEFAULT_Et_Min_Ratio      ),
00090     _Thresh_Diff_Et    (_DEFAULT_Thresh_Diff_Et    ){}
00091 
00092   // some functions to return info about parameters
00093   inline double CONErad           () const { return _CONErad           ;} //= 0.7;
00094   inline double JETmne            () const { return _JETmne            ;} //= 8.0;
00095   inline double SPLifr            () const { return _SPLifr            ;} // =0.5;
00096   inline double TWOrad            () const { return _TWOrad            ;} //= 0.;
00097   inline bool   D0_Angle          () const { return _D0_Angle          ;} // =false;
00098   inline bool   Increase_Delta_R  () const { return _Increase_Delta_R  ;} // =true; 
00099   inline bool   Kill_Far_Clusters () const { return _Kill_Far_Clusters ;} // =true; 
00100   inline bool   Jet_Et_Min_On_Iter() const { return _Jet_Et_Min_On_Iter;} // =true; 
00101   inline double Far_Ratio         () const { return _Far_Ratio         ;} // =0.5; 
00102   inline double Eitem_Negdrop     () const { return _Eitem_Negdrop     ;} // =-1.0;
00103   inline double Et_Min_Ratio      () const { return _Et_Min_Ratio      ;} // =0.5; 
00104   inline double Thresh_Diff_Et    () const { return _Thresh_Diff_Et    ;} // =0.01;
00105 
00106 
00107   /// access the split_ratio() also by the name overlap_threshold()
00108   inline double overlap_threshold() const {return SPLifr();}
00109 
00110   // the things that are required by base class
00111   virtual std::string description () const = 0;
00112 
00113   // the part that really does the clustering
00114   virtual void run_clustering(ClusterSequence &) const = 0;
00115 
00116   /// the plugin mechanism's standard way of accessing the jet radius
00117   virtual double R() const {return CONErad();}
00118 
00119 protected:
00120   template<typename HepEntityType>
00121   void run_clustering_worker(ClusterSequence &) const;
00122 
00123   //private:
00124 
00125   double _CONErad  ;//= 0.7 
00126   double _JETmne  ;//= 8.
00127   //the parameters below have been found to be set to the values given below 
00128   //in the original implementation, shouldn't be altered 
00129   double _SPLifr            ;  //=0.5
00130   double _TWOrad            ;  //=0.
00131   bool   _D0_Angle          ;  //=false
00132   bool   _Increase_Delta_R  ;  //=true
00133   bool   _Kill_Far_Clusters ;  //=true
00134   bool   _Jet_Et_Min_On_Iter;  //=true
00135   double _Far_Ratio         ;  //=0.5         
00136   double _Eitem_Negdrop     ;  //=-1.0
00137   double _Et_Min_Ratio      ;  //=0.5
00138   double _Thresh_Diff_Et    ;  //=0.01
00139 
00140   // here are the variables for the default parameters of the D0 Run I Cone algorithm.
00141   // They are set in the .cc file 
00142   const static double _DEFAULT_SPLifr                  ;  // = 0.5; //shared Et fraction threshold
00143   const static double _DEFAULT_TWOrad                  ;  // = 0.; //minimum Delta_R separation between cones
00144   const static bool   _DEFAULT_D0_Angle                ;  // = false;
00145   const static bool   _DEFAULT_Increase_Delta_R        ;  // = true;
00146   const static bool   _DEFAULT_Kill_Far_Clusters       ;  // = true;
00147   const static bool   _DEFAULT_Jet_Et_Min_On_Iter      ;  // = true;
00148   const static double _DEFAULT_Far_Ratio               ;  // = 0.5;
00149   const static double _DEFAULT_Eitem_Negdrop           ;  // = -1.0;
00150   const static double _DEFAULT_Et_Min_Ratio            ;  // = 0.5;
00151   const static double _DEFAULT_Thresh_Diff_Et          ;  // = 0.01;
00152 };
00153 
00154 
00155 FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
00156 
00157 #endif // __D0RUNIBASECONEPLUGIN_HH__
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends