Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <fastjet/PseudoJet.hh>
00020 #include <fastjet/ClusterSequence.hh>
00021 #include <fastjet/Selector.hh>
00022 #include <iostream>
00023 #include "fastjet/tools/Filter.hh"
00024
00025 #include <cstdio>
00026
00027 using namespace fastjet;
00028 using namespace std;
00029
00030
00031 int main (int argc, char ** argv) {
00032
00033
00034 vector<PseudoJet> input_particles;
00035
00036 double px, py , pz, E;
00037 while (cin >> px >> py >> pz >> E) {
00038
00039
00040 input_particles.push_back(PseudoJet(px,py,pz,E));
00041 }
00042
00043
00044
00045 JetDefinition jet_def(cambridge_algorithm, 1.2);
00046 ClusterSequence clust_seq(input_particles, jet_def);
00047 vector<fastjet::PseudoJet> inclusive_jets = sorted_by_pt(clust_seq.inclusive_jets(5.0));
00048
00049
00050 printf("%5s %15s %15s %15s\n","jet #", "rapidity", "phi", "pt");
00051
00052
00053 for (unsigned int i = 0; i < inclusive_jets.size(); i++) {
00054 printf("%5u %15.8f %15.8f %15.8f\n",
00055 i, inclusive_jets[i].rap(), inclusive_jets[i].phi(),
00056 inclusive_jets[i].perp());
00057 }
00058
00059
00060
00061 if (inclusive_jets.size()<2){
00062 cout << "Please provide an event with at least 2 jets above 5 GeV" << endl;
00063 return 1;
00064 }
00065
00066
00067
00068
00069
00070 vector<PseudoJet> candidates;
00071 candidates.push_back(inclusive_jets[0]);
00072 candidates.push_back(join(inclusive_jets[0],inclusive_jets[1]));
00073
00074
00075
00076 vector<Filter> filters;
00077
00078
00079 filters.push_back(Filter(JetDefinition(cambridge_algorithm, 0.3), SelectorNHardest(3)));
00080
00081
00082 filters.push_back(Filter(JetDefinition(kt_algorithm, 0.2), SelectorPtFractionMin(0.03)));
00083
00084
00085
00086
00087 for (vector<PseudoJet>::iterator jit=candidates.begin(); jit!=candidates.end(); jit++){
00088 const PseudoJet & c = *jit;
00089 cout << "Original jet : " << c.description() << endl;
00090 cout << " rap = " << c.rap() << ", phi = " << c.phi() << ", pt = " << c.perp() << endl;
00091
00092 for (vector<Filter>::iterator it=filters.begin(); it!=filters.end(); it++){
00093 const Filter & f = *it;
00094
00095 cout << "Applying filter: " << f.description() << endl;
00096 PseudoJet j = f(c);
00097
00098 cout << "Resulting jet : " << j.description() << endl;
00099 cout << " rap = " << j.rap() << ", phi = " << j.phi() << ", pt = " << j.perp() << endl;
00100 cout << " #pieces: " << j.pieces().size() << endl;
00101
00102
00103
00104 assert(j.has_properties_of<Filter>());
00105 const FilteredJetStructure * fj_struct = j.extra_properties<Filter>();
00106 cout << " #rejected pieces: " << fj_struct->rejected().size() << endl;
00107 }
00108 cout << endl;
00109 }
00110
00111 return 0;
00112 }