6 #include "fastjet/ClusterSequenceArea.hh"
17 void SubJetAlgorithm::run(
const vector<fastjet::PseudoJet>& cell_particles, vector<CompoundPseudoJet>& hardjetsOutput) {
20 fastjet::FastPrunePlugin PRplugin(*fjJetDefinition_, *fjJetDefinition_, zcut_, rcut_factor_);
21 fastjet::JetDefinition pjetdef(&PRplugin);
25 std::shared_ptr<fastjet::ClusterSequence> fjClusterSeq;
26 if (!doAreaFastjet_) {
27 fjClusterSeq = std::make_shared<fastjet::ClusterSequence>(cell_particles, pjetdef);
28 }
else if (voronoiRfact_ <= 0) {
29 fjClusterSeq = std::shared_ptr<fastjet::ClusterSequence>(
30 new fastjet::ClusterSequenceActiveArea(cell_particles, pjetdef, *fjActiveArea_));
32 fjClusterSeq = std::shared_ptr<fastjet::ClusterSequence>(
33 new fastjet::ClusterSequenceVoronoiArea(cell_particles, pjetdef, fastjet::VoronoiAreaSpec(voronoiRfact_)));
36 vector<fastjet::PseudoJet> inclusiveJets = fjClusterSeq->inclusive_jets(ptMin_);
40 vector<vector<int> >
indices(inclusiveJets.size());
42 vector<fastjet::PseudoJet>::iterator jetIt = inclusiveJets.begin();
43 for (; jetIt != inclusiveJets.end(); ++jetIt) {
45 vector<fastjet::PseudoJet> subjets = fjClusterSeq->exclusive_subjets(*jetIt, nSubjets_);
47 vector<CompoundPseudoSubJet> subjetsOutput;
48 std::vector<fastjet::PseudoJet>::const_iterator itSubJetBegin = subjets.begin(), itSubJet = itSubJetBegin,
49 itSubJetEnd = subjets.end();
50 for (; itSubJet != itSubJetEnd; ++itSubJet) {
52 vector<fastjet::PseudoJet> subjetFastjetConstituents = fjClusterSeq->constituents(*itSubJet);
54 vector<int> constituents;
55 vector<fastjet::PseudoJet>::const_iterator fastSubIt = subjetFastjetConstituents.begin(),
56 transConstEnd = subjetFastjetConstituents.end();
57 for (; fastSubIt != transConstEnd; ++fastSubIt) {
58 if (fastSubIt->user_index() >= 0) {
59 constituents.push_back(fastSubIt->user_index());
64 (doAreaFastjet_) ? dynamic_cast<fastjet::ClusterSequenceActiveArea&>(*fjClusterSeq).area(*itSubJet) : 0.0;
71 (doAreaFastjet_) ? dynamic_cast<fastjet::ClusterSequenceActiveArea&>(*fjClusterSeq).area(*jetIt) : 0.0;