SISConePlugin.hh

00001 #ifndef __SISCONEPLUGIN_HH__
00002 #define __SISCONEPLUGIN_HH__
00003 
00004 #include "SISConeBasePlugin.hh"
00005 
00006 // forward declaration of the siscone classes we'll need
00007 namespace siscone{
00008   class Csiscone;
00009 }
00010 
00011 
00012 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
00013 
00014 //----------------------------------------------------------------------
00015 //
00070 //
00071 class SISConePlugin : public SISConeBasePlugin{
00072 public:
00073 
00076   enum SplitMergeScale {SM_pt,     
00077                         SM_Et,     
00078 
00079                         SM_mt,     
00080 
00081                         SM_pttilde 
00082 
00083   };
00084 
00085 
00095   SISConePlugin (double cone_radius,
00096                  double overlap_threshold,
00097                  int    n_pass_max = 0,
00098                  double protojet_ptmin = 0.0, 
00099                  bool   caching = false,
00100                  SplitMergeScale  split_merge_scale = SM_pttilde,
00101                  double split_merge_stopping_scale = 0.0){
00102     _cone_radius           = cone_radius;
00103     _overlap_threshold     = overlap_threshold;
00104     _n_pass_max            = n_pass_max;
00105     _protojet_ptmin        = protojet_ptmin;
00106     _caching               = caching;   
00107     _split_merge_scale     = split_merge_scale;
00108     _split_merge_stopping_scale = split_merge_stopping_scale;
00109     _ghost_sep_scale       = 0.0;
00110     _use_pt_weighted_splitting = false;}
00111 
00112 
00114   SISConePlugin (double cone_radius,
00115                  double overlap_threshold,
00116                  int    n_pass_max,
00117                  double protojet_ptmin, 
00118                  bool   caching ,
00119                  bool   split_merge_on_transverse_mass){
00120     _cone_radius           = cone_radius;
00121     _overlap_threshold     = overlap_threshold;
00122     _n_pass_max            = n_pass_max;
00123     _protojet_ptmin        = protojet_ptmin;
00124     _caching               = caching;   
00125     _split_merge_stopping_scale = 0.0;
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     _split_merge_stopping_scale = 0.0;
00142     _ghost_sep_scale       = 0.0;
00143     _use_pt_weighted_splitting = false;}
00144 
00147   double protojet_ptmin  () const {return _protojet_ptmin  ;}
00148 
00153   double protojet_or_ghost_ptmin  () const {return std::max(_protojet_ptmin,
00154                                                             _ghost_sep_scale);}
00155 
00157   SplitMergeScale split_merge_scale() const {return _split_merge_scale;}
00159   void set_split_merge_scale(SplitMergeScale sms) {_split_merge_scale = sms;}
00160 
00163   bool split_merge_on_transverse_mass() const {return _split_merge_scale == SM_mt ;}
00164   void set_split_merge_on_transverse_mass(bool val) {
00165     _split_merge_scale = val  ? SM_mt : SM_pt;}
00166 
00169   bool split_merge_use_pt_weighted_splitting() const {return _use_pt_weighted_splitting;}
00170   void set_split_merge_use_pt_weighted_splitting(bool val) {
00171     _use_pt_weighted_splitting = val;}
00172 
00173   // the things that are required by base class
00174   virtual std::string description () const;
00175   virtual void run_clustering(ClusterSequence &) const ;
00176 
00177 protected:
00178   virtual void reset_stored_plugin() const;
00179 
00180 private:
00181   double _protojet_ptmin;
00182   SplitMergeScale _split_merge_scale;
00183 
00184   bool _use_pt_weighted_splitting;
00185 
00186   // part needed for the cache 
00187   // variables for caching the results and the input
00188   static std::auto_ptr<SISConePlugin          > stored_plugin;
00189   static std::auto_ptr<std::vector<PseudoJet> > stored_particles;
00190   static std::auto_ptr<siscone::Csiscone      > stored_siscone;
00191 };
00192 
00193 
00194 //======================================================================
00198 class SISConeExtras : public SISConeBaseExtras {
00199 public:
00201   //  it just initialises the pass information 
00202   SISConeExtras(int nparticles)
00203     : SISConeBaseExtras(nparticles){}
00204 
00208   const SISConePlugin* jet_def_plugin() const {
00209     return dynamic_cast<const SISConePlugin*>(_jet_def_plugin);
00210   }
00211 
00212 private:
00213   // let us be written to by SISConePlugin
00214   friend class SISConePlugin;
00215 };
00216 
00217 FASTJET_END_NAMESPACE        // defined in fastjet/internal/base.hh
00218 
00219 #endif // __SISCONEPLUGIN_HH__
00220