30#ifndef __SPH_SPLIT_MERGE_H__
31#define __SPH_SPLIT_MERGE_H__
34#include <siscone/config.h>
43namespace siscone_spherical{
45const int CJET_INEXISTENT_PASS = -2;
106enum Esplit_merge_scale {
112std::string split_merge_scale_name(Esplit_merge_scale sms);
164typedef std::multiset<siscone_spherical::CSphjet,CSphsplit_merge_ptcomparison>::iterator cjet_iterator;
167typedef std::vector<siscone_spherical::CSphjet>::iterator jet_iterator;
196 int init(std::vector<CSphmomentum> &_particles, std::vector<CSphmomentum> *protocones,
double R2,
double Emin=0.0);
222 use_E_weighted_splitting = _use_E_weighted_splitting;
276 _user_scale = user_scale_in;
305 int add_protocones(std::vector<CSphmomentum> *protocones,
double R2,
double Emin=0.0);
328 int perform(
double overlap_tshold,
double Emin=0.0);
401 bool get_overlap(
const CSphjet &j1,
const CSphjet &j2,
double *v);
415 bool split(cjet_iterator &it_j1, cjet_iterator &it_j2);
425 bool merge(cjet_iterator &it_j1, cjet_iterator &it_j2);
444 void compute_Etilde(
CSphjet &j);
448#ifdef SISCONE_USES_UNIQUE_PTR_AS_AUTO_PTR
449 std::unique_ptr<std::multiset<CSphjet,CSphsplit_merge_ptcomparison> > candidates;
451 std::auto_ptr<std::multiset<CSphjet,CSphsplit_merge_ptcomparison> > candidates;
462 bool use_E_weighted_splitting;
468#ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES
470 std::set<siscone::Creference> cand_refs;
int pass
pass at which the jet has been found It starts at 0 (first pass), -1 means infinite rapidity (it will...
double sm_var2
ordering variable used for ordering and overlap in the split–merge.
double E_tilde
sum of E_i [ 1 +|p_i x p_J|^2/(|p_i|^2 E_J^2)]
CSphmomentum v
jet momentum
std::vector< int > contents
particle contents (list of indices)
CSphtheta_phi_range range
covered range in eta-phi
int n
number of particles inside
base class for dynamic coordinates management
base class for user-defined ordering of stable cones
virtual bool is_larger(const CSphjet &a, const CSphjet &b) const
returns true when the scale associated with jet a is larger than the scale associated with jet b
virtual ~Cuser_scale_base()
empty virtual dtor
virtual double operator()(const CSphjet &jet) const =0
the scale associated with a given jet
a class that allows us to carry out comparisons of pt of jets, using information from exact particle ...
std::vector< CSphmomentum > * particles
pointer to the list of particles
CSphsplit_merge_ptcomparison()
default ctor
bool operator()(const CSphjet &jet1, const CSphjet &jet2) const
comparison of 2 CSphjet
Esplit_merge_scale split_merge_scale
the following parameter controls the variable we're using for the split-merge process i....
std::vector< double > * particles_norm2
pointer to the particles's norm^2
void get_difference(const CSphjet &j1, const CSphjet &j2, CSphmomentum *v, double *E_tilde) const
get the difference between 2 jets, calculated such that rounding errors will not affect the result ev...
std::string SM_scale_name() const
return the name corresponding to the SM scale variable
Class used to split and merge jets.
double stable_cone_soft_E2_cutoff
Energy cutoff for the particles to put in p_uncol_hard this is meant to allow removing soft particles...
int show()
show jets/candidates status
int idx_size
number of elements in indices1
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
double most_ambiguous_split
minimal difference in squared distance between a particle and two overlapping protojets when doing a ...
double SM_var2_hardest_cut_off
stop split–merge or progressive-removal when the squared SM_var of the hardest protojet is below this...
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 full_clear()
full clearance
std::vector< double > particles_norm2
norm^2 of the particle (3-vect part)
int n_pass
index of the run
CSphsplit_merge()
default ctor
int init_pleft()
build initial list of left particles
int init(std::vector< CSphmomentum > &_particles, std::vector< CSphmomentum > *protocones, double R2, double Emin=0.0)
initialisation function
~CSphsplit_merge()
default dtor
std::vector< CSphmomentum > p_remain
list of particles remaining to deal with
const Cuser_scale_base * user_scale() const
return the user-defined scale (NULL if none)
void set_user_scale(const Cuser_scale_base *user_scale_in)
associate a user-defined scale to order the stable cones
int save_contents(FILE *flux)
save final jets
int merge_collinear_and_remove_soft()
build the list 'p_uncol_hard' from p_remain by clustering collinear particles note that thins in only...
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
bool merge_identical_protocones
The following flag indicates that identical protocones are to be merged automatically each time aroun...
int n_left
numer of particles that does not belong to any jet
int set_E_weighted_splitting(bool _use_E_weighted_splitting)
use an energy-dependent boundary for splitting When called with true, the criterium for splitting two...
int * indices
maximal size array for indices works
std::vector< CSphmomentum > particles
list of particles
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
class for holding a covering range in eta-phi