9 #include <fastjet/ClusterSequence.hh>
10 #include <fastjet/JetDefinition.hh>
11 #include <fastjet/PseudoJet.hh>
24 : _verbosity(verbosity)
28 fastjet::ClusterSequence clusseq;
31 clusseq.print_banner();
36 clusseq.set_fastjet_banner_stream(&nullstream);
37 clusseq.print_banner();
38 clusseq.set_fastjet_banner_stream(&cout);
44 os <<
" FastJetAlgoSub: ";
46 os <<
"ANTIKT r=" <<
_par;
48 os <<
"KT r=" <<
_par;
50 os <<
"CAMBRIDGE r=" <<
_par;
60 if (
_verbosity > 1) cout <<
"FastJetAlgoSub::process_event -- entered" << endl;
63 std::vector<fastjet::PseudoJet> pseudojets;
64 for (
unsigned int ipart = 0; ipart < particles.size(); ++ipart)
66 float this_e = particles[ipart]->get_e();
68 if (this_e == 0.)
continue;
70 float this_px = particles[ipart]->get_px();
71 float this_py = particles[ipart]->get_py();
72 float this_pz = particles[ipart]->get_pz();
77 float e_ratio = 0.001 / this_e;
79 this_e = this_e * e_ratio;
80 this_px = this_px * e_ratio;
81 this_py = this_py * e_ratio;
82 this_pz = this_pz * e_ratio;
86 std::cout <<
" FastJetAlgoSub input particle with negative-E, original kinematics px / py / pz / E = ";
87 std::cout << particles[ipart]->get_px() <<
" / " << particles[ipart]->get_py() <<
" / " << particles[ipart]->get_pz() <<
" / " << particles[ipart]->get_e() << std::endl;
88 std::cout <<
" --> entering with modified kinematics px / py / pz / E = " << this_px <<
" / " << this_py <<
" / " << this_pz <<
" / " << this_e << std::endl;
92 fastjet::PseudoJet pseudojet(this_px, this_py, this_pz, this_e);
94 pseudojet.set_user_index(ipart);
95 pseudojets.push_back(pseudojet);
99 fastjet::JetDefinition* jetdef = NULL;
109 fastjet::ClusterSequence jetFinder(pseudojets, *jetdef);
110 std::vector<fastjet::PseudoJet> fastjets = jetFinder.inclusive_jets();
114 std::vector<Jet*> jets;
115 for (
unsigned int ijet = 0; ijet < fastjets.size(); ++ijet)
121 std::cout <<
" FastJetAlgoSub : jet # " << ijet <<
" comes out of clustering with pt / eta / phi = " << fastjets[ijet].perp() <<
" / " << fastjets[ijet].eta() <<
" / " << fastjets[ijet].phi();
122 std::cout <<
", px / py / pz / e = " << fastjets[ijet].px() <<
" / " << fastjets[ijet].py() <<
" / " << fastjets[ijet].pz() <<
" / " << fastjets[ijet].e() << std::endl;
131 std::vector<fastjet::PseudoJet> comps = fastjets[ijet].constituents();
132 for (
unsigned int icomp = 0; icomp < comps.size(); ++icomp)
134 Jet*
particle = particles[comps[icomp].user_index()];
136 total_px += particle->
get_px();
137 total_py += particle->
get_py();
138 total_pz += particle->
get_pz();
139 total_e += particle->
get_e();
143 jet->set_comp_sort_flag();
146 jet->set_px(total_px);
147 jet->set_py(total_py);
148 jet->set_pz(total_pz);
154 std::cout <<
" FastJetAlgoSub : jet # " << ijet <<
" after correcting for proper constituent kinematics, pt / eta / phi = " << jet->get_pt() <<
" / " << jet->get_eta() <<
" / " << jet->get_phi();
155 std::cout <<
", px / py / pz / e = " << jet->get_px() <<
" / " << jet->get_py() <<
" / " << jet->get_pz() <<
" / " << jet->get_e() << std::endl;
159 if (
_verbosity > 1) cout <<
"FastJetAlgoSub::process_event -- exited" << endl;