FastJet 3.5.0
Loading...
Searching...
No Matches
main.C
1#include <list>
2#include "ILConeAlgorithm.hpp"
3#include "HepEntity.h"
4
5#include <fastjet/internal/base.hh>
6
7FASTJET_BEGIN_NAMESPACE
8
9namespace d0{
10
11using namespace std;
12
13int main() {
14
15
16 HepEntity el;
17 list<const HepEntity*> *ensemble = new list<const HepEntity*>;
18 //list<const HepEntity*> ensemble;
19
20 //fill with E, px, py, pz
21 el.Fill(100., 25., 25., 25., 0);
22 ensemble->push_back(new HepEntity(el));
23 el.Fill(105., 20., 30., 30., 1);
24 ensemble->push_back(new HepEntity(el));
25 el.Fill(60., 20., 20., 20., 2);
26 ensemble->push_back(new HepEntity(el));
27 el.Fill(95., 65., 10., 20., 3);
28 ensemble->push_back(new HepEntity(el));
29
30 el.Fill(110., 25., -25., -25., 4);
31 ensemble->push_back(new HepEntity(el));
32 el.Fill(100., 23., -25., -25., 5);
33 ensemble->push_back(new HepEntity(el));
34 el.Fill(101., 25., -20., -25., 6);
35 ensemble->push_back(new HepEntity(el));
36 el.Fill(102., 25., -25., -23., 7);
37 ensemble->push_back(new HepEntity(el));
38
39
40
41 cout << "list->size()=" << ensemble->size() << endl;
42 int i=1;
43 for (list<const HepEntity*>::iterator it = ensemble->begin(); it != ensemble->end(); ++it) {
44 cout << "4-vector " << i++ << " : E=" << (*it)->E << " pT=" << (*it)->pT() << " y=" << (*it)->y() << " phi=" << (*it)->phi() << endl;
45 cout << (*it) << endl;
46 }
47
48
49 float cone_radius = 0.5;
50 float min_jet_Et = 8.0;
51 float split_ratio = 0.5;
52
53 //the parameters below have been found to be set to the values given below
54 //in the original implementation, shouldn't be altered
55 float far_ratio=0.5;
56 float Et_min_ratio=0.5;
57 bool kill_duplicate=true;
58 float duplicate_dR=0.005;
59 float duplicate_dPT=0.01;
60 float search_factor=1.0;
61 float pT_min_leading_protojet=0.;
62 float pT_min_second_protojet=0.;
63 int merge_max=10000;
64 float pT_min_nomerge=0.;
65
66 ILConeAlgorithm<HepEntity>
67 ilegac(cone_radius, min_jet_Et, split_ratio,
68 far_ratio, Et_min_ratio, kill_duplicate, duplicate_dR,
69 duplicate_dPT, search_factor, pT_min_leading_protojet,
70 pT_min_second_protojet, merge_max, pT_min_nomerge);
71
72 float Item_ET_Threshold = 0.;
73 float Zvertex = 0.;
74
75 float* Item_ET_Threshold_ptr = &Item_ET_Threshold;
76
77
78 list<HepEntity> jets;
79 ilegac.makeClusters(jets, *ensemble, Item_ET_Threshold);
80
81
82 list<HepEntity>::iterator it;
83 cout << "Number of jets = " << jets.size() << endl;
84 for (it=jets.begin(); it!=jets.end(); ++it) {
85 cout << "jet: E=" << (*it).E << " pT=" << (*it).pT() << " y=" << (*it).y() << " phi=" << (*it).phi() << endl;
86 }
87
88 //delete elements of the ensemble particle list
89 //relevant to prevent memory leakage when running over many events
90 for (list<const HepEntity*>::iterator it = ensemble->begin(); it != ensemble->end(); ++it) {
91 delete *it;
92 }
93 delete ensemble;
94
95 return 0;
96
97}
98
99} // namespace d0
100
101
102FASTJET_END_NAMESPACE
int main()
an example program showing how to use fastjet
Definition 01-basic.cc:52