3 #include <Pythia8/Event.h>
4 #include <Pythia8/Pythia.h>
7 #include <fastjet/ClusterSequence.hh>
8 #include <fastjet/JetDefinition.hh>
9 #include <fastjet/PseudoJet.hh>
45 cout <<
"PHPy8JetTrigger::Apply - pythia event size: "
46 << pythia->event.size() << endl;
50 std::vector<fastjet::PseudoJet> pseudojets;
51 for (
int i = 0;
i < pythia->event.size(); ++
i)
53 if (pythia->event[
i].status() > 0)
62 if ((abs(pythia->event[
i].id()) >= 12) && (abs(pythia->event[
i].id()) <= 16))
68 if ((pythia->event[
i].px() == 0.0) && (pythia->event[
i].py() == 0.0))
78 fastjet::PseudoJet pseudojet(pythia->event[
i].px(),
79 pythia->event[
i].py(),
80 pythia->event[
i].pz(),
81 pythia->event[
i].e());
82 pseudojet.set_user_index(
i);
83 pseudojets.push_back(pseudojet);
90 fastjet::ClusterSequence jetFinder(pseudojets, *jetdef);
91 std::vector<fastjet::PseudoJet> fastjets = jetFinder.inclusive_jets();
94 bool jetFound =
false;
96 for (
unsigned int ijet = 0; ijet < fastjets.size(); ++ijet)
98 const double pt = sqrt(fastjets[ijet].px() * fastjets[ijet].px() + fastjets[ijet].py() * fastjets[ijet].py());
105 vector<fastjet::PseudoJet> constituents = fastjets[ijet].constituents();
106 int ijet_nconst = constituents.size();
114 double leading_Z = 0.0;
116 double jet_ptot = sqrt(fastjets[ijet].px() * fastjets[ijet].px() +
117 fastjets[ijet].py() * fastjets[ijet].py() +
118 fastjets[ijet].pz() * fastjets[ijet].pz());
120 for (
unsigned int j = 0;
j < constituents.size();
j++)
122 double con_ptot = sqrt(constituents[
j].px() * constituents[
j].px() +
123 constituents[
j].py() * constituents[
j].py() +
124 constituents[
j].pz() * constituents[
j].pz());
126 double ctheta = (constituents[
j].px() * fastjets[ijet].px() +
127 constituents[
j].py() * fastjets[ijet].py() +
128 constituents[
j].pz() * fastjets[ijet].pz()) /
129 (con_ptot * jet_ptot);
131 double z_constit = con_ptot * ctheta / jet_ptot;
133 if (z_constit > leading_Z)
135 leading_Z = z_constit;
139 if (leading_Z >
_minZ)
155 cout <<
"PHPy8JetTrigger::Apply - max_pt = " << max_pt <<
", and jetFound = " << jetFound << endl;
194 cout <<
"---------------- PHPy8JetTrigger::PrintConfig --------------------" << endl;
197 cout <<
" Minimum Jet pT: " <<
_minPt <<
" GeV/c" << endl;
198 cout <<
" Anti-kT Radius: " <<
_R << endl;
199 cout <<
"-----------------------------------------------------------------------" << endl;