fastjet_areas.cc
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
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 #include "fastjet/PseudoJet.hh"
00046 #include "fastjet/ClusterSequenceArea.hh"
00047 #include "fastjet/ClusterSequencePassiveArea.hh"
00048
00049
00050 #include "fastjet/config.h"
00051
00052 #ifdef ENABLE_PLUGIN_SISCONE
00053 #include "fastjet/SISConePlugin.hh"
00054 #endif
00055
00056 #include<iostream>
00057 #include<sstream>
00058 #include<vector>
00059
00060 using namespace std;
00061
00062
00063 void print_jets (const fastjet::ClusterSequenceAreaBase &,
00064 const vector<fastjet::PseudoJet> &);
00065
00067 int main (int argc, char ** argv) {
00068
00069 vector<fastjet::PseudoJet> input_particles;
00070
00071
00072 double px, py , pz, E;
00073 while (cin >> px >> py >> pz >> E) {
00074
00075
00076 input_particles.push_back(fastjet::PseudoJet(px,py,pz,E));
00077 }
00078
00079
00080
00081 double Rparam = 1.0;
00082 fastjet::Strategy strategy = fastjet::Best;
00083 fastjet::JetDefinition jet_def(fastjet::kt_algorithm, Rparam, strategy);
00084
00085
00086
00087
00088
00089 fastjet::AreaDefinition area_def;
00090 bool use_voronoi = false;
00091 if (!use_voronoi) {
00092 double ghost_etamax = 7.0;
00093 double ghost_area = 0.05;
00094 int active_area_repeats = 1;
00095
00096
00097
00098
00099
00100
00101
00102
00103 fastjet::GhostedAreaSpec ghost_spec(ghost_etamax, active_area_repeats,
00104 ghost_area);
00105 area_def = fastjet::AreaDefinition(fastjet::passive_area,ghost_spec);
00106
00107 } else {
00108 double effective_Rfact = 1.0;
00109 area_def = fastjet::VoronoiAreaSpec(effective_Rfact);
00110 }
00111
00112
00113 fastjet::ClusterSequenceArea clust_seq(input_particles,
00114 jet_def, area_def);
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126 cout << "Jet definition was: " << jet_def.description() << endl;
00127 cout << "Area definition was: " << area_def.description() << endl;
00128 cout << "Strategy adopted by FastJet was "<<
00129 clust_seq.strategy_string()<<endl<<endl;
00130
00131
00132 double ptmin = 5.0;
00133 vector<fastjet::PseudoJet> inclusive_jets = clust_seq.inclusive_jets(ptmin);
00134
00135
00136 cout << "Printing inclusive jets with pt > "<< ptmin<<" GeV\n";
00137 cout << "---------------------------------------\n";
00138 print_jets(clust_seq, inclusive_jets);
00139 cout << endl;
00140
00141
00142 cout << "Number of unclustered particles: "
00143 << clust_seq.unclustered_particles().size() << endl;
00144
00145
00146 }
00147
00148
00149
00151 void print_jets (const fastjet::ClusterSequenceAreaBase & clust_seq,
00152 const vector<fastjet::PseudoJet> & unsorted_jets) {
00153
00154
00155 vector<fastjet::PseudoJet> jets = sorted_by_pt(unsorted_jets);
00156
00157 printf(" ijet rap phi Pt area +- err\n");
00158 for (size_t j = 0; j < jets.size(); j++) {
00159
00160 double area = clust_seq.area(jets[j]);
00161 double area_error = clust_seq.area_error(jets[j]);
00162
00163 printf("%5u %9.5f %8.5f %10.3f %8.3f +- %6.3f\n",j,jets[j].rap(),
00164 jets[j].phi(),jets[j].perp(), area, area_error);
00165 }
00166
00167
00168 }
00169
00170
00171
00172
00173
00174
00175