40 #include "fastjet/PseudoJet.hh"
41 #include "fastjet/ClusterSequenceArea.hh"
42 #include "fastjet/Selector.hh"
43 #include "fastjet/tools/JetMedianBackgroundEstimator.hh"
44 #include "fastjet/tools/Subtractor.hh"
46 #include <fastjet/config.h>
59 vector<PseudoJet> hard_event, full_event;
65 double particle_maxrap = 5.0;
69 while (getline(cin, line)) {
70 istringstream linestream(line);
73 if (line.substr(0,4) ==
"#END") {
break;}
74 if (line.substr(0,9) ==
"#SUBSTART") {
76 if (nsub == 1) hard_event = full_event;
79 if (line.substr(0,1) ==
"#") {
continue;}
81 linestream >> px >> py >> pz >> E;
86 if (abs(particle.rap()) <= particle_maxrap) full_event.push_back(particle);
90 if (nsub == 1) hard_event = full_event;
94 cerr <<
"Error: read empty event\n";
110 double ghost_maxrap = 6.0;
125 vector<PseudoJet> hard_jets =
sorted_by_pt(clust_seq_hard.inclusive_jets(ptmin));
126 vector<PseudoJet> full_jets =
sorted_by_pt(clust_seq_full.inclusive_jets(ptmin));
181 #if FASTJET_VERSION_NUMBER >= 30100
182 subtractor.set_use_rho_m(
true);
183 subtractor.set_safe_mass(
true);
192 bkgd_estimator.set_particles(full_event);
199 cout <<
"Main clustering:" << endl;
200 cout <<
" Ran: " << jet_def.description() << endl;
201 cout <<
" Area: " << area_def.description() << endl;
202 cout <<
" Particles up to |y|=" << particle_maxrap << endl;
205 cout <<
"Background estimation:" << endl;
206 cout <<
" " << bkgd_estimator.description() << endl << endl;;
207 cout <<
" Giving, for the full event" << endl;
208 cout <<
" rho = " << bkgd_estimator.rho() << endl;
209 cout <<
" sigma = " << bkgd_estimator.sigma() << endl;
210 #if FASTJET_VERSION_NUMBER >= 30100
211 cout <<
" rho_m = " << bkgd_estimator.rho_m() << endl;
212 cout <<
" sigma_m = " << bkgd_estimator.sigma_m() << endl;
216 cout <<
"Jets above " << ptmin <<
" GeV in the hard event (" << hard_event.size() <<
" particles)" << endl;
217 cout <<
"---------------------------------------\n";
218 printf(
"%5s %15s %15s %15s %15s %15s\n",
"jet #",
"rapidity",
"phi",
"pt",
"m",
"area");
219 for (
unsigned int i = 0; i < hard_jets.size(); i++) {
220 printf(
"%5u %15.8f %15.8f %15.8f %15.8f %15.8f\n", i,
221 hard_jets[i].rap(), hard_jets[i].phi(), hard_jets[i].pt(), hard_jets[i].m(),
222 hard_jets[i].area());
232 cout <<
"Jets above " << ptmin <<
" GeV in the full event (" << full_event.size() <<
" particles)" << endl;
233 cout <<
"---------------------------------------\n";
234 printf(
"%5s %15s %15s %15s %15s %15s %15s %15s %15s %15s\n",
"jet #",
"rapidity",
"phi",
"pt",
"m",
"area",
"rap_sub",
"phi_sub",
"pt_sub",
"m_sub");
238 vector<PseudoJet> subtracted_jets = subtractor(full_jets);
240 for (
unsigned int i=0; i<full_jets.size(); i++){
242 if (subtracted_jets[i].pt2() >= ptmin*ptmin){
243 printf(
"%5u %15.8f %15.8f %15.8f %15.8f %15.8f %15.8f %15.8f %15.8f %15.8f\n", idx,
244 full_jets[i].rap(), full_jets[i].phi(), full_jets[i].pt(), full_jets[i].m(),
246 subtracted_jets[i].rap(), subtracted_jets[i].phi(),
247 subtracted_jets[i].pt(),
248 subtracted_jets[i].m());