fastjet 2.4.5
Public Member Functions | Private Member Functions | Private Attributes
fastjet::CDFJetCluPlugin Class Reference

a plugin for fastjet-v2.1 that provides an interface to the CDF jetclu algorithm More...

#include <CDFJetCluPlugin.hh>

Inheritance diagram for fastjet::CDFJetCluPlugin:
Inheritance graph
[legend]
Collaboration diagram for fastjet::CDFJetCluPlugin:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CDFJetCluPlugin (double cone_radius, double overlap_threshold, double seed_threshold=1.0, int iratch=1)
 a compact constructor
 CDFJetCluPlugin (double seed_threshold, double cone_radius, int adjacency_cut, int max_iterations, int iratch, double overlap_threshold)
 a constructor that looks like the one provided by CDF
double seed_threshold () const
double cone_radius () const
int adjacency_cut () const
int max_iterations () const
int iratch () const
double overlap_threshold () const
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:
virtual double R () const
 the plugin mechanism's standard way of accessing the jet radius

Private Member Functions

void _insert_unique (PseudoJet &jet, std::map< double, int > &jetmap) const
 given a jet try inserting its energy into the map -- if that energy entry already exists, modify the jet infinitesimally so as ensure that the jet energy is unique

Private Attributes

double _seed_threshold
double _cone_radius
int _adjacency_cut
int _max_iterations
int _iratch
double _overlap_threshold

Detailed Description

a plugin for fastjet-v2.1 that provides an interface to the CDF jetclu algorithm

Definition at line 44 of file CDFJetCluPlugin.hh.


Constructor & Destructor Documentation

fastjet::CDFJetCluPlugin::CDFJetCluPlugin ( double  cone_radius,
double  overlap_threshold,
double  seed_threshold = 1.0,
int  iratch = 1 
) [inline]

a compact constructor

Definition at line 47 of file CDFJetCluPlugin.hh.

fastjet::CDFJetCluPlugin::CDFJetCluPlugin ( double  seed_threshold,
double  cone_radius,
int  adjacency_cut,
int  max_iterations,
int  iratch,
double  overlap_threshold 
) [inline]

a constructor that looks like the one provided by CDF

Definition at line 59 of file CDFJetCluPlugin.hh.


Member Function Documentation

void fastjet::CDFJetCluPlugin::_insert_unique ( PseudoJet jet,
std::map< double, int > &  jetmap 
) const [private]

given a jet try inserting its energy into the map -- if that energy entry already exists, modify the jet infinitesimally so as ensure that the jet energy is unique

int fastjet::CDFJetCluPlugin::adjacency_cut ( ) const [inline]

Definition at line 76 of file CDFJetCluPlugin.hh.

{return _adjacency_cut     ;}
double fastjet::CDFJetCluPlugin::cone_radius ( ) const [inline]

Definition at line 75 of file CDFJetCluPlugin.hh.

{return _cone_radius       ;}
string fastjet::CDFJetCluPlugin::description ( ) const [virtual]

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

Implements fastjet::JetDefinition::Plugin.

Definition at line 46 of file CDFJetCluPlugin.cc.

                                           {
  ostringstream desc;
  
  desc << "CDF JetClu jet algorithm with " 
       << "seed_threshold = "     << seed_threshold    () << ", "
       << "cone_radius = "        << cone_radius       () << ", "
       << "adjacency_cut = "      << adjacency_cut     () << ", " 
       << "max_iterations = "     << max_iterations    () << ", "
       << "iratch = "             << iratch            () << ", "
       << "overlap_threshold = "  << overlap_threshold () ;

  return desc.str();
}
int fastjet::CDFJetCluPlugin::iratch ( ) const [inline]

Definition at line 78 of file CDFJetCluPlugin.hh.

{return _iratch            ;}
int fastjet::CDFJetCluPlugin::max_iterations ( ) const [inline]

Definition at line 77 of file CDFJetCluPlugin.hh.

{return _max_iterations    ;}
double fastjet::CDFJetCluPlugin::overlap_threshold ( ) const [inline]

Definition at line 79 of file CDFJetCluPlugin.hh.

{return _overlap_threshold ;}
virtual double fastjet::CDFJetCluPlugin::R ( ) const [inline, virtual]

the plugin mechanism's standard way of accessing the jet radius

Implements fastjet::JetDefinition::Plugin.

Definition at line 86 of file CDFJetCluPlugin.hh.

{return cone_radius();}
void fastjet::CDFJetCluPlugin::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 61 of file CDFJetCluPlugin.cc.

References fastjet::ClusterSequence::jets(), fastjet::ClusterSequence::plugin_record_iB_recombination(), fastjet::ClusterSequence::plugin_record_ij_recombination(), and fastjet::sort_indices().

                                                                      {
 
  // create the physics towers needed by the CDF code
  vector<PhysicsTower> towers;
  towers.reserve(clust_seq.jets().size());

  // create a map to identify jets (actually just the input particles)...
  //map<double,int> jetmap;

  for (unsigned i = 0; i < clust_seq.jets().size(); i++) {
    PseudoJet particle(clust_seq.jets()[i]);
    //_insert_unique(particle, jetmap);
    LorentzVector fourvect(particle.px(), particle.py(),
                           particle.pz(), particle.E());
    PhysicsTower tower(fourvect);
    // add tracking information for later
    tower.fjindex = i;
    towers.push_back(tower);
  }

  // prepare the CDF algorithm
  JetCluAlgorithm j(seed_threshold(), cone_radius(), adjacency_cut(),
                    max_iterations(), iratch(), overlap_threshold());
    
  // run the CDF algorithm
  std::vector<Cluster> jets;
  j.run(towers,jets);


  // now transfer the jets back into our own structure -- we will
  // mimic the cone code with a sequential recombination sequence in
  // which the jets are built up by adding one particle at a time

  // NB: with g++-4.0, the reverse iterator code gave problems, so switch
  //     to indices instead
  //for(vector<Cluster>::const_reverse_iterator jetIter = jets.rbegin(); 
  //                                    jetIter != jets.rend(); jetIter++) {
  //  const vector<PhysicsTower> & tower_list = jetIter->towerList;
  //  int jet_k = jetmap[tower_list[0].fourVector.E];
  //
  //  int ntow = int(jetIter->towerList.size());

  for(int iCDFjets = jets.size()-1; iCDFjets >= 0; iCDFjets--) {

    const vector<PhysicsTower> & tower_list = jets[iCDFjets].towerList;
    int ntow = int(tower_list.size());
    
    // 2008-09-04: sort the towerList (according to fjindex) so as
    //             to have a consistent order for particles in jet
    //             (necessary because addition of ultra-soft particles
    //             sometimes often modifies the order, while maintaining
    //             the same overall set)
    vector<int>    jc_indices(ntow);
    vector<double> fj_indices(ntow); // use double: benefit from existing routine
    for (int itow = 0; itow < ntow; itow++) {
      jc_indices[itow] = itow;
      fj_indices[itow] = tower_list[itow].fjindex;
    }
    sort_indices(jc_indices, fj_indices);

    int jet_k = tower_list[jc_indices[0]].fjindex;
  
    for (int itow = 1; itow < ntow; itow++) {
      if (tower_list[jc_indices[itow]].Et() > 1e-50) {
      }
      int jet_i = jet_k;
      // retrieve our index for the jet
      int jet_j;
      jet_j = tower_list[jc_indices[itow]].fjindex;

      // safety check
      assert (jet_j >= 0 && jet_j < int(towers.size()));

      // do a fake recombination step with dij=0
      double dij = 0.0;

      // JetClu does E-scheme recombination so we can stick with the
      // simple option
      clust_seq.plugin_record_ij_recombination(jet_i, jet_j, dij, jet_k);

    }
  
    // NB: put a sensible looking d_iB just to be nice...
    double d_iB = clust_seq.jets()[jet_k].perp2();
    clust_seq.plugin_record_iB_recombination(jet_k, d_iB);
  }


  // following code is for testing only
  //cout << endl;
  //for(vector<Cluster>::const_iterator jetIter = jets.begin(); 
  //                                    jetIter != jets.end(); jetIter++) {
  //  cout << jetIter->fourVector.pt() << " " << jetIter->fourVector.y() << endl;
  //}
  //cout << "-----------------------------------------------------\n";
  //vector<PseudoJet> ourjets(clust_seq.inclusive_jets());
  //for (vector<PseudoJet>::const_iterator ourjet = ourjets.begin();
  //     ourjet != ourjets.end(); ourjet++) {
  //  cout << ourjet->perp() << " " << ourjet->rap() << endl;
  //}
  //cout << endl;
}
double fastjet::CDFJetCluPlugin::seed_threshold ( ) const [inline]

Definition at line 74 of file CDFJetCluPlugin.hh.

{return _seed_threshold    ;}

Member Data Documentation

Definition at line 93 of file CDFJetCluPlugin.hh.

Definition at line 92 of file CDFJetCluPlugin.hh.

Definition at line 95 of file CDFJetCluPlugin.hh.

Definition at line 94 of file CDFJetCluPlugin.hh.

Definition at line 96 of file CDFJetCluPlugin.hh.

Definition at line 91 of file CDFJetCluPlugin.hh.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines