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>
49 using namespace fastjet;
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;
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;
212 cout <<
"Jets above " << ptmin <<
" GeV in the hard event (" << hard_event.size() <<
" particles)" << endl;
213 cout <<
"---------------------------------------\n";
214 printf(
"%5s %15s %15s %15s %15s\n",
"jet #",
"rapidity",
"phi",
"pt",
"area");
215 for (
unsigned int i = 0; i < hard_jets.size(); i++) {
216 printf(
"%5u %15.8f %15.8f %15.8f %15.8f\n", i,
217 hard_jets[i].rap(), hard_jets[i].phi(), hard_jets[i].perp(),
218 hard_jets[i].area());
228 cout <<
"Jets above " << ptmin <<
" GeV in the full event (" << full_event.size() <<
" particles)" << endl;
229 cout <<
"---------------------------------------\n";
230 printf(
"%5s %15s %15s %15s %15s %15s %15s %15s\n",
"jet #",
"rapidity",
"phi",
"pt",
"area",
"rap_sub",
"phi_sub",
"pt_sub");
234 vector<PseudoJet> subtracted_jets = subtractor(full_jets);
236 for (
unsigned int i=0; i<full_jets.size(); i++){
238 if (subtracted_jets[i].perp2() >= ptmin*ptmin){
239 printf(
"%5u %15.8f %15.8f %15.8f %15.8f %15.8f %15.8f %15.8f\n", idx,
240 full_jets[i].rap(), full_jets[i].phi(), full_jets[i].perp(),
242 subtracted_jets[i].rap(), subtracted_jets[i].phi(),
243 subtracted_jets[i].perp());