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 localCellCollection &storedCells, localCellCollection &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 57 of file ClusterKtStrategy.h.


Constructor & Destructor Documentation

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

Constructor.

Definition at line 61 of file ClusterKtStrategy.h.

References m_minClusterET.

00061 : m_minClusterET(minet){}

Member Function Documentation

void Atlfast::ClusterKtStrategy::makeClusters MsgStream &    log,
const localCellCollection   storedCells,
localCellCollection   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 all the unassociated cells into the unusedCells vector

Definition at line 27 of file ClusterKtStrategy.cxx.

References Atlfast::localCellCollection, Atlfast::localCellIterator, and m_minClusterET.

00031                                                                             {
00032     log << MSG::DEBUG << storedCells.size() << " cells to start with"<<endreq;
00033     
00037     localCellIterator itr = storedCells.begin();
00038     std::vector<KtJet::KtLorentzVector> jetvec;
00039     std::map<KtJet::KtLorentzVector,Cell*> CellMap;
00040     for(; itr != storedCells.end() ; ++itr){
00041       KtJet::KtLorentzVector tempVec = KtJet::KtLorentzVector((*itr)->momentum());
00042       jetvec.push_back(tempVec);
00043       CellMap[tempVec] = (*itr);
00044     }
00045     log << MSG::DEBUG << "Made jetvec"<<endreq;
00050     KtJet::KtEvent ev(jetvec,4,2,1,1.0);
00051     log << MSG::DEBUG << "Made KtEvent"<<endreq;
00053     vector<KtJet::KtLorentzVector> jets0 = ev.getJets();
00058     log << MSG::DEBUG << "Got events jets "<< jets0.size() << endreq;
00059     std::vector<KtJet::KtLorentzVector>::const_iterator iter = jets0.begin();
00060     for (; iter != jets0.end() ; ++iter){
00061       if((*iter).et() > m_minClusterET) { 
00062         std::vector<KtJet::KtLorentzVector> tompVec;
00063         tompVec = (*iter).copyConstituents();
00064         //Make a vector of associated cells
00065         std::vector<Cell*> tempCellVec;
00066         std::vector<KtJet::KtLorentzVector>::const_iterator iter2  = tompVec.begin();
00067         for (; iter2 != tompVec.end() ; ++iter2){
00068           if(CellMap.find((*iter2)) == CellMap.end()){
00069             log << MSG::ERROR <<  "Cannot find this key" << endreq;
00070           }else {
00071             tempCellVec.push_back(CellMap[(*iter2)]);
00072             CellMap.erase((*iter2));
00073             //      log << MSG::DEBUG << "Removed cell from map" << endreq;
00074           }
00075         }
00076         //Make a Atlfast::KtCluster
00077         Cluster* clu = new Cluster(*iter,tempCellVec.begin(),tempCellVec.end());
00078         log << MSG::DEBUG << "Made a KtCluster" << endreq;
00080         clusters->push_back(clu);
00081       }
00082     }
00083     log << MSG::DEBUG <<  "Number of clusters Made by Kt algo " << clusters->size() << endreq;
00085     std::map<KtJet::KtLorentzVector,Cell*>::iterator celit = CellMap.begin();
00086     for (; celit != CellMap.end() ; ++celit) unusedCells.push_back((*celit).second);
00087     log << MSG::DEBUG <<  "Size of unusedCells vector " << unusedCells.size() << endreq;
00088     return;
00089   }

Member Data Documentation

double Atlfast::ClusterKtStrategy::m_minClusterET [private]
 

Cut on cluster et.

Definition at line 72 of file ClusterKtStrategy.h.

Referenced by ClusterKtStrategy(), and makeClusters().


The documentation for this class was generated from the following files:
Generated on Tue Jan 28 09:57:34 2003 for AtlfastAlgs by doxygen1.3-rc1