#include <PrunedRecombPlugin.h>
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 |
Definition at line 61 of file PrunedRecombPlugin.h.
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:
Definition at line 86 of file PrunedRecombPlugin.h.
: _find_definition(find_definition), _prune_definition(prune_definition), _zcut(zcut), _Rcut_factor(Rcut_factor) {}
double PrunedRecombPlugin::_characteristic_angle | ( | const PseudoJet & | jet, |
const ClusterSequence & | seq | ||
) | const [private] |
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.
{ 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] |
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.
double PrunedRecombPlugin::_Rcut_factor [private] |
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().