29#include <siscone/config.h>
31#include <siscone/siscone_error.h>
39namespace siscone_spherical{
54 rerun_allowed =
false;
60 rerun_allowed =
false;
64std::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)";
104 bool finished =
false;
106 rerun_allowed =
false;
109#ifdef DEBUG_STABLE_CONES
110 nb_hash_cones_total = 0;
111 nb_hash_occupied_total = 0;
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;
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)";
180 bool unclustered_left;
181 rerun_allowed =
false;
199 }
while ((unclustered_left) && (
n_left>0) && (_n_pass_max!=0));
216 Esplit_merge_scale _split_merge_scale){
237void CSphsiscone::_initialise_if_needed(){
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);
284string siscone_package_name(){
285 return SISCONE_PACKAGE_NAME;
293string 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
std::vector< std::vector< CSphmomentum > > protocones_list
list of protocones found pass-by-pass
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
Esplit_merge_scale split_merge_scale
the following parameter controls the variable we're using for the split-merge process i....
int perform(double overlap_tshold, double Emin=0.0)
really do the splitting and merging At the end, the vector jets is filled with the jets found.
int partial_clear()
partial clearance
int add_hardest_protocone_to_jets(std::vector< CSphmomentum > *protocones, double R2, double Emin=0.0)
remove the hardest protocone and declare it a a jet
int init_pleft()
build initial list of left particles
std::vector< CSphmomentum > p_uncol_hard
list of particles remaining with collinear clustering
int init_particles(std::vector< CSphmomentum > &_particles)
initialisation function for particle list
int n_left
numer of particles that does not belong to any jet
std::vector< CSphjet > jets
list of jets
CSphsplit_merge_ptcomparison ptcomparison
member used for detailed comparisons of pt's
int add_protocones(std::vector< CSphmomentum > *protocones, double R2, double Emin=0.0)
add a list of protocones
void init(std::vector< CSphmomentum > &_particle_list)
initialisation
int get_stable_cones(double _radius)
compute stable cones.
double R2
cone radius SQUARED
std::vector< CSphmomentum > protocones
list of stable cones