3 #include "fastjet/ClusterSequence.hh"
4 #include "fastjet/SISConeSphericalPlugin.hh"
7 #include "siscone/spherical/momentum.h"
8 #include "siscone/spherical/siscone.h"
13 FASTJET_BEGIN_NAMESPACE
16 using namespace siscone_spherical;
19 template<> PseudoJet::PseudoJet(
const siscone_spherical::CSphmomentum & four_vector) {
20 (*this) =
PseudoJet(four_vector.px,four_vector.py,four_vector.pz,
27 std::auto_ptr<SISConeSphericalPlugin> SISConeSphericalPlugin::stored_plugin;
28 std::auto_ptr<std::vector<PseudoJet> > SISConeSphericalPlugin::stored_particles;
29 std::auto_ptr<CSphsiscone> SISConeSphericalPlugin::stored_siscone;
35 string SISConeSphericalPlugin::description ()
const {
38 const string on =
"on";
39 const string off =
"off";
41 string sm_scale_string =
"split-merge uses " +
42 split_merge_scale_name(Esplit_merge_scale(split_merge_scale()));
44 desc <<
"Spherical SISCone jet algorithm with " ;
45 desc <<
"cone_radius = " << cone_radius () <<
", ";
46 desc <<
"overlap_threshold = " << overlap_threshold () <<
", ";
47 desc <<
"n_pass_max = " << n_pass_max () <<
", ";
48 desc <<
"protojet_Emin = " << protojet_Emin() <<
", ";
49 desc << sm_scale_string <<
", ";
50 desc <<
"caching turned " << (caching() ? on : off);
51 desc <<
", SM stop scale = " << _split_merge_stopping_scale;
54 if (_use_E_weighted_splitting){
55 desc <<
", using E-weighted splitting";
58 if (_use_jet_def_recombiner){
59 desc <<
", using jet-definition's own recombiner";
64 if (siscone.merge_identical_protocones) {
65 desc <<
", and (IR unsafe) merge_indentical_protocones=true" ;
68 desc <<
", SISCone code v" << siscone_version();
79 CSphsiscone local_siscone;
80 CSphsiscone * siscone;
82 unsigned n = clust_seq.
jets().size();
84 bool new_siscone =
true;
92 if (stored_siscone.get() != 0) {
93 new_siscone = !(stored_plugin->cone_radius() == cone_radius()
94 && stored_plugin->n_pass_max() == n_pass_max()
95 && stored_particles->size() == n);
97 for(
unsigned i = 0; i < n; i++) {
101 (*stored_particles)[i]);
108 stored_siscone .reset(
new CSphsiscone );
109 stored_particles.reset(
new std::vector<PseudoJet>(clust_seq.
jets()));
110 reset_stored_plugin();
113 siscone = stored_siscone.get();
115 siscone = &local_siscone;
119 siscone->SM_var2_hardest_cut_off = _split_merge_stopping_scale*_split_merge_stopping_scale;
124 siscone->stable_cone_soft_E2_cutoff = ghost_separation_scale()
125 * ghost_separation_scale();
127 siscone->set_E_weighted_splitting(_use_E_weighted_splitting);
132 std::vector<CSphmomentum> siscone_momenta(n);
133 for(
unsigned i = 0; i < n; i++) {
135 siscone_momenta[i] = CSphmomentum(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_Emin(),
142 Esplit_merge_scale(split_merge_scale()));
147 siscone->recompute_jets(overlap_threshold(), protojet_or_ghost_Emin(),
148 Esplit_merge_scale(split_merge_scale()));
152 int njet = siscone->jets.size();
157 for (
int ijet = njet-1; ijet >= 0; ijet--) {
158 const CSphjet & 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;
216 void SISConeSphericalPlugin::reset_stored_plugin()
const{
221 FASTJET_END_NAMESPACE