24 #include "fastjet/ClusterSequence.hh"
25 #include "fastjet/ClusterSequenceArea.hh"
26 #include "StjFastJet.h"
28 void StjFastJet::findJets(JetList& protoJetList,
const FourVecList& particleList)
31 std::vector<fastjet::PseudoJet> inputParticles;
32 for (
size_t i = 0; i < particleList.size(); ++i) {
33 fastjet::PseudoJet pseudojet(particleList[i]->px(),particleList[i]->py(),particleList[i]->pz(),particleList[i]->e());
34 pseudojet.set_user_index(i);
35 inputParticles.push_back(pseudojet);
37 if(!mPars.jetAreaFlag()){
39 fastjet::ClusterSequence clusterSequence(inputParticles,jetDefinition());
41 std::vector<fastjet::PseudoJet> inclusiveJets = clusterSequence.inclusive_jets(mPars.ptMin());
42 for (
size_t i = 0; i < inclusiveJets.size(); ++i) {
44 std::vector<fastjet::PseudoJet> constituents = clusterSequence.constituents(inclusiveJets[i]);
45 for (
size_t j = 0; j < constituents.size(); ++j) {
46 const_cast<FourVecList&
>(protojet.list()).push_back(particleList[constituents[j].user_index()]);
49 protoJetList.push_back(protojet);
52 }
else if(mPars.jetAreaFlag()){
54 fastjet::ClusterSequenceArea clusterSequenceArea(inputParticles, jetDefinition(), areaDefinition());
55 std::vector<fastjet::PseudoJet> inclusiveJets = clusterSequenceArea.inclusive_jets(mPars.ptMin());
56 for (
size_t i = 0; i < inclusiveJets.size(); ++i) {
58 std::vector<fastjet::PseudoJet> constituents = clusterSequenceArea.constituents(inclusiveJets[i]);
59 protojet.setArea(inclusiveJets[i].area());
60 protojet.setAreaError(inclusiveJets[i].area_error());
61 for (
size_t j = 0; j < constituents.size(); ++j) {
62 const_cast<FourVecList&
>(protojet.list()).push_back(particleList[constituents[j].user_index()]);
65 protoJetList.push_back(protojet);
70 fastjet::JetDefinition StjFastJet::jetDefinition()
const
72 return (mPars.jetAlgorithm() == fastjet::plugin_algorithm)
73 ? fastjet::JetDefinition(static_cast<fastjet::JetDefinition::Plugin*>(mPars.plugin()))
74 : fastjet::JetDefinition(static_cast<fastjet::JetAlgorithm>(mPars.jetAlgorithm()),
76 static_cast<fastjet::RecombinationScheme
>(mPars.recombinationScheme()),
77 static_cast<fastjet::Strategy>(mPars.strategy()));
79 fastjet::AreaDefinition StjFastJet::areaDefinition()
const
81 fastjet::GhostedAreaSpec area_spec(mPars.jetArea()->ghostMaxRap(), mPars.jetArea()->repeat(), mPars.jetArea()->ghostArea(), mPars.jetArea()->gridScatter(), mPars.jetArea()->ptScatter(), mPars.jetArea()->meanGhostPt());
82 return fastjet::AreaDefinition(static_cast<fastjet::AreaType>(mPars.jetArea()->areaType()), area_spec);