8 #include <fastjet/ClusterSequence.hh>
9 #include <fastjet/JetDefinition.hh>
10 #include <fastjet/PseudoJet.hh>
23 : _verbosity(verbosity)
27 fastjet::ClusterSequence clusseq;
30 clusseq.print_banner();
34 ostringstream nullstream;
35 clusseq.set_fastjet_banner_stream(&nullstream);
36 clusseq.print_banner();
37 clusseq.set_fastjet_banner_stream(&cout);
43 os <<
" FastJetAlgoSub: ";
45 os <<
"ANTIKT r=" <<
_par;
47 os <<
"KT r=" <<
_par;
49 os <<
"CAMBRIDGE r=" <<
_par;
55 if (
_verbosity > 1) cout <<
"FastJetAlgoSub::process_event -- entered" << endl;
58 std::vector<fastjet::PseudoJet> pseudojets;
61 float this_e = particles[
ipart]->get_e();
63 if (this_e == 0.)
continue;
65 float this_px = particles[
ipart]->get_px();
66 float this_py = particles[
ipart]->get_py();
67 float this_pz = particles[
ipart]->get_pz();
72 float e_ratio = 0.001 / this_e;
74 this_e = this_e * e_ratio;
75 this_px = this_px * e_ratio;
76 this_py = this_py * e_ratio;
77 this_pz = this_pz * e_ratio;
81 std::cout <<
" FastJetAlgoSub input particle with negative-E, original kinematics px / py / pz / E = ";
82 std::cout << particles[
ipart]->get_px() <<
" / " << particles[
ipart]->get_py() <<
" / " << particles[
ipart]->get_pz() <<
" / " << particles[
ipart]->get_e() << std::endl;
83 std::cout <<
" --> entering with modified kinematics px / py / pz / E = " << this_px <<
" / " << this_py <<
" / " << this_pz <<
" / " << this_e << std::endl;
87 fastjet::PseudoJet pseudojet(this_px, this_py, this_pz, this_e);
89 pseudojet.set_user_index(
ipart);
90 pseudojets.push_back(pseudojet);
94 fastjet::JetDefinition* jetdef = NULL;
96 jetdef =
new fastjet::JetDefinition(fastjet::antikt_algorithm,
_par, fastjet::E_scheme, fastjet::Best);
98 jetdef =
new fastjet::JetDefinition(fastjet::kt_algorithm,
_par, fastjet::E_scheme, fastjet::Best);
100 jetdef =
new fastjet::JetDefinition(fastjet::cambridge_algorithm,
_par, fastjet::E_scheme, fastjet::Best);
102 return std::vector<Jet*>();
103 fastjet::ClusterSequence jetFinder(pseudojets, *jetdef);
104 std::vector<fastjet::PseudoJet> fastjets = jetFinder.inclusive_jets();
108 std::vector<Jet*> jets;
109 for (
unsigned int ijet = 0; ijet < fastjets.size(); ++ijet)
115 std::cout <<
" FastJetAlgoSub : jet # " << ijet <<
" comes out of clustering with pt / eta / phi = " << fastjets[ijet].perp() <<
" / " << fastjets[ijet].eta() <<
" / " << fastjets[ijet].phi();
116 std::cout <<
", px / py / pz / e = " << fastjets[ijet].px() <<
" / " << fastjets[ijet].py() <<
" / " << fastjets[ijet].pz() <<
" / " << fastjets[ijet].e() << std::endl;
125 std::vector<fastjet::PseudoJet> comps = fastjets[ijet].constituents();
126 for (
unsigned int icomp = 0; icomp < comps.size(); ++icomp)
128 Jet*
particle = particles[comps[icomp].user_index()];
130 total_px += particle->
get_px();
131 total_py += particle->
get_py();
132 total_pz += particle->
get_pz();
133 total_e += particle->
get_e();
151 std::cout <<
" FastJetAlgoSub : jet # " << ijet <<
" after correcting for proper constituent kinematics, pt / eta / phi = " << jet->
get_pt() <<
" / " << jet->
get_eta() <<
" / " << jet->
get_phi();
152 std::cout <<
", px / py / pz / e = " << jet->
get_px() <<
" / " << jet->
get_py() <<
" / " << jet->
get_pz() <<
" / " << jet->
get_e() << std::endl;
158 if (
_verbosity > 1) cout <<
"FastJetAlgoSub::process_event -- exited" << endl;