3 #include "fastjet/ClusterSequence.hh"
4 #include "fastjet/SISConePlugin.hh"
7 #include "siscone/momentum.h"
8 #include "siscone/siscone.h"
13 FASTJET_BEGIN_NAMESPACE
16 using namespace siscone;
19 template<> PseudoJet::PseudoJet(
const siscone::Cmomentum & four_vector) {
20 (*this) =
PseudoJet(four_vector.px,four_vector.py,four_vector.pz,
28 std::auto_ptr<SISConePlugin> SISConePlugin::stored_plugin;
29 std::auto_ptr<std::vector<PseudoJet> > SISConePlugin::stored_particles;
30 std::auto_ptr<Csiscone> SISConePlugin::stored_siscone;
36 string SISConePlugin::description ()
const {
39 const string on =
"on";
40 const string off =
"off";
42 string sm_scale_string =
"split-merge uses " +
43 split_merge_scale_name(Esplit_merge_scale(split_merge_scale()));
45 desc <<
"SISCone jet algorithm with " ;
46 desc <<
"cone_radius = " << cone_radius () <<
", ";
47 desc <<
"overlap_threshold = " << overlap_threshold () <<
", ";
48 desc <<
"n_pass_max = " << n_pass_max () <<
", ";
49 desc <<
"protojet_ptmin = " << protojet_ptmin() <<
", ";
50 desc << sm_scale_string <<
", ";
51 desc <<
"caching turned " << (caching() ? on : off);
52 desc <<
", SM stop scale = " << _split_merge_stopping_scale;
55 if (_use_pt_weighted_splitting){
56 desc <<
", using pt-weighted splitting";
59 if (_use_jet_def_recombiner){
60 desc <<
", using jet-definition's own recombiner";
65 if (siscone.merge_identical_protocones) {
66 desc <<
", and (IR unsafe) merge_indentical_protocones=true" ;
69 desc <<
", SISCone code v" << siscone_version();
80 Csiscone local_siscone;
83 unsigned n = clust_seq.
jets().size();
85 bool new_siscone =
true;
93 if (stored_siscone.get() != 0) {
94 new_siscone = !(stored_plugin->cone_radius() == cone_radius()
95 && stored_plugin->n_pass_max() == n_pass_max()
96 && stored_particles->size() == n);
98 for(
unsigned i = 0; i < n; i++) {
102 (*stored_particles)[i]);
109 stored_siscone .reset(
new Csiscone );
110 stored_particles.reset(
new std::vector<PseudoJet>(clust_seq.
jets()));
111 reset_stored_plugin();
114 siscone = stored_siscone.get();
116 siscone = &local_siscone;
120 siscone->SM_var2_hardest_cut_off = _split_merge_stopping_scale*_split_merge_stopping_scale;
125 siscone->stable_cone_soft_pt2_cutoff = ghost_separation_scale()
126 * ghost_separation_scale();
128 siscone->set_pt_weighted_splitting(_use_pt_weighted_splitting);
132 std::vector<Cmomentum> siscone_momenta(n);
133 for(
unsigned i = 0; i < n; i++) {
135 siscone_momenta[i] = Cmomentum(p.px(), p.py(), p.pz(), p.E());
140 siscone->compute_jets(siscone_momenta, cone_radius(), overlap_threshold(),
141 n_pass_max(), protojet_or_ghost_ptmin(),
142 Esplit_merge_scale(split_merge_scale()));
147 siscone->recompute_jets(overlap_threshold(), protojet_or_ghost_ptmin(),
148 Esplit_merge_scale(split_merge_scale()));
152 int njet = siscone->jets.size();
157 for (
int ijet = njet-1; ijet >= 0; ijet--) {
158 const Cjet & jet = siscone->jets[ijet];
163 int jet_k = jet.contents[0];
164 for (
unsigned ipart = 1; ipart < jet.contents.size(); ipart++) {
168 int jet_j = jet.contents[ipart];
172 if (_use_jet_def_recombiner) {
188 double d_iB = clust_seq.
jets()[jet_k].perp2();
192 extras->_pass[clust_seq.
jets()[jet_k].cluster_hist_index()] = jet.pass;
196 for (
unsigned ipass = 0; ipass < siscone->protocones_list.size(); ipass++) {
197 for (
unsigned ipc = 0; ipc < siscone->protocones_list[ipass].size(); ipc++) {
198 PseudoJet protocone(siscone->protocones_list[ipass][ipc]);
200 extras->_protocones.push_back(protocone);
203 extras->_most_ambiguous_split = siscone->most_ambiguous_split;
206 extras->_jet_def_plugin =
this;
218 void SISConePlugin::reset_stored_plugin()
const{
222 FASTJET_END_NAMESPACE