42#include "fastjet/PseudoJet.hh"
43#include "fastjet/ClusterSequence.hh"
57void print_jets (
const vector<fj::PseudoJet> &);
63void print_jets_and_sub (
const vector<fj::PseudoJet> & jets,
67int main (
int argc,
char ** argv) {
69 vector<fj::PseudoJet> input_particles;
72 double px, py , pz, E;
73 while (cin >> px >> py >> pz >> E) {
89 cout <<
"Ran " << cam_def.description() << endl;
90 cout <<
"Strategy adopted by FastJet was "<<
91 cam_seq.strategy_string()<<endl<<endl;
95 vector<fj::PseudoJet> inclusive_jets = cam_seq.inclusive_jets(ptmin);
99 double dcut_cam = pow(smallR/R,2);
102 cout <<
"Printing inclusive jets (R = "<<R<<
") with pt > "<< ptmin<<
" GeV\n";
103 cout <<
"and their subjets with smallR = " << smallR <<
"\n";
104 cout <<
"---------------------------------------\n";
105 print_jets_and_sub(inclusive_jets, dcut_cam);
110 vector<fj::PseudoJet> exclusive_jets = cam_seq.exclusive_jets(dcut_cam);
111 cout <<
"Printing exclusive jets with dcut = "<< dcut_cam<<
" \n";
112 cout <<
"--------------------------------------------\n";
113 print_jets(exclusive_jets);
121void print_jets (
const vector<fj::PseudoJet> & jets) {
127 printf(
"%5s %15s %15s %15s %15s\n",
"jet #",
"rapidity",
128 "phi",
"pt",
"n constituents");
131 for (
unsigned int i = 0; i < sorted_jets.size(); i++) {
133 print_jet(sorted_jets[i]);
141void print_jets_and_sub (
const vector<fj::PseudoJet> & jets,
148 printf(
"%5s %15s %15s %15s %15s\n",
"jet #",
"rapidity",
149 "phi",
"pt",
"n constituents");
152 for (
unsigned int i = 0; i < sorted_jets.size(); i++) {
154 print_jet(sorted_jets[i]);
155 vector<fj::PseudoJet> subjets =
sorted_by_pt(sorted_jets[i].exclusive_subjets(dcut));
156 for (
unsigned int j = 0; j < subjets.size(); j++) {
157 printf(
" -sub-%02u ",j);
158 print_jet(subjets[j]);
169 printf(
"%15.8f %15.8f %15.8f %8u\n",
170 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
@ cambridge_algorithm
the longitudinally invariant variant of the cambridge algorithm (aka Aachen algoithm).
vector< PseudoJet > sorted_by_pt(const vector< PseudoJet > &jets)
return a vector of jets sorted into decreasing kt2