Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Atlfast::ClusterKtStrategy Class Reference

This Class builds Atlfast::KtClusters from Atlfast::Cells It uses the KT++ Algorithm based on the fortran Kt clustering Algorithm written by mike seymour. More...

#include <ClusterKtStrategy.h>

List of all members.


Public Methods

 ClusterKtStrategy (double minet)
 Constructor.

virtual void makeClusters (MsgStream &log, const std::vector< IKinematic * > &storedCells, std::vector< IKinematic * > &unusedCells, ClusterCollection *clusters) const
 only method required by IClusterStrategy


Private Attributes

double m_minClusterET
 Cut on cluster et.


Detailed Description

This Class builds Atlfast::KtClusters from Atlfast::Cells It uses the KT++ Algorithm based on the fortran Kt clustering Algorithm written by mike seymour.

This algorithm was written by the UCL & Manchester groups It stores the Atlfast::KtClusters as Atlfast::Cluster* in a std::vector. All unused cells are put in the a std::vector of Atlfast::Cells

Author:
Jon Couchman

Definition at line 63 of file ClusterKtStrategy.h.


Constructor & Destructor Documentation

Atlfast::ClusterKtStrategy::ClusterKtStrategy double    minet [inline]
 

Constructor.

Definition at line 67 of file ClusterKtStrategy.h.

References m_minClusterET.

00067 : m_minClusterET(minet){}

Member Function Documentation

void Atlfast::ClusterKtStrategy::makeClusters MsgStream &    log,
const std::vector< IKinematic * > &    storedCells,
std::vector< IKinematic * > &    unusedCells,
ClusterCollection *    clusters
const [virtual]
 

only method required by IClusterStrategy

First we make a std::vector<KtLorentzVector> from the Atlfast::Cells We need to fill a map relating KtLorentzVectors to Cells so that we can associate the Atlfast::Cells with the Atlfast::KtClusters

Now make a KtEvent object from the std::vector<KtLorentzVector> This Object calculates all the Clusters using the Kt clustering scheme defined by the input variables.

Now we retrieve all the Clusters made by the KtEvent

We can construct Atlfast::KtClusters from the returned KtLorentzVectors as they are HepLorentzVectors. Also use the map to get list of Clusters associated Cells. Also make a second KtEvent from each KtLorentzVectors constituents to calculate the y-cut

put cluster into main vector

Put copies of all the unassociated cells into the unusedCells vector

Definition at line 28 of file ClusterKtStrategy.cxx.

References m_minClusterET.

00032                                                                      {
00033     log << MSG::DEBUG << storedCells.size() << " cells to start with"<<endreq;
00034     
00039     std::vector<IKinematic*>::const_iterator itr = storedCells.begin();
00040     std::vector<KtJet::KtLorentzVector> jetvec;
00041     std::map<KtJet::KtLorentzVector,IKinematic*> CellMap;
00042     for(; itr != storedCells.end() ; ++itr){
00043       KtJet::KtLorentzVector tempVec = KtJet::KtLorentzVector((*itr)->momentum());
00044       jetvec.push_back(tempVec);
00045       CellMap[tempVec] = (*itr);
00046     }
00047     log << MSG::DEBUG << "Made jetvec"<<endreq;
00052     KtJet::KtEvent ev(jetvec,4,2,1,1.0);
00053     log << MSG::DEBUG << "Made KtEvent"<<endreq;
00054 
00056     vector<KtJet::KtLorentzVector> jets0 = ev.getJets();
00061     log << MSG::DEBUG << "Got events jets "<< jets0.size() << endreq;
00062     std::vector<KtJet::KtLorentzVector>::const_iterator iter = jets0.begin();
00063     for (; iter != jets0.end() ; ++iter){
00064       if((*iter).et() > m_minClusterET) { 
00065         std::vector<KtJet::KtLorentzVector> tompVec;
00066         tompVec = (*iter).copyConstituents();
00067         //Make a vector of associated cells
00068         std::vector<IKinematic*> tempCellVec;
00069         std::vector<KtJet::KtLorentzVector>::const_iterator iter2  = tompVec.begin();
00070         for (; iter2 != tompVec.end() ; ++iter2){
00071           if(CellMap.find((*iter2)) == CellMap.end()){
00072             log << MSG::ERROR <<  "Cannot find this key" << endreq;
00073           }else {
00074             tempCellVec.push_back(CellMap[(*iter2)]);
00075             CellMap.erase((*iter2));
00076             //log << MSG::DEBUG << "Removed cell from map" << endreq;
00077           }
00078         }
00079         //Make a Atlfast::KtCluster
00080         Cluster* clu = new Cluster(*iter,tempCellVec.begin(),tempCellVec.end());
00081         log << MSG::DEBUG << "Made a KtCluster" << endreq;
00083         clusters->push_back(clu);
00084       }
00085     }
00086     //return;
00087     log << MSG::DEBUG 
00088         <<  "Number of clusters Made by Kt algo " << clusters->size() 
00089         << endreq;
00091     std::map<KtJet::KtLorentzVector,IKinematic*>::iterator celit = 
00092       CellMap.begin();
00093 
00094     for (; celit != CellMap.end() ; ++celit){
00095 
00096       unusedCells.push_back( ( (*celit).second ) );
00097 
00098       log << MSG::DEBUG 
00099           << "Size of unusedCells vector " << unusedCells.size() 
00100           << endreq;
00101     }
00102 
00103     return;
00104   }

Member Data Documentation

double Atlfast::ClusterKtStrategy::m_minClusterET [private]
 

Cut on cluster et.

Definition at line 78 of file ClusterKtStrategy.h.

Referenced by ClusterKtStrategy(), and makeClusters().


The documentation for this class was generated from the following files:
Generated on Tue Mar 18 11:18:53 2003 for AtlfastAlgs by doxygen1.3-rc1