32 #include "siscone_error.h"
52 rerun_allowed =
false;
58 rerun_allowed =
false;
62 std::ostream* Csiscone::_banner_ostr = &cout;
80 int _n_pass_max,
double _ptmin,
81 Esplit_merge_scale _split_merge_scale){
82 _initialise_if_needed();
85 if (_radius <= 0.0 || _radius >= 0.5*M_PI) {
86 ostringstream message;
87 message <<
"Illegal value for cone radius, R = " << _radius
88 <<
" (legal values are 0<R<pi/2)";
94 ptcomparison.split_merge_scale = _split_merge_scale;
99 init_particles(_particles);
101 bool finished =
false;
103 rerun_allowed =
false;
104 protocones_list.clear();
106 #ifdef DEBUG_STABLE_CONES
107 nb_hash_cones_total = 0;
108 nb_hash_occupied_total = 0;
118 if (get_stable_cones(_radius)){
123 add_protocones(&protocones, R2, _ptmin);
124 protocones_list.push_back(protocones);
125 #ifdef DEBUG_STABLE_CONES
126 nb_hash_cones_total += nb_hash_cones;
127 nb_hash_occupied_total += nb_hash_occupied;
135 }
while ((!finished) && (n_left>0) && (_n_pass_max!=0));
137 rerun_allowed =
true;
140 return perform(_f, _ptmin);
157 int _n_pass_max,
double _ptmin,
158 Esplit_merge_scale _ordering_scale){
159 _initialise_if_needed();
162 if (_radius <= 0.0 || _radius >= 0.5*M_PI) {
163 ostringstream message;
164 message <<
"Illegal value for cone radius, R = " << _radius
165 <<
" (legal values are 0<R<pi/2)";
169 ptcomparison.split_merge_scale = _ordering_scale;
176 init_particles(_particles);
179 bool unclustered_left;
180 rerun_allowed =
false;
181 protocones_list.clear();
192 unclustered_left = get_stable_cones(_radius);
195 if (add_hardest_protocone_to_jets(&protocones, R2, _ptmin))
break;
198 }
while ((unclustered_left) && (n_left>0) && (_n_pass_max!=0));
217 Esplit_merge_scale _split_merge_scale){
221 ptcomparison.split_merge_scale = _split_merge_scale;
229 for (i=0;i<protocones_list.size();i++)
230 add_protocones(&(protocones_list[i]), R2, _ptmin);
233 return perform(_f, _ptmin);
237 void Csiscone::_initialise_if_needed(){
239 if (init_done)
return;
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) <<
"# A description of the algorithm is available in the publication o" << endl;
260 (*_banner_ostr) <<
"# JHEP 05 (2007) 086 [arXiv:0704.0292 (hep-ph)]. o" << endl;
261 (*_banner_ostr) <<
"# Please cite it if you use SISCone. o" << endl;
262 (*_banner_ostr) <<
"#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" << endl;
263 (*_banner_ostr) << endl;
265 _banner_ostr->flush();
266 _banner_ostr->flags(flags_to_restore);
281 string siscone_package_name(){
282 return SISCONE_PACKAGE_NAME;
290 string siscone_version(){
291 return SISCONE_VERSION;
class corresponding to errors that will be thrown by siscone
int compute_jets(std::vector< Cmomentum > &_particles, double _radius, double _f, int _n_pass_max=0, double _ptmin=0.0, Esplit_merge_scale _split_merge_scale=SM_pttilde)
compute the jets from a given particle set.
int recompute_jets(double _f, double _ptmin=0.0, Esplit_merge_scale _split_merge_scale=SM_pttilde)
recompute the jets with a different overlap parameter.
int compute_jets_progressive_removal(std::vector< Cmomentum > &_particles, double _radius, int _n_pass_max=0, double _ptmin=0.0, Esplit_merge_scale _ordering_scale=SM_pttilde)
compute the jets from a given particle set.
static bool init_done
check random generator initialisation
void init(std::vector< Cmomentum > &_particle_list)
initialisation