45#include "fastjet/PseudoJet.hh"
46#include "fastjet/ClusterSequenceArea.hh"
56 const vector<fastjet::PseudoJet> &);
59int main (
int argc,
char ** argv) {
63 vector<fastjet::PseudoJet> hard_event, full_event;
74 while (getline(cin, line)) {
75 istringstream linestream(line);
78 if (line.substr(0,4) ==
"#END") {
break;}
79 if (line.substr(0,9) ==
"#SUBSTART") {
81 if (nsub == 1) hard_event = full_event;
84 if (line.substr(0,1) ==
"#") {
continue;}
85 valarray<double> fourvec(4);
86 linestream >> fourvec[0] >> fourvec[1] >> fourvec[2] >> fourvec[3];
88 psjet.set_user_index(0);
90 if (abs(psjet.rap()) < etamax) {full_event.push_back(psjet);}
94 if (nsub == 1) hard_event = full_event;
98 cerr <<
"Error: read empty event\n";
112 double ghost_etamax = 6.0;
113 int active_area_repeats = 1;
114 double ghost_area = 0.01;
127 vector<fastjet::PseudoJet> inclusive_jets = clust_seq.inclusive_jets(ptmin);
131 cout <<
"Hard event only"<<endl;
132 cout <<
"Number of input particles: "<<hard_event.size()<<endl;
133 cout <<
"Strategy used: "<<clust_seq.strategy_string()<<endl;
134 cout <<
"Printing inclusive jets with pt > "<< ptmin<<
" GeV\n";
135 cout <<
"---------------------------------------\n";
136 print_jets(clust_seq, inclusive_jets);
147 inclusive_jets = clust_seq_full.inclusive_jets(ptmin);
150 cout <<
"Full event, with pileup, and its subtraction"<<endl;
151 cout <<
"Number of input particles: "<<full_event.size()<<endl;
152 cout <<
"Strategy used: "<<clust_seq_full.strategy_string()<<endl;
153 cout <<
"Printing inclusive jets with pt > "<< ptmin<<
" GeV (before subtraction)\n";
154 cout <<
"---------------------------------------\n";
155 print_jets(clust_seq_full, inclusive_jets);
167 const vector<fastjet::PseudoJet> & unsorted_jets ) {
170 vector<fastjet::PseudoJet> jets =
sorted_by_pt(unsorted_jets);
173 vector<fastjet::PseudoJet> corrected_jets(jets.size());
182 printf(
" ijet rap phi Pt area Pt corr (rap corr phi corr Pt corr)ext\n");
183 for (
size_t j = 0; j < jets.size(); j++) {
186 double area = jets[j].area();
189 double pt_corr = jets[j].perp() - area*median_pt_per_area;
194 if (sub_4vect.
perp2() >= jets[j].perp2() ||
195 sub_4vect.E() >= jets[j].E()) {
197 corrected_jets[j] = 0.0 * jets[j];
200 corrected_jets[j] = jets[j] - sub_4vect;
207 printf(
"%5u %7.3f %7.3f %9.3f %7.3f %9.3f %7.3f %7.3f %9.3f\n",
208 j,jets[j].rap(),jets[j].phi(),jets[j].perp(), area, pt_corr,
209 corrected_jets[j].rap(),corrected_jets[j].phi(), corrected_jets[j].perp());
213 cout <<
"median pt_over_area = " << median_pt_per_area << endl;
214 cout <<
"median pt_over_area4vector = " << median_pt_per_area4vector << endl << endl;
int main()
an example program showing how to use fastjet
class that holds a generic area definition
base class that sets interface for extensions of ClusterSequence that provide information about the a...
double median_pt_per_unit_area_4vector(const Selector &selector) const
the median of (pt/area_4vector) for jets contained within the selector range, making use also of the ...
double median_pt_per_unit_area(const Selector &selector) const
the median of (pt/area) for jets contained within the selector range, making use also of the info on ...
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 perp2() const
returns the squared transverse momentum
virtual PseudoJet area_4vector() const
return the jet 4-vector area.
Strategy
the various options for the algorithmic strategy to adopt in clustering events with kt and cambridge ...
@ Best
automatic selection of the best (based on N), including the LazyTiled strategies that are new to FJ3....
@ 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