36 #include "JetConeFinderTool.hh"
38 #include "JetDistances.hh"
39 #include "CommonUtils.hh"
44 #include <fastjet/internal/base.hh>
46 FASTJET_BEGIN_NAMESPACE
53 JetConeFinderTool::JetConeFinderTool() :m_coneR(0.7)
60 JetConeFinderTool::~JetConeFinderTool()
66 int JetConeFinderTool::execute(jetcollection_t & theJets)
68 sort_jet_list<JetSorter_Et>(theJets);
72 if(theJets.size()==0)
return 0;
87 jetcollection_t::iterator it = m_jetOV->begin();
88 jetcollection_t::iterator itE = m_jetOV->end();
90 theJets.push_back(*it);
103 JetConeFinderTool::reconstruct()
105 m_jetOV =
new jetcollection_t();
107 jetcollection_t::iterator tItr;
108 jetcollection_t::iterator tItr_begin = m_pjetV->begin();
109 jetcollection_t::iterator tItr_end = m_pjetV->end();
113 for ( tItr=tItr_begin; tItr!=tItr_end; ++tItr ) {
116 double tEt = (*tItr)->et();
117 if ( tEt < m_seedPt )
break;
120 double etaT = (*tItr)->eta();
121 double phiT = (*tItr)->phi();
133 preJet = calc_cone(etaT,phiT);
134 double etaC = preJet->eta();
135 double phiC = preJet->phi();
137 double deta = fabs(etaT - etaC);
138 double dphi = fabs(JetDistances::deltaPhi(phiT,phiC));
141 if ( deta < m_eps && dphi < m_eps )
145 if ( fabs(etaC) > m_etaMax )
151 if ( !stable && inGeom ) {
157 }
while ( !stable && inGeom && count < 10 );
159 if ( count > 9 && (!stable && inGeom) )
continue;
164 if ( stable && inGeom ) {
165 jetcollection_t::iterator pItr = m_jetOV->begin();
166 jetcollection_t::iterator pItrE = m_jetOV->end();
169 double etaT = preJet->eta();
170 double phiT = preJet->phi();
172 for ( ; pItr != pItrE ; ++pItr ) {
173 double etaC = (*pItr)->eta();
174 double phiC = (*pItr)->phi();
176 double deta = fabs(etaT - etaC);
177 double dphi = fabs(JetDistances::deltaPhi(phiT,phiC));
179 if ( deta < 0.05 && dphi < 0.05 ) {
203 m_jetOV->push_back( preJet );
235 Jet* JetConeFinderTool::calc_cone(
double eta,
double phi)
242 jetcollection_t::iterator itr = m_pjetV->begin();
243 jetcollection_t::iterator itrE = m_pjetV->end();
245 for ( ; itr!=itrE; ++itr ) {
246 double dR = JetDistances::deltaR(eta,phi,(*itr)->eta(),(*itr)->phi());
247 if ( dR < m_coneR ) {
259 FASTJET_END_NAMESPACE