4 #include <HepMC/GenEvent.h>
5 #include <HepMC/GenParticle.h>
6 #include <HepMC/SimpleVector.h>
9 #include <fastjet/ClusterSequence.hh>
10 #include <fastjet/JetDefinition.hh>
11 #include <fastjet/PseudoJet.hh>
37 std::vector<fastjet::PseudoJet> pseudojets;
38 for (HepMC::GenEvent::particle_const_iterator
p = evt->particles_begin();
p != evt->particles_end(); ++
p)
41 if (((*p)->status() != 1) != 0)
continue;
49 if ((
abs(((*p)->pdg_id())) >= 12) && (
abs(((*p)->pdg_id())) <= 16))
continue;
52 if (((*p)->momentum().px() == 0.0) && ((*p)->momentum().py() == 0.0))
continue;
53 if ((((*p)->momentum().pseudoRapidity()) <
m_theEtaLow) ||
54 (((*p)->momentum().pseudoRapidity()) >
m_theEtaHigh))
continue;
56 fastjet::PseudoJet pseudojet((*p)->momentum().px(),
57 (*p)->momentum().py(),
58 (*p)->momentum().pz(),
59 (*p)->momentum().e());
60 pseudojet.set_user_index(idx);
61 pseudojets.push_back(pseudojet);
66 fastjet::JetDefinition *jetdef =
new fastjet::JetDefinition(fastjet::antikt_algorithm,
m_R, fastjet::E_scheme, fastjet::Best);
67 fastjet::ClusterSequence jetFinder(pseudojets, *jetdef);
68 std::vector<fastjet::PseudoJet> fastjets = jetFinder.inclusive_jets();
71 bool jetFound =
false;
73 for (
unsigned int ijet = 0; ijet < fastjets.size(); ++ijet)
75 const double pt = sqrt(pow(fastjets[ijet].px(), 2) + pow(fastjets[ijet].py(), 2));
77 if (pt > max_pt) max_pt = pt;
79 vector<fastjet::PseudoJet> constituents = fastjets[ijet].constituents();
80 const int nconst = constituents.size();
91 cout <<
"PHPy6JetTrigger::Apply - max_pt = " << max_pt <<
", and jetFound = " << jetFound << endl;
110 cout <<
"---------------- PHPy6JetTrigger::PrintConfig --------------------" << endl;
113 cout <<
" Minimum Jet pT: " <<
m_minPt <<
" GeV/c" << endl;
114 cout <<
" Anti-kT Radius: " <<
m_R << endl;
115 cout <<
"-----------------------------------------------------------------------" << endl;