4 #include <fastjet/JetDefinition.hh>
5 #include <fastjet/PseudoJet.hh>
6 #include <fastjet/ClusterSequence.hh>
7 #include <fastjet/SISConePlugin.hh>
40 ~FastJetAlgorithmWrapper() {}
43 std::vector<Jet> operator () (
46 std::auto_ptr<fastjet::JetDefinition::Plugin>
plugin;
47 std::auto_ptr<fastjet::JetDefinition> jetDefinition;
50 class KtAlgorithm :
public FastJetAlgorithmWrapper {
57 class SISConeAlgorithm :
public FastJetAlgorithmWrapper {
61 ~SISConeAlgorithm() {}
64 static fastjet::SISConePlugin::SplitMergeScale
69 FastJetAlgorithmWrapper::FastJetAlgorithmWrapper(
71 JetClustering::Algorithm(params, jetPtMin)
75 std::vector<JetClustering::Jet> FastJetAlgorithmWrapper::operator () (
79 return std::vector<JetClustering::Jet>();
81 std::vector<fastjet::PseudoJet> jfInput;
82 jfInput.reserve(input.size());
83 for(ParticleVector::const_iterator iter = input.begin();
84 iter != input.end(); ++iter) {
85 jfInput.push_back(fastjet::PseudoJet(
86 (*iter)->momentum().px(), (*iter)->momentum().py(),
87 (*iter)->momentum().pz(), (*iter)->momentum().e()));
88 jfInput.back().set_user_index(iter - input.begin());
91 fastjet::ClusterSequence
sequence(jfInput, *jetDefinition);
92 std::vector<fastjet::PseudoJet>
jets =
96 result.reserve(jets.size());
98 for(std::vector<fastjet::PseudoJet>::const_iterator iter = jets.begin();
99 iter != jets.end(); ++iter) {
100 std::vector<fastjet::PseudoJet> fjConstituents =
102 unsigned int size = fjConstituents.size();
103 constituents.resize(size);
104 for(
unsigned int i = 0;
i <
size;
i++)
106 input[fjConstituents[
i].user_index()];
109 Jet(iter->px(), iter->py(), iter->pz(), iter->E(),
117 FastJetAlgorithmWrapper(params, jetPtMin)
119 jetDefinition.reset(
new fastjet::JetDefinition(
120 fastjet::kt_algorithm,
125 SISConeAlgorithm::SISConeAlgorithm(
127 FastJetAlgorithmWrapper(params, jetPtMin)
131 fastjet::SISConePlugin::SplitMergeScale
scale;
133 if (splitMergeScale ==
"pt")
134 scale = fastjet::SISConePlugin::SM_pt;
135 else if (splitMergeScale ==
"Et")
136 scale = fastjet::SISConePlugin::SM_Et;
137 else if (splitMergeScale ==
"mt")
138 scale = fastjet::SISConePlugin::SM_mt;
139 else if (splitMergeScale ==
"pttilde")
140 scale = fastjet::SISConePlugin::SM_pttilde;
143 <<
"JetClustering SISCone scale '" << splitMergeScale
144 <<
"' unknown." << std::endl;
146 plugin.reset(
new fastjet::SISConePlugin(
153 jetDefinition.reset(
new fastjet::JetDefinition(
plugin.get()));
158 double jetPtMin = params.
getParameter<
double>(
"jetPtMin");
159 init(params, jetPtMin);
165 init(params, jetPtMin);
178 if (algoName ==
"KT")
179 jetAlgo.reset(
new KtAlgorithm(algoParams, jetPtMin));
180 else if (algoName ==
"SISCone")
181 jetAlgo.reset(
new SISConeAlgorithm(algoParams, jetPtMin));
184 <<
"JetClustering algorithm \"" << algoName
185 <<
"\" unknown." << std::endl;
T getParameter(std::string const &) const
double getJetPtMin() const
auto_ptr< JetDefinition::Plugin > plugin
double getJetPtMin() const
std::auto_ptr< Algorithm > jetAlgo
JetClustering::ParticleVector ParticleVector
static std::string const input
JetClustering(const edm::ParameterSet ¶ms)
std::vector< Jet > operator()(const ParticleVector &input) const
JetInput::ParticleVector ParticleVector
virtual std::vector< Jet > operator()(const ParticleVector &input) const =0
void init(const edm::ParameterSet ¶ms, double jetPtMin)
Algorithm(const edm::ParameterSet ¶ms, double jetPtMin)
tuple size
Write out results.