45#include "fastjet/PseudoJet.hh"
46#include "fastjet/ClusterSequenceArea.hh"
51int main (
int argc,
char ** argv) {
59 vector<fastjet::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<fastjet::PseudoJet> hard_jets =
sorted_by_pt(clust_seq_hard.inclusive_jets(ptmin));
126 vector<fastjet::PseudoJet> full_jets =
sorted_by_pt(clust_seq_full.inclusive_jets(ptmin));
175 double range_maxrap = 4.5;
178 bool use_4vector_area =
true;
181 clust_seq_bkgd.get_median_rho_and_sigma(range, use_4vector_area, rho, sigma);
188 cout <<
"Main clustering:" << endl;
189 cout <<
" Ran: " << jet_def.description() << endl;
190 cout <<
" Area: " << area_def.description() << endl;
191 cout <<
" Particles up to |y|=" << particle_maxrap << endl;
194 cout <<
"Background estimation:" << endl;
195 cout <<
" Ran " << jet_def_bkgd.description() << endl;
196 cout <<
" Area: " << area_def_bkgd.description() << endl;
197 cout <<
" Range: " << range.description() << endl;
198 cout <<
" Giving, for the full event" << endl;
199 cout <<
" rho = " << rho << endl;
200 cout <<
" sigma = " << sigma << endl;
203 cout <<
"Jets above " << ptmin <<
" GeV in the hard event (" << hard_event.size() <<
" particles)" << endl;
204 cout <<
"---------------------------------------\n";
205 printf(
"%5s %15s %15s %15s %15s\n",
"jet #",
"rapidity",
"phi",
"pt",
"area");
206 for (
unsigned int i = 0; i < hard_jets.size(); i++) {
207 printf(
"%5u %15.8f %15.8f %15.8f %15.8f\n", i,
208 hard_jets[i].rap(), hard_jets[i].phi(), hard_jets[i].perp(),
209 hard_jets[i].area());
225 cout <<
"Jets above " << ptmin <<
" GeV in the full event (" << full_event.size() <<
" particles)" << endl;
226 cout <<
"---------------------------------------\n";
227 printf(
"%5s %15s %15s %15s %15s %15s %15s %15s\n",
"jet #",
"rapidity",
"phi",
"pt",
"area",
"rap_sub",
"phi_sub",
"pt_sub");
229 for (
unsigned int i=0; i<full_jets.size(); i++){
234 if (subtracted_jet.
perp2() >= ptmin*ptmin){
235 printf(
"%5u %15.8f %15.8f %15.8f %15.8f %15.8f %15.8f %15.8f\n", idx,
236 full_jets[i].rap(), full_jets[i].phi(), full_jets[i].perp(),
238 subtracted_jet.
rap(), subtracted_jet.
phi(),
239 subtracted_jet.
perp());
int main()
an example program showing how to use fastjet
class that holds a generic area definition
General class for user to obtain ClusterSequence with additional area information.
Parameters to configure the computation of jet areas using ghosts.
class that is intended to hold a full definition of the jet clusterer
Class to contain pseudojets, including minimal information of use to jet-clustering routines.
double rap() const
returns the rapidity or some large value when the rapidity is infinite
double phi() const
returns phi (in the range 0..2pi)
double perp() const
returns the scalar transverse momentum
double perp2() const
returns the squared transverse momentum
class for holding a range definition specification, given by limits on rapidity and azimuth.
@ antikt_algorithm
like the k_t but with distance measures dij = min(1/kti^2,1/ktj^2) Delta R_{ij}^2 / R^2 diB = 1/kti^2
@ kt_algorithm
the longitudinally invariant kt algorithm
vector< PseudoJet > sorted_by_pt(const vector< PseudoJet > &jets)
return a vector of jets sorted into decreasing kt2