CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/RecoJets/JetAlgorithms/src/PrunedRecombPlugin.h

Go to the documentation of this file.
00001 /*
00002 
00003 Original source:
00004 https://www.phys.washington.edu/groups/lhcti/pruning/FastJetPlugin/
00005 for physics, see
00006 https://arxiv.org/abs/0903.5081
00007 
00008 Some minor adaptions for integration into CMSSW by Jochen Ott.
00009 
00010 */
00012 //
00013 // PrunedRecombPlugin.hh
00014 // Last update: 5/29/09 CKV
00015 // PrunedRecomb version: 0.2.0
00016 // Author: Christopher Vermilion <verm@u.washington.edu>
00017 //
00018 // -------------------
00019 //
00020 // Defines the PrunedRecomb Plugin to FastJet.  This is the "pruned" version of
00021 //   a recombination algorithm specifed in the constructor (Cambridge/Aachen and
00022 //   kT are both sensible choices), as described in arXiv:0903.5081.
00023 //
00024 // The helper class PrunedRecombiner is also defined below.
00025 //
00026 // When a ClusterSequence created with this plugin calls "run_clustering" on a
00027 //   set of input particles, the following occurs:
00028 //
00029 // 1) Normal jets are formed using the JetDefintion _find_definition.
00030 // 2) For each of these jets, create a second ClusterSequence with the JetDef.
00031 //      _prune_definition and the Recombiner PrunedRecombiner.
00032 //      See comments below for more on how this works.  The pruned jet is the
00033 //      original jet with certain branches removed.
00034 // 3) This creates a pruned jet.  For each of these, the helper function
00035 //      output_mergings takes the cluster sequence from the pruned jet and
00036 //      feeds it into the input ClusterSequence with the 
00037 //      plugin_record_{ij,iB}_recombination functions.  This leaves the
00038 //      ClusterSequence holding pruned versions of all the original jets.
00039 // 4) Pruned away branches are marked in the history as entries that are not
00040 //      not subsequently recombined (i.e., child == Invalid).  This means that
00041 //      only inclusive_jets(ptcut) makes sense.  Future versions of this plugins
00042 //      will hopefully include an Extras() object with the ClusterSequence so 
00043 //      that the pruned branches can be associated with the points they were 
00044 //      pruned from.
00045 //
00047 
00048 #ifndef RecoJetsJetAlgorithms_PRUNEDRECOMBPLUGIN_H_
00049 #define RecoJetsJetAlgorithms_PRUNEDRECOMBPLUGIN_H_
00050 
00051 #include "fastjet/ClusterSequence.hh"
00052 #include "fastjet/JetDefinition.hh"
00053 
00054 #include <string>
00055 
00056 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
00057 
00058 // forward declaration since we use this in the plugin
00059 //class PrunedRecombiner;
00060 
00061 class PrunedRecombPlugin : public JetDefinition::Plugin {
00062 public:
00063 
00086         PrunedRecombPlugin (const JetDefinition & find_definition,
00087                             const JetDefinition & prune_definition,
00088                                                           const double & zcut = 0.1,
00089                                                           const double & Rcut_factor = 0.5) :
00090                 _find_definition(find_definition),
00091                 _prune_definition(prune_definition),
00092                 _zcut(zcut),
00093                 _Rcut_factor(Rcut_factor)
00094                 {}
00095         
00096         // The things that are required by base class.
00097         virtual std::string description () const;
00098         virtual void run_clustering(ClusterSequence &) const;
00099         
00100         // Access to parameters.
00101         inline virtual double R() const {return _find_definition.R();}
00102         inline double zcut() const {return _zcut;}
00103         inline double Rcut_factor() const {return _Rcut_factor;}
00104 
00105 private:
00106 
00107         JetDefinition _find_definition;
00108         mutable JetDefinition _prune_definition;  // mutable so we can change its Recombiner*
00109         double _zcut;
00110         double _Rcut_factor;
00111 
00112         // Helper function to find the characteristic angle of a given jet.
00113         // There are a few reasonable choices for this; we use 2*m/pT.
00114         //   If no parents, return -1.0.
00115         double _characteristic_angle (const PseudoJet & jet,
00116                                const ClusterSequence & seq) const;
00117         
00118         // Takes the merging structure of "in_seq" and feeds this into
00119         //  "out_seq" using _plugin_record_{ij,iB}_recombination()
00120         void _output_mergings(ClusterSequence & in_seq, 
00121                                    ClusterSequence & out_seq) const;
00122 
00123 };
00124 
00125 
00126 
00128 //
00129 // The PrunedRecombiner class.  This class extends the DefaultRecombiner
00130 //   class to include a "pruning test".  If this test on a recombination fails,
00131 //   the recombination does not occur.  This happens in the following way:
00132 // 1) The "new" PseudoJet is set equal to the higher-pT parent.
00133 // 2) The lower-pT parent is effectively discarded from the algorithm.
00134 // 3) Not implemented yet: some method of keeping track of what was pruned when.
00135 //
00137 
00138 
00139 class PrunedRecombiner : public JetDefinition::DefaultRecombiner {
00140 public:
00141         PrunedRecombiner(const double & zcut = 0.1, const double & Rcut = 0.5,
00142                          RecombinationScheme recomb_scheme = E_scheme) :
00143            JetDefinition::DefaultRecombiner(recomb_scheme), _zcut(zcut), _Rcut(Rcut) 
00144                 {}
00145                 
00146         virtual std::string description() const;
00147         
00149         virtual void recombine(const PseudoJet & pa, const PseudoJet & pb, 
00150                            PseudoJet & pab) const;
00151                 
00152 private:
00154         int _pruning_test(const PseudoJet & pa, const PseudoJet & pb) const;
00155 
00156         double _zcut; // zcut parameter to the pruning test
00157         double _Rcut; // Rcut parameter to the pruning test
00158 };
00159 
00160 
00161 
00162 FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
00163 
00164 
00165 
00166 #endif