FastJet 3.0.5
ILConeAlgorithm.hpp
00001 #ifndef  D0RunIIconeJets_ILCONEALGORITHM
00002 #define  D0RunIIconeJets_ILCONEALGORITHM
00003 // ---------------------------------------------------------------------------
00004 // ILConeAlgorithm.hpp
00005 //
00006 // Created: 28-JUL-2000 Francois Touze (+ Laurent Duflot)
00007 //
00008 // Purpose: Implements the Improved Legacy Cone Algorithm
00009 //
00010 // Modified:
00011 //   31-JUL-2000  Laurent Duflot
00012 //     + introduce support for additional informations (ConeJetInfo)
00013 //    1-AUG-2000  Laurent Duflot
00014 //     + seedET for midpoint jet is -999999., consistent with seedET ordering
00015 //       in ConeSplitMerge: final jets with seedET=-999999. will be midpoint 
00016 //       jets which were actually different from stable cones.
00017 //    4-Aug-2000  Laurent Duflot
00018 //     + remove unecessary copy in TemporaryJet::is_stable()
00019 //   11-Aug-2000  Laurent Duflot
00020 //     + remove using namespace std
00021 //     + add threshold on item. The input list to makeClusters() IS modified
00022 //   20-June-2002 John Krane
00023 //     + remove bug in midpoint calculation based on pT weight
00024 //     + started to add new midpoint calculation based on 4-vectors,
00025 //       but not enough info held by this class
00026 //   24-June-2002 John Krane
00027 //     + modify is_stable() to not iterate if desired 
00028 //       (to expand search cone w/out moving it)
00029 //     + added search cone logic for initial jets but not midpoint jets as per
00030 //       agreement with CDF
00031 //   19-July-2002 John Krane
00032 //     + _SEARCH_CONE size factor now provided by calreco/CalClusterReco.cpp 
00033 //     + (default = 1.0 = like original ILCone behavior)
00034 //   10-Oct-2002 John Krane
00035 //     + Check min Pt of cone with full size first, then iterate with search cone
00036 //   07-Dec-2002 John Krane
00037 //     + speed up the midpoint phi-wrap solution
00038 //   01-May-2007 Lars Sonnenschein
00039 //   extracted from D0 software framework and modified to remove subsequent dependencies
00040 //
00041 //
00042 // This file is distributed with FastJet under the terms of the GNU
00043 // General Public License (v2). Permission to do so has been granted
00044 // by Lars Sonnenschein and the D0 collaboration (see COPYING for
00045 // details)
00046 //
00047 // History of changes in FastJet compared tothe original version of
00048 // ProtoJet.hpp
00049 //
00050 // 2012-06-12  Gregory Soyez  <soyez@fastjet.fr>
00051 //
00052 //        * Replaced addItem(...) by this->addItem(...) to allow
00053 //          compilation with gcc 4.7 which no longer performs
00054 //          unqualified template lookups. See
00055 //          e.g. http://gcc.gnu.org/gcc-4.7/porting_to.html
00056 //
00057 // 2011-12-13  Gregory Soyez  <soyez@fastjet.fr>
00058 // 
00059 //        * added license information
00060 //
00061 // 2011-11-14  Gregory Soyez  <soyez@fastjet.fr>
00062 //
00063 //        * changed the name of a few parameters to avoid a gcc
00064 //          -Wshadow warning
00065 //
00066 // 2009-01-17  Gregory Soyez  <soyez@fastjet.fr>
00067 //
00068 //        * put the code in the fastjet::d0 namespace
00069 //
00070 // 2007-12-14  Gavin Salam  <salam@lpthe.jussieu.fr>
00071 // 
00072 //        * moved the 'std::vector<ProtoJet<Item> > ilcv' structure
00073 //          containing the info about the final jets from a local
00074 //          variable to a class variable (for integration in the
00075 //          FastJet plugin core)
00076 //
00077 // ---------------------------------------------------------------------------
00078 
00079 #include <vector>
00080 #include <list>
00081 #include <utility>  // defines pair<,>
00082 #include <map>
00083 #include <algorithm>
00084 #include <iostream>
00085 
00086 
00087 //#include "energycluster/EnergyClusterReco.hpp"
00088 //#include "energycluster/ProtoJet.hpp"
00089 #include "ProtoJet.hpp"
00090 //#include "energycluster/ConeSplitMerge.hpp"
00091 #include "ConeSplitMerge.hpp"
00092 //#include "energycluster/ConeJetInfoChunk.hpp"
00093 
00094 #include "inline_maths.h"
00095 
00096 ///////////////////////////////////////////////////////////////////////////////
00097 #include <fastjet/internal/base.hh>
00098 
00099 FASTJET_BEGIN_NAMESPACE
00100 
00101 namespace d0{
00102 
00103 using namespace inline_maths;
00104 
00105 /*
00106  NB: Some attempt at optimizing the code has been made by ordering the object
00107      along rapidity but this did not improve the speed. There are traces of 
00108      these atemps in the code, that will be cleaned up in the future.
00109  */
00110 
00111 // at most one of those !
00112 // order the input list and use lower_bound() and upper_bound() to restrict the
00113 // on item to those that could possibly be in the cone.
00114 //#define ILCA_USE_ORDERED_LIST
00115 
00116 // idem but use an intermediate multimap in hope that lower_bound() and 
00117 // upper_bound() are faster in this case.
00118 //#define ILCA_USE_MMAP
00119 
00120 
00121 #ifdef ILCA_USE_ORDERED_LIST
00122 // this class is used to order the item list along rapidity
00123 template <class Item>
00124 class rapidity_order
00125 {
00126 public:
00127   bool operator()(const Item* first, const Item* second)
00128   {
00129     return (first->y() < second->y());
00130   }
00131   bool operator()(float const & first, const Item* second)
00132   {
00133     return (first  < second->y());
00134   }
00135   bool operator()(const Item* first, float const& second)
00136   {
00137     return (first->y() < second);
00138   }
00139 };
00140 #endif
00141 
00142 
00143 //template <class Item,class ItemAddress,class IChunk>
00144 template <class Item>
00145 class ILConeAlgorithm 
00146 {
00147 
00148 public:
00149 
00150   // default constructor (default parameters are crazy: you should not use that
00151   // constructor !)
00152   ILConeAlgorithm():
00153     _CONE_RADIUS(0.),
00154     _MIN_JET_ET(99999.),
00155     _ET_MIN_RATIO(0.5),
00156     _FAR_RATIO(0.5),
00157     _SPLIT_RATIO(0.5),
00158     _DUPLICATE_DR(0.005),
00159     _DUPLICATE_DPT(0.01),
00160     _SEARCH_CONE(0.5),
00161     _PT_MIN_LEADING_PROTOJET(0), 
00162     _PT_MIN_SECOND_PROTOJET(0), 
00163     _MERGE_MAX(10000), 
00164     _PT_MIN_noMERGE_MAX(0)
00165   {;}
00166 
00167   // full constructor
00168   ILConeAlgorithm(float cone_radius, float min_jet_Et, float split_ratio,
00169                   float far_ratio=0.5, float Et_min_ratio=0.5,
00170                   bool kill_duplicate=true, float duplicate_dR=0.005, 
00171                   float duplicate_dPT=0.01, float search_factor=1.0, 
00172                   float pT_min_leading_protojet=0., float pT_min_second_protojet=0.,
00173                   int merge_max=10000, float pT_min_nomerge=0.) :
00174     // cone radius
00175     _CONE_RADIUS(cone_radius), 
00176     // minimum jet ET
00177     _MIN_JET_ET(min_jet_Et), 
00178     // stable cones must have ET > _ET_MIN_RATIO*_MIN_JET_ET at any iteration
00179     _ET_MIN_RATIO(Et_min_ratio),
00180     // precluster at least _FAR_RATIO*_CONE_RADIUS away from stable cones
00181     _FAR_RATIO(far_ratio), 
00182     // split or merge criterium           
00183     _SPLIT_RATIO(split_ratio),
00184     _DUPLICATE_DR(duplicate_dR),
00185     _DUPLICATE_DPT(duplicate_dPT),
00186     _SEARCH_CONE(cone_radius/search_factor),
00187     // kill stable cone if within _DUPLICATE_DR and delta(pT)<_DUPLICATE_DPT
00188     // of another stable cone.
00189     _KILL_DUPLICATE(kill_duplicate),
00190     _PT_MIN_LEADING_PROTOJET(pT_min_leading_protojet),
00191     _PT_MIN_SECOND_PROTOJET(pT_min_second_protojet),
00192     _MERGE_MAX(merge_max),
00193     _PT_MIN_noMERGE_MAX(pT_min_nomerge)
00194     {;}
00195 
00196   //destructor
00197   ~ILConeAlgorithm() {;}
00198 
00199   // make jet clusters using improved legacy cone algorithm
00200   //void makeClusters(const EnergyClusterReco* r,
00201   void makeClusters(
00202                     // the input list modified (ordered)
00203                     std::list<Item> &jets,
00204                     std::list<const Item*>& itemlist, 
00205                     //float zvertex,   
00206                     ////std::list<const Item*>& itemlist);   
00207                     //const EnergyClusterCollection<ItemAddress>& preclu,
00208                     //IChunk* chunkptr, ConeJetInfoChunk* infochunkptr,
00209                     const float Item_ET_Threshold);
00210 
00211   // this will hold the final jets + contents
00212   std::vector<ProtoJet<Item> > ilcv;
00213 
00214 private:
00215 
00216   float _CONE_RADIUS;
00217   float _MIN_JET_ET;
00218   float _ET_MIN_RATIO;
00219   float _FAR_RATIO;
00220   float _SPLIT_RATIO;
00221   float _DUPLICATE_DR;
00222   float _DUPLICATE_DPT;
00223   float _SEARCH_CONE;
00224 
00225   bool _KILL_DUPLICATE;
00226 
00227   float _PT_MIN_LEADING_PROTOJET;
00228   float _PT_MIN_SECOND_PROTOJET;
00229   int  _MERGE_MAX; 
00230   float _PT_MIN_noMERGE_MAX;
00231 
00232   // private class 
00233   // This is a ProtoJet with additional methods dist(), midpoint() and 
00234   // is_stable()
00235   class TemporaryJet : public ProtoJet<Item> 
00236   {
00237     
00238   public :
00239     
00240     TemporaryJet(float seedET) : ProtoJet<Item>(seedET) {;}
00241 
00242     TemporaryJet(float seedET,float y_in,float phi_in) : 
00243       ProtoJet<Item>(seedET,y_in,phi_in) {;}
00244     
00245     ~TemporaryJet() {;}
00246     
00247     float dist(TemporaryJet& jet) const 
00248     {
00249       return RDelta(this->_y,this->_phi,jet.y(),jet.phi()); 
00250     }
00251     
00252     void midpoint(const TemporaryJet& jet,float & y_out, float & phi_out) const 
00253     {
00254       // Midpoint should probably be computed w/4-vectors but don't 
00255       // have that info.  Preserving Pt-weighted calculation - JPK
00256       float pTsum = this->_pT + jet.pT();
00257       y_out = (this->_y*this->_pT + jet.y()*jet.pT())/pTsum;
00258 
00259       phi_out = (this->_phi*this->_pT + jet.phi()*jet.pT())/pTsum;
00260       // careful with phi-wrap area: convert from [0,2pi] to [-pi,pi]
00261       //ls: original D0 code, as of 23/Mar/2007
00262       //if ( abs(phi-this->_phi)>2.0 ) { // assumes cones R=1.14 or smaller, merge within 2R only  
00263       //ls: abs bug fixed 26/Mar/2007 
00264       if ( fabs(phi_out-this->_phi)>2.0 ) { // assumes cones R=1.14 or smaller, merge within 2R only  
00265         phi_out = fmod( this->_phi+PI, TWOPI);
00266         if (phi_out < 0.0) phi_out += TWOPI;
00267         phi_out -= PI;
00268 
00269         float temp=fmod( jet.phi()+PI, TWOPI);
00270         if (temp < 0.0) temp += TWOPI;
00271         temp -= PI;
00272 
00273         phi_out = (phi_out*this->_pT + temp*jet.pT()) /pTsum;
00274       }
00275 
00276       if ( phi_out < 0. ) phi_out += TWOPI;
00277     }
00278     
00279 
00280 ////////////////////////////////////////
00281 #ifdef ILCA_USE_MMAP
00282     bool is_stable(const std::multimap<float,const Item*>& items, 
00283                    float radius, float min_ET, int max_iterations=50) 
00284 #else
00285     bool is_stable(const std::list<const Item*>& itemlist, float radius, 
00286                  float min_ET, int max_iterations=50) 
00287 #endif
00288     // Note: max_iterations = 0 will just recompute the jet using the specified cone
00289     {
00290       float radius2 = radius*radius;
00291       float Rcut= 1.E-06;
00292       
00293       
00294       // ?? if(_Increase_Delta_R) Rcut= 1.E-04;
00295       bool stable= true;
00296       int trial= 0;
00297       float Yst;
00298       float PHIst;
00299       do {  
00300         trial++;
00301         //std::cout << "   trial " << trial << " " << _y << " " << _phi << std::endl; 
00302         Yst  = this->_y;
00303         PHIst= this->_phi;    
00304         //cout << "is_stable beginning do loop: this->_pT=" << this->_pT << " this->_y=" << this->_y << " this->_phi=" << this->_phi << endl;
00305         this->erase();
00306         
00307         this->setJet(Yst,PHIst,0.0);
00308         
00309         
00310 #ifdef ILCA_USE_ORDERED_LIST      
00311         std::list<const Item*>::const_iterator lower = 
00312           lower_bound(itemlist.begin(),itemlist.end(),Yst-radius,
00313                       rapidity_order<Item>());
00314         std::list<const Item*>::const_iterator upper = 
00315           upper_bound(itemlist.begin(),itemlist.end(),Yst+radius,
00316                       rapidity_order<Item>());
00317         for(std::list<const Item*>::const_iterator tk = lower; tk != upper; ++tk)      {
00318           //std::cout << " is_stable: item y=" << (*tk)->y() << " phi=" << (*tk)->phi() << " RD2=" << RD2((*tk)->y(),(*tk)->phi(),Yst,PHIst) << " " << Yst-radius << " " << Yst+radius << endl;
00319           if(RD2((*tk)->y(),(*tk)->phi(),Yst,PHIst) <= radius2) 
00320             {
00321               this->addItem(*tk);
00322             }
00323         }       
00324 #else
00325 #ifdef ILCA_USE_MMAP      
00326         // need to loop only on the subset with   Yst-R < y < Yst+R
00327         for ( std::multimap<float,const Item*>::const_iterator 
00328                 tk = items.lower_bound(Yst-radius);
00329               tk != items.upper_bound(Yst+radius); ++tk )
00330           {
00331             //std::cout << "     item " << (*tk)->y() << " " << (*tk)->phi() << " " << RD2((*tk)->y(),(*tk)->phi(),Yst,PHIst) << " " << Yst-radius << " " << Yst+radius << endl;
00332             if(RD2(((*tk).second)->y(),((*tk).second)->phi(),Yst,PHIst) <= radius2) 
00333               {
00334                 this->addItem((*tk).second);
00335               }
00336           }
00337         
00338 #else   
00339 
00340         //cout << " is_stable: itemlist.size()=" << itemlist.size() << endl;
00341         for(typename std::list<const Item*>::const_iterator tk = itemlist.begin(); tk != itemlist.end(); ++tk) 
00342           {
00343             //std::cout << "    is_stable: item (*tk)->y()=" << (*tk)->y() << " (*tk)->phi=" << (*tk)->phi() << " RD2=" << RD2((*tk)->y(),(*tk)->phi(),Yst,PHIst) << " Yst-rad=" << Yst-radius << " Yst+rad=" << Yst+radius << endl;
00344             if(RD2((*tk)->y(),(*tk)->phi(),Yst,PHIst) <= radius2) 
00345                {
00346                  //cout << "add item to *tk" << endl;
00347                 this->addItem(*tk);
00348               }
00349           }
00350 #endif
00351 #endif      
00352       
00353         //std::cout << "is_stable, before update: jet this->_y=" << this->_y << " _phi=" << this->_phi << " _pT=" << this->_pT << " min_ET=" << min_ET << std::endl; 
00354         this->updateJet();
00355         //std::cout << "is_stable, after update: jet this->_y=" << this->_y << " _phi=" << this->_phi << " _pT=" << this->_pT << " min_ET=" << min_ET << std::endl; 
00356         
00357         if(this->_pT < min_ET ) 
00358           {
00359             stable= false;
00360             break;
00361           } 
00362         //cout << "is_stable end while loop: this->_pT=" << this->_pT << " this->_y=" << this->_y << " this->_phi=" << this->_phi << endl;
00363       } while(RD2(this->_y,this->_phi,Yst,PHIst) >= Rcut && trial <= max_iterations);
00364       //std::cout << "   trial stable " << trial << " " << stable << std::endl; 
00365       return stable;
00366     }
00367     
00368   private :
00369     
00370   };
00371 };
00372 ///////////////////////////////////////////////////////////////////////////////
00373 //template <class Item,class ItemAddress,class IChunk>
00374 //void ILConeAlgorithm <Item,ItemAddress,IChunk>::
00375 template <class Item>
00376 void ILConeAlgorithm <Item>::
00377 //makeClusters(const EnergyClusterReco* r,
00378 makeClusters(
00379              std::list<Item> &jets,
00380              std::list<const Item*>& ilist, 
00381              //float Zvertex, 
00382              ////std::list<const Item*>& ilist) 
00383              //const EnergyClusterCollection<ItemAddress>& preclu,
00384              //IChunk* chunkptr, ConeJetInfoChunk* infochunkptr,
00385              const float Item_ET_Threshold) 
00386 {
00387   // remove items below threshold
00388   for ( typename std::list<const Item*>::iterator it = ilist.begin(); 
00389 
00390         it != ilist.end(); )
00391   {
00392     if ( (*it)->pT() < Item_ET_Threshold ) 
00393     {
00394       it = ilist.erase(it);
00395     }
00396       else ++it;
00397   }
00398 
00399   // create an energy cluster collection for jets 
00400   //EnergyClusterCollection<ItemAddress>* ptrcol;
00401   //Item* ptrcol;
00402   //r->createClusterCollection(chunkptr,ptrcol);
00403   ////std::vector<const EnergyCluster<ItemAddress>*> ecv;
00404   std::vector<const Item*> ecv;
00405   for ( typename std::list<const Item*>::iterator it = ilist.begin(); 
00406         it != ilist.end(); it++) {
00407     ecv.push_back(*it);
00408   }
00409 
00410 
00411   //preclu.getClusters(ecv);
00412   //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% need to fill here vector ecv
00413 
00414   //std::cout << " number of seed clusters: " << ecv.size() << std::endl;
00415 
00416   // skip precluster close to jets
00417   float far_def = _FAR_RATIO*_CONE_RADIUS * _FAR_RATIO*_CONE_RADIUS;
00418 
00419   // skip if jet Et is below some value
00420   float ratio= _MIN_JET_ET*_ET_MIN_RATIO;
00421 
00422 
00423 #ifdef ILCA_USE_ORDERED_LIST
00424   // sort the list in rapidity order
00425   ilist.sort(rapidity_order<Item>());
00426 #else
00427 #ifdef ILCA_USE_MMAP  
00428   // create a y ordered list of items 
00429   std::multimap<float,const Item*> items;
00430   std::list<const Item*>::const_iterator it;
00431   for(it = ilist.begin(); it != ilist.end(); ++it) 
00432   {
00433     pair<float,const Item*> p((*it)->y(),*it);
00434     items.insert(p);
00435   }
00436 #endif
00437 #endif
00438 
00439   std::vector<ProtoJet<Item> > mcoll;
00440   std::vector<TemporaryJet> scoll; 
00441 
00442 
00443   // find stable jets around seeds 
00444   //typename std::vector<const EnergyCluster<ItemAddress>* >::iterator jclu;
00445   typename std::vector<const Item*>::iterator jclu;
00446   for(jclu = ecv.begin(); jclu != ecv.end(); ++jclu) 
00447   {
00448     //const EnergyCluster<ItemAddress>* ptr= *jclu;
00449     const Item* ptr= *jclu;
00450     float p[4];
00451     ptr->p4vec(p);
00452     float Yst  = P2y(p);
00453     float PHIst= P2phi(p);
00454 
00455     // don't keep preclusters close to jet
00456     bool is_far= true;
00457     // ?? if(_Kill_Far_Clusters) {
00458     for(unsigned int i = 0; i < scoll.size(); ++i) 
00459     {
00460       float y  = scoll[i].y();
00461       float phi= scoll[i].phi();
00462       if(RD2(Yst,PHIst,y,phi) < far_def) 
00463       {
00464         is_far= false;
00465         break;
00466       }
00467     }
00468     // ?? }
00469 
00470     if(is_far) 
00471     {
00472       TemporaryJet jet(ptr->pT(),Yst,PHIst);
00473       //cout << "temporary jet: pt=" << ptr->pT() << " y=" << Yst << " phi=" << PHIst << endl;
00474 
00475       // Search cones are smaller, so contain less jet Et 
00476       // Don't throw out too many little jets during search phase!
00477       // Strategy: check Et first with full cone, then search with low-GeV min_et thresh
00478 #ifdef ILCA_USE_MMAP
00479       if(jet.is_stable(items,_CONE_RADIUS,ratio,0) && jet.is_stable(items,_SEARCH_CONE,3.0)) 
00480 #else
00481       if(jet.is_stable(ilist,_CONE_RADIUS,ratio,0) && jet.is_stable(ilist,_SEARCH_CONE,3.0)) 
00482 #endif
00483       {
00484 
00485         //cout << "temporary jet is stable" << endl;
00486 
00487 // jpk  Resize the found jets 
00488 #ifdef ILCA_USE_MMAP
00489         jet.is_stable(items,_CONE_RADIUS,ratio,0) ;
00490 #else
00491         jet.is_stable(ilist,_CONE_RADIUS,ratio,0) ;
00492 #endif
00493         //cout << "found jet has been resized if any" << endl;
00494 
00495         if ( _KILL_DUPLICATE ) 
00496         {
00497           // check if we are not finding the same jet again
00498           float distmax = 999.; int imax = -1;
00499           for(unsigned int i = 0; i < scoll.size(); ++i) 
00500           {
00501             float dist = jet.dist(scoll[i]);
00502             if ( dist < distmax )
00503             {
00504               distmax = dist;
00505               imax = i;
00506             }
00507           }
00508           if ( distmax > _DUPLICATE_DR ||
00509                fabs((jet.pT()-scoll[imax].pT())/scoll[imax].pT())>_DUPLICATE_DPT )
00510           {
00511             scoll.push_back(jet);
00512             mcoll.push_back(jet);
00513             //std::cout << " stable cone " << jet.y() << " " << jet.phi() << " " << jet.pT() << std::endl;
00514           }
00515           /*
00516             else
00517             {
00518             std::cout << " jet too close to a found jet " << distmax << " " << 
00519             fabs((jet.pT()-scoll[imax].pT())/scoll[imax].pT()) << std::endl;
00520             }
00521           */
00522         }
00523         else
00524         {
00525           scoll.push_back(jet);
00526           mcoll.push_back(jet);
00527           //std::cout << " stable cone " << jet.y() << " " << jet.phi() << " " << jet.pT() << std::endl;
00528         }
00529 
00530       }
00531     }
00532   }
00533 
00534   // find stable jets around midpoints
00535   for(unsigned int i = 0; i < scoll.size(); ++i) 
00536   {
00537     for(unsigned int k = i+1; k < scoll.size(); ++k) 
00538     {
00539       float djet= scoll[i].dist(scoll[k]);
00540       if(djet > _CONE_RADIUS && djet < 2.*_CONE_RADIUS) 
00541       {
00542         float y_mid,phi_mid;
00543         scoll[i].midpoint(scoll[k],y_mid,phi_mid);
00544         TemporaryJet jet(-999999.,y_mid,phi_mid);
00545         //std::cout << " midpoint: " << scoll[i].pT() << " " << scoll[i].info().seedET() << " " << scoll[k].pT() << " " << scoll[k].info().seedET() << " " << y_mid << " " << phi_mid << std::endl; 
00546 
00547 // midpoint jets are full size
00548 #ifdef ILCA_USE_MMAP
00549       if(jet.is_stable(items,_CONE_RADIUS,ratio)) 
00550 #else
00551       if(jet.is_stable(ilist,_CONE_RADIUS,ratio)) 
00552 #endif
00553         {
00554           mcoll.push_back(jet);
00555           //std::cout << " stable midpoint cone " << jet.y() << " " << jet.phi() << " " << jet.pT() << std::endl;
00556         }
00557       }
00558     }
00559   }
00560 
00561 
00562   // do a pT ordered splitting/merging
00563   ConeSplitMerge<Item> pjets(mcoll);
00564   ilcv.clear();
00565   pjets.split_merge(ilcv,_SPLIT_RATIO, _PT_MIN_LEADING_PROTOJET, _PT_MIN_SECOND_PROTOJET, _MERGE_MAX, _PT_MIN_noMERGE_MAX);
00566 
00567 
00568   for(unsigned int i = 0; i < ilcv.size(); ++i) 
00569   {
00570     if ( ilcv[i].pT() > _MIN_JET_ET )
00571     {
00572       //EnergyCluster<ItemAddress>* ptrclu;
00573       Item ptrclu;
00574       //r->createCluster(ptrcol,ptrclu);
00575       
00576       std::list<const Item*> tlist=ilcv[i].LItems();
00577       typename std::list<const Item*>::iterator tk;
00578       for(tk = tlist.begin(); tk != tlist.end(); ++tk) 
00579       {
00580         //ItemAddress addr= (*tk)->address();
00581         float pk[4];
00582         (*tk)->p4vec(pk);
00583         //std::cout << (*tk)->index <<" " <<  (*tk) << std::endl;
00584         //float emE= (*tk)->emE();
00585         //r->addClusterItem(ptrclu,addr,pk,emE);
00586         //ptrclu->Add(*tk);
00587         ptrclu.Add(**tk);
00588       }
00589       // print out
00590       //ptrclu->print(cout);
00591       
00592       //infochunkptr->addInfo(ilcv[i].info());
00593       jets.push_back(ptrclu);
00594     }
00595   }
00596 }
00597 
00598 }  // namespace d0
00599 
00600 FASTJET_END_NAMESPACE
00601 
00602 #endif
00603 
00604 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends