fastjet 2.4.5
SISConeBasePlugin.hh
Go to the documentation of this file.
00001 #ifndef __SISCONEBASEPLUGIN_HH__
00002 #define __SISCONEBASEPLUGIN_HH__
00003 
00004 #include "fastjet/JetDefinition.hh"
00005 #include "fastjet/ClusterSequence.hh"
00006 #include <vector>
00007 #include <memory>
00008 #include <cmath>
00009 
00010 #include <sstream>
00011 
00012 // questionable whether this should be in fastjet namespace or not...
00013 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
00014 
00015 //----------------------------------------------------------------------
00016 //
00032 //
00033 class SISConeBasePlugin : public JetDefinition::Plugin {
00034 public:
00036   SISConeBasePlugin (){
00037     _use_jet_def_recombiner = false;
00038   }
00039 
00041   SISConeBasePlugin (const SISConeBasePlugin & plugin) {
00042     *this = plugin;
00043   }
00044 
00046   double cone_radius        () const {return _cone_radius        ;}
00047 
00050   double overlap_threshold  () const {return _overlap_threshold  ;}
00051 
00054   int n_pass_max  () const {return _n_pass_max  ;}
00055 
00062   void set_split_merge_stopping_scale(double scale) {
00063     _split_merge_stopping_scale = scale;}
00064 
00067   double split_merge_stopping_scale() {return _split_merge_stopping_scale;}
00068 
00070   void set_use_jet_def_recombiner(bool choice) {_use_jet_def_recombiner = choice;}
00071 
00073   bool use_jet_def_recombiner() const {return _use_jet_def_recombiner;}
00074 
00076   bool caching() const {return _caching ;}
00077 
00079   virtual double R() const {return cone_radius();}
00080 
00085   virtual bool supports_ghosted_passive_areas() const {
00086     return true;
00087   }
00088   
00092   virtual void set_ghost_separation_scale(double scale) const {
00093     _ghost_sep_scale = scale;
00094   }
00095 
00096   virtual double ghost_separation_scale() const {
00097     return _ghost_sep_scale;
00098   }
00099 
00100   // the things that one MUST overload required by base class
00101   //---------------------------------------------------------
00102 
00104   virtual std::string description () const =0;
00105 
00107   virtual void run_clustering(ClusterSequence &) const = 0;
00108 
00109 protected:
00110   double _cone_radius, _overlap_threshold;
00111   int    _n_pass_max;
00112   bool   _caching;//, _split_merge_on_transverse_mass;
00113   double _split_merge_stopping_scale;
00114   bool   _use_jet_def_recombiner;
00115 
00116   mutable double _ghost_sep_scale;
00117 
00118   // the part that HAS to be overloaded
00120   virtual void reset_stored_plugin() const =0;
00121 
00122 };
00123 
00124 
00125 //======================================================================
00131 class SISConeBaseExtras : public ClusterSequence::Extras {
00132 public:
00133 
00135   //  it just initialises the pass information 
00136   SISConeBaseExtras(int nparticles) : _pass(nparticles*2,-1) {}
00137 
00139   inline virtual ~SISConeBaseExtras()=0;
00140 
00142   const std::vector<PseudoJet> & stable_cones() const {return _protocones;}
00143 
00145   const std::vector<PseudoJet> & protocones() const {return _protocones;}
00146 
00149   int pass(const PseudoJet & jet) const {return _pass[jet.cluster_hist_index()];}
00150 
00153   std::string description() const{
00154     std::ostringstream ostr;
00155     ostr << "This SISCone clustering found " << protocones().size()
00156          << " stable protocones";
00157     return ostr.str();
00158   };
00159 
00163   inline double most_ambiguous_split() const {return _most_ambiguous_split;}
00164 
00165 protected:
00166   std::vector<PseudoJet> _protocones;
00167   std::vector<int>       _pass;
00168   double                _most_ambiguous_split;
00169   const SISConeBasePlugin * _jet_def_plugin;
00170 };
00171 
00173 inline SISConeBaseExtras::~SISConeBaseExtras(){}
00174 
00175 
00176 FASTJET_END_NAMESPACE        // defined in fastjet/internal/base.hh
00177 
00178 #endif // __SISCONEBASEPLUGIN_HH__
00179 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines