Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

SISConePlugin.hh

Go to the documentation of this file.
00001 #ifndef __SISCONEPLUGIN_HH__
00002 #define __SISCONEPLUGIN_HH__
00003 
00004 #include "fastjet/JetDefinition.hh"
00005 #include "fastjet/ClusterSequence.hh" // needed for the extras we define
00006 #include <vector>
00007 #include <memory>
00008 #include <cmath>
00009 
00010 // put a forward declaration to the Csiscone class to avoid having to
00011 // include the siscone headers here
00012 namespace siscone {
00013   class Csiscone;
00014 }
00015 
00016 // questionable whether this should be in fastjet namespace or not...
00017 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
00018 
00019 // another forward declaration to reduce includes
00020 class PseudoJet;
00021 
00022 //----------------------------------------------------------------------
00023 //
00075 //
00076 class SISConePlugin : public JetDefinition::Plugin {
00077 public:
00078 
00081   enum SplitMergeScale {SM_pt,     
00082                         SM_Et,     
00083 
00084                         SM_mt,     
00085 
00086                         SM_pttilde 
00087 
00088   };
00089 
00090 
00098   SISConePlugin (double cone_radius,
00099                  double overlap_threshold = 0.5,
00100                  int    n_pass_max = 0,
00101                  double protojet_ptmin = 0.0, 
00102                  bool   caching = false,
00103                  SplitMergeScale  split_merge_scale = SM_pttilde,
00104                  double split_merge_stopping_scale = 0.0) :
00105     _cone_radius           (cone_radius       ),
00106     _overlap_threshold     (overlap_threshold ),
00107     _n_pass_max            (n_pass_max ), 
00108     _protojet_ptmin        (protojet_ptmin),
00109     _caching               (caching),             
00110     _split_merge_scale     (split_merge_scale),
00111     _split_merge_stopping_scale (split_merge_stopping_scale),
00112     _ghost_sep_scale       (0.0) {}
00113 
00115   SISConePlugin (double cone_radius,
00116                  double overlap_threshold,
00117                  int    n_pass_max,
00118                  double protojet_ptmin, 
00119                  bool   caching ,
00120                  bool   split_merge_on_transverse_mass) :
00121     _cone_radius           (cone_radius       ),
00122     _overlap_threshold     (overlap_threshold ),
00123     _n_pass_max            (n_pass_max ), 
00124     _protojet_ptmin        (protojet_ptmin),
00125     _caching               (caching),             
00126     _split_merge_scale     (split_merge_on_transverse_mass ? SM_mt : SM_pttilde),
00127     _ghost_sep_scale       (0.0)  {}
00128   
00131   SISConePlugin (double cone_radius,
00132                  double overlap_threshold,
00133                  int    n_pass_max,
00134                  bool   caching ) :
00135     _cone_radius           (cone_radius       ),
00136     _overlap_threshold     (overlap_threshold ),
00137     _n_pass_max            (n_pass_max ), 
00138     _protojet_ptmin        (0.0),
00139     _caching               (caching),
00140     _split_merge_scale     (SM_mt),
00141     _ghost_sep_scale       (0.0) {}
00142 
00144   SISConePlugin (const SISConePlugin & plugin) {
00145     *this = plugin;
00146   }
00147 
00149   double cone_radius        () const {return _cone_radius        ;}
00150 
00153   double overlap_threshold  () const {return _overlap_threshold  ;}
00154 
00157   int n_pass_max  () const {return _n_pass_max  ;}
00158 
00161   double protojet_ptmin  () const {return _protojet_ptmin  ;}
00162 
00167   double protojet_or_ghost_ptmin  () const {return std::max(_protojet_ptmin,
00168                                                             _ghost_sep_scale);}
00169 
00171   SplitMergeScale split_merge_scale() const {return _split_merge_scale;}
00173   void set_split_merge_scale(SplitMergeScale sms) {_split_merge_scale = sms;}
00174 
00177   bool split_merge_on_transverse_mass() const {return _split_merge_scale == SM_mt ;}
00178   void set_split_merge_on_transverse_mass(bool val) {
00179     _split_merge_scale = val  ? SM_mt : SM_pt;}
00180 
00187   void set_split_merge_stopping_scale(double scale) {
00188     _split_merge_stopping_scale = scale;}
00189 
00192   double split_merge_stopping_scale() {return _split_merge_stopping_scale;}
00193 
00195   bool caching() const {return _caching ;}
00196 
00197   // the things that are required by base class
00198   virtual std::string description () const;
00199   virtual void run_clustering(ClusterSequence &) const;
00201   virtual double R() const {return cone_radius();}
00202 
00207   virtual bool supports_ghosted_passive_areas() const {return true;}
00208   
00212   virtual void set_ghost_separation_scale(double scale) const {
00213     _ghost_sep_scale = scale;
00214   }
00215 
00216   virtual double ghost_separation_scale() const {return _ghost_sep_scale;}
00217 
00218 private:
00219   double _cone_radius, _overlap_threshold;
00220   int    _n_pass_max;
00221   double _protojet_ptmin;
00222   bool   _caching;//, _split_merge_on_transverse_mass;
00223   SplitMergeScale _split_merge_scale;
00224   double _split_merge_stopping_scale;
00225 
00226   mutable double _ghost_sep_scale;
00227 
00228   // variables for caching the results and the input
00229   static std::auto_ptr<SISConePlugin          > stored_plugin;
00230   static std::auto_ptr<std::vector<PseudoJet> > stored_particles;
00231   static std::auto_ptr<siscone::Csiscone      > stored_siscone;
00232 
00233 };
00234 
00235 
00236 //======================================================================
00238 class SISConeExtras : public ClusterSequence::Extras {
00239 public:
00241   const std::vector<PseudoJet> & stable_cones() const {return _protocones;}
00242 
00244   const std::vector<PseudoJet> & protocones() const {return _protocones;}
00245 
00246 
00250   const SISConePlugin * jet_def_plugin() const {return _jet_def_plugin;}
00251 
00254   std::string description() const;
00255 
00259   inline double most_ambiguous_split() const {return _most_ambiguous_split;}
00260 
00261 private:
00262   std::vector<PseudoJet> _protocones;
00263   const SISConePlugin * _jet_def_plugin;
00264   double                _most_ambiguous_split;
00265   // let us be written to by SISConePlugin
00266   friend class SISConePlugin;
00267 };
00268 
00269 
00270 FASTJET_END_NAMESPACE        // defined in fastjet/internal/base.hh
00271 
00272 #endif // __SISCONEPLUGIN_HH__
00273 

Generated on Fri Aug 15 13:45:28 2008 for fastjet by  doxygen 1.4.2