31 #include "fastjet/CDFJetCluPlugin.hh" 
   32 #include "fastjet/ClusterSequence.hh" 
   37 #include "JetCluAlgorithm.hh" 
   38 #include "PhysicsTower.hh" 
   41 FASTJET_BEGIN_NAMESPACE      
 
   46 thread_safety_helpers::FirstTimeTrue CDFJetCluPlugin::_first_time;
 
   48 string CDFJetCluPlugin::description ()
 const {
 
   51   desc << 
"CDF JetClu jet algorithm with "  
   52        << 
"seed_threshold = "     << seed_threshold    () << 
", " 
   53        << 
"cone_radius = "        << cone_radius       () << 
", " 
   54        << 
"adjacency_cut = "      << adjacency_cut     () << 
", "  
   55        << 
"max_iterations = "     << max_iterations    () << 
", " 
   56        << 
"iratch = "             << iratch            () << 
", " 
   57        << 
"overlap_threshold = "  << overlap_threshold () ;
 
   68   vector<PhysicsTower> towers;
 
   69   towers.reserve(clust_seq.
jets().size());
 
   74   for (
unsigned i = 0; i < clust_seq.
jets().size(); i++) {
 
   77     LorentzVector fourvect(particle.px(), particle.py(),
 
   78                            particle.pz(), particle.E());
 
   79     PhysicsTower tower(fourvect);
 
   82     towers.push_back(tower);
 
   86   JetCluAlgorithm j(seed_threshold(), cone_radius(), adjacency_cut(),
 
   87                     max_iterations(), iratch(), overlap_threshold());
 
   90   std::vector<Cluster> jets;
 
  107   for(
int iCDFjets = jets.size()-1; iCDFjets >= 0; iCDFjets--) {
 
  109     const vector<PhysicsTower> & tower_list = jets[iCDFjets].towerList;
 
  110     int ntow = int(tower_list.size());
 
  117     vector<int>    jc_indices(ntow);
 
  118     vector<double> fj_indices(ntow); 
 
  119     for (
int itow = 0; itow < ntow; itow++) {
 
  120       jc_indices[itow] = itow;
 
  121       fj_indices[itow] = tower_list[itow].fjindex;
 
  123     sort_indices(jc_indices, fj_indices);
 
  125     int jet_k = tower_list[jc_indices[0]].fjindex;
 
  127     for (
int itow = 1; itow < ntow; itow++) {
 
  128       if (tower_list[jc_indices[itow]].Et() > 1e-50) {
 
  133       jet_j = tower_list[jc_indices[itow]].fjindex;
 
  136       assert (jet_j >= 0 && jet_j < 
int(towers.size()));
 
  148     double d_iB = clust_seq.
jets()[jet_k].perp2();
 
  170 void CDFJetCluPlugin::_print_banner(ostream *ostr)
 const{
 
  171   if (! _first_time()) 
return;
 
  176   (*ostr) << 
"#-------------------------------------------------------------------------" << endl;
 
  177   (*ostr) << 
"# You are running the CDF JetClu plugin for FastJet                       " << endl;
 
  178   (*ostr) << 
"# This is based on an implementation provided by Joey Huston.             " << endl;
 
  179   (*ostr) << 
"# If you use this plugin, please cite                                     " << endl;
 
  180   (*ostr) << 
"#   F. Abe et al. [CDF Collaboration], Phys. Rev. D 45 (1992) 1448.       " << endl;
 
  181   (*ostr) << 
"# in addition to the usual FastJet reference.                             " << endl;
 
  182   (*ostr) << 
"#-------------------------------------------------------------------------" << endl;
 
  188 FASTJET_END_NAMESPACE