48#include <fastjet/PseudoJet.hh>
49#include <fastjet/ClusterSequence.hh>
50#include <fastjet/Selector.hh>
52#include "fastjet/tools/Filter.hh"
53#include "fastjet/tools/Pruner.hh"
64 vector<PseudoJet> input_particles;
66 double px, py , pz, E;
67 while (cin >> px >> py >> pz >> E) {
70 input_particles.push_back(
PseudoJet(px,py,pz,E));
77 vector<PseudoJet> inclusive_jets =
81 printf(
"%5s %15s %15s %15s %15s\n",
"jet #",
"rapidity",
"phi",
"pt",
"mass");
84 for (
unsigned int i = 0; i < inclusive_jets.size(); i++) {
85 printf(
"%5u %15.8f %15.8f %15.8f %15.8f\n",
86 i, inclusive_jets[i].rap(), inclusive_jets[i].phi(),
87 inclusive_jets[i].perp(),inclusive_jets[i].m());
92 if (inclusive_jets.size()<2){
93 cout <<
"Please provide an event with at least 2 jets above 5 GeV" << endl;
103 vector<Transformer *> groomers;
109 unsigned int nfilt = 3;
116 double ptfrac = 0.03;
123 double rcut_factor = 0.5;
131 cout <<
"\nOriginal jets that will be grooomed: " << endl;
132 for (vector<PseudoJet>::iterator jit=candidates.begin(); jit!=candidates.end(); jit++){
134 cout <<
" rap = " << c.
rap() <<
", phi = " << c.
phi() <<
", pt = " << c.
perp()
135 <<
", mass = " << c.
m()
140 for (
unsigned int i=0; i < groomers.size(); i++){
142 cout <<
"\nUsing groomer: " << f.
description() << endl;
145 for (vector<PseudoJet>::iterator jit=candidates.begin(); jit!=candidates.end(); jit++){
160 n_rejected = fj_struct.
rejected().size();
164 n_rejected = fj_struct.
rejected().size();
168 cout <<
" rap = " << j.
rap() <<
", phi = " << j.
phi() <<
", pt = " << j.
perp()
169 <<
" mass = " << j.
m()
170 <<
" [kept: " << j.
pieces().size()
171 <<
", rejected: " << n_rejected;
180 for (
unsigned int i=0; i < groomers.size(); i++)
delete groomers[i];
int main()
an example program showing how to use fastjet
std::vector< PseudoJet > inclusive_jets(const double ptmin=0.0) const
return a vector of all jets (in the sense of the inclusive algorithm) with pt >= ptmin.
const std::vector< PseudoJet > & rejected() const
returns the subjets that were not kept during the filtering procedure (subtracted if the filter reque...
Class that helps perform filtering (Butterworth, Davison, Rubin and Salam, arXiv:0802....
Filter()
trivial ctor Note: this is just for derived classes a Filter initialised through this constructor wil...
class that is intended to hold a full definition of the jet clusterer
JetDefinition()
a default constructor which creates a jet definition that is in a well-defined internal state,...
std::vector< PseudoJet > rejected() const
return the constituents that have been rejected
Transformer that prunes a jet.
Pruner(const JetAlgorithm jet_alg, double zcut, double Rcut_factor)
minimal constructor, which takes a jet algorithm, sets the radius to JetDefinition::max_allowable_R (...
Class to contain pseudojets, including minimal information of use to jet-clustering routines.
PseudoJet()
default constructor, which as of FJ3.0 provides an object for which all operations are now valid and ...
double rap() const
returns the rapidity or some large value when the rapidity is infinite
const TransformerType::StructureType & structure_of() const
this is a helper to access any structure created by a Transformer (that is, of type Transformer::Stru...
double phi() const
returns phi (in the range 0..2pi)
double perp() const
returns the scalar transverse momentum
bool has_structure_of() const
check if the PseudoJet has the structure resulting from a Transformer (that is, its structure is comp...
double m() const
returns the invariant mass (If m2() is negative then -sqrt(-m2()) is returned, as in CLHEP)
std::string description() const
return a string describing what kind of PseudoJet we are dealing with
virtual std::vector< PseudoJet > pieces() const
retrieve the pieces that make up the jet.
Selector SelectorNHardest(unsigned int n)
select the n hardest objects
Selector SelectorPtFractionMin(double fraction)
select objects that carry at least a fraction "fraction" of the reference jet.
@ cambridge_algorithm
the longitudinally invariant variant of the cambridge algorithm (aka Aachen algoithm).
@ 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