CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

PrunedRecombPlugin Class Reference

#include <PrunedRecombPlugin.h>

List of all members.

Public Member Functions

virtual std::string description () const
 PrunedRecombPlugin (const JetDefinition &find_definition, const JetDefinition &prune_definition, const double &zcut=0.1, const double &Rcut_factor=0.5)
virtual double R () const
double Rcut_factor () const
virtual void run_clustering (ClusterSequence &) const
double zcut () const

Private Member Functions

double _characteristic_angle (const PseudoJet &jet, const ClusterSequence &seq) const
void _output_mergings (ClusterSequence &in_seq, ClusterSequence &out_seq) const

Private Attributes

JetDefinition _find_definition
JetDefinition _prune_definition
double _Rcut_factor
double _zcut

Detailed Description

Definition at line 61 of file PrunedRecombPlugin.h.


Constructor & Destructor Documentation

PrunedRecombPlugin::PrunedRecombPlugin ( const JetDefinition &  find_definition,
const JetDefinition &  prune_definition,
const double &  zcut = 0.1,
const double &  Rcut_factor = 0.5 
) [inline]

constructor for the PrunedRecombPlugin, whose arguments have the following meaning:

  • find_definition, which is a JetDefinition object, specifies which jet algorithm to run to find jets.
  • prune_definition is the algorithm used when pruning the found jet (typically the same as find_algorithm). Also a JetDefinition. The PrunedRecombiner will be used in this definition.
  • zcut and Rcut_factor are parameters to the pruning procedure. Jet alg. prune_algorithm is run as normal, but with infinite R (actually R = pi/2, since FastJet asserts that R <= pi/2), and recombinations with DeltaR > Rcut and z < zcut are vetoed, and the softer PseudoJet is discarded. (It will appear in the history as a PJ that never merged again -- it is not merged with the beam! inclusive_jets(ptCut) should be used to access the pruned jets. Rcut is chosen for each jet according to Rcut = Rcut_factor * 2*m/pT, where m and pT correspond to the four-momentum of the found jet.

Definition at line 86 of file PrunedRecombPlugin.h.

                                                                                            :
                _find_definition(find_definition),
                _prune_definition(prune_definition),
                _zcut(zcut),
                _Rcut_factor(Rcut_factor)
                {}

Member Function Documentation

double PrunedRecombPlugin::_characteristic_angle ( const PseudoJet &  jet,
const ClusterSequence &  seq 
) const [private]

Definition at line 146 of file PrunedRecombPlugin.cc.

References p1, and p2.

{
        PseudoJet p1, p2;
        if (! seq.has_parents(jet, p1, p2))
                return -1.0;
        else
                //return sqrt(p1.squared_distance(p2));  // DeltaR
                return 2.0*jet.m()/jet.perp();
}
void PrunedRecombPlugin::_output_mergings ( ClusterSequence &  in_seq,
ClusterSequence &  out_seq 
) const [private]

Definition at line 98 of file PrunedRecombPlugin.cc.

References estimatePileup::hist, and L1TEmulatorMonitor_cff::p.

{
        vector<PseudoJet> p = in_seq.jets();

        // get the history from in_seq
        const vector<ClusterSequence::history_element> & hist = in_seq.history();
        vector<ClusterSequence::history_element>::const_iterator
                iter = hist.begin();
        
        // skip particle input elements
        while (iter->parent1 == ClusterSequence::InexistentParent)
                iter++;
        
        // Walk through history.  PseudoJets in in_seq should have a user_index
        //   corresponding to their index in out_seq.  Note that when we create a 
        //   new PJ via record_ij we need to set the user_index of our local copy.
        for (; iter != hist.end(); iter++) {
                int new_jet_index = -1;
                int i1 = p[hist[iter->parent1].jetp_index].user_index() - 1;
                if (iter->parent2 == ClusterSequence::BeamJet) {
                        out_seq.plugin_record_iB_recombination(i1, iter->dij);
                } else {
                        int i2 = p[hist[iter->parent2].jetp_index].user_index() - 1;
                        
                        // Check if either parent is equal to the child, indicating pruning.
                        //  There is probably a smarter way to keep track of this.
                        if (p[iter->jetp_index].e() - p[hist[iter->parent1].jetp_index].e() == 0)
                                // pruned away parent2 -- just give child parent1's index
                                p[iter->jetp_index].set_user_index(p[hist[iter->parent1].jetp_index].user_index());
                        else if (p[iter->jetp_index].e() - p[hist[iter->parent2].jetp_index].e() == 0)
                                // pruned away parent1 -- just give child parent2's index
                                p[iter->jetp_index].set_user_index(p[hist[iter->parent2].jetp_index].user_index());
                        else {
                                // no pruning -- record combination and index for child
                                out_seq.plugin_record_ij_recombination(i1, i2, iter->dij,
                                                               new_jet_index);
                                p[iter->jetp_index].set_user_index(new_jet_index + 1);
                        }
                }
        }
}
FASTJET_BEGIN_NAMESPACE string PrunedRecombPlugin::description ( ) const [virtual]

Definition at line 21 of file PrunedRecombPlugin.cc.

                                              {
        ostringstream desc;
  
        desc << "Pruned jet algorithm \n"
             << "----------------------- \n"
             << "Jet finder: " << _find_definition.description()
             << "\n----------------------- \n"
             << "Prune jets with: " << _prune_definition.description()
             << "\n----------------------- \n"
                  << "Pruning parameters: "
             << "zcut = " << _zcut << ", "
             << "Rcut_factor = " << _Rcut_factor << "\n"
                  << "----------------------- \n" ;

  return desc.str();
}
virtual double PrunedRecombPlugin::R ( ) const [inline, virtual]

Definition at line 101 of file PrunedRecombPlugin.h.

References _find_definition.

{return _find_definition.R();}
double PrunedRecombPlugin::Rcut_factor ( ) const [inline]

Definition at line 103 of file PrunedRecombPlugin.h.

References _Rcut_factor.

{return _Rcut_factor;}
void PrunedRecombPlugin::run_clustering ( ClusterSequence &  input_seq) const [virtual]

Definition at line 50 of file PrunedRecombPlugin.cc.

References angle(), and i.

                                                                         {
                
        vector<PseudoJet> inputs = input_seq.jets();
        // Record user_index's so we can match PJ's in pruned jets to PJ's in 
        //   input_seq.
        // Use i+1 to distinguish from the default, which in some places appears to
        //   be 0.
        for (unsigned int i = 0; i < inputs.size(); i++)
                inputs[i].set_user_index(i+1);
                
        // ClusterSequence for initial (unpruned) jet finding
        ClusterSequence unpruned_seq(inputs, _find_definition);
        
        // now, for each jet, construct a pruned version:
        vector<PseudoJet> unpruned_jets
                            = sorted_by_pt(unpruned_seq.inclusive_jets(0.0));
        for (unsigned int i = 0; i < unpruned_jets.size(); i++) {
                double angle = _characteristic_angle(unpruned_jets[i], unpruned_seq);
                // PrunedRecombiner is just DefaultRecombiner but vetoes on recombinations
                //   that fail a pruning test.  Note that Rcut is proportional to the
                //   characteristic angle of the jet.
                JetDefinition::Recombiner *pruned_recombiner = 
                                          new PrunedRecombiner(_zcut, _Rcut_factor*angle);
                _prune_definition.set_recombiner(pruned_recombiner);
                ClusterSequence pruned_seq
                                       (unpruned_seq.constituents(unpruned_jets[i]), 
                                        _prune_definition);
                delete pruned_recombiner;
                
                // Cluster all the particles in this jet into 1 pruned jet.
                // It is possible, though rare, to have a particle or two not clustered 
                //   into the jet even with R = pi/2.  It doesn't have to be the first 
                //  element of pruned_jets!  Sorting by pT and taking [0] should work...
                vector<PseudoJet> pruned_jets = pruned_seq.inclusive_jets(0.0);
                PseudoJet pruned_jet = sorted_by_pt(pruned_jets)[0];

                _output_mergings(pruned_seq, input_seq);
        }
}
double PrunedRecombPlugin::zcut ( ) const [inline]

Definition at line 102 of file PrunedRecombPlugin.h.

References _zcut.

{return _zcut;}

Member Data Documentation

JetDefinition PrunedRecombPlugin::_find_definition [private]

Definition at line 107 of file PrunedRecombPlugin.h.

Referenced by R().

JetDefinition PrunedRecombPlugin::_prune_definition [mutable, private]

Definition at line 108 of file PrunedRecombPlugin.h.

Definition at line 110 of file PrunedRecombPlugin.h.

Referenced by Rcut_factor().

double PrunedRecombPlugin::_zcut [private]

Definition at line 109 of file PrunedRecombPlugin.h.

Referenced by zcut().