40 #include "fastjet/PseudoJet.hh"
41 #include "fastjet/ClusterSequence.hh"
55 void print_jets (
const vector<fj::PseudoJet> &);
61 void print_jets_and_sub (
const vector<fj::PseudoJet> & jets,
65 int main (
int argc,
char ** argv) {
67 vector<fj::PseudoJet> input_particles;
70 double px, py , pz, E;
71 while (cin >> px >> py >> pz >> E) {
87 cout <<
"Ran " << cam_def.description() << endl;
88 cout <<
"Strategy adopted by FastJet was "<<
89 cam_seq.strategy_string()<<endl<<endl;
93 vector<fj::PseudoJet> inclusive_jets = cam_seq.inclusive_jets(ptmin);
97 double dcut_cam = pow(smallR/R,2);
100 cout <<
"Printing inclusive jets (R = "<<R<<
") with pt > "<< ptmin<<
" GeV\n";
101 cout <<
"and their subjets with smallR = " << smallR <<
"\n";
102 cout <<
"---------------------------------------\n";
103 print_jets_and_sub(inclusive_jets, dcut_cam);
108 vector<fj::PseudoJet> exclusive_jets = cam_seq.exclusive_jets(dcut_cam);
109 cout <<
"Printing exclusive jets with dcut = "<< dcut_cam<<
" \n";
110 cout <<
"--------------------------------------------\n";
119 void print_jets (
const vector<fj::PseudoJet> & jets) {
125 printf(
"%5s %15s %15s %15s %15s\n",
"jet #",
"rapidity",
126 "phi",
"pt",
"n constituents");
129 for (
unsigned int i = 0; i < sorted_jets.size(); i++) {
131 print_jet(sorted_jets[i]);
139 void print_jets_and_sub (
const vector<fj::PseudoJet> & jets,
146 printf(
"%5s %15s %15s %15s %15s\n",
"jet #",
"rapidity",
147 "phi",
"pt",
"n constituents");
150 for (
unsigned int i = 0; i < sorted_jets.size(); i++) {
152 print_jet(sorted_jets[i]);
153 vector<fj::PseudoJet> subjets =
sorted_by_pt(sorted_jets[i].exclusive_subjets(dcut));
154 for (
unsigned int j = 0; j < subjets.size(); j++) {
155 printf(
" -sub-%02u ",j);
156 print_jet(subjets[j]);
167 printf(
"%15.8f %15.8f %15.8f %8u\n",
168 jet.
rap(), jet.
phi(), jet.
perp(), n_constituents);
int main()
an example program showing how to use fastjet
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.
virtual std::vector< PseudoJet > constituents() const
retrieve the constituents.
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
void print_jets(const vector< fastjet::PseudoJet > &)
a function that pretty prints a list of jets
vector< PseudoJet > sorted_by_pt(const vector< PseudoJet > &jets)
return a vector of jets sorted into decreasing kt2