51#include <fastjet/ClusterSequence.hh>
52#include <fastjet/Selector.hh>
53#include <fastjet/tools/JHTopTagger.hh>
62ostream & operator<<(ostream &,
const PseudoJet &);
69 vector<PseudoJet> particles;
75 while (getline(cin,line)) {
76 if (line.substr(0,1) ==
"#") {
continue;}
77 istringstream linestream(line);
79 linestream >> px >> py >> pz >> E;
82 particles.push_back(
PseudoJet(px,py,pz,E));
88 for (
unsigned int i=0; i<particles.size(); i++)
89 Et += particles[i].perp();
91 double R, delta_p, delta_r;
92 if (Et>2600){ R=0.4; delta_p=0.05; delta_r=0.19;}
93 else if (Et>1600){ R=0.6; delta_p=0.05; delta_r=0.19;}
94 else if (Et>1000){ R=0.8; delta_p=0.10; delta_r=0.19;}
95 else{ cerr <<
"Et has to be at least 1 TeV"<< endl;
return 1;}
97 double ptmin = min(500.0, 0.7*Et/2);
103 vector<PseudoJet> jets =
sorted_by_pt(cs.inclusive_jets());
105 cout <<
"Ran: " << jet_def.description() << endl << endl;
106 cout <<
"2 Hardest jets: " << jets[0] << endl
107 <<
" " << jets[1] << endl << endl;
109 if (jets[0].perp()<ptmin){
110 cout <<
"No jet above the ptmin threshold" << endl;
133 cout <<
"Ran the following top tagger: " << top_tagger.description() << endl;
136 cout <<
"No top substructure found" << endl;
140 cout <<
"Found top substructure from the hardest jet:" << endl;
141 cout <<
" top candidate: " << tagged << endl;
153ostream & operator<<(ostream & ostr,
const PseudoJet & jet) {
154 ostr <<
"pt, y, phi =" << setprecision(6)
155 <<
" " << setw(9) << jet.
perp()
156 <<
" " << setw(9) << jet.
rap()
157 <<
" " << setw(9) << jet.
phi()
158 <<
", mass = " << setw(9) << jet.
m();
int main()
an example program showing how to use fastjet
Class that helps perform boosted top tagging using the "Johns Hopkins" method from arXiv:0806....
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.
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
double m() const
returns the invariant mass (If m2() is negative then -sqrt(-m2()) is returned, as in CLHEP)
Selector SelectorMassRange(double mmin, double mmax)
select objects with Mmin <= Mass <= Mmax
@ 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