#include <ClusterKtStrategy.h>
Inheritance diagram for Atlfast::ClusterKtStrategy:
Public Member Functions | |
ClusterKtStrategy (double, double, std::string, std::string, int) | |
virtual void | makeClusters (MsgStream &log, const std::vector< IKinematic * > &storedCells, IKinematicVector &unusedCells, IClusterCollection *clusters) const |
Private Attributes | |
double | m_minClusterET |
double | m_rParameter |
int | m_subjet |
int | m_angle |
int | m_recom |
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
Definition at line 71 of file ClusterKtStrategy.h.
Atlfast::ClusterKtStrategy::ClusterKtStrategy | ( | double | , | |
double | , | |||
std::string | , | |||
std::string | , | |||
int | ||||
) |
Constructor
Definition at line 30 of file ClusterKtStrategy.cxx.
00030 : 00031 m_minClusterET(minet), m_rParameter(rp), m_subjet(subjet){ 00032 //set kt angle scheme 00033 if(angle == "angular") {m_angle = 1;} 00034 else if (angle == "deltaR") {m_angle = 2;} 00035 else if (angle == "QCD") {m_angle = 3;} 00036 else{ 00037 std::cerr << "Warning, unknown Kt angle scheme. Scheme set to \"angular\"" << std::endl; 00038 m_angle = 1; 00039 } 00040 //set kt rcombination scheme 00041 if(recom == "E") {m_recom = 1;} 00042 else if (recom == "pt") {m_recom = 2;} 00043 else if (recom == "pt2") {m_recom = 3;} 00044 else if (recom == "et") {m_recom = 4;} 00045 else if (recom == "et2") {m_recom = 5;} 00046 else{ 00047 std::cerr << "Warning, unknown Kt recombination scheme. Scheme set to \"E\"" << std::endl; 00048 m_recom = 1; 00049 } 00050 }
void Atlfast::ClusterKtStrategy::makeClusters | ( | MsgStream & | log, | |
const std::vector< IKinematic * > & | storedCells, | |||
IKinematicVector & | unusedCells, | |||
IClusterCollection * | clusters | |||
) | const [virtual] |
only method required by IClusterStrategy. Runs KT++ via the KtJet::KtEvent interface.
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
Implements Atlfast::IClusterStrategy.
Definition at line 53 of file ClusterKtStrategy.cxx.
00057 { 00058 log << MSG::DEBUG << storedCells.size() << " cells to start with"<<endreq; 00059 00064 std::vector<IKinematic*>::const_iterator itr = storedCells.begin(); 00065 std::vector<KtJet::KtLorentzVector> jetvec; 00066 std::map<KtJet::KtLorentzVector,IKinematic*> CellMap; 00067 for(; itr != storedCells.end() ; ++itr){ 00068 KtJet::KtLorentzVector tempVec = KtJet::KtLorentzVector((*itr)->momentum()); 00069 jetvec.push_back(tempVec); 00070 CellMap[tempVec] = (*itr); 00071 } 00072 log << MSG::DEBUG << "Made jetvec"<<endreq; 00077 KtJet::KtEvent ev(jetvec,4,m_angle,m_recom,m_rParameter); 00078 log << MSG::DEBUG << "Made KtEvent"<<endreq; 00079 00081 vector<KtJet::KtLorentzVector> jets0 = ev.getJets(); 00086 log << MSG::DEBUG << "Got events jets "<< jets0.size() << endreq; 00087 std::vector<KtJet::KtLorentzVector>::const_iterator iter = jets0.begin(); 00088 for (; iter != jets0.end() ; ++iter){ 00089 if((*iter).et() > m_minClusterET) { 00090 std::vector<KtJet::KtLorentzVector> tompVec; 00091 tompVec = (*iter).copyConstituents(); 00092 //Make a vector of associated cells 00093 std::vector<IKinematic*> tempCellVec; 00094 std::vector<KtJet::KtLorentzVector>::const_iterator iter2 = tompVec.begin(); 00095 for (; iter2 != tompVec.end() ; ++iter2){ 00096 if(CellMap.find((*iter2)) == CellMap.end()){ 00097 log << MSG::ERROR << "Cannot find this key" << endreq; 00098 }else { 00099 tempCellVec.push_back(CellMap[(*iter2)]); 00100 CellMap.erase((*iter2)); 00101 //log << MSG::DEBUG << "Removed cell from map" << endreq; 00102 } 00103 } 00104 //now do sub-jet analysis if required 00105 double yCut = 0.; 00106 if(m_subjet){ 00107 KtJet::KtEvent subev(*iter,m_angle,m_recom); 00108 yCut = subev.getYMerge(m_subjet); 00109 } 00110 //Make a Atlfast::KtCluster 00111 ICluster* clu = new KtCluster(*iter,tempCellVec.begin(),tempCellVec.end(),yCut); 00112 log << MSG::DEBUG << "Made a KtCluster" << endreq; 00114 clusters->push_back(clu); 00115 } 00116 } 00117 //return; 00118 log << MSG::DEBUG 00119 << "Number of clusters Made by Kt algo " << clusters->size() 00120 << endreq; 00122 std::map<KtJet::KtLorentzVector,IKinematic*>::iterator celit = 00123 CellMap.begin(); 00124 00125 for (; celit != CellMap.end() ; ++celit){ 00126 00127 unusedCells.push_back( ( (*celit).second ) ); 00128 00129 log << MSG::DEBUG 00130 << "Size of unusedCells vector " << unusedCells.size() 00131 << endreq; 00132 } 00133 00134 return; 00135 }
double Atlfast::ClusterKtStrategy::m_minClusterET [private] |
Cut on cluster et
Definition at line 87 of file ClusterKtStrategy.h.
double Atlfast::ClusterKtStrategy::m_rParameter [private] |
Definition at line 88 of file ClusterKtStrategy.h.
int Atlfast::ClusterKtStrategy::m_subjet [private] |
Definition at line 89 of file ClusterKtStrategy.h.
int Atlfast::ClusterKtStrategy::m_angle [private] |
Definition at line 90 of file ClusterKtStrategy.h.
int Atlfast::ClusterKtStrategy::m_recom [private] |
Definition at line 91 of file ClusterKtStrategy.h.