00001
00002
00003
00004
00005
00006
00007
00008 #include<iostream>
00009 #include<sstream>
00010 #include<vector>
00011
00013 #include "KtJet/KtEvent.h"
00014 #include "KtJet/KtLorentzVector.h"
00015
00016 using namespace std;
00017 using namespace KtJet;
00018
00019
00020 void print_jets (const vector<KtLorentzVector> &);
00021
00024 int main (int argc, char ** argv) {
00025
00026 vector<KtLorentzVector> input_particles;
00027
00028
00029 double px, py , pz, E;
00030 while (cin >> px >> py >> pz >> E) {
00031
00032
00033 input_particles.push_back(KtLorentzVector(px,py,pz,E));
00034 }
00035
00036
00037
00038 double Rparam = 1.0;
00039 KtEvent clust_seq(input_particles,4,2,1,Rparam);
00040
00041
00042 double ptmin = 5.0;
00043 vector<KtLorentzVector> temporary_jets = clust_seq.getJetsPt();
00044 vector<KtLorentzVector> inclusive_jets;
00045 for (unsigned int i = 0; i < temporary_jets.size(); i++) {
00046 if (temporary_jets[i].perp() >= ptmin) {
00047 inclusive_jets.push_back(temporary_jets[i]);}
00048 else {break;}
00049 }
00050
00051
00052 cout << "Printing inclusive jets with pt > "<< ptmin<<" GeV\n";
00053 cout << "---------------------------------------\n";
00054 print_jets(inclusive_jets);
00055 cout << endl;
00056
00057
00058 double dcut = 25.0;
00059
00060
00061
00062 clust_seq.findJetsD(dcut * Rparam*Rparam);
00063 vector<KtLorentzVector> exclusive_jets = clust_seq.getJetsPt();
00064
00065
00066 cout << "Printing exclusive jets with dcut = "<< dcut<<" GeV^2\n";
00067 cout << "--------------------------------------------\n";
00068 print_jets(exclusive_jets);
00069
00070
00071 }
00072
00073
00074
00075
00076 void print_jets (const vector<KtLorentzVector> & jets) {
00077
00078
00079 printf("%5s %15s %15s %15s %15s\n","jet #", "rapidity",
00080 "phi", "pt", "n constituents");
00081
00082
00083 for (unsigned int i = 0; i < jets.size(); i++) {
00084 int n_constituents = jets[i].getConstituents().size();
00085 double phi = jets[i].phi();
00086 if (phi < 0.0) {phi += 6.283185307179586476925286766559005768394;}
00087 printf("%5u %15.8f %15.8f %15.8f %8u\n",
00088 i, jets[i].rapidity(), phi,
00089 jets[i].perp(), n_constituents);
00090 }
00091
00092 }