4 #pragma GCC diagnostic push
5 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
6 #include <HepMC/GenEvent.h>
7 #pragma GCC diagnostic pop
9 #include <HepMC/GenParticle.h>
10 #include <HepMC/SimpleVector.h>
13 #include <fastjet/ClusterSequence.hh>
14 #include <fastjet/JetDefinition.hh>
15 #include <fastjet/PseudoJet.hh>
41 std::vector<fastjet::PseudoJet> pseudojets;
42 for (HepMC::GenEvent::particle_const_iterator
p = evt->particles_begin();
p != evt->particles_end(); ++
p)
45 if (((*p)->status() != 1) != 0)
continue;
53 if ((abs(((*p)->pdg_id())) >= 12) && (abs(((*p)->pdg_id())) <= 16))
continue;
56 if (((*p)->momentum().px() == 0.0) && ((*p)->momentum().py() == 0.0))
continue;
57 if ((((*p)->momentum().pseudoRapidity()) <
m_theEtaLow) ||
58 (((*p)->momentum().pseudoRapidity()) >
m_theEtaHigh))
continue;
60 fastjet::PseudoJet pseudojet((*p)->momentum().px(),
61 (*p)->momentum().py(),
62 (*p)->momentum().pz(),
63 (*p)->momentum().e());
64 pseudojet.set_user_index(idx);
65 pseudojets.push_back(pseudojet);
71 fastjet::ClusterSequence jetFinder(pseudojets, *jetdef);
72 std::vector<fastjet::PseudoJet> fastjets = jetFinder.inclusive_jets();
75 bool jetFound =
false;
77 for (
unsigned int ijet = 0; ijet < fastjets.size(); ++ijet)
79 const double pt = sqrt(pow(fastjets[ijet].px(), 2) + pow(fastjets[ijet].py(), 2));
81 if (pt > max_pt) max_pt =
pt;
83 vector<fastjet::PseudoJet> constituents = fastjets[ijet].constituents();
84 const int nconst = constituents.size();
95 cout <<
"PHPy6JetTrigger::Apply - max_pt = " << max_pt <<
", and jetFound = " << jetFound << endl;
114 cout <<
"---------------- PHPy6JetTrigger::PrintConfig --------------------" << endl;
117 cout <<
" Minimum Jet pT: " <<
m_minPt <<
" GeV/c" << endl;
118 cout <<
" Anti-kT Radius: " <<
m_R << endl;
119 cout <<
"-----------------------------------------------------------------------" << endl;