29 #include <siscone/config.h>
31 #include <siscone/siscone_error.h>
39 namespace siscone_spherical{
54 rerun_allowed =
false;
60 rerun_allowed =
false;
64 std::ostream* CSphsiscone::_banner_ostr=&cout;
82 int _n_pass_max,
double _Emin,
83 Esplit_merge_scale _split_merge_scale){
85 _initialise_if_needed();
88 if (_radius <= 0.0 || _radius >= 0.5*M_PI) {
89 ostringstream message;
90 message <<
"Illegal value for cone radius, R = " << _radius
91 <<
" (legal values are 0<R<pi/2)";
97 ptcomparison.split_merge_scale = _split_merge_scale;
102 init_particles(_particles);
104 bool finished =
false;
106 rerun_allowed =
false;
107 protocones_list.clear();
109 #ifdef DEBUG_STABLE_CONES
110 nb_hash_cones_total = 0;
111 nb_hash_occupied_total = 0;
121 if (get_stable_cones(_radius)){
124 protocones_list.push_back(protocones);
125 add_protocones(&protocones, R2, _Emin);
126 #ifdef DEBUG_STABLE_CONES
127 nb_hash_cones_total += nb_hash_cones;
128 nb_hash_occupied_total += nb_hash_occupied;
136 }
while ((!finished) && (n_left>0) && (_n_pass_max!=0));
138 rerun_allowed =
true;
141 return perform(_f, _Emin);
157 int _n_pass_max,
double _Emin,
158 Esplit_merge_scale _ordering_scale){
160 _initialise_if_needed();
163 if (_radius <= 0.0 || _radius >= 0.5*M_PI) {
164 ostringstream message;
165 message <<
"Illegal value for cone radius, R = " << _radius
166 <<
" (legal values are 0<R<pi/2)";
170 ptcomparison.split_merge_scale = _ordering_scale;
177 init_particles(_particles);
180 bool unclustered_left;
181 rerun_allowed =
false;
182 protocones_list.clear();
193 unclustered_left = get_stable_cones(_radius);
196 if (add_hardest_protocone_to_jets(&protocones, R2, _Emin))
break;
199 }
while ((unclustered_left) && (n_left>0) && (_n_pass_max!=0));
216 Esplit_merge_scale _split_merge_scale){
220 ptcomparison.split_merge_scale = _split_merge_scale;
228 for (i=0;i<protocones_list.size();i++)
229 add_protocones(&(protocones_list[i]), R2, _Emin);
232 return perform(_f, _Emin);
237 void CSphsiscone::_initialise_if_needed(){
239 if (init_done)
return;
242 siscone::ranlux_init();
248 if (_banner_ostr != 0){
249 ios::fmtflags flags_to_restore(_banner_ostr->flags());
251 (*_banner_ostr) <<
"#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" << endl;
252 (*_banner_ostr) <<
"# SISCone version " << setw(28) << left << siscone_version() <<
"o" << endl;
253 (*_banner_ostr) <<
"# http://projects.hepforge.org/siscone o" << endl;
254 (*_banner_ostr) <<
"# o" << endl;
255 (*_banner_ostr) <<
"# This is SISCone: the Seedless Infrared Safe Cone Jet Algorithm o" << endl;
256 (*_banner_ostr) <<
"# SISCone was written by Gavin Salam and Gregory Soyez o" << endl;
257 (*_banner_ostr) <<
"# It is released under the terms of the GNU General Public License o" << endl;
258 (*_banner_ostr) <<
"# o" << endl;
259 (*_banner_ostr) <<
"# !!! WARNING !!! o" << endl;
260 (*_banner_ostr) <<
"# This is the version of SISCone using spherical coordinates o" << endl;
261 (*_banner_ostr) <<
"# o" << endl;
262 (*_banner_ostr) <<
"# A description of the algorithm is available in the publication o" << endl;
263 (*_banner_ostr) <<
"# JHEP 05 (2007) 086 [arXiv:0704.0292 (hep-ph)]. o" << endl;
264 (*_banner_ostr) <<
"# Please cite it if you use SISCone. o" << endl;
265 (*_banner_ostr) <<
"#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" << endl;
266 (*_banner_ostr) << endl;
268 _banner_ostr->flush();
269 _banner_ostr->flags(flags_to_restore);
284 string siscone_package_name(){
285 return SISCONE_PACKAGE_NAME;
293 string siscone_version(){
294 return SISCONE_VERSION;
class corresponding to errors that will be thrown by siscone
int compute_jets_progressive_removal(std::vector< CSphmomentum > &_particles, double _radius, int _n_pass_max=0, double _Emin=0.0, Esplit_merge_scale _ordering_scale=SM_Etilde)
compute the jets from a given particle set.
CSphsiscone()
default ctor
int compute_jets(std::vector< CSphmomentum > &_particles, double _radius, double _f, int _n_pass_max=0, double _Emin=0.0, Esplit_merge_scale _split_merge_scale=SM_Etilde)
compute the jets from a given particle set.
~CSphsiscone()
default dtor
int recompute_jets(double _f, double _Emin=0.0, Esplit_merge_scale _split_merge_scale=SM_Etilde)
recompute the jets with a different overlap parameter.
static bool init_done
check random generator initialisation
void init(std::vector< CSphmomentum > &_particle_list)
initialisation