fastjet::TrackJetPlugin Class Reference

#include <TrackJetPlugin.hh>

Inheritance diagram for fastjet::TrackJetPlugin:

Inheritance graph
fastjet::JetDefinition::Plugin
[legend]
Collaboration diagram for fastjet::TrackJetPlugin:

Collaboration graph
fastjet::JetDefinition::Pluginfastjet::JetDefinition::DefaultRecombinerfastjet::JetDefinition::Recombiner
[legend]

List of all members.

Public Member Functions

 TrackJetPlugin (double radius, RecombinationScheme jet_recombination_scheme=pt_scheme, RecombinationScheme track_recombination_scheme=pt_scheme)
 Main constructor for the TrackJet Plugin class.
 TrackJetPlugin (const TrackJetPlugin &plugin)
 copy constructor
virtual std::string description () const
 return a textual description of the jet-definition implemented in this plugin
virtual void run_clustering (ClusterSequence &) const
 given a ClusterSequence that has been filled up with initial particles, the following function should fill up the rest of the ClusterSequence, using the following member functions of ClusterSequence:
  • plugin_do_ij_recombination(.

virtual double R () const
 the plugin mechanism's standard way of accessing the jet radius here we return the R of the last alg in the list

Private Attributes

double _radius
double _radius2
JetDefinition::DefaultRecombiner _jet_recombiner
JetDefinition::DefaultRecombiner _track_recombiner


Detailed Description

Definition at line 47 of file TrackJetPlugin.hh.


Constructor & Destructor Documentation

fastjet::TrackJetPlugin::TrackJetPlugin ( double  radius,
RecombinationScheme  jet_recombination_scheme = pt_scheme,
RecombinationScheme  track_recombination_scheme = pt_scheme 
) [inline]

Main constructor for the TrackJet Plugin class.

The argument is an initialised list of jet algorithms

Parameters:
_radius the distance at which point a particle is no longer recombied into the jet
jet_recombination_scheme the recombination scheme used to sum the 4-vecors inside the jet
track_recombination_scheme the recombination scheme used to sum the 4-vecors when accumulating track into a the jet Both recombiners are defaulted to pt_scheme recomb as for the Rivet implementation.

Definition at line 61 of file TrackJetPlugin.hh.

00063                                                                            {
00064     _radius  = radius;
00065     _radius2 = radius*radius;
00066     _jet_recombiner = JetDefinition::DefaultRecombiner(jet_recombination_scheme);
00067     _track_recombiner = JetDefinition::DefaultRecombiner(track_recombination_scheme);
00068   }

fastjet::TrackJetPlugin::TrackJetPlugin ( const TrackJetPlugin plugin  )  [inline]

copy constructor

Definition at line 71 of file TrackJetPlugin.hh.

00071                                                  {
00072     *this = plugin;
00073   }


Member Function Documentation

string fastjet::TrackJetPlugin::description (  )  const [virtual]

return a textual description of the jet-definition implemented in this plugin

Implements fastjet::JetDefinition::Plugin.

Definition at line 56 of file TrackJetPlugin.cc.

References R().

00056                                           {
00057   ostringstream desc;
00058   desc << "TrackJet algorithm with R = " << R();
00059   return desc.str();
00060 }

virtual double fastjet::TrackJetPlugin::R (  )  const [inline, virtual]

the plugin mechanism's standard way of accessing the jet radius here we return the R of the last alg in the list

Implements fastjet::JetDefinition::Plugin.

Definition at line 81 of file TrackJetPlugin.hh.

Referenced by description().

00081 {return _radius;}

void fastjet::TrackJetPlugin::run_clustering ( ClusterSequence  )  const [virtual]

given a ClusterSequence that has been filled up with initial particles, the following function should fill up the rest of the ClusterSequence, using the following member functions of ClusterSequence:

  • plugin_do_ij_recombination(.

..)

  • plugin_do_iB_recombination(...)

Implements fastjet::JetDefinition::Plugin.

Definition at line 62 of file TrackJetPlugin.cc.

References _jet_recombiner, _radius2, _track_recombiner, fastjet::ClusterSequence::jets(), fastjet::PseudoJet::plain_distance(), fastjet::ClusterSequence::plugin_record_iB_recombination(), fastjet::ClusterSequence::plugin_record_ij_recombination(), fastjet::JetDefinition::DefaultRecombiner::preprocess(), and fastjet::JetDefinition::DefaultRecombiner::recombine().

00062                                                                      {
00063   // we first need to sort the particles in pt
00064   vector<TrackJetParticlePtr> particle_list;
00065 
00066   const vector<PseudoJet> & jets = clust_seq.jets();  
00067   int index=0;
00068   for (vector<PseudoJet>::const_iterator mom_it = jets.begin(); mom_it != jets.end(); mom_it++){
00069     particle_list.push_back(TrackJetParticlePtr(index, mom_it->perp2()));
00070     index++;
00071   }
00072 
00073   // sort the particles into decreasing pt
00074   sort(particle_list.begin(), particle_list.end());
00075 
00076 
00077   // if we're using a recombination scheme different from the E scheme,
00078   // we first need to update the particles' energy so that they
00079   // are massless (and rapidity = pseudorapidity)
00080   vector<PseudoJet> tuned_particles = clust_seq.jets();
00081   vector<PseudoJet> tuned_tracks = clust_seq.jets();
00082   for (vector<PseudoJet>::iterator pit = tuned_particles.begin();
00083        pit != tuned_particles.end(); pit++)
00084     _jet_recombiner.preprocess(*pit);
00085   for (vector<PseudoJet>::iterator pit = tuned_tracks.begin();
00086        pit != tuned_tracks.end(); pit++)
00087     _track_recombiner.preprocess(*pit);
00088 
00089 
00090   // we'll just need the particle indices for what follows
00091   list<int> sorted_pt_index;
00092   for (vector<TrackJetParticlePtr>::iterator mom_it = particle_list.begin();
00093        mom_it != particle_list.end(); mom_it++)
00094     sorted_pt_index.push_back(mom_it->index);
00095   
00096   // now start building the jets
00097   while (sorted_pt_index.size()){
00098     // note that here 'track' refers to the direction we're using to test if a particle belongs to the jet
00099     // 'jet' refers to the momentum of the jet
00100     // the difference between the two is in the recombination scheme used to compute the sum of 4-vectors
00101     int current_jet_index = sorted_pt_index.front();
00102     PseudoJet current_jet   = tuned_particles[current_jet_index];
00103     PseudoJet current_track = tuned_tracks[current_jet_index];
00104 
00105     // remove the first particle from the available ones    
00106     list<int>::iterator index_it = sorted_pt_index.begin();
00107     sorted_pt_index.erase(index_it);
00108 
00109     // start browsing the remaining ones
00110     index_it = sorted_pt_index.begin();
00111     while (index_it != sorted_pt_index.end()){
00112       const PseudoJet & current_particle = tuned_particles[*index_it];
00113       const PseudoJet & current_particle_track = tuned_tracks[*index_it];
00114 
00115       // check if the particle is within a distance R of the jet
00116       double distance2 = current_track.plain_distance(current_particle_track);
00117       if (distance2 <= _radius2){
00118         // add the particle to the jet
00119         PseudoJet new_track;
00120         PseudoJet new_jet;
00121         _jet_recombiner.recombine(current_jet, current_particle, new_jet);
00122         _track_recombiner.recombine(current_track, current_particle_track, new_track);
00123 
00124         int new_jet_index;
00125         clust_seq.plugin_record_ij_recombination(current_jet_index, *index_it, distance2, new_jet, new_jet_index);
00126 
00127         current_jet = new_jet;
00128         current_track = new_track;
00129         current_jet_index = new_jet_index;
00130 
00131         // particle has been clustered so remove it from the list
00132         sorted_pt_index.erase(index_it);
00133 
00134         // and don't forget to start again from the beginning
00135         //  as the jet axis may have changed
00136         index_it = sorted_pt_index.begin();
00137       } else {
00138         index_it++;
00139       }
00140     }
00141 
00142     // now we have a final jet, so cluster it with the beam
00143     clust_seq.plugin_record_iB_recombination(current_jet_index, _radius2);
00144   }
00145     
00146 }


Member Data Documentation

Definition at line 86 of file TrackJetPlugin.hh.

Referenced by run_clustering().

Definition at line 84 of file TrackJetPlugin.hh.

Definition at line 84 of file TrackJetPlugin.hh.

Referenced by run_clustering().

Definition at line 87 of file TrackJetPlugin.hh.

Referenced by run_clustering().


The documentation for this class was generated from the following files:

Generated on Fri Apr 17 16:16:05 2009 for fastjet by  doxygen 1.5.7.1