2 #include "StKtCluJetFinder.h"
13 #include "StProtoJet.h"
14 #include "StProtoJetPair.h"
15 #include "StJetFinder.h"
21 StKtCluJetFinder::StKtCluJetFinder(
const StKtCluPars& pars) : mPars(pars)
23 cout <<
"StKtCluJetFinder::StKtCluJetFinder()"<<endl;
26 StKtCluJetFinder::~StKtCluJetFinder()
28 cout <<
"StKtCluJetFinder::~StKtCluJetFinder()"<<endl;
31 void StKtCluJetFinder::Init()
36 void StKtCluJetFinder::findJets(JetList& pj,
const FourVecList& particleList)
40 for(FourVecList::const_iterator particle = particleList.begin(); particle != particleList.end(); ++particle) {
44 if (pj.size()<2)
return;
49 while (pj.empty()==
false) {
51 if ( mPars.debug() ) {
52 cout <<
"\n --- protojets after clustering "<<nSteps<<
" steps"<<endl;
53 for (JetList::const_iterator it3=pj.begin(); it3!=pj.end(); ++it3) {
56 cout <<
" --- jets after clustering "<<nSteps<<
" steps"<<endl;
57 for (JetList::const_iterator it4=mJets.begin(); it4!=mJets.end(); ++it4) {
64 double d_min_pj = DBL_MAX;
65 JetList::iterator bestProto=pj.end();
68 for (JetList::iterator protoIt=pj.begin(); protoIt!=pj.end(); ++protoIt) {
69 double d = (*protoIt).d();
77 double d_min_jets = DBL_MAX;
78 JetList::iterator bestJet1=pj.end();
79 JetList::iterator bestJet2=pj.end();
81 for (JetList::iterator jetIt1=pj.begin(); jetIt1!=pj.end(); ++jetIt1) {
82 for (JetList::iterator jetIt2=jetIt1; jetIt2!=pj.end(); ++jetIt2) {
85 double d = myPair.d();
97 if (d_min_pj < d_min_jets) {
101 if (bestProto==pj.end()) {
102 cout <<
"StJetFinder::findJets(). ERROR:\t"
103 <<
"Trying to use protojet iterator that doesn't exist"<<endl;
105 (*bestProto).update();
106 mJets.push_back(*bestProto);
114 if (bestJet1==pj.end() || bestJet2==pj.end()) {
115 cout <<
"StJetFinder::findJets(). ERROR:\t"
116 <<
"Trying to use 2 protojet iterators, one doesn't exist"<<endl;
118 (*bestJet1).merge(*bestJet2);
131 for (JetList::iterator it=mJets.begin(); it!=mJets.end(); ++it) {