--- /srv/reproducible-results/rbuild-debian/r-b-build.sDpncMPO/b1/siscone_3.0.5-2_i386.changes +++ /srv/reproducible-results/rbuild-debian/r-b-build.sDpncMPO/b2/siscone_3.0.5-2_i386.changes ├── Files │ @@ -1,10 +1,10 @@ │ │ a79185bcefd31847d490b1481ad80474 88876 libdevel optional libsiscone-dev_3.0.5-2_i386.deb │ b18f100be821ddf918909d9f70ee3ecf 79660 libdevel optional libsiscone-spherical-dev_3.0.5-2_i386.deb │ dc876a0a4ce739c978538e6eb1cc5220 415592 debug optional libsiscone-spherical0v5-dbgsym_3.0.5-2_i386.deb │ 6af775b6d8de4bfc44e456d8b8b2c712 64544 libs optional libsiscone-spherical0v5_3.0.5-2_i386.deb │ fc69bd2c4ab5a8a86014cb1ded2872ff 488688 debug optional libsiscone0v5-dbgsym_3.0.5-2_i386.deb │ 725118a762b2f07d271fe052e1844926 70620 libs optional libsiscone0v5_3.0.5-2_i386.deb │ - c3af25106aaea9f7db11aa68146c1b15 1186464 doc optional siscone-doc-html_3.0.5-2_all.deb │ - 1712200196f5c38532c03f419cd8517f 1609316 doc optional siscone-doc-pdf_3.0.5-2_all.deb │ + 6ec6705b657a991695ac0611dac2032a 1187416 doc optional siscone-doc-html_3.0.5-2_all.deb │ + c13dc7e417e2059a70aa2767cf8093d8 1610080 doc optional siscone-doc-pdf_3.0.5-2_all.deb │ ee8a36e6ed6ae32143424e71fcc9dc11 34968 devel optional siscone-examples_3.0.5-2_all.deb ├── siscone-doc-html_3.0.5-2_all.deb │ ├── file list │ │ @@ -1,3 +1,3 @@ │ │ -rw-r--r-- 0 0 0 4 2023-01-10 17:32:40.000000 debian-binary │ │ --rw-r--r-- 0 0 0 8564 2023-01-10 17:32:40.000000 control.tar.xz │ │ --rw-r--r-- 0 0 0 1177708 2023-01-10 17:32:40.000000 data.tar.xz │ │ +-rw-r--r-- 0 0 0 8568 2023-01-10 17:32:40.000000 control.tar.xz │ │ +-rw-r--r-- 0 0 0 1178656 2023-01-10 17:32:40.000000 data.tar.xz │ ├── control.tar.xz │ │ ├── control.tar │ │ │ ├── ./control │ │ │ │ @@ -1,13 +1,13 @@ │ │ │ │ Package: siscone-doc-html │ │ │ │ Source: siscone │ │ │ │ Version: 3.0.5-2 │ │ │ │ Architecture: all │ │ │ │ Maintainer: Debian Science Maintainers │ │ │ │ -Installed-Size: 5801 │ │ │ │ +Installed-Size: 5827 │ │ │ │ Depends: libjs-jquery │ │ │ │ Section: doc │ │ │ │ Priority: optional │ │ │ │ Multi-Arch: foreign │ │ │ │ Homepage: http://projects.hepforge.org/siscone/ │ │ │ │ Description: Developer's reference manual of SISCone (HTML) │ │ │ │ SISCone implements a Seedless Infrared (IR) Safe Cone jet algorithm, it takes │ │ │ ├── ./md5sums │ │ │ │ ├── ./md5sums │ │ │ │ │┄ Files differ │ ├── data.tar.xz │ │ ├── data.tar │ │ │ ├── file list │ │ │ │ @@ -212,15 +212,15 @@ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3191 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/functions_t.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 2319 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/functions_u.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 4264 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/functions_v.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 30418 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/functions_vars.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 2155 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/functions_x.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 5352 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/functions_~.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 31816 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/geom__2d_8cpp_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 30773 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/geom__2d_8h_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 31825 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/geom__2d_8h_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 2552 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/globals.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 2434 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/globals_defs.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 2059 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/globals_vars.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 6197 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/graph_legend.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 23370 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/graph_legend.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 52933 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/hash_8cpp_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 22548 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/hash_8h_source.html │ │ │ │ @@ -291,30 +291,30 @@ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 95 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/nav_g.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 98 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/nav_h.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 114 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/nav_hd.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 123 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/open.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 52457 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/options_8cpp_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 19815 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/options_8h_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 151303 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/protocones_8cpp_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 40112 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/protocones_8h_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 69506 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/quadtree_8cpp_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 22117 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/quadtree_8h_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 27192 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/ranlux_8cpp_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 42170 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/protocones_8h_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 78918 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/quadtree_8cpp_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 23577 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/quadtree_8h_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 27768 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/ranlux_8cpp_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 7902 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/ranlux_8h.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 1021 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/ranlux_8h__dep__incl.map │ │ │ │ -rw-r--r-- 0 root (0) root (0) 12914 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/ranlux_8h__dep__incl.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 9111 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/ranlux_8h_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 30528 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/reference_8cpp_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 24185 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/reference_8h_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 31723 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/reference_8cpp_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 25627 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/reference_8h_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 20315 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/sample_8cpp_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 82495 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/siscone_2area_8cpp_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 64453 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/siscone_8cpp_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 22318 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/siscone_8h_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 69585 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/siscone_8cpp_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 23914 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/siscone_8h_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 8011 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/siscone__error_8cpp_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 14494 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/siscone__error_8h_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15206 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/siscone__error_8h_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 38933 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/spherical_2geom__2d_8cpp_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 22148 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/spherical_2geom__2d_8h_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 47437 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/spherical_2hash_8cpp_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 22599 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/spherical_2hash_8h_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 81644 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/spherical_2momentum_8cpp_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 70242 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/spherical_2momentum_8h_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 165886 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-html/html/devel/spherical_2protocones_8cpp_source.html │ │ │ ├── ./usr/share/doc/siscone-doc-html/html/devel/geom__2d_8h_source.html │ │ │ │ @@ -109,21 +109,21 @@ │ │ │ │
67
│ │ │ │
68
│ │ │ │
│ │ │ │
73class Ctwovect {
│ │ │ │
74public:
│ │ │ │
76 Ctwovect() : x(0.0), y(0.0) {}
│ │ │ │
77
│ │ │ │ -
81 Ctwovect(double _x, double _y) : x(_x), y(_y) {}
│ │ │ │ +
81 Ctwovect(double _x, double _y) : x(_x), y(_y) {}
│ │ │ │
82
│ │ │ │
84 double x, y;
│ │ │ │
85
│ │ │ │
87 inline double mod2() const {return pow2(x)+pow2(y);}
│ │ │ │
88
│ │ │ │ -
90 inline double modulus() const {return sqrt(mod2());}
│ │ │ │ +
90 inline double modulus() const {return sqrt(mod2());}
│ │ │ │
91};
│ │ │ │
│ │ │ │
92
│ │ │ │
93
│ │ │ │
98inline double dot_product(const Ctwovect & a, const Ctwovect & b) {
│ │ │ │
99 return a.x*b.x + a.y*b.y;
│ │ │ │
100}
│ │ │ │ @@ -135,35 +135,35 @@ │ │ │ │
110
│ │ │ │
111
│ │ │ │
│ │ │ │ │ │ │ │
121public:
│ │ │ │ │ │ │ │
124
│ │ │ │ -
130 Ceta_phi_range(double c_eta, double c_phi, double R);
│ │ │ │ +
130 Ceta_phi_range(double c_eta, double c_phi, double R);
│ │ │ │
131
│ │ │ │ - │ │ │ │ + │ │ │ │
135
│ │ │ │
140 int add_particle(const double eta, const double phi);
│ │ │ │
141
│ │ │ │
143 unsigned int eta_range;
│ │ │ │
144
│ │ │ │
146 unsigned int phi_range;
│ │ │ │
147
│ │ │ │
148 // extremal value for eta
│ │ │ │
149 static double eta_min;
│ │ │ │
150 static double eta_max;
│ │ │ │
151
│ │ │ │
152private:
│ │ │ │
154 inline unsigned int get_eta_cell(double eta){
│ │ │ │ -
155 return (unsigned int) (1u << ((int) (32*((eta-eta_min)/(eta_max-eta_min)))));
│ │ │ │ +
155 return (unsigned int) (1u << ((int) (32*((eta-eta_min)/(eta_max-eta_min)))));
│ │ │ │
156 }
│ │ │ │
157
│ │ │ │
159 inline unsigned int get_phi_cell(double phi){
│ │ │ │ -
160 return (unsigned int) (1u << ((int) (32*phi/twopi+16)%32));
│ │ │ │ +
160 return (unsigned int) (1u << ((int) (32*phi/twopi+16)%32));
│ │ │ │
161 }
│ │ │ │
162};
│ │ │ │
│ │ │ │
163
│ │ │ │
168bool is_range_overlap(const Ceta_phi_range &r1, const Ceta_phi_range &r2);
│ │ │ │
169
│ │ │ │
175const Ceta_phi_range range_union(const Ceta_phi_range &r1, const Ceta_phi_range &r2);
│ │ │ │ @@ -181,14 +181,15 @@ │ │ │ │
unsigned int phi_range
phi range as a binary coding of covered cells
Definition geom_2d.h:146
│ │ │ │
class for holding a two-vector
Definition geom_2d.h:73
│ │ │ │
double mod2() const
norm (modulud square) of the vector
Definition geom_2d.h:87
│ │ │ │
double x
vector coordinates
Definition geom_2d.h:84
│ │ │ │
Ctwovect()
default ctor
Definition geom_2d.h:76
│ │ │ │
double modulus() const
modulus of the vector
Definition geom_2d.h:90
│ │ │ │
Ctwovect(double _x, double _y)
ctor with initialisation
Definition geom_2d.h:81
│ │ │ │ +
a circulator that is foreseen to take as template member either a pointer or an iterator;
Definition circulator.h:36
│ │ │ │
│ │ │ │
const double twopi
definition of 2*M_PI which is useful a bit everyhere!
Definition defines.h:114
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -59,21 +59,21 @@ │ │ │ │ │ 66inline double pow2(double x) {return x*x;} │ │ │ │ │ 67 │ │ │ │ │ 68 │ │ │ │ │ _7_3class _C_t_w_o_v_e_c_t { │ │ │ │ │ 74public: │ │ │ │ │ _7_6 _C_t_w_o_v_e_c_t() : _x(0.0), y(0.0) {} │ │ │ │ │ 77 │ │ │ │ │ -_8_1 _C_t_w_o_v_e_c_t(double _x, double _y) : _x(_x), y(_y) {} │ │ │ │ │ +_8_1 _C_t_w_o_v_e_c_t(double ___x, double ___y) : _x(___x), y(___y) {} │ │ │ │ │ 82 │ │ │ │ │ _8_4 double _x, y; │ │ │ │ │ 85 │ │ │ │ │ _8_7 inline double _m_o_d_2() const {return pow2(_x)+pow2(y);} │ │ │ │ │ 88 │ │ │ │ │ -_9_0 inline double _m_o_d_u_l_u_s() const {return sqrt(_m_o_d_2());} │ │ │ │ │ +_9_0 inline double _m_o_d_u_l_u_s() const {return _s_q_r_t(_m_o_d_2());} │ │ │ │ │ 91}; │ │ │ │ │ 92 │ │ │ │ │ 93 │ │ │ │ │ 98inline double dot_product(const Ctwovect & a, const Ctwovect & b) { │ │ │ │ │ 99 return a.x*b.x + a.y*b.y; │ │ │ │ │ 100} │ │ │ │ │ 101 │ │ │ │ │ @@ -83,36 +83,36 @@ │ │ │ │ │ 109} │ │ │ │ │ 110 │ │ │ │ │ 111 │ │ │ │ │ _1_2_0class _C_e_t_a___p_h_i___r_a_n_g_e{ │ │ │ │ │ 121public: │ │ │ │ │ 123 _C_e_t_a___p_h_i___r_a_n_g_e(); │ │ │ │ │ 124 │ │ │ │ │ -130 _C_e_t_a___p_h_i___r_a_n_g_e(double c_eta, double c_phi, double R); │ │ │ │ │ +130 _C_e_t_a___p_h_i___r_a_n_g_e(double _c___e_t_a, double _c___p_h_i, double R); │ │ │ │ │ 131 │ │ │ │ │ -134 _C_e_t_a___p_h_i___r_a_n_g_e& _o_p_e_r_a_t_o_r_ _=_ (const _C_e_t_a___p_h_i___r_a_n_g_e &r); │ │ │ │ │ +134 _C_e_t_a___p_h_i___r_a_n_g_e& _o_p_e_r_a_t_o_r_ _=_ (const _C_e_t_a___p_h_i___r_a_n_g_e &_r); │ │ │ │ │ 135 │ │ │ │ │ 140 int _a_d_d___p_a_r_t_i_c_l_e(const double eta, const double phi); │ │ │ │ │ 141 │ │ │ │ │ _1_4_3 unsigned int _e_t_a___r_a_n_g_e; │ │ │ │ │ 144 │ │ │ │ │ _1_4_6 unsigned int _p_h_i___r_a_n_g_e; │ │ │ │ │ 147 │ │ │ │ │ 148 // extremal value for eta │ │ │ │ │ _1_4_9 static double _e_t_a___m_i_n; │ │ │ │ │ _1_5_0 static double _e_t_a___m_a_x; │ │ │ │ │ 151 │ │ │ │ │ 152private: │ │ │ │ │ 154 inline unsigned int get_eta_cell(double eta){ │ │ │ │ │ -155 return (unsigned int) (1u << ((int) (32*((eta-_e_t_a___m_i_n)/(_e_t_a___m_a_x- │ │ │ │ │ +155 return (unsigned int) (1u << ((_i_n_t) (32*((eta-_e_t_a___m_i_n)/(_e_t_a___m_a_x- │ │ │ │ │ _e_t_a___m_i_n))))); │ │ │ │ │ 156 } │ │ │ │ │ 157 │ │ │ │ │ 159 inline unsigned int get_phi_cell(double phi){ │ │ │ │ │ -160 return (unsigned int) (1u << ((int) (32*phi/_t_w_o_p_i+16)%32)); │ │ │ │ │ +160 return (unsigned int) (1u << ((_i_n_t) (32*phi/_t_w_o_p_i+16)%32)); │ │ │ │ │ 161 } │ │ │ │ │ 162}; │ │ │ │ │ 163 │ │ │ │ │ 168bool is_range_overlap(const Ceta_phi_range &r1, const Ceta_phi_range &r2); │ │ │ │ │ 169 │ │ │ │ │ 175const Ceta_phi_range range_union(const Ceta_phi_range &r1, const │ │ │ │ │ Ceta_phi_range &r2); │ │ │ │ │ @@ -170,14 +170,18 @@ │ │ │ │ │ double modulus() const │ │ │ │ │ modulus of the vector │ │ │ │ │ DDeeffiinniittiioonn _g_e_o_m___2_d_._h_:_9_0 │ │ │ │ │ _s_i_s_c_o_n_e_:_:_C_t_w_o_v_e_c_t_:_:_C_t_w_o_v_e_c_t │ │ │ │ │ Ctwovect(double _x, double _y) │ │ │ │ │ ctor with initialisation │ │ │ │ │ DDeeffiinniittiioonn _g_e_o_m___2_d_._h_:_8_1 │ │ │ │ │ +_s_i_s_c_o_n_e_:_:_c_i_r_c_u_l_a_t_o_r │ │ │ │ │ +a circulator that is foreseen to take as template member either a pointer or an │ │ │ │ │ +iterator; │ │ │ │ │ +DDeeffiinniittiioonn _c_i_r_c_u_l_a_t_o_r_._h_:_3_6 │ │ │ │ │ _d_e_f_i_n_e_s_._h │ │ │ │ │ _t_w_o_p_i │ │ │ │ │ const double twopi │ │ │ │ │ definition of 2*M_PI which is useful a bit everyhere! │ │ │ │ │ DDeeffiinniittiioonn _d_e_f_i_n_e_s_._h_:_1_1_4 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/siscone-doc-html/html/devel/protocones_8h_source.html │ │ │ │ @@ -90,52 +90,52 @@ │ │ │ │
39
│ │ │ │
40namespace siscone{
│ │ │ │
41
│ │ │ │
│ │ │ │ │ │ │ │
54public:
│ │ │ │
│ │ │ │ -
56 Cborder_store(Cmomentum * momentum, double centre_eta, double centre_phi) :
│ │ │ │ -
57 mom(momentum), is_in(false) {
│ │ │ │ -
58 angle = atan2(mom->phi - centre_phi, mom->eta - centre_eta);
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
59 }
│ │ │ │
│ │ │ │
60
│ │ │ │ │ │ │ │
62 double angle;
│ │ │ │
63 bool is_in;
│ │ │ │
64};
│ │ │ │
│ │ │ │
65
│ │ │ │
66
│ │ │ │ -
69inline bool operator<(const Cborder_store & a, const Cborder_store & b) {
│ │ │ │ -
70 return a.angle < b.angle;
│ │ │ │ +
69inline bool operator<(const Cborder_store & a, const Cborder_store & b) {
│ │ │ │ +
70 return a.angle < b.angle;
│ │ │ │
71}
│ │ │ │
72
│ │ │ │
73
│ │ │ │
│ │ │ │
82class Cstable_cones : public Cvicinity{
│ │ │ │
83 public:
│ │ │ │ │ │ │ │
86
│ │ │ │ -
88 Cstable_cones(std::vector<Cmomentum> &_particle_list);
│ │ │ │ +
88 Cstable_cones(std::vector<Cmomentum> &_particle_list);
│ │ │ │
89
│ │ │ │ │ │ │ │
92
│ │ │ │ -
97 void init(std::vector<Cmomentum> &_particle_list);
│ │ │ │ +
97 void init(std::vector<Cmomentum> &_particle_list);
│ │ │ │
98
│ │ │ │ -
106 int get_stable_cones(double _radius);
│ │ │ │ +
106 int get_stable_cones(double _radius);
│ │ │ │
107
│ │ │ │
109 std::vector<Cmomentum> protocones;
│ │ │ │
110
│ │ │ │ │ │ │ │
113
│ │ │ │ │ │ │ │
116#ifdef DEBUG_STABLE_CONES
│ │ │ │ -
117 int nb_hash_cones, nb_hash_occupied;
│ │ │ │ + │ │ │ │
118#endif
│ │ │ │
119
│ │ │ │
120 protected:
│ │ │ │
122 double R;
│ │ │ │
123
│ │ │ │
125 double R2;
│ │ │ │
126
│ │ │ │ @@ -160,43 +160,43 @@ │ │ │ │
167 * run through the vicinity of the current parent and for each child
│ │ │ │
168 * indicate which members are cocircular...
│ │ │ │
169 */
│ │ │ │
170 void prepare_cocircular_lists();
│ │ │ │
171
│ │ │ │
179 bool cocircular_check();
│ │ │ │
180
│ │ │ │ -
185 void test_cone_cocircular(Cmomentum & borderless_cone,
│ │ │ │ -
186 std::list<Cmomentum *> & border_list);
│ │ │ │ +
185 void test_cone_cocircular(Cmomentum & borderless_cone,
│ │ │ │ +
186 std::list<Cmomentum *> & border_list);
│ │ │ │
187
│ │ │ │ -
194 void test_stability(Cmomentum & candidate,
│ │ │ │ -
195 const std::vector<Cborder_store> & border_vect);
│ │ │ │ +
194 void test_stability(Cmomentum & candidate,
│ │ │ │ +
195 const std::vector<Cborder_store> & border_vect);
│ │ │ │
196
│ │ │ │
203 void compute_cone_contents();
│ │ │ │
204
│ │ │ │
210 void recompute_cone_contents();
│ │ │ │
211
│ │ │ │
212 /*
│ │ │ │
213 * if we have gone beyond the acceptable threshold of change, compute
│ │ │ │
214 * the cone momentum from particle list. in this version, we use the
│ │ │ │
215 * 'pincluded' information from the Cvicinity class, but we don't
│ │ │ │
216 * change the member cone, only the locally supplied one
│ │ │ │
217 */
│ │ │ │ -
218 void recompute_cone_contents_if_needed(Cmomentum & this_cone, double & this_dpt);
│ │ │ │ +
218 void recompute_cone_contents_if_needed(Cmomentum & this_cone, double & this_dpt);
│ │ │ │
219
│ │ │ │
225 int proceed_with_stability();
│ │ │ │
226
│ │ │ │
227 /*
│ │ │ │
228 * circle intersection.
│ │ │ │
229 * computes the intersection with a circle of given centre and radius.
│ │ │ │
230 * The output takes the form of a checkxor of the intersection's particles
│ │ │ │
231 * - cx circle centre x coordinate
│ │ │ │
232 * - cy circle centre y coordinate
│ │ │ │
233 * return the checkxor for the intersection
│ │ │ │
234 ******************************************************************/
│ │ │ │ -
235 Creference circle_intersect(double cx, double cy);
│ │ │ │ +
235 Creference circle_intersect(double cx, double cy);
│ │ │ │
236
│ │ │ │
238 Cmomentum cone_candidate;
│ │ │ │
239
│ │ │ │
241 std::vector<Cmomentum*> child_list;
│ │ │ │
242
│ │ │ │
245 std::vector< std::pair<Creference,Creference> > multiple_centre_done;
│ │ │ │
246
│ │ │ │ @@ -210,15 +210,15 @@ │ │ │ │
261/*
│ │ │ │
262 * compute the absolute value of the difference between 2 angles.
│ │ │ │
263 * We take care of the 2pi periodicity
│ │ │ │
264 * \param angle1 first angle
│ │ │ │
265 * \param angle2 second angle
│ │ │ │
266 * \return the absolute value of the difference between the angles
│ │ │ │
267 *****************************************************************/
│ │ │ │ -
268inline double abs_dangle(double &angle1, double &angle2);
│ │ │ │ +
268inline double abs_dangle(double &angle1, double &angle2);
│ │ │ │
269
│ │ │ │
270}
│ │ │ │
271#endif
│ │ │ │
class for storing a border momentum (in context of co-circularity checks).
Definition protocones.h:53
│ │ │ │
Cborder_store(Cmomentum *momentum, double centre_eta, double centre_phi)
default ctor
Definition protocones.h:56
│ │ │ │
double angle
angle w.r.t. circle centre
Definition protocones.h:62
│ │ │ │
bool is_in
inclusion status of the particle
Definition protocones.h:63
│ │ │ │ @@ -236,14 +236,15 @@ │ │ │ │
double R
cone radius
Definition protocones.h:122
│ │ │ │
int get_stable_cones(double _radius)
compute stable cones.
│ │ │ │
hash_cones * hc
list of candidates
Definition protocones.h:112
│ │ │ │
~Cstable_cones()
default dtor
│ │ │ │
Cstable_cones(std::vector< Cmomentum > &_particle_list)
ctor with initialisation (sse init for details)
│ │ │ │
element in the vicinity of a parent.
Definition vicinity.h:63
│ │ │ │
list of element in the vicinity of a parent.
Definition vicinity.h:95
│ │ │ │ +
a circulator that is foreseen to take as template member either a pointer or an iterator;
Definition circulator.h:36
│ │ │ │
list of cones candidates.
Definition hash.h:62
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -39,49 +39,49 @@ │ │ │ │ │ 37 │ │ │ │ │ 38#include "_d_e_f_i_n_e_s_._h" │ │ │ │ │ 39 │ │ │ │ │ 40namespace siscone{ │ │ │ │ │ 41 │ │ │ │ │ _5_3class _C_b_o_r_d_e_r___s_t_o_r_e{ │ │ │ │ │ 54public: │ │ │ │ │ -_5_6 _C_b_o_r_d_e_r___s_t_o_r_e(_C_m_o_m_e_n_t_u_m * momentum, double centre_eta, double centre_phi) : │ │ │ │ │ -57 _m_o_m(momentum), _i_s___i_n(false) { │ │ │ │ │ -58 _a_n_g_l_e = atan2(_m_o_m->_p_h_i - centre_phi, _m_o_m->_e_t_a - centre_eta); │ │ │ │ │ +_5_6 _C_b_o_r_d_e_r___s_t_o_r_e(_C_m_o_m_e_n_t_u_m * _m_o_m_e_n_t_u_m, double _c_e_n_t_r_e___e_t_a, double _c_e_n_t_r_e___p_h_i) : │ │ │ │ │ +57 _m_o_m(_m_o_m_e_n_t_u_m), _i_s___i_n(_f_a_l_s_e) { │ │ │ │ │ +58 _a_n_g_l_e = _a_t_a_n_2(_m_o_m->_p_h_i - _c_e_n_t_r_e___p_h_i, _m_o_m->_e_t_a - _c_e_n_t_r_e___e_t_a); │ │ │ │ │ 59 } │ │ │ │ │ 60 │ │ │ │ │ _6_1 _C_m_o_m_e_n_t_u_m * _m_o_m; │ │ │ │ │ _6_2 double _a_n_g_l_e; │ │ │ │ │ _6_3 bool _i_s___i_n; │ │ │ │ │ 64}; │ │ │ │ │ 65 │ │ │ │ │ 66 │ │ │ │ │ -69inline bool operator<(const _C_b_o_r_d_e_r___s_t_o_r_e & a, const _C_b_o_r_d_e_r___s_t_o_r_e & b) { │ │ │ │ │ -70 return a._a_n_g_l_e < b._a_n_g_l_e; │ │ │ │ │ +69inline bool _o_p_e_r_a_t_o_r_<(const _C_b_o_r_d_e_r___s_t_o_r_e & _a, const _C_b_o_r_d_e_r___s_t_o_r_e & _b) { │ │ │ │ │ +70 return _a.angle < _b.angle; │ │ │ │ │ 71} │ │ │ │ │ 72 │ │ │ │ │ 73 │ │ │ │ │ _8_2class _C_s_t_a_b_l_e___c_o_n_e_s : public _C_v_i_c_i_n_i_t_y{ │ │ │ │ │ 83 public: │ │ │ │ │ 85 _C_s_t_a_b_l_e___c_o_n_e_s(); │ │ │ │ │ 86 │ │ │ │ │ -_8_8 _C_s_t_a_b_l_e___c_o_n_e_s(std::vector &_particle_list); │ │ │ │ │ +_8_8 _C_s_t_a_b_l_e___c_o_n_e_s(std::vector &___p_a_r_t_i_c_l_e___l_i_s_t); │ │ │ │ │ 89 │ │ │ │ │ 91 _~_C_s_t_a_b_l_e___c_o_n_e_s(); │ │ │ │ │ 92 │ │ │ │ │ -97 void _i_n_i_t(std::vector &_particle_list); │ │ │ │ │ +97 void _i_n_i_t(std::vector &___p_a_r_t_i_c_l_e___l_i_s_t); │ │ │ │ │ 98 │ │ │ │ │ -106 int _g_e_t___s_t_a_b_l_e___c_o_n_e_s(double _radius); │ │ │ │ │ +106 int _g_e_t___s_t_a_b_l_e___c_o_n_e_s(double ___r_a_d_i_u_s); │ │ │ │ │ 107 │ │ │ │ │ _1_0_9 std::vector _p_r_o_t_o_c_o_n_e_s; │ │ │ │ │ 110 │ │ │ │ │ _1_1_2 _h_a_s_h___c_o_n_e_s *_h_c; │ │ │ │ │ 113 │ │ │ │ │ _1_1_5 int _n_b___t_o_t; │ │ │ │ │ 116#ifdef DEBUG_STABLE_CONES │ │ │ │ │ -117 int nb_hash_cones, nb_hash_occupied; │ │ │ │ │ +117 int _n_b___h_a_s_h___c_o_n_e_s, _n_b___h_a_s_h___o_c_c_u_p_i_e_d; │ │ │ │ │ 118#endif │ │ │ │ │ 119 │ │ │ │ │ 120 protected: │ │ │ │ │ _1_2_2 double _R; │ │ │ │ │ 123 │ │ │ │ │ _1_2_5 double _R_2; │ │ │ │ │ 126 │ │ │ │ │ @@ -106,44 +106,44 @@ │ │ │ │ │ 167 * run through the vicinity of the current parent and for each child │ │ │ │ │ 168 * indicate which members are cocircular... │ │ │ │ │ 169 */ │ │ │ │ │ 170 void prepare_cocircular_lists(); │ │ │ │ │ 171 │ │ │ │ │ 179 bool cocircular_check(); │ │ │ │ │ 180 │ │ │ │ │ -185 void test_cone_cocircular(_C_m_o_m_e_n_t_u_m & borderless_cone, │ │ │ │ │ -186 std::list & border_list); │ │ │ │ │ +185 void test_cone_cocircular(_C_m_o_m_e_n_t_u_m & _b_o_r_d_e_r_l_e_s_s___c_o_n_e, │ │ │ │ │ +186 std::list & _b_o_r_d_e_r___l_i_s_t); │ │ │ │ │ 187 │ │ │ │ │ -194 void test_stability(_C_m_o_m_e_n_t_u_m & candidate, │ │ │ │ │ -195 const std::vector & border_vect); │ │ │ │ │ +194 void test_stability(_C_m_o_m_e_n_t_u_m & _c_a_n_d_i_d_a_t_e, │ │ │ │ │ +195 const std::vector & _b_o_r_d_e_r___v_e_c_t); │ │ │ │ │ 196 │ │ │ │ │ 203 void compute_cone_contents(); │ │ │ │ │ 204 │ │ │ │ │ 210 void recompute_cone_contents(); │ │ │ │ │ 211 │ │ │ │ │ 212 /* │ │ │ │ │ 213 * if we have gone beyond the acceptable threshold of change, compute │ │ │ │ │ 214 * the cone momentum from particle list. in this version, we use the │ │ │ │ │ 215 * 'pincluded' information from the Cvicinity class, but we don't │ │ │ │ │ 216 * change the member cone, only the locally supplied one │ │ │ │ │ 217 */ │ │ │ │ │ -218 void recompute_cone_contents_if_needed(_C_m_o_m_e_n_t_u_m & this_cone, double & │ │ │ │ │ -this_dpt); │ │ │ │ │ +218 void recompute_cone_contents_if_needed(_C_m_o_m_e_n_t_u_m & _t_h_i_s___c_o_n_e, double & │ │ │ │ │ +_t_h_i_s___d_p_t); │ │ │ │ │ 219 │ │ │ │ │ 225 int proceed_with_stability(); │ │ │ │ │ 226 │ │ │ │ │ 227 /* │ │ │ │ │ 228 * circle intersection. │ │ │ │ │ 229 * computes the intersection with a circle of given centre and radius. │ │ │ │ │ 230 * The output takes the form of a checkxor of the intersection's particles │ │ │ │ │ 231 * - cx circle centre x coordinate │ │ │ │ │ 232 * - cy circle centre y coordinate │ │ │ │ │ 233 * return the checkxor for the intersection │ │ │ │ │ 234 ******************************************************************/ │ │ │ │ │ -235 _C_r_e_f_e_r_e_n_c_e circle_intersect(double cx, double cy); │ │ │ │ │ +235 _C_r_e_f_e_r_e_n_c_e circle_intersect(double _c_x, double _c_y); │ │ │ │ │ 236 │ │ │ │ │ 238 _C_m_o_m_e_n_t_u_m cone_candidate; │ │ │ │ │ 239 │ │ │ │ │ 241 std::vector child_list; │ │ │ │ │ 242 │ │ │ │ │ 245 std::vector< std::pair > multiple_centre_done; │ │ │ │ │ 246 │ │ │ │ │ @@ -156,15 +156,15 @@ │ │ │ │ │ 261/* │ │ │ │ │ 262 * compute the absolute value of the difference between 2 angles. │ │ │ │ │ 263 * We take care of the 2pi periodicity │ │ │ │ │ 264 * \param angle1 first angle │ │ │ │ │ 265 * \param angle2 second angle │ │ │ │ │ 266 * \return the absolute value of the difference between the angles │ │ │ │ │ 267 *****************************************************************/ │ │ │ │ │ -268inline double abs_dangle(double &angle1, double &angle2); │ │ │ │ │ +268inline double abs_dangle(double &_a_n_g_l_e_1, double &_a_n_g_l_e_2); │ │ │ │ │ 269 │ │ │ │ │ 270} │ │ │ │ │ 271#endif │ │ │ │ │ _s_i_s_c_o_n_e_:_:_C_b_o_r_d_e_r___s_t_o_r_e │ │ │ │ │ class for storing a border momentum (in context of co-circularity checks). │ │ │ │ │ DDeeffiinniittiioonn _p_r_o_t_o_c_o_n_e_s_._h_:_5_3 │ │ │ │ │ _s_i_s_c_o_n_e_:_:_C_b_o_r_d_e_r___s_t_o_r_e_:_:_C_b_o_r_d_e_r___s_t_o_r_e │ │ │ │ │ @@ -241,13 +241,17 @@ │ │ │ │ │ ctor with initialisation (sse init for details) │ │ │ │ │ _s_i_s_c_o_n_e_:_:_C_v_i_c_i_n_i_t_y___e_l_m │ │ │ │ │ element in the vicinity of a parent. │ │ │ │ │ DDeeffiinniittiioonn _v_i_c_i_n_i_t_y_._h_:_6_3 │ │ │ │ │ _s_i_s_c_o_n_e_:_:_C_v_i_c_i_n_i_t_y │ │ │ │ │ list of element in the vicinity of a parent. │ │ │ │ │ DDeeffiinniittiioonn _v_i_c_i_n_i_t_y_._h_:_9_5 │ │ │ │ │ +_s_i_s_c_o_n_e_:_:_c_i_r_c_u_l_a_t_o_r │ │ │ │ │ +a circulator that is foreseen to take as template member either a pointer or an │ │ │ │ │ +iterator; │ │ │ │ │ +DDeeffiinniittiioonn _c_i_r_c_u_l_a_t_o_r_._h_:_3_6 │ │ │ │ │ _s_i_s_c_o_n_e_:_:_h_a_s_h___c_o_n_e_s │ │ │ │ │ list of cones candidates. │ │ │ │ │ DDeeffiinniittiioonn _h_a_s_h_._h_:_6_2 │ │ │ │ │ _d_e_f_i_n_e_s_._h │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/siscone-doc-html/html/devel/quadtree_8cpp_source.html │ │ │ │ @@ -92,44 +92,44 @@ │ │ │ │
40 * The elements at each node are of 'Cmomentum' type. *
│ │ │ │
41 *******************************************************************/
│ │ │ │
42
│ │ │ │
43// default ctor
│ │ │ │
44//--------------
│ │ │ │
│ │ │ │ │ │ │ │ -
46 v = NULL;
│ │ │ │ +
46 v = NULL;
│ │ │ │
47
│ │ │ │ -
48 children[0][0] = children[0][1] = children[1][0] = children[1][1] = NULL;
│ │ │ │ +
48 children[0][0] = children[0][1] = children[1][0] = children[1][1] = NULL;
│ │ │ │
49 has_child = false;
│ │ │ │
50}
│ │ │ │
│ │ │ │
51
│ │ │ │
52
│ │ │ │
53// ctor with initialisation (see init for details)
│ │ │ │
54//--------------------------
│ │ │ │
│ │ │ │ -
55Cquadtree::Cquadtree(double _x, double _y, double _half_size_x, double _half_size_y){
│ │ │ │ -
56 v = NULL;
│ │ │ │ +
55Cquadtree::Cquadtree(double _x, double _y, double _half_size_x, double _half_size_y){
│ │ │ │ +
56 v = NULL;
│ │ │ │
57
│ │ │ │ -
58 children[0][0] = children[0][1] = children[1][0] = children[1][1] = NULL;
│ │ │ │ +
58 children[0][0] = children[0][1] = children[1][0] = children[1][1] = NULL;
│ │ │ │
59 has_child = false;
│ │ │ │
60
│ │ │ │ -
61 init(_x, _y, _half_size_x, _half_size_y);
│ │ │ │ + │ │ │ │
62}
│ │ │ │
│ │ │ │
63
│ │ │ │
64
│ │ │ │
65// default destructor
│ │ │ │
66// at destruction, everything is destroyed except
│ │ │ │
67// physical values at the leaves
│ │ │ │
68//------------------------------------------------
│ │ │ │
│ │ │ │ │ │ │ │
70 if (has_child){
│ │ │ │ -
71 if (v!=NULL) delete v;
│ │ │ │ +
71 if (v!=NULL) delete v;
│ │ │ │
72 delete children[0][0];
│ │ │ │
73 delete children[0][1];
│ │ │ │
74 delete children[1][0];
│ │ │ │
75 delete children[1][1];
│ │ │ │
76 }
│ │ │ │
77}
│ │ │ │
│ │ │ │ @@ -143,86 +143,86 @@ │ │ │ │
85 * - _y y-position of the center
│ │ │ │
86 * - half_size_x half x-size of the cell
│ │ │ │
87 * - half_size_y half y-size of the cell
│ │ │ │
88 * return 0 on success, 1 on error. Note that if the cell
│ │ │ │
89 * is already filled, we return an error.
│ │ │ │
90 ******************************************************************/
│ │ │ │
│ │ │ │ -
91int Cquadtree::init(double _x, double _y, double _half_size_x, double _half_size_y){
│ │ │ │ -
92 if (v!=NULL)
│ │ │ │ +
91int Cquadtree::init(double _x, double _y, double _half_size_x, double _half_size_y){
│ │ │ │ +
92 if (v!=NULL)
│ │ │ │
93 return 1;
│ │ │ │
94
│ │ │ │ -
95 centre_x = _x;
│ │ │ │ -
96 centre_y = _y;
│ │ │ │ -
97 half_size_x = _half_size_x;
│ │ │ │ -
98 half_size_y = _half_size_y;
│ │ │ │ +
95 centre_x = _x;
│ │ │ │ +
96 centre_y = _y;
│ │ │ │ + │ │ │ │ + │ │ │ │
99
│ │ │ │
100 return 0;
│ │ │ │
101}
│ │ │ │
│ │ │ │
102
│ │ │ │
103
│ │ │ │
104/*
│ │ │ │
105 * adding a particle to the tree.
│ │ │ │
106 * This method adds one vector to the quadtree structure which
│ │ │ │
107 * is updated consequently.
│ │ │ │
108 * - v vector to add
│ │ │ │
109 * return 0 on success 1 on error
│ │ │ │
110 ******************************************************************/
│ │ │ │
│ │ │ │ - │ │ │ │ + │ │ │ │
112 // Description of the method:
│ │ │ │
113 // --------------------------
│ │ │ │
114 // the addition process goes as follows:
│ │ │ │
115 // 1. check if the cell is empty, in which case, add the particle
│ │ │ │
116 // here and leave.
│ │ │ │
117 // 2. If there is a unique particle already inside,
│ │ │ │
118 // (a) create children
│ │ │ │
119 // (b) forward the existing particle to the appropriate child
│ │ │ │
120 // 3. Add current particle to this cell and forward to the
│ │ │ │
121 // adequate child
│ │ │ │
122 // NOTE: we assume in the whole procedure that the particle is
│ │ │ │
123 // indeed inside the cell !
│ │ │ │
124
│ │ │ │
125 // step 1: the case of empty cells
│ │ │ │ -
126 if (v==NULL){
│ │ │ │ -
127 v = v_add;
│ │ │ │ +
126 if (v==NULL){
│ │ │ │ +
127 v = v_add;
│ │ │ │
128 return 0;
│ │ │ │
129 }
│ │ │ │
130
│ │ │ │
131 // step 2: additional work if 1! particle already present
│ │ │ │
132 // we use the fact that only 1-particle systems have no child
│ │ │ │
133 if (!has_child){
│ │ │ │ -
134 double new_half_size_x = 0.5*half_size_x;
│ │ │ │ -
135 double new_half_size_y = 0.5*half_size_y;
│ │ │ │ +
134 double new_half_size_x = 0.5*half_size_x;
│ │ │ │ +
135 double new_half_size_y = 0.5*half_size_y;
│ │ │ │
136 // create children
│ │ │ │ -
137 children[0][0] = new Cquadtree(centre_x-new_half_size_x, centre_y-new_half_size_y,
│ │ │ │ -
138 new_half_size_x, new_half_size_y);
│ │ │ │ -
139 children[0][1] = new Cquadtree(centre_x-new_half_size_x, centre_y+new_half_size_y,
│ │ │ │ -
140 new_half_size_x, new_half_size_y);
│ │ │ │ -
141 children[1][0] = new Cquadtree(centre_x+new_half_size_x, centre_y-new_half_size_y,
│ │ │ │ -
142 new_half_size_x, new_half_size_y);
│ │ │ │ -
143 children[1][1] = new Cquadtree(centre_x+new_half_size_x, centre_y+new_half_size_y,
│ │ │ │ -
144 new_half_size_x, new_half_size_y);
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
145
│ │ │ │
146 has_child = true;
│ │ │ │
147
│ │ │ │
148 // forward to child
│ │ │ │
149 //? The following line assumes 'true'==1 and 'false'==0
│ │ │ │
150 // Note: v being a single particle, eta and phi are correct
│ │ │ │ │ │ │ │
152
│ │ │ │
153 // copy physical params
│ │ │ │
154 v = new Cmomentum(*v);
│ │ │ │
155 }
│ │ │ │
156
│ │ │ │
157 // step 3: add new particle
│ │ │ │
158 // Note: v_add being a single particle, eta and phi are correct
│ │ │ │ -
159 children[v_add->eta>centre_x][v_add->phi>centre_y]->add(v_add);
│ │ │ │ -
160 *v+=*v_add;
│ │ │ │ + │ │ │ │ +
160 *v+=*v_add;
│ │ │ │
161
│ │ │ │
162 return 0;
│ │ │ │
163}
│ │ │ │
│ │ │ │
164
│ │ │ │
165
│ │ │ │
166/*
│ │ │ │ @@ -232,112 +232,112 @@ │ │ │ │
170 * in the circle.
│ │ │ │
171 * - cx circle centre x coordinate
│ │ │ │
172 * - cy circle centre y coordinate
│ │ │ │
173 * - cR2 circle radius SQUARED
│ │ │ │
174 * return the checksum for the intersection
│ │ │ │
175 ******************************************************************/
│ │ │ │
│ │ │ │ -
176Creference Cquadtree::circle_intersect(double cx, double cy, double cR2){
│ │ │ │ + │ │ │ │
177 // Description of the method:
│ │ │ │
178 // --------------------------
│ │ │ │
179 // 1. check if cell is empty => no intersection
│ │ │ │
180 // 2. if cell has 1! particle, check if it is inside the circle.
│ │ │ │
181 // If yes, add it and return, if not simply return.
│ │ │ │
182 // 3. check if the circle intersects the square. If not, return.
│ │ │ │
183 // 4. check if the square is inside the circle.
│ │ │ │
184 // If yes, add it to qt and return.
│ │ │ │
185 // 5. check intersections with children.
│ │ │ │
186
│ │ │ │
187 // step 1: if there is no particle inside te square, no reason to go further
│ │ │ │ -
188 if (v==NULL)
│ │ │ │ +
188 if (v==NULL)
│ │ │ │
189 return Creference();
│ │ │ │
190
│ │ │ │ -
191 double dx, dy;
│ │ │ │ +
191 double dx, dy;
│ │ │ │
192
│ │ │ │
193 // step 2: if there is only one particle inside the square, test if it is in
│ │ │ │
194 // the circle, in which case return associated reference
│ │ │ │
195 if (!has_child){
│ │ │ │
196 // compute the distance
│ │ │ │
197 // Note: v has only one particle => eta and phi are defined
│ │ │ │ -
198 dx = cx - v->eta;
│ │ │ │ -
199 dy = fabs(cy - v->phi);
│ │ │ │ -
200 if (dy>M_PI)
│ │ │ │ -
201 dy -= 2.0*M_PI;
│ │ │ │ +
198 dx = cx - v->eta;
│ │ │ │ +
199 dy = fabs(cy - v->phi);
│ │ │ │ +
200 if (dy>M_PI)
│ │ │ │ +
201 dy -= 2.0*M_PI;
│ │ │ │
202
│ │ │ │
203 // test distance
│ │ │ │ -
204 if (dx*dx+dy*dy<cR2){
│ │ │ │ +
204 if (dx*dx+dy*dy<cR2){
│ │ │ │
205 return v->ref;
│ │ │ │
206 }
│ │ │ │
207
│ │ │ │
208 return Creference();
│ │ │ │
209 }
│ │ │ │
210
│ │ │ │
211 // step 3: check if there is an intersection
│ │ │ │
212 //double ryp, rym;
│ │ │ │ -
213 double dx_c, dy_c;
│ │ │ │ +
213 double dx_c, dy_c;
│ │ │ │
214
│ │ │ │
215 // store distance with the centre of the square
│ │ │ │ -
216 dx_c = fabs(cx-centre_x);
│ │ │ │ -
217 dy_c = fabs(cy-centre_y);
│ │ │ │ -
218 if (dy_c>M_PI) dy_c = 2.0*M_PI-dy_c;
│ │ │ │ +
216 dx_c = fabs(cx-centre_x);
│ │ │ │ +
217 dy_c = fabs(cy-centre_y);
│ │ │ │ +
218 if (dy_c>M_PI) dy_c = 2.0*M_PI-dy_c;
│ │ │ │
219
│ │ │ │
220 // compute (minimal) the distance (pay attention to the periodicity in phi).
│ │ │ │ -
221 dx = dx_c-half_size_x;
│ │ │ │ -
222 if (dx<0) dx=0;
│ │ │ │ -
223 dy = dy_c-half_size_y;
│ │ │ │ -
224 if (dy<0) dy=0;
│ │ │ │ + │ │ │ │ +
222 if (dx<0) dx=0;
│ │ │ │ + │ │ │ │ +
224 if (dy<0) dy=0;
│ │ │ │
225
│ │ │ │
226 // check the distance
│ │ │ │ -
227 if (dx*dx+dy*dy>=cR2){
│ │ │ │ +
227 if (dx*dx+dy*dy>=cR2){
│ │ │ │
228 // no intersection
│ │ │ │
229 return Creference();
│ │ │ │
230 }
│ │ │ │
231
│ │ │ │
232 // step 4: check if included
│ │ │ │
233
│ │ │ │
234 // compute the (maximal) distance
│ │ │ │ -
235 dx = dx_c+half_size_x;
│ │ │ │ -
236 dy = dy_c+half_size_y;
│ │ │ │ -
237 if (dy>M_PI) dy = M_PI;
│ │ │ │ + │ │ │ │ + │ │ │ │ +
237 if (dy>M_PI) dy = M_PI;
│ │ │ │
238
│ │ │ │
239 // compute the distance
│ │ │ │ -
240 if (dx*dx+dy*dy<cR2){
│ │ │ │ +
240 if (dx*dx+dy*dy<cR2){
│ │ │ │
241 return v->ref;
│ │ │ │
242 }
│ │ │ │
243
│ │ │ │
244 // step 5: the square is not fully in. Recurse to children
│ │ │ │ -
245 return children[0][0]->circle_intersect(cx, cy, cR2)
│ │ │ │ -
246 + children[0][1]->circle_intersect(cx, cy, cR2)
│ │ │ │ -
247 + children[1][0]->circle_intersect(cx, cy, cR2)
│ │ │ │ -
248 + children[1][1]->circle_intersect(cx, cy, cR2);
│ │ │ │ +
245 return children[0][0]->circle_intersect(cx, cy, cR2)
│ │ │ │ +
246 + children[0][1]->circle_intersect(cx, cy, cR2)
│ │ │ │ +
247 + children[1][0]->circle_intersect(cx, cy, cR2)
│ │ │ │ +
248 + children[1][1]->circle_intersect(cx, cy, cR2);
│ │ │ │
249}
│ │ │ │
│ │ │ │
250
│ │ │ │
251
│ │ │ │
252/*
│ │ │ │
253 * output a data file for drawing the grid.
│ │ │ │
254 * This can be used to output a data file containing all the
│ │ │ │
255 * grid subdivisions. The file contents is as follows:
│ │ │ │
256 * first and second columns give center of the cell, the third
│ │ │ │
257 * gives the size.
│ │ │ │
258 * - flux opened stream to write to
│ │ │ │
259 * return 0 on success, 1 on error
│ │ │ │
260 ******************************************************************/
│ │ │ │
│ │ │ │ -
261int Cquadtree::save(FILE *flux){
│ │ │ │ + │ │ │ │
262
│ │ │ │ -
263 if (flux==NULL)
│ │ │ │ +
263 if (flux==NULL)
│ │ │ │
264 return 1;
│ │ │ │
265
│ │ │ │
266 if (has_child){
│ │ │ │ -
267 fprintf(flux, "%e\t%e\t%e\t%e\n", centre_x, centre_y, half_size_x, half_size_y);
│ │ │ │ -
268 children[0][0]->save(flux);
│ │ │ │ -
269 children[0][1]->save(flux);
│ │ │ │ -
270 children[1][0]->save(flux);
│ │ │ │ -
271 children[1][1]->save(flux);
│ │ │ │ +
267 fprintf(flux, "%e\t%e\t%e\t%e\n", centre_x, centre_y, half_size_x, half_size_y);
│ │ │ │ +
268 children[0][0]->save(flux);
│ │ │ │ +
269 children[0][1]->save(flux);
│ │ │ │ +
270 children[1][0]->save(flux);
│ │ │ │ +
271 children[1][1]->save(flux);
│ │ │ │
272 }
│ │ │ │
273
│ │ │ │
274 return 0;
│ │ │ │
275}
│ │ │ │
│ │ │ │
276
│ │ │ │
277
│ │ │ │ @@ -347,26 +347,26 @@ │ │ │ │
281 * tree leaves. The file contents is as follows:
│ │ │ │
282 * first and second columns give center of the cell, the third
│ │ │ │
283 * gives the size.
│ │ │ │
284 * - flux opened stream to write to
│ │ │ │
285 * return 0 on success, 1 on error
│ │ │ │
286 ******************************************************************/
│ │ │ │
│ │ │ │ - │ │ │ │ + │ │ │ │
288
│ │ │ │ -
289 if (flux==NULL)
│ │ │ │ +
289 if (flux==NULL)
│ │ │ │
290 return 1;
│ │ │ │
291
│ │ │ │
292 if (has_child){
│ │ │ │ -
293 if (children[0][0]!=NULL) children[0][0]->save_leaves(flux);
│ │ │ │ -
294 if (children[0][1]!=NULL) children[0][1]->save_leaves(flux);
│ │ │ │ -
295 if (children[1][0]!=NULL) children[1][0]->save_leaves(flux);
│ │ │ │ -
296 if (children[1][1]!=NULL) children[1][1]->save_leaves(flux);
│ │ │ │ +
293 if (children[0][0]!=NULL) children[0][0]->save_leaves(flux);
│ │ │ │ +
294 if (children[0][1]!=NULL) children[0][1]->save_leaves(flux);
│ │ │ │ +
295 if (children[1][0]!=NULL) children[1][0]->save_leaves(flux);
│ │ │ │ +
296 if (children[1][1]!=NULL) children[1][1]->save_leaves(flux);
│ │ │ │
297 } else {
│ │ │ │ -
298 fprintf(flux, "%e\t%e\t%e\t%e\n", centre_x, centre_y, half_size_x, half_size_y);
│ │ │ │ +
298 fprintf(flux, "%e\t%e\t%e\t%e\n", centre_x, centre_y, half_size_x, half_size_y);
│ │ │ │
299 }
│ │ │ │
300
│ │ │ │
301 return 0;
│ │ │ │
302}
│ │ │ │
│ │ │ │
303
│ │ │ │
304}
│ │ │ │ @@ -385,14 +385,15 @@ │ │ │ │
int save_leaves(FILE *flux)
output a data file for drawing the tree leaves.
Definition quadtree.cpp:287
│ │ │ │
double centre_y
y-position of the centre of the cell
Definition quadtree.h:113
│ │ │ │
bool has_child
true if not a leaf
Definition quadtree.h:120
│ │ │ │
Cmomentum * v
physical contents
Definition quadtree.h:117
│ │ │ │
int init(double _x, double _y, double _half_size_x, double _half_size_y)
init the tree.
Definition quadtree.cpp:91
│ │ │ │
Cquadtree * children[2][2]
sub-cells ( 0,1->left-right; 0,1->bottom,top)
Definition quadtree.h:119
│ │ │ │
references used for checksums.
Definition reference.h:43
│ │ │ │ +
a circulator that is foreseen to take as template member either a pointer or an iterator;
Definition circulator.h:36
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -42,41 +42,41 @@ │ │ │ │ │ 39 * This class implements the traditional two-dimensional quadtree. * │ │ │ │ │ 40 * The elements at each node are of 'Cmomentum' type. * │ │ │ │ │ 41 *******************************************************************/ │ │ │ │ │ 42 │ │ │ │ │ 43// default ctor │ │ │ │ │ 44//-------------- │ │ │ │ │ _4_5_C_q_u_a_d_t_r_e_e_:_:_C_q_u_a_d_t_r_e_e(){ │ │ │ │ │ -46 _v = NULL; │ │ │ │ │ +46 _v = _N_U_L_L; │ │ │ │ │ 47 │ │ │ │ │ -48 _c_h_i_l_d_r_e_n[0][0] = _c_h_i_l_d_r_e_n[0][1] = _c_h_i_l_d_r_e_n[1][0] = _c_h_i_l_d_r_e_n[1][1] = NULL; │ │ │ │ │ +48 _c_h_i_l_d_r_e_n[0][0] = _c_h_i_l_d_r_e_n[0][1] = _c_h_i_l_d_r_e_n[1][0] = _c_h_i_l_d_r_e_n[1][1] = _N_U_L_L; │ │ │ │ │ 49 _h_a_s___c_h_i_l_d = false; │ │ │ │ │ 50} │ │ │ │ │ 51 │ │ │ │ │ 52 │ │ │ │ │ 53// ctor with initialisation (see init for details) │ │ │ │ │ 54//-------------------------- │ │ │ │ │ -_5_5_C_q_u_a_d_t_r_e_e_:_:_C_q_u_a_d_t_r_e_e(double _x, double _y, double _half_size_x, double │ │ │ │ │ -_half_size_y){ │ │ │ │ │ -56 _v = NULL; │ │ │ │ │ +_5_5_C_q_u_a_d_t_r_e_e_:_:_C_q_u_a_d_t_r_e_e(double ___x, double ___y, double ___h_a_l_f___s_i_z_e___x, double │ │ │ │ │ +___h_a_l_f___s_i_z_e___y){ │ │ │ │ │ +56 _v = _N_U_L_L; │ │ │ │ │ 57 │ │ │ │ │ -58 _c_h_i_l_d_r_e_n[0][0] = _c_h_i_l_d_r_e_n[0][1] = _c_h_i_l_d_r_e_n[1][0] = _c_h_i_l_d_r_e_n[1][1] = NULL; │ │ │ │ │ +58 _c_h_i_l_d_r_e_n[0][0] = _c_h_i_l_d_r_e_n[0][1] = _c_h_i_l_d_r_e_n[1][0] = _c_h_i_l_d_r_e_n[1][1] = _N_U_L_L; │ │ │ │ │ 59 _h_a_s___c_h_i_l_d = false; │ │ │ │ │ 60 │ │ │ │ │ -61 _i_n_i_t(_x, _y, _half_size_x, _half_size_y); │ │ │ │ │ +61 _i_n_i_t(___x, ___y, ___h_a_l_f___s_i_z_e___x, ___h_a_l_f___s_i_z_e___y); │ │ │ │ │ 62} │ │ │ │ │ 63 │ │ │ │ │ 64 │ │ │ │ │ 65// default destructor │ │ │ │ │ 66// at destruction, everything is destroyed except │ │ │ │ │ 67// physical values at the leaves │ │ │ │ │ 68//------------------------------------------------ │ │ │ │ │ _6_9_C_q_u_a_d_t_r_e_e_:_:_~_C_q_u_a_d_t_r_e_e(){ │ │ │ │ │ 70 if (_h_a_s___c_h_i_l_d){ │ │ │ │ │ -71 if (_v!=NULL) delete _v; │ │ │ │ │ +71 if (_v!=_N_U_L_L) delete _v; │ │ │ │ │ 72 delete _c_h_i_l_d_r_e_n[0][0]; │ │ │ │ │ 73 delete _c_h_i_l_d_r_e_n[0][1]; │ │ │ │ │ 74 delete _c_h_i_l_d_r_e_n[1][0]; │ │ │ │ │ 75 delete _c_h_i_l_d_r_e_n[1][1]; │ │ │ │ │ 76 } │ │ │ │ │ 77} │ │ │ │ │ 78 │ │ │ │ │ @@ -88,89 +88,89 @@ │ │ │ │ │ 84 * - _x x-position of the center │ │ │ │ │ 85 * - _y y-position of the center │ │ │ │ │ 86 * - half_size_x half x-size of the cell │ │ │ │ │ 87 * - half_size_y half y-size of the cell │ │ │ │ │ 88 * return 0 on success, 1 on error. Note that if the cell │ │ │ │ │ 89 * is already filled, we return an error. │ │ │ │ │ 90 ******************************************************************/ │ │ │ │ │ -_9_1int _C_q_u_a_d_t_r_e_e_:_:_i_n_i_t(double _x, double _y, double _half_size_x, double │ │ │ │ │ -_half_size_y){ │ │ │ │ │ -92 if (_v!=NULL) │ │ │ │ │ +_9_1int _C_q_u_a_d_t_r_e_e_:_:_i_n_i_t(double ___x, double ___y, double ___h_a_l_f___s_i_z_e___x, double │ │ │ │ │ +___h_a_l_f___s_i_z_e___y){ │ │ │ │ │ +92 if (_v!=_N_U_L_L) │ │ │ │ │ 93 return 1; │ │ │ │ │ 94 │ │ │ │ │ -95 _c_e_n_t_r_e___x = _x; │ │ │ │ │ -96 _c_e_n_t_r_e___y = _y; │ │ │ │ │ -97 _h_a_l_f___s_i_z_e___x = _half_size_x; │ │ │ │ │ -98 _h_a_l_f___s_i_z_e___y = _half_size_y; │ │ │ │ │ +95 _c_e_n_t_r_e___x = ___x; │ │ │ │ │ +96 _c_e_n_t_r_e___y = ___y; │ │ │ │ │ +97 _h_a_l_f___s_i_z_e___x = ___h_a_l_f___s_i_z_e___x; │ │ │ │ │ +98 _h_a_l_f___s_i_z_e___y = ___h_a_l_f___s_i_z_e___y; │ │ │ │ │ 99 │ │ │ │ │ 100 return 0; │ │ │ │ │ 101} │ │ │ │ │ 102 │ │ │ │ │ 103 │ │ │ │ │ 104/* │ │ │ │ │ 105 * adding a particle to the tree. │ │ │ │ │ 106 * This method adds one vector to the quadtree structure which │ │ │ │ │ 107 * is updated consequently. │ │ │ │ │ 108 * - v vector to add │ │ │ │ │ 109 * return 0 on success 1 on error │ │ │ │ │ 110 ******************************************************************/ │ │ │ │ │ -_1_1_1int _C_q_u_a_d_t_r_e_e_:_:_a_d_d(_C_m_o_m_e_n_t_u_m *v_add){ │ │ │ │ │ +_1_1_1int _C_q_u_a_d_t_r_e_e_:_:_a_d_d(_C_m_o_m_e_n_t_u_m *_v___a_d_d){ │ │ │ │ │ 112 // Description of the method: │ │ │ │ │ 113 // -------------------------- │ │ │ │ │ 114 // the addition process goes as follows: │ │ │ │ │ 115 // 1. check if the cell is empty, in which case, add the particle │ │ │ │ │ 116 // here and leave. │ │ │ │ │ 117 // 2. If there is a unique particle already inside, │ │ │ │ │ 118 // (a) create children │ │ │ │ │ 119 // (b) forward the existing particle to the appropriate child │ │ │ │ │ 120 // 3. Add current particle to this cell and forward to the │ │ │ │ │ 121 // adequate child │ │ │ │ │ 122 // NOTE: we assume in the whole procedure that the particle is │ │ │ │ │ 123 // indeed inside the cell ! │ │ │ │ │ 124 │ │ │ │ │ 125 // step 1: the case of empty cells │ │ │ │ │ -126 if (_v==NULL){ │ │ │ │ │ -127 _v = v_add; │ │ │ │ │ +126 if (_v==_N_U_L_L){ │ │ │ │ │ +127 _v = _v___a_d_d; │ │ │ │ │ 128 return 0; │ │ │ │ │ 129 } │ │ │ │ │ 130 │ │ │ │ │ 131 // step 2: additional work if 1! particle already present │ │ │ │ │ 132 // we use the fact that only 1-particle systems have no child │ │ │ │ │ 133 if (!_h_a_s___c_h_i_l_d){ │ │ │ │ │ -134 double new_half_size_x = 0.5*_h_a_l_f___s_i_z_e___x; │ │ │ │ │ -135 double new_half_size_y = 0.5*_h_a_l_f___s_i_z_e___y; │ │ │ │ │ +134 double _n_e_w___h_a_l_f___s_i_z_e___x = 0.5*_h_a_l_f___s_i_z_e___x; │ │ │ │ │ +135 double _n_e_w___h_a_l_f___s_i_z_e___y = 0.5*_h_a_l_f___s_i_z_e___y; │ │ │ │ │ 136 // create children │ │ │ │ │ -137 _c_h_i_l_d_r_e_n[0][0] = new _C_q_u_a_d_t_r_e_e(_c_e_n_t_r_e___x-new_half_size_x, _c_e_n_t_r_e___y- │ │ │ │ │ -new_half_size_y, │ │ │ │ │ -138 new_half_size_x, new_half_size_y); │ │ │ │ │ -139 _c_h_i_l_d_r_e_n[0][1] = new _C_q_u_a_d_t_r_e_e(_c_e_n_t_r_e___x-new_half_size_x, │ │ │ │ │ -_c_e_n_t_r_e___y+new_half_size_y, │ │ │ │ │ -140 new_half_size_x, new_half_size_y); │ │ │ │ │ -141 _c_h_i_l_d_r_e_n[1][0] = new _C_q_u_a_d_t_r_e_e(_c_e_n_t_r_e___x+new_half_size_x, _c_e_n_t_r_e___y- │ │ │ │ │ -new_half_size_y, │ │ │ │ │ -142 new_half_size_x, new_half_size_y); │ │ │ │ │ -143 _c_h_i_l_d_r_e_n[1][1] = new _C_q_u_a_d_t_r_e_e(_c_e_n_t_r_e___x+new_half_size_x, │ │ │ │ │ -_c_e_n_t_r_e___y+new_half_size_y, │ │ │ │ │ -144 new_half_size_x, new_half_size_y); │ │ │ │ │ +137 _c_h_i_l_d_r_e_n[0][0] = new _C_q_u_a_d_t_r_e_e(_c_e_n_t_r_e___x-_n_e_w___h_a_l_f___s_i_z_e___x, _c_e_n_t_r_e___y- │ │ │ │ │ +_n_e_w___h_a_l_f___s_i_z_e___y, │ │ │ │ │ +138 _n_e_w___h_a_l_f___s_i_z_e___x, _n_e_w___h_a_l_f___s_i_z_e___y); │ │ │ │ │ +139 _c_h_i_l_d_r_e_n[0][1] = new _C_q_u_a_d_t_r_e_e(_c_e_n_t_r_e___x-_n_e_w___h_a_l_f___s_i_z_e___x, │ │ │ │ │ +_c_e_n_t_r_e___y+_n_e_w___h_a_l_f___s_i_z_e___y, │ │ │ │ │ +140 _n_e_w___h_a_l_f___s_i_z_e___x, _n_e_w___h_a_l_f___s_i_z_e___y); │ │ │ │ │ +141 _c_h_i_l_d_r_e_n[1][0] = new _C_q_u_a_d_t_r_e_e(_c_e_n_t_r_e___x+_n_e_w___h_a_l_f___s_i_z_e___x, _c_e_n_t_r_e___y- │ │ │ │ │ +_n_e_w___h_a_l_f___s_i_z_e___y, │ │ │ │ │ +142 _n_e_w___h_a_l_f___s_i_z_e___x, _n_e_w___h_a_l_f___s_i_z_e___y); │ │ │ │ │ +143 _c_h_i_l_d_r_e_n[1][1] = new _C_q_u_a_d_t_r_e_e(_c_e_n_t_r_e___x+_n_e_w___h_a_l_f___s_i_z_e___x, │ │ │ │ │ +_c_e_n_t_r_e___y+_n_e_w___h_a_l_f___s_i_z_e___y, │ │ │ │ │ +144 _n_e_w___h_a_l_f___s_i_z_e___x, _n_e_w___h_a_l_f___s_i_z_e___y); │ │ │ │ │ 145 │ │ │ │ │ 146 _h_a_s___c_h_i_l_d = true; │ │ │ │ │ 147 │ │ │ │ │ 148 // forward to child │ │ │ │ │ 149 //? The following line assumes 'true'==1 and 'false'==0 │ │ │ │ │ 150 // Note: v being a single particle, eta and phi are correct │ │ │ │ │ 151 _c_h_i_l_d_r_e_n[_v->_e_t_a>_c_e_n_t_r_e___x][_v->_p_h_i>_c_e_n_t_r_e___y]->_a_d_d(_v); │ │ │ │ │ 152 │ │ │ │ │ 153 // copy physical params │ │ │ │ │ 154 _v = new _C_m_o_m_e_n_t_u_m(*_v); │ │ │ │ │ 155 } │ │ │ │ │ 156 │ │ │ │ │ 157 // step 3: add new particle │ │ │ │ │ 158 // Note: v_add being a single particle, eta and phi are correct │ │ │ │ │ -159 _c_h_i_l_d_r_e_n[v_add->_e_t_a>_c_e_n_t_r_e___x][v_add->_p_h_i>_c_e_n_t_r_e___y]->_a_d_d(v_add); │ │ │ │ │ -160 *_v+=*v_add; │ │ │ │ │ +159 _c_h_i_l_d_r_e_n[_v___a_d_d->eta>_c_e_n_t_r_e___x][_v___a_d_d->phi>_c_e_n_t_r_e___y]->_a_d_d(_v___a_d_d); │ │ │ │ │ +160 *_v+=*_v___a_d_d; │ │ │ │ │ 161 │ │ │ │ │ 162 return 0; │ │ │ │ │ 163} │ │ │ │ │ 164 │ │ │ │ │ 165 │ │ │ │ │ 166/* │ │ │ │ │ 167 * circle intersection. │ │ │ │ │ @@ -178,114 +178,114 @@ │ │ │ │ │ 169 * The output takes the form of a quadtree with all squares included │ │ │ │ │ 170 * in the circle. │ │ │ │ │ 171 * - cx circle centre x coordinate │ │ │ │ │ 172 * - cy circle centre y coordinate │ │ │ │ │ 173 * - cR2 circle radius SQUARED │ │ │ │ │ 174 * return the checksum for the intersection │ │ │ │ │ 175 ******************************************************************/ │ │ │ │ │ -_1_7_6_C_r_e_f_e_r_e_n_c_e _C_q_u_a_d_t_r_e_e_:_:_c_i_r_c_l_e___i_n_t_e_r_s_e_c_t(double cx, double cy, double cR2){ │ │ │ │ │ +_1_7_6_C_r_e_f_e_r_e_n_c_e _C_q_u_a_d_t_r_e_e_:_:_c_i_r_c_l_e___i_n_t_e_r_s_e_c_t(double _c_x, double _c_y, double _c_R_2){ │ │ │ │ │ 177 // Description of the method: │ │ │ │ │ 178 // -------------------------- │ │ │ │ │ 179 // 1. check if cell is empty => no intersection │ │ │ │ │ 180 // 2. if cell has 1! particle, check if it is inside the circle. │ │ │ │ │ 181 // If yes, add it and return, if not simply return. │ │ │ │ │ 182 // 3. check if the circle intersects the square. If not, return. │ │ │ │ │ 183 // 4. check if the square is inside the circle. │ │ │ │ │ 184 // If yes, add it to qt and return. │ │ │ │ │ 185 // 5. check intersections with children. │ │ │ │ │ 186 │ │ │ │ │ 187 // step 1: if there is no particle inside te square, no reason to go │ │ │ │ │ further │ │ │ │ │ -188 if (_v==NULL) │ │ │ │ │ +188 if (_v==_N_U_L_L) │ │ │ │ │ 189 return _C_r_e_f_e_r_e_n_c_e(); │ │ │ │ │ 190 │ │ │ │ │ -191 double dx, dy; │ │ │ │ │ +191 double _d_x, _d_y; │ │ │ │ │ 192 │ │ │ │ │ 193 // step 2: if there is only one particle inside the square, test if it is │ │ │ │ │ in │ │ │ │ │ 194 // the circle, in which case return associated reference │ │ │ │ │ 195 if (!_h_a_s___c_h_i_l_d){ │ │ │ │ │ 196 // compute the distance │ │ │ │ │ 197 // Note: v has only one particle => eta and phi are defined │ │ │ │ │ -198 dx = cx - _v->_e_t_a; │ │ │ │ │ -199 dy = fabs(cy - _v->_p_h_i); │ │ │ │ │ -200 if (dy>M_PI) │ │ │ │ │ -201 dy -= 2.0*M_PI; │ │ │ │ │ +198 _d_x = _c_x - _v->_e_t_a; │ │ │ │ │ +199 _d_y = _f_a_b_s(_c_y - _v->_p_h_i); │ │ │ │ │ +200 if (_d_y>M_PI) │ │ │ │ │ +201 _d_y -= 2.0*M_PI; │ │ │ │ │ 202 │ │ │ │ │ 203 // test distance │ │ │ │ │ -204 if (dx*dx+dy*dy_r_e_f; │ │ │ │ │ 206 } │ │ │ │ │ 207 │ │ │ │ │ 208 return _C_r_e_f_e_r_e_n_c_e(); │ │ │ │ │ 209 } │ │ │ │ │ 210 │ │ │ │ │ 211 // step 3: check if there is an intersection │ │ │ │ │ 212 //double ryp, rym; │ │ │ │ │ -213 double dx_c, dy_c; │ │ │ │ │ +213 double _d_x___c, _d_y___c; │ │ │ │ │ 214 │ │ │ │ │ 215 // store distance with the centre of the square │ │ │ │ │ -216 dx_c = fabs(cx-_c_e_n_t_r_e___x); │ │ │ │ │ -217 dy_c = fabs(cy-_c_e_n_t_r_e___y); │ │ │ │ │ -218 if (dy_c>M_PI) dy_c = 2.0*M_PI-dy_c; │ │ │ │ │ +216 _d_x___c = _f_a_b_s(_c_x-_c_e_n_t_r_e___x); │ │ │ │ │ +217 _d_y___c = _f_a_b_s(_c_y-_c_e_n_t_r_e___y); │ │ │ │ │ +218 if (_d_y___c>M_PI) _d_y___c = 2.0*M_PI-_d_y___c; │ │ │ │ │ 219 │ │ │ │ │ 220 // compute (minimal) the distance (pay attention to the periodicity in │ │ │ │ │ phi). │ │ │ │ │ -221 dx = dx_c-_h_a_l_f___s_i_z_e___x; │ │ │ │ │ -222 if (dx<0) dx=0; │ │ │ │ │ -223 dy = dy_c-_h_a_l_f___s_i_z_e___y; │ │ │ │ │ -224 if (dy<0) dy=0; │ │ │ │ │ +221 _d_x = _d_x___c-_h_a_l_f___s_i_z_e___x; │ │ │ │ │ +222 if (_d_x<0) _d_x=0; │ │ │ │ │ +223 _d_y = _d_y___c-_h_a_l_f___s_i_z_e___y; │ │ │ │ │ +224 if (_d_y<0) _d_y=0; │ │ │ │ │ 225 │ │ │ │ │ 226 // check the distance │ │ │ │ │ -227 if (dx*dx+dy*dy>=cR2){ │ │ │ │ │ +227 if (_d_x*_d_x+_d_y*_d_y>=_c_R_2){ │ │ │ │ │ 228 // no intersection │ │ │ │ │ 229 return _C_r_e_f_e_r_e_n_c_e(); │ │ │ │ │ 230 } │ │ │ │ │ 231 │ │ │ │ │ 232 // step 4: check if included │ │ │ │ │ 233 │ │ │ │ │ 234 // compute the (maximal) distance │ │ │ │ │ -235 dx = dx_c+_h_a_l_f___s_i_z_e___x; │ │ │ │ │ -236 dy = dy_c+_h_a_l_f___s_i_z_e___y; │ │ │ │ │ -237 if (dy>M_PI) dy = M_PI; │ │ │ │ │ +235 _d_x = _d_x___c+_h_a_l_f___s_i_z_e___x; │ │ │ │ │ +236 _d_y = _d_y___c+_h_a_l_f___s_i_z_e___y; │ │ │ │ │ +237 if (_d_y>M_PI) _d_y = M_PI; │ │ │ │ │ 238 │ │ │ │ │ 239 // compute the distance │ │ │ │ │ -240 if (dx*dx+dy*dy_r_e_f; │ │ │ │ │ 242 } │ │ │ │ │ 243 │ │ │ │ │ 244 // step 5: the square is not fully in. Recurse to children │ │ │ │ │ -245 return _c_h_i_l_d_r_e_n[0][0]->_c_i_r_c_l_e___i_n_t_e_r_s_e_c_t(cx, cy, cR2) │ │ │ │ │ -246 + _c_h_i_l_d_r_e_n[0][1]->_c_i_r_c_l_e___i_n_t_e_r_s_e_c_t(cx, cy, cR2) │ │ │ │ │ -247 + _c_h_i_l_d_r_e_n[1][0]->_c_i_r_c_l_e___i_n_t_e_r_s_e_c_t(cx, cy, cR2) │ │ │ │ │ -248 + _c_h_i_l_d_r_e_n[1][1]->_c_i_r_c_l_e___i_n_t_e_r_s_e_c_t(cx, cy, cR2); │ │ │ │ │ +245 return _c_h_i_l_d_r_e_n[0][0]->_c_i_r_c_l_e___i_n_t_e_r_s_e_c_t(_c_x, _c_y, _c_R_2) │ │ │ │ │ +246 + _c_h_i_l_d_r_e_n[0][1]->_c_i_r_c_l_e___i_n_t_e_r_s_e_c_t(_c_x, _c_y, _c_R_2) │ │ │ │ │ +247 + _c_h_i_l_d_r_e_n[1][0]->_c_i_r_c_l_e___i_n_t_e_r_s_e_c_t(_c_x, _c_y, _c_R_2) │ │ │ │ │ +248 + _c_h_i_l_d_r_e_n[1][1]->_c_i_r_c_l_e___i_n_t_e_r_s_e_c_t(_c_x, _c_y, _c_R_2); │ │ │ │ │ 249} │ │ │ │ │ 250 │ │ │ │ │ 251 │ │ │ │ │ 252/* │ │ │ │ │ 253 * output a data file for drawing the grid. │ │ │ │ │ 254 * This can be used to output a data file containing all the │ │ │ │ │ 255 * grid subdivisions. The file contents is as follows: │ │ │ │ │ 256 * first and second columns give center of the cell, the third │ │ │ │ │ 257 * gives the size. │ │ │ │ │ 258 * - flux opened stream to write to │ │ │ │ │ 259 * return 0 on success, 1 on error │ │ │ │ │ 260 ******************************************************************/ │ │ │ │ │ -_2_6_1int _C_q_u_a_d_t_r_e_e_:_:_s_a_v_e(FILE *flux){ │ │ │ │ │ +_2_6_1int _C_q_u_a_d_t_r_e_e_:_:_s_a_v_e(_F_I_L_E *_f_l_u_x){ │ │ │ │ │ 262 │ │ │ │ │ -263 if (flux==NULL) │ │ │ │ │ +263 if (_f_l_u_x==_N_U_L_L) │ │ │ │ │ 264 return 1; │ │ │ │ │ 265 │ │ │ │ │ 266 if (_h_a_s___c_h_i_l_d){ │ │ │ │ │ -267 fprintf(flux, "%e\t%e\t%e\t%e\n", _c_e_n_t_r_e___x, _c_e_n_t_r_e___y, _h_a_l_f___s_i_z_e___x, │ │ │ │ │ +267 _f_p_r_i_n_t_f(_f_l_u_x, "%e\t%e\t%e\t%e\n", _c_e_n_t_r_e___x, _c_e_n_t_r_e___y, _h_a_l_f___s_i_z_e___x, │ │ │ │ │ _h_a_l_f___s_i_z_e___y); │ │ │ │ │ -268 _c_h_i_l_d_r_e_n[0][0]->_s_a_v_e(flux); │ │ │ │ │ -269 _c_h_i_l_d_r_e_n[0][1]->_s_a_v_e(flux); │ │ │ │ │ -270 _c_h_i_l_d_r_e_n[1][0]->_s_a_v_e(flux); │ │ │ │ │ -271 _c_h_i_l_d_r_e_n[1][1]->_s_a_v_e(flux); │ │ │ │ │ +268 _c_h_i_l_d_r_e_n[0][0]->_s_a_v_e(_f_l_u_x); │ │ │ │ │ +269 _c_h_i_l_d_r_e_n[0][1]->_s_a_v_e(_f_l_u_x); │ │ │ │ │ +270 _c_h_i_l_d_r_e_n[1][0]->_s_a_v_e(_f_l_u_x); │ │ │ │ │ +271 _c_h_i_l_d_r_e_n[1][1]->_s_a_v_e(_f_l_u_x); │ │ │ │ │ 272 } │ │ │ │ │ 273 │ │ │ │ │ 274 return 0; │ │ │ │ │ 275} │ │ │ │ │ 276 │ │ │ │ │ 277 │ │ │ │ │ 278/* │ │ │ │ │ @@ -293,26 +293,26 @@ │ │ │ │ │ 280 * This can be used to output a data file containing all the │ │ │ │ │ 281 * tree leaves. The file contents is as follows: │ │ │ │ │ 282 * first and second columns give center of the cell, the third │ │ │ │ │ 283 * gives the size. │ │ │ │ │ 284 * - flux opened stream to write to │ │ │ │ │ 285 * return 0 on success, 1 on error │ │ │ │ │ 286 ******************************************************************/ │ │ │ │ │ -_2_8_7int _C_q_u_a_d_t_r_e_e_:_:_s_a_v_e___l_e_a_v_e_s(FILE *flux){ │ │ │ │ │ +_2_8_7int _C_q_u_a_d_t_r_e_e_:_:_s_a_v_e___l_e_a_v_e_s(_F_I_L_E *_f_l_u_x){ │ │ │ │ │ 288 │ │ │ │ │ -289 if (flux==NULL) │ │ │ │ │ +289 if (_f_l_u_x==_N_U_L_L) │ │ │ │ │ 290 return 1; │ │ │ │ │ 291 │ │ │ │ │ 292 if (_h_a_s___c_h_i_l_d){ │ │ │ │ │ -293 if (_c_h_i_l_d_r_e_n[0][0]!=NULL) _c_h_i_l_d_r_e_n[0][0]->_s_a_v_e___l_e_a_v_e_s(flux); │ │ │ │ │ -294 if (_c_h_i_l_d_r_e_n[0][1]!=NULL) _c_h_i_l_d_r_e_n[0][1]->_s_a_v_e___l_e_a_v_e_s(flux); │ │ │ │ │ -295 if (_c_h_i_l_d_r_e_n[1][0]!=NULL) _c_h_i_l_d_r_e_n[1][0]->_s_a_v_e___l_e_a_v_e_s(flux); │ │ │ │ │ -296 if (_c_h_i_l_d_r_e_n[1][1]!=NULL) _c_h_i_l_d_r_e_n[1][1]->_s_a_v_e___l_e_a_v_e_s(flux); │ │ │ │ │ +293 if (_c_h_i_l_d_r_e_n[0][0]!=_N_U_L_L) _c_h_i_l_d_r_e_n[0][0]->_s_a_v_e___l_e_a_v_e_s(_f_l_u_x); │ │ │ │ │ +294 if (_c_h_i_l_d_r_e_n[0][1]!=_N_U_L_L) _c_h_i_l_d_r_e_n[0][1]->_s_a_v_e___l_e_a_v_e_s(_f_l_u_x); │ │ │ │ │ +295 if (_c_h_i_l_d_r_e_n[1][0]!=_N_U_L_L) _c_h_i_l_d_r_e_n[1][0]->_s_a_v_e___l_e_a_v_e_s(_f_l_u_x); │ │ │ │ │ +296 if (_c_h_i_l_d_r_e_n[1][1]!=_N_U_L_L) _c_h_i_l_d_r_e_n[1][1]->_s_a_v_e___l_e_a_v_e_s(_f_l_u_x); │ │ │ │ │ 297 } else { │ │ │ │ │ -298 fprintf(flux, "%e\t%e\t%e\t%e\n", _c_e_n_t_r_e___x, _c_e_n_t_r_e___y, _h_a_l_f___s_i_z_e___x, │ │ │ │ │ +298 _f_p_r_i_n_t_f(_f_l_u_x, "%e\t%e\t%e\t%e\n", _c_e_n_t_r_e___x, _c_e_n_t_r_e___y, _h_a_l_f___s_i_z_e___x, │ │ │ │ │ _h_a_l_f___s_i_z_e___y); │ │ │ │ │ 299 } │ │ │ │ │ 300 │ │ │ │ │ 301 return 0; │ │ │ │ │ 302} │ │ │ │ │ 303 │ │ │ │ │ 304} │ │ │ │ │ @@ -387,9 +387,13 @@ │ │ │ │ │ _s_i_s_c_o_n_e_:_:_C_q_u_a_d_t_r_e_e_:_:_c_h_i_l_d_r_e_n │ │ │ │ │ Cquadtree * children[2][2] │ │ │ │ │ sub-cells ( 0,1->left-right; 0,1->bottom,top) │ │ │ │ │ DDeeffiinniittiioonn _q_u_a_d_t_r_e_e_._h_:_1_1_9 │ │ │ │ │ _s_i_s_c_o_n_e_:_:_C_r_e_f_e_r_e_n_c_e │ │ │ │ │ references used for checksums. │ │ │ │ │ DDeeffiinniittiioonn _r_e_f_e_r_e_n_c_e_._h_:_4_3 │ │ │ │ │ +_s_i_s_c_o_n_e_:_:_c_i_r_c_u_l_a_t_o_r │ │ │ │ │ +a circulator that is foreseen to take as template member either a pointer or an │ │ │ │ │ +iterator; │ │ │ │ │ +DDeeffiinniittiioonn _c_i_r_c_u_l_a_t_o_r_._h_:_3_6 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/siscone-doc-html/html/devel/quadtree_8h_source.html │ │ │ │ @@ -85,27 +85,27 @@ │ │ │ │
34namespace siscone{
│ │ │ │
35
│ │ │ │
│ │ │ │ │ │ │ │
44 public:
│ │ │ │
46 Cquadtree();
│ │ │ │
47
│ │ │ │ -
49 Cquadtree(double _x, double _y, double _half_size_x, double _half_size_y);
│ │ │ │ +
49 Cquadtree(double _x, double _y, double _half_size_x, double _half_size_y);
│ │ │ │
50
│ │ │ │
54 ~Cquadtree();
│ │ │ │
55
│ │ │ │ -
67 int init(double _x, double _y, double _half_size_x, double _half_size_y);
│ │ │ │ +
67 int init(double _x, double _y, double _half_size_x, double _half_size_y);
│ │ │ │
68
│ │ │ │ -
76 int add(Cmomentum *v_add);
│ │ │ │ +
76 int add(Cmomentum *v_add);
│ │ │ │
77
│ │ │ │ -
88 Creference circle_intersect(double cx, double cy, double cR2);
│ │ │ │ +
88 Creference circle_intersect(double cx, double cy, double cR2);
│ │ │ │
89
│ │ │ │ -
99 int save(FILE *flux);
│ │ │ │ +
99 int save(FILE *flux);
│ │ │ │
100
│ │ │ │ -
110 int save_leaves(FILE *flux);
│ │ │ │ +
110 int save_leaves(FILE *flux);
│ │ │ │
111
│ │ │ │
112 double centre_x;
│ │ │ │
113 double centre_y;
│ │ │ │
114 double half_size_x;
│ │ │ │
115 double half_size_y;
│ │ │ │
116
│ │ │ │ │ │ │ │ @@ -130,14 +130,15 @@ │ │ │ │
int save_leaves(FILE *flux)
output a data file for drawing the tree leaves.
Definition quadtree.cpp:287
│ │ │ │
double centre_y
y-position of the centre of the cell
Definition quadtree.h:113
│ │ │ │
bool has_child
true if not a leaf
Definition quadtree.h:120
│ │ │ │
Cmomentum * v
physical contents
Definition quadtree.h:117
│ │ │ │
int init(double _x, double _y, double _half_size_x, double _half_size_y)
init the tree.
Definition quadtree.cpp:91
│ │ │ │
Cquadtree * children[2][2]
sub-cells ( 0,1->left-right; 0,1->bottom,top)
Definition quadtree.h:119
│ │ │ │
references used for checksums.
Definition reference.h:43
│ │ │ │ +
a circulator that is foreseen to take as template member either a pointer or an iterator;
Definition circulator.h:36
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -35,27 +35,27 @@ │ │ │ │ │ 33 │ │ │ │ │ 34namespace siscone{ │ │ │ │ │ 35 │ │ │ │ │ _4_3class _C_q_u_a_d_t_r_e_e{ │ │ │ │ │ 44 public: │ │ │ │ │ 46 _C_q_u_a_d_t_r_e_e(); │ │ │ │ │ 47 │ │ │ │ │ -49 _C_q_u_a_d_t_r_e_e(double _x, double _y, double _half_size_x, double _half_size_y); │ │ │ │ │ +49 _C_q_u_a_d_t_r_e_e(double ___x, double ___y, double ___h_a_l_f___s_i_z_e___x, double ___h_a_l_f___s_i_z_e___y); │ │ │ │ │ 50 │ │ │ │ │ 54 _~_C_q_u_a_d_t_r_e_e(); │ │ │ │ │ 55 │ │ │ │ │ -67 int _i_n_i_t(double _x, double _y, double _half_size_x, double _half_size_y); │ │ │ │ │ +67 int _i_n_i_t(double ___x, double ___y, double ___h_a_l_f___s_i_z_e___x, double ___h_a_l_f___s_i_z_e___y); │ │ │ │ │ 68 │ │ │ │ │ -76 int _a_d_d(_C_m_o_m_e_n_t_u_m *v_add); │ │ │ │ │ +76 int _a_d_d(_C_m_o_m_e_n_t_u_m *_v___a_d_d); │ │ │ │ │ 77 │ │ │ │ │ -88 _C_r_e_f_e_r_e_n_c_e _c_i_r_c_l_e___i_n_t_e_r_s_e_c_t(double cx, double cy, double cR2); │ │ │ │ │ +88 _C_r_e_f_e_r_e_n_c_e _c_i_r_c_l_e___i_n_t_e_r_s_e_c_t(double _c_x, double _c_y, double _c_R_2); │ │ │ │ │ 89 │ │ │ │ │ -99 int _s_a_v_e(FILE *flux); │ │ │ │ │ +99 int _s_a_v_e(_F_I_L_E *_f_l_u_x); │ │ │ │ │ 100 │ │ │ │ │ -110 int _s_a_v_e___l_e_a_v_e_s(FILE *flux); │ │ │ │ │ +110 int _s_a_v_e___l_e_a_v_e_s(_F_I_L_E *_f_l_u_x); │ │ │ │ │ 111 │ │ │ │ │ _1_1_2 double _c_e_n_t_r_e___x; │ │ │ │ │ _1_1_3 double _c_e_n_t_r_e___y; │ │ │ │ │ _1_1_4 double _h_a_l_f___s_i_z_e___x; │ │ │ │ │ _1_1_5 double _h_a_l_f___s_i_z_e___y; │ │ │ │ │ 116 │ │ │ │ │ _1_1_7 _C_m_o_m_e_n_t_u_m *_v; │ │ │ │ │ @@ -128,9 +128,13 @@ │ │ │ │ │ _s_i_s_c_o_n_e_:_:_C_q_u_a_d_t_r_e_e_:_:_c_h_i_l_d_r_e_n │ │ │ │ │ Cquadtree * children[2][2] │ │ │ │ │ sub-cells ( 0,1->left-right; 0,1->bottom,top) │ │ │ │ │ DDeeffiinniittiioonn _q_u_a_d_t_r_e_e_._h_:_1_1_9 │ │ │ │ │ _s_i_s_c_o_n_e_:_:_C_r_e_f_e_r_e_n_c_e │ │ │ │ │ references used for checksums. │ │ │ │ │ DDeeffiinniittiioonn _r_e_f_e_r_e_n_c_e_._h_:_4_3 │ │ │ │ │ +_s_i_s_c_o_n_e_:_:_c_i_r_c_u_l_a_t_o_r │ │ │ │ │ +a circulator that is foreseen to take as template member either a pointer or an │ │ │ │ │ +iterator; │ │ │ │ │ +DDeeffiinniittiioonn _c_i_r_c_u_l_a_t_o_r_._h_:_3_6 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/siscone-doc-html/html/devel/ranlux_8cpp_source.html │ │ │ │ @@ -114,20 +114,20 @@ │ │ │ │
59
│ │ │ │
60
│ │ │ │
61// incrementation of the generator state
│ │ │ │
62//---------------------------------------
│ │ │ │
63static inline unsigned long int increment_state(){
│ │ │ │
64 unsigned int i = local_ranlux_state.i;
│ │ │ │
65 unsigned int j = local_ranlux_state.j;
│ │ │ │ -
66 long int delta = local_ranlux_state.u[j] - local_ranlux_state.u[i]
│ │ │ │ +
66 long int delta = local_ranlux_state.u[j] - local_ranlux_state.u[i]
│ │ │ │
67 - local_ranlux_state.carry;
│ │ │ │
68
│ │ │ │ -
69 if (delta & mask_hi){
│ │ │ │ +
69 if (delta & mask_hi){
│ │ │ │
70 local_ranlux_state.carry = 1;
│ │ │ │ -
71 delta &= mask_lo;
│ │ │ │ +
71 delta &= mask_lo;
│ │ │ │
72 } else {
│ │ │ │
73 local_ranlux_state.carry = 0;
│ │ │ │
74 }
│ │ │ │
75
│ │ │ │
76 local_ranlux_state.u[i] = delta;
│ │ │ │
77
│ │ │ │
78 if (i==0)
│ │ │ │ @@ -220,14 +220,15 @@ │ │ │ │
165 for (i=0;i<n;i++){
│ │ │ │
166 /* FIXME: we're assuming that a char is 8 bits */
│ │ │ │
167 printf("%.2x", *(p+i));
│ │ │ │
168 }
│ │ │ │
169}
│ │ │ │
170
│ │ │ │
171}
│ │ │ │ +
a circulator that is foreseen to take as template member either a pointer or an iterator;
Definition circulator.h:36
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -62,20 +62,20 @@ │ │ │ │ │ 59 │ │ │ │ │ 60 │ │ │ │ │ 61// incrementation of the generator state │ │ │ │ │ 62//--------------------------------------- │ │ │ │ │ 63static inline unsigned long int increment_state(){ │ │ │ │ │ 64 unsigned int i = local_ranlux_state.i; │ │ │ │ │ 65 unsigned int j = local_ranlux_state.j; │ │ │ │ │ -66 long int delta = local_ranlux_state.u[j] - local_ranlux_state.u[i] │ │ │ │ │ +66 long int _d_e_l_t_a = local_ranlux_state.u[j] - local_ranlux_state.u[i] │ │ │ │ │ 67 - local_ranlux_state.carry; │ │ │ │ │ 68 │ │ │ │ │ -69 if (delta & mask_hi){ │ │ │ │ │ +69 if (_d_e_l_t_a & mask_hi){ │ │ │ │ │ 70 local_ranlux_state.carry = 1; │ │ │ │ │ -71 delta &= mask_lo; │ │ │ │ │ +71 _d_e_l_t_a &= mask_lo; │ │ │ │ │ 72 } else { │ │ │ │ │ 73 local_ranlux_state.carry = 0; │ │ │ │ │ 74 } │ │ │ │ │ 75 │ │ │ │ │ 76 local_ranlux_state.u[i] = delta; │ │ │ │ │ 77 │ │ │ │ │ 78 if (i==0) │ │ │ │ │ @@ -168,12 +168,16 @@ │ │ │ │ │ 165 for (i=0;i │ │ │ │ │ │ │ │
55// ref[0] = reference_bit;
│ │ │ │
56// ref[1] = 0;
│ │ │ │
57// ref[2] = 0;
│ │ │ │
58// reference_bit <<= 1;
│ │ │ │
59
│ │ │ │ -
60 unsigned int r1 = ranlux_get();
│ │ │ │ -
61 unsigned int r2 = ranlux_get();
│ │ │ │ -
62 unsigned int r3 = ranlux_get();
│ │ │ │ -
63 unsigned int r4 = ranlux_get();
│ │ │ │ +
60 unsigned int r1 = ranlux_get();
│ │ │ │ +
61 unsigned int r2 = ranlux_get();
│ │ │ │ +
62 unsigned int r3 = ranlux_get();
│ │ │ │ +
63 unsigned int r4 = ranlux_get();
│ │ │ │
64 // since ranlux only produces 24 bits, take r4 and add 8 bits
│ │ │ │
65 // from it to each of r1,r2, r3 to get 3*32 bits.
│ │ │ │ -
66 ref[0] = r1+((r4 & 0x00ff0000) << 8);
│ │ │ │ -
67 ref[1] = r2+((r4 & 0x0000ff00) << 16);
│ │ │ │ -
68 ref[2] = r3+((r4 & 0x000000ff) << 24);
│ │ │ │ +
66 ref[0] = r1+((r4 & 0x00ff0000) << 8);
│ │ │ │ +
67 ref[1] = r2+((r4 & 0x0000ff00) << 16);
│ │ │ │ +
68 ref[2] = r3+((r4 & 0x000000ff) << 24);
│ │ │ │
69
│ │ │ │
70 if (is_empty()) randomize();
│ │ │ │
71}
│ │ │ │ │ │ │ │
72
│ │ │ │
73// test emptyness
│ │ │ │
74//----------------
│ │ │ │ @@ -140,49 +140,49 @@ │ │ │ │
82 return (ref[0]!=0) || (ref[1]!=0) || (ref[2]!=0);
│ │ │ │
83}
│ │ │ │ │ │ │ │
84
│ │ │ │
85// assignment of reference
│ │ │ │
86//-------------------------
│ │ │ │
│ │ │ │ - │ │ │ │ -
88 ref[0] = r.ref[0];
│ │ │ │ -
89 ref[1] = r.ref[1];
│ │ │ │ -
90 ref[2] = r.ref[2];
│ │ │ │ + │ │ │ │ +
88 ref[0] = r.ref[0];
│ │ │ │ +
89 ref[1] = r.ref[1];
│ │ │ │ +
90 ref[2] = r.ref[2];
│ │ │ │
91 return *this;
│ │ │ │
92}
│ │ │ │
│ │ │ │
93
│ │ │ │
94// addition of reference
│ │ │ │
95//-----------------------
│ │ │ │
│ │ │ │ - │ │ │ │ -
97 Creference tmp = *this;
│ │ │ │ -
98 return tmp+=r;
│ │ │ │ + │ │ │ │ +
97 Creference tmp = *this;
│ │ │ │ +
98 return tmp+=r;
│ │ │ │
99}
│ │ │ │
│ │ │ │
100
│ │ │ │
101// incrementation of reference
│ │ │ │
102//-----------------------------
│ │ │ │
│ │ │ │ - │ │ │ │ -
104 ref[0] ^= r.ref[0];
│ │ │ │ -
105 ref[1] ^= r.ref[1];
│ │ │ │ -
106 ref[2] ^= r.ref[2];
│ │ │ │ + │ │ │ │ +
104 ref[0] ^= r.ref[0];
│ │ │ │ +
105 ref[1] ^= r.ref[1];
│ │ │ │ +
106 ref[2] ^= r.ref[2];
│ │ │ │
107 return *this;
│ │ │ │
108}
│ │ │ │
│ │ │ │
109
│ │ │ │
110// decrementation of reference
│ │ │ │
111//-----------------------------
│ │ │ │
│ │ │ │ - │ │ │ │ -
113 ref[0] ^= r.ref[0];
│ │ │ │ -
114 ref[1] ^= r.ref[1];
│ │ │ │ -
115 ref[2] ^= r.ref[2];
│ │ │ │ + │ │ │ │ +
113 ref[0] ^= r.ref[0];
│ │ │ │ +
114 ref[1] ^= r.ref[1];
│ │ │ │ +
115 ref[2] ^= r.ref[2];
│ │ │ │
116 return *this;
│ │ │ │
117}
│ │ │ │
│ │ │ │
118
│ │ │ │
119}
│ │ │ │
120
│ │ │ │
references used for checksums.
Definition reference.h:43
│ │ │ │ @@ -191,14 +191,15 @@ │ │ │ │
Creference & operator=(const Creference &r)
assignment of reference
Definition reference.cpp:87
│ │ │ │
Creference()
default constructor
Definition reference.cpp:46
│ │ │ │
void randomize()
create a random reference
Definition reference.cpp:54
│ │ │ │
Creference & operator+=(const Creference &r)
incrementation of reference
│ │ │ │
bool not_empty()
test non-emptyness
Definition reference.cpp:81
│ │ │ │
Creference & operator-=(const Creference &r)
decrementation of reference
│ │ │ │
unsigned int ref[3]
actual data for the reference
Definition reference.h:72
│ │ │ │ +
a circulator that is foreseen to take as template member either a pointer or an iterator;
Definition circulator.h:36
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -55,23 +55,23 @@ │ │ │ │ │ 53//--------------------------- │ │ │ │ │ _5_4void _C_r_e_f_e_r_e_n_c_e_:_:_r_a_n_d_o_m_i_z_e(){ │ │ │ │ │ 55// ref[0] = reference_bit; │ │ │ │ │ 56// ref[1] = 0; │ │ │ │ │ 57// ref[2] = 0; │ │ │ │ │ 58// reference_bit <<= 1; │ │ │ │ │ 59 │ │ │ │ │ -60 unsigned int r1 = ranlux_get(); │ │ │ │ │ -61 unsigned int r2 = ranlux_get(); │ │ │ │ │ -62 unsigned int r3 = ranlux_get(); │ │ │ │ │ -63 unsigned int r4 = ranlux_get(); │ │ │ │ │ +60 unsigned int _r_1 = ranlux_get(); │ │ │ │ │ +61 unsigned int _r_2 = ranlux_get(); │ │ │ │ │ +62 unsigned int _r_3 = ranlux_get(); │ │ │ │ │ +63 unsigned int _r_4 = ranlux_get(); │ │ │ │ │ 64 // since ranlux only produces 24 bits, take r4 and add 8 bits │ │ │ │ │ 65 // from it to each of r1,r2, r3 to get 3*32 bits. │ │ │ │ │ -66 _r_e_f[0] = r1+((r4 & 0x00ff0000) << 8); │ │ │ │ │ -67 _r_e_f[1] = r2+((r4 & 0x0000ff00) << 16); │ │ │ │ │ -68 _r_e_f[2] = r3+((r4 & 0x000000ff) << 24); │ │ │ │ │ +66 _r_e_f[0] = _r_1+((_r_4 & 0x00ff0000) << 8); │ │ │ │ │ +67 _r_e_f[1] = _r_2+((_r_4 & 0x0000ff00) << 16); │ │ │ │ │ +68 _r_e_f[2] = _r_3+((_r_4 & 0x000000ff) << 24); │ │ │ │ │ 69 │ │ │ │ │ 70 if (_i_s___e_m_p_t_y()) _r_a_n_d_o_m_i_z_e(); │ │ │ │ │ 71} │ │ │ │ │ 72 │ │ │ │ │ 73// test emptyness │ │ │ │ │ 74//---------------- │ │ │ │ │ _7_5bool _C_r_e_f_e_r_e_n_c_e_:_:_i_s___e_m_p_t_y(){ │ │ │ │ │ @@ -82,43 +82,43 @@ │ │ │ │ │ 80//-------------------- │ │ │ │ │ _8_1bool _C_r_e_f_e_r_e_n_c_e_:_:_n_o_t___e_m_p_t_y(){ │ │ │ │ │ 82 return (_r_e_f[0]!=0) || (_r_e_f[1]!=0) || (_r_e_f[2]!=0); │ │ │ │ │ 83} │ │ │ │ │ 84 │ │ │ │ │ 85// assignment of reference │ │ │ │ │ 86//------------------------- │ │ │ │ │ -_8_7_C_r_e_f_e_r_e_n_c_e& _C_r_e_f_e_r_e_n_c_e_:_:_o_p_e_r_a_t_o_r_ _=_ (const _C_r_e_f_e_r_e_n_c_e &r){ │ │ │ │ │ -88 _r_e_f[0] = r._r_e_f[0]; │ │ │ │ │ -89 _r_e_f[1] = r._r_e_f[1]; │ │ │ │ │ -90 _r_e_f[2] = r._r_e_f[2]; │ │ │ │ │ +_8_7_C_r_e_f_e_r_e_n_c_e& _C_r_e_f_e_r_e_n_c_e_:_:_o_p_e_r_a_t_o_r_ _=_ (const _C_r_e_f_e_r_e_n_c_e &_r){ │ │ │ │ │ +88 _r_e_f[0] = _r.ref[0]; │ │ │ │ │ +89 _r_e_f[1] = _r.ref[1]; │ │ │ │ │ +90 _r_e_f[2] = _r.ref[2]; │ │ │ │ │ 91 return *this; │ │ │ │ │ 92} │ │ │ │ │ 93 │ │ │ │ │ 94// addition of reference │ │ │ │ │ 95//----------------------- │ │ │ │ │ -_9_6_C_r_e_f_e_r_e_n_c_e _C_r_e_f_e_r_e_n_c_e_:_:_o_p_e_r_a_t_o_r_ _+_ (const _C_r_e_f_e_r_e_n_c_e &r){ │ │ │ │ │ -97 _C_r_e_f_e_r_e_n_c_e tmp = *this; │ │ │ │ │ -98 return tmp+=r; │ │ │ │ │ +_9_6_C_r_e_f_e_r_e_n_c_e _C_r_e_f_e_r_e_n_c_e_:_:_o_p_e_r_a_t_o_r_ _+_ (const _C_r_e_f_e_r_e_n_c_e &_r){ │ │ │ │ │ +97 _C_r_e_f_e_r_e_n_c_e _t_m_p = *this; │ │ │ │ │ +98 return _t_m_p+=_r; │ │ │ │ │ 99} │ │ │ │ │ 100 │ │ │ │ │ 101// incrementation of reference │ │ │ │ │ 102//----------------------------- │ │ │ │ │ -_1_0_3_C_r_e_f_e_r_e_n_c_e& _C_r_e_f_e_r_e_n_c_e_:_:_o_p_e_r_a_t_o_r_ _+_=_ (const _C_r_e_f_e_r_e_n_c_e &r){ │ │ │ │ │ -104 _r_e_f[0] ^= r._r_e_f[0]; │ │ │ │ │ -105 _r_e_f[1] ^= r._r_e_f[1]; │ │ │ │ │ -106 _r_e_f[2] ^= r._r_e_f[2]; │ │ │ │ │ +_1_0_3_C_r_e_f_e_r_e_n_c_e& _C_r_e_f_e_r_e_n_c_e_:_:_o_p_e_r_a_t_o_r_ _+_=_ (const _C_r_e_f_e_r_e_n_c_e &_r){ │ │ │ │ │ +104 _r_e_f[0] ^= _r.ref[0]; │ │ │ │ │ +105 _r_e_f[1] ^= _r.ref[1]; │ │ │ │ │ +106 _r_e_f[2] ^= _r.ref[2]; │ │ │ │ │ 107 return *this; │ │ │ │ │ 108} │ │ │ │ │ 109 │ │ │ │ │ 110// decrementation of reference │ │ │ │ │ 111//----------------------------- │ │ │ │ │ -_1_1_2_C_r_e_f_e_r_e_n_c_e& _C_r_e_f_e_r_e_n_c_e_:_:_o_p_e_r_a_t_o_r_ _-_=_ (const _C_r_e_f_e_r_e_n_c_e &r){ │ │ │ │ │ -113 _r_e_f[0] ^= r._r_e_f[0]; │ │ │ │ │ -114 _r_e_f[1] ^= r._r_e_f[1]; │ │ │ │ │ -115 _r_e_f[2] ^= r._r_e_f[2]; │ │ │ │ │ +_1_1_2_C_r_e_f_e_r_e_n_c_e& _C_r_e_f_e_r_e_n_c_e_:_:_o_p_e_r_a_t_o_r_ _-_=_ (const _C_r_e_f_e_r_e_n_c_e &_r){ │ │ │ │ │ +113 _r_e_f[0] ^= _r.ref[0]; │ │ │ │ │ +114 _r_e_f[1] ^= _r.ref[1]; │ │ │ │ │ +115 _r_e_f[2] ^= _r.ref[2]; │ │ │ │ │ 116 return *this; │ │ │ │ │ 117} │ │ │ │ │ 118 │ │ │ │ │ 119} │ │ │ │ │ 120 │ │ │ │ │ _s_i_s_c_o_n_e_:_:_C_r_e_f_e_r_e_n_c_e │ │ │ │ │ references used for checksums. │ │ │ │ │ @@ -155,10 +155,14 @@ │ │ │ │ │ Creference & operator-=(const Creference &r) │ │ │ │ │ decrementation of reference │ │ │ │ │ DDeeffiinniittiioonn _r_e_f_e_r_e_n_c_e_._c_p_p_:_1_1_2 │ │ │ │ │ _s_i_s_c_o_n_e_:_:_C_r_e_f_e_r_e_n_c_e_:_:_r_e_f │ │ │ │ │ unsigned int ref[3] │ │ │ │ │ actual data for the reference │ │ │ │ │ DDeeffiinniittiioonn _r_e_f_e_r_e_n_c_e_._h_:_7_2 │ │ │ │ │ +_s_i_s_c_o_n_e_:_:_c_i_r_c_u_l_a_t_o_r │ │ │ │ │ +a circulator that is foreseen to take as template member either a pointer or an │ │ │ │ │ +iterator; │ │ │ │ │ +DDeeffiinniittiioonn _c_i_r_c_u_l_a_t_o_r_._h_:_3_6 │ │ │ │ │ _r_a_n_l_u_x_._h │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/siscone-doc-html/html/devel/reference_8h_source.html │ │ │ │ @@ -88,43 +88,43 @@ │ │ │ │
47
│ │ │ │
49 void randomize();
│ │ │ │
50
│ │ │ │
52 bool is_empty();
│ │ │ │
53
│ │ │ │
55 bool not_empty();
│ │ │ │
56
│ │ │ │ - │ │ │ │ + │ │ │ │
59
│ │ │ │ - │ │ │ │ + │ │ │ │
62
│ │ │ │ - │ │ │ │ + │ │ │ │
65
│ │ │ │ - │ │ │ │ + │ │ │ │
68
│ │ │ │
70 inline unsigned int operator[] (int i) {return ref[i];}
│ │ │ │
71
│ │ │ │
72 unsigned int ref[3];
│ │ │ │
73};
│ │ │ │ │ │ │ │
74
│ │ │ │ -
76Creference operator + (Creference &r1, Creference &r2);
│ │ │ │ + │ │ │ │
77
│ │ │ │ -
79bool operator == (const Creference &r1, const Creference &r2);
│ │ │ │ +
79bool operator == (const Creference &r1, const Creference &r2);
│ │ │ │
80
│ │ │ │ -
82bool operator != (const Creference &r1, const Creference &r2);
│ │ │ │ +
82bool operator != (const Creference &r1, const Creference &r2);
│ │ │ │
83
│ │ │ │ -
85bool operator < (const Creference &r1, const Creference &r2);
│ │ │ │ +
85bool operator < (const Creference &r1, const Creference &r2);
│ │ │ │
86
│ │ │ │
87
│ │ │ │
88//=============== inline material ================
│ │ │ │
89
│ │ │ │
90// equality test for two references
│ │ │ │
91//----------------------------------
│ │ │ │ -
92inline bool operator == (const Creference &r1, const Creference &r2){
│ │ │ │ -
93 return (r1.ref[0]==r2.ref[0]) && (r1.ref[1]==r2.ref[1]) && (r1.ref[2]==r2.ref[2]);
│ │ │ │ +
92inline bool operator == (const Creference &r1, const Creference &r2){
│ │ │ │ +
93 return (r1.ref[0]==r2.ref[0]) && (r1.ref[1]==r2.ref[1]) && (r1.ref[2]==r2.ref[2]);
│ │ │ │
94}
│ │ │ │
95
│ │ │ │
96// difference test for two references
│ │ │ │
97//----------------------------------
│ │ │ │
98inline bool operator != (const Creference &r1, const Creference &r2){
│ │ │ │
99 return (r1.ref[0]!=r2.ref[0]) || (r1.ref[1]!=r2.ref[1]) || (r1.ref[2]!=r2.ref[2]);
│ │ │ │
100}
│ │ │ │ @@ -146,14 +146,15 @@ │ │ │ │
unsigned int operator[](int i)
accessing the reference
Definition reference.h:70
│ │ │ │
Creference()
default constructor
Definition reference.cpp:46
│ │ │ │
void randomize()
create a random reference
Definition reference.cpp:54
│ │ │ │
Creference & operator+=(const Creference &r)
incrementation of reference
│ │ │ │
bool not_empty()
test non-emptyness
Definition reference.cpp:81
│ │ │ │
Creference & operator-=(const Creference &r)
decrementation of reference
│ │ │ │
unsigned int ref[3]
actual data for the reference
Definition reference.h:72
│ │ │ │ +
a circulator that is foreseen to take as template member either a pointer or an iterator;
Definition circulator.h:36
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -38,43 +38,43 @@ │ │ │ │ │ 47 │ │ │ │ │ 49 void _r_a_n_d_o_m_i_z_e(); │ │ │ │ │ 50 │ │ │ │ │ 52 bool _i_s___e_m_p_t_y(); │ │ │ │ │ 53 │ │ │ │ │ 55 bool _n_o_t___e_m_p_t_y(); │ │ │ │ │ 56 │ │ │ │ │ -58 _C_r_e_f_e_r_e_n_c_e& _o_p_e_r_a_t_o_r_ _=_ (const _C_r_e_f_e_r_e_n_c_e &r); │ │ │ │ │ +58 _C_r_e_f_e_r_e_n_c_e& _o_p_e_r_a_t_o_r_ _=_ (const _C_r_e_f_e_r_e_n_c_e &_r); │ │ │ │ │ 59 │ │ │ │ │ -61 _C_r_e_f_e_r_e_n_c_e _o_p_e_r_a_t_o_r_ _+_ (const _C_r_e_f_e_r_e_n_c_e &r); │ │ │ │ │ +61 _C_r_e_f_e_r_e_n_c_e _o_p_e_r_a_t_o_r_ _+_ (const _C_r_e_f_e_r_e_n_c_e &_r); │ │ │ │ │ 62 │ │ │ │ │ -64 _C_r_e_f_e_r_e_n_c_e& _o_p_e_r_a_t_o_r_ _+_=_ (const _C_r_e_f_e_r_e_n_c_e &r); │ │ │ │ │ +64 _C_r_e_f_e_r_e_n_c_e& _o_p_e_r_a_t_o_r_ _+_=_ (const _C_r_e_f_e_r_e_n_c_e &_r); │ │ │ │ │ 65 │ │ │ │ │ -67 _C_r_e_f_e_r_e_n_c_e& _o_p_e_r_a_t_o_r_ _-_=_ (const _C_r_e_f_e_r_e_n_c_e &r); │ │ │ │ │ +67 _C_r_e_f_e_r_e_n_c_e& _o_p_e_r_a_t_o_r_ _-_=_ (const _C_r_e_f_e_r_e_n_c_e &_r); │ │ │ │ │ 68 │ │ │ │ │ _7_0 inline unsigned int _o_p_e_r_a_t_o_r_[_]_ (int i) {return _r_e_f[i];} │ │ │ │ │ 71 │ │ │ │ │ _7_2 unsigned int _r_e_f[3]; │ │ │ │ │ 73}; │ │ │ │ │ 74 │ │ │ │ │ -76_C_r_e_f_e_r_e_n_c_e operator + (_C_r_e_f_e_r_e_n_c_e &r1, _C_r_e_f_e_r_e_n_c_e &r2); │ │ │ │ │ +76_C_r_e_f_e_r_e_n_c_e _o_p_e_r_a_t_o_r_ _+_ (_C_r_e_f_e_r_e_n_c_e &_r_1, _C_r_e_f_e_r_e_n_c_e &_r_2); │ │ │ │ │ 77 │ │ │ │ │ -79bool operator == (const _C_r_e_f_e_r_e_n_c_e &r1, const _C_r_e_f_e_r_e_n_c_e &r2); │ │ │ │ │ +79bool _o_p_e_r_a_t_o_r_ _=_=_ (const _C_r_e_f_e_r_e_n_c_e &_r_1, const _C_r_e_f_e_r_e_n_c_e &_r_2); │ │ │ │ │ 80 │ │ │ │ │ -82bool operator != (const _C_r_e_f_e_r_e_n_c_e &r1, const _C_r_e_f_e_r_e_n_c_e &r2); │ │ │ │ │ +82bool _o_p_e_r_a_t_o_r_ _!_=_ (const _C_r_e_f_e_r_e_n_c_e &_r_1, const _C_r_e_f_e_r_e_n_c_e &_r_2); │ │ │ │ │ 83 │ │ │ │ │ -85bool operator < (const _C_r_e_f_e_r_e_n_c_e &r1, const _C_r_e_f_e_r_e_n_c_e &r2); │ │ │ │ │ +85bool _o_p_e_r_a_t_o_r_ _<_ (const _C_r_e_f_e_r_e_n_c_e &_r_1, const _C_r_e_f_e_r_e_n_c_e &_r_2); │ │ │ │ │ 86 │ │ │ │ │ 87 │ │ │ │ │ 88//=============== inline material ================ │ │ │ │ │ 89 │ │ │ │ │ 90// equality test for two references │ │ │ │ │ 91//---------------------------------- │ │ │ │ │ -92inline bool operator == (const _C_r_e_f_e_r_e_n_c_e &r1, const _C_r_e_f_e_r_e_n_c_e &r2){ │ │ │ │ │ -93 return (r1._r_e_f[0]==r2._r_e_f[0]) && (r1._r_e_f[1]==r2._r_e_f[1]) && (r1._r_e_f │ │ │ │ │ -[2]==r2._r_e_f[2]); │ │ │ │ │ +92inline bool _o_p_e_r_a_t_o_r_ _=_=_ (const _C_r_e_f_e_r_e_n_c_e &_r_1, const _C_r_e_f_e_r_e_n_c_e &_r_2){ │ │ │ │ │ +93 return (_r_1.ref[0]==_r_2.ref[0]) && (_r_1.ref[1]==_r_2.ref[1]) && (_r_1.ref │ │ │ │ │ +[2]==_r_2.ref[2]); │ │ │ │ │ 94} │ │ │ │ │ 95 │ │ │ │ │ 96// difference test for two references │ │ │ │ │ 97//---------------------------------- │ │ │ │ │ 98inline bool operator != (const Creference &r1, const Creference &r2){ │ │ │ │ │ 99 return (r1.ref[0]!=r2.ref[0]) || (r1.ref[1]!=r2.ref[1]) || (r1.ref │ │ │ │ │ [2]!=r2.ref[2]); │ │ │ │ │ @@ -129,9 +129,13 @@ │ │ │ │ │ Creference & operator-=(const Creference &r) │ │ │ │ │ decrementation of reference │ │ │ │ │ DDeeffiinniittiioonn _r_e_f_e_r_e_n_c_e_._c_p_p_:_1_1_2 │ │ │ │ │ _s_i_s_c_o_n_e_:_:_C_r_e_f_e_r_e_n_c_e_:_:_r_e_f │ │ │ │ │ unsigned int ref[3] │ │ │ │ │ actual data for the reference │ │ │ │ │ DDeeffiinniittiioonn _r_e_f_e_r_e_n_c_e_._h_:_7_2 │ │ │ │ │ +_s_i_s_c_o_n_e_:_:_c_i_r_c_u_l_a_t_o_r │ │ │ │ │ +a circulator that is foreseen to take as template member either a pointer or an │ │ │ │ │ +iterator; │ │ │ │ │ +DDeeffiinniittiioonn _c_i_r_c_u_l_a_t_o_r_._h_:_3_6 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/siscone-doc-html/html/devel/siscone_8cpp_source.html │ │ │ │ @@ -111,15 +111,15 @@ │ │ │ │
│ │ │ │ │ │ │ │
58 rerun_allowed = false;
│ │ │ │
59}
│ │ │ │
│ │ │ │
60
│ │ │ │
61bool Csiscone::init_done=false;
│ │ │ │ -
62std::ostream* Csiscone::_banner_ostr = &cout;
│ │ │ │ +
62std::ostream* Csiscone::_banner_ostr = &cout;
│ │ │ │
63
│ │ │ │
64/*
│ │ │ │
65 * compute the jets from a given particle set doing multiple passes
│ │ │ │
66 * such pass N looks for jets among all particles not put into jets
│ │ │ │
67 * during previous passes.
│ │ │ │
68 * - _particles list of particles
│ │ │ │
69 * - _radius cone radius
│ │ │ │ @@ -129,76 +129,76 @@ │ │ │ │
73 * - _split_merge_scale the scale choice for the split-merge procedure
│ │ │ │
74 * NOTE: using pt leads to IR unsafety for some events with momentum
│ │ │ │
75 * conservation. So we strongly advise not to change the default
│ │ │ │
76 * value.
│ │ │ │
77 * return the number of jets found.
│ │ │ │
78 **********************************************************************/
│ │ │ │
│ │ │ │ -
79int Csiscone::compute_jets(vector<Cmomentum> &_particles, double _radius, double _f,
│ │ │ │ -
80 int _n_pass_max, double _ptmin,
│ │ │ │ -
81 Esplit_merge_scale _split_merge_scale){
│ │ │ │ + │ │ │ │ +
80 int _n_pass_max, double _ptmin,
│ │ │ │ +
81 Esplit_merge_scale _split_merge_scale){
│ │ │ │
82 _initialise_if_needed();
│ │ │ │
83
│ │ │ │
84 // run some general safety tests (NB: f will be checked in split-merge)
│ │ │ │ -
85 if (_radius <= 0.0 || _radius >= 0.5*M_PI) {
│ │ │ │ -
86 ostringstream message;
│ │ │ │ -
87 message << "Illegal value for cone radius, R = " << _radius
│ │ │ │ +
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)";
│ │ │ │
89 throw Csiscone_error(message.str());
│ │ │ │
90 }
│ │ │ │
91
│ │ │ │
92
│ │ │ │
93
│ │ │ │ -
94 ptcomparison.split_merge_scale = _split_merge_scale;
│ │ │ │ + │ │ │ │
95 partial_clear(); // make sure some things are initialised properly
│ │ │ │
96
│ │ │ │
97 // init the split_merge algorithm with the initial list of particles
│ │ │ │
98 // this initialises particle list p_left of remaining particles to deal with
│ │ │ │ -
99 init_particles(_particles);
│ │ │ │ + │ │ │ │
100
│ │ │ │ -
101 bool finished = false;
│ │ │ │ +
101 bool finished = false;
│ │ │ │
102
│ │ │ │
103 rerun_allowed = false;
│ │ │ │
104 protocones_list.clear();
│ │ │ │
105
│ │ │ │
106#ifdef DEBUG_STABLE_CONES
│ │ │ │ -
107 nb_hash_cones_total = 0;
│ │ │ │ -
108 nb_hash_occupied_total = 0;
│ │ │ │ + │ │ │ │ + │ │ │ │
109#endif
│ │ │ │
110
│ │ │ │
111 do{
│ │ │ │
112 // initialise stable_cone finder
│ │ │ │
113 // here we use the list of remaining particles
│ │ │ │
114 // AFTER COLLINEAR CLUSTERING !!!!!!
│ │ │ │ │ │ │ │
116
│ │ │ │
117 // get stable cones
│ │ │ │ -
118 if (get_stable_cones(_radius)){
│ │ │ │ + │ │ │ │
119 // we have some new protocones; add them to candidates
│ │ │ │
120 // Note that add_protocones has to be called first
│ │ │ │
121 // if we want the 4-vect components to be available
│ │ │ │
122 // on top of eta and phi.
│ │ │ │ -
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;
│ │ │ │ + │ │ │ │ + │ │ │ │
128#endif
│ │ │ │
129 } else {
│ │ │ │
130 // no new protocone: leave
│ │ │ │ -
131 finished=true;
│ │ │ │ +
131 finished=true;
│ │ │ │
132 }
│ │ │ │
133
│ │ │ │ -
134 _n_pass_max--;
│ │ │ │ -
135 } while ((!finished) && (n_left>0) && (_n_pass_max!=0));
│ │ │ │ +
134 _n_pass_max--;
│ │ │ │ +
135 } while ((!finished) && (n_left>0) && (_n_pass_max!=0));
│ │ │ │
136
│ │ │ │
137 rerun_allowed = true;
│ │ │ │
138
│ │ │ │
139 // split & merge
│ │ │ │ -
140 return perform(_f, _ptmin);
│ │ │ │ +
140 return perform(_f, _ptmin);
│ │ │ │
141}
│ │ │ │
│ │ │ │
142
│ │ │ │
143
│ │ │ │
144/*
│ │ │ │
145 * compute the jets from a given particle set doing multiple passes
│ │ │ │
146 * such pass N looks for jets among all particles not put into jets
│ │ │ │ @@ -208,57 +208,57 @@ │ │ │ │
150 * - _n_pass_max maximum number of runs
│ │ │ │
151 * - _ptmin minimum pT of the protojets
│ │ │ │
152 * - _ordering_scale the ordering scale to decide which stable
│ │ │ │
153 * cone is removed
│ │ │ │
154 * return the number of jets found.
│ │ │ │
155 **********************************************************************/
│ │ │ │
│ │ │ │ -
156int Csiscone::compute_jets_progressive_removal(vector<Cmomentum> &_particles, double _radius,
│ │ │ │ -
157 int _n_pass_max, double _ptmin,
│ │ │ │ -
158 Esplit_merge_scale _ordering_scale){
│ │ │ │ + │ │ │ │ +
157 int _n_pass_max, double _ptmin,
│ │ │ │ +
158 Esplit_merge_scale _ordering_scale){
│ │ │ │
159 _initialise_if_needed();
│ │ │ │
160
│ │ │ │
161 // run some general safety tests (NB: f will be checked in split-merge)
│ │ │ │ -
162 if (_radius <= 0.0 || _radius >= 0.5*M_PI) {
│ │ │ │ -
163 ostringstream message;
│ │ │ │ -
164 message << "Illegal value for cone radius, R = " << _radius
│ │ │ │ +
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)";
│ │ │ │
166 throw Csiscone_error(message.str());
│ │ │ │
167 }
│ │ │ │
168
│ │ │ │ -
169 ptcomparison.split_merge_scale = _ordering_scale;
│ │ │ │ + │ │ │ │
170 partial_clear(); // make sure some things are initialised properly
│ │ │ │
171
│ │ │ │
172 // init the split_merge algorithm with the initial list of particles
│ │ │ │
173 // this initialises particle list p_left of remaining particles to deal with
│ │ │ │
174 //
│ │ │ │
175 // this stores the "processed" particles in p_uncol_hard
│ │ │ │ -
176 init_particles(_particles);
│ │ │ │ + │ │ │ │
177 jets.clear();
│ │ │ │
178
│ │ │ │ -
179 bool unclustered_left;
│ │ │ │ +
179 bool unclustered_left;
│ │ │ │
180 rerun_allowed = false;
│ │ │ │
181 protocones_list.clear();
│ │ │ │
182
│ │ │ │
183 do{
│ │ │ │
184 //cout << n_left << " particle left" << endl;
│ │ │ │
185
│ │ │ │
186 // initialise stable_cone finder
│ │ │ │
187 // here we use the list of remaining particles
│ │ │ │
188 // AFTER COLLINEAR CLUSTERING !!!!!!
│ │ │ │ │ │ │ │
190
│ │ │ │
191 // get stable cones (stored in 'protocones')
│ │ │ │ -
192 unclustered_left = get_stable_cones(_radius);
│ │ │ │ + │ │ │ │
193
│ │ │ │
194 // add the hardest stable cone to the list of jets
│ │ │ │ -
195 if (add_hardest_protocone_to_jets(&protocones, R2, _ptmin)) break;
│ │ │ │ + │ │ │ │
196
│ │ │ │ -
197 _n_pass_max--;
│ │ │ │ -
198 } while ((unclustered_left) && (n_left>0) && (_n_pass_max!=0));
│ │ │ │ +
197 _n_pass_max--;
│ │ │ │ +
198 } while ((unclustered_left) && (n_left>0) && (_n_pass_max!=0));
│ │ │ │
199
│ │ │ │
200 // split & merge
│ │ │ │
201 return jets.size();
│ │ │ │
202}
│ │ │ │
│ │ │ │
203
│ │ │ │
204
│ │ │ │ @@ -270,32 +270,32 @@ │ │ │ │
210 * - _split_merge_scale the scale choice for the split-merge procedure
│ │ │ │
211 * NOTE: using pt leads to IR unsafety for some events with momentum
│ │ │ │
212 * conservation. So we strongly advise not to change the default
│ │ │ │
213 * value.
│ │ │ │
214 * return the number of jets found, -1 if recomputation not allowed.
│ │ │ │
215 ********************************************************************/
│ │ │ │
│ │ │ │ -
216int Csiscone::recompute_jets(double _f, double _ptmin,
│ │ │ │ -
217 Esplit_merge_scale _split_merge_scale){
│ │ │ │ + │ │ │ │ +
217 Esplit_merge_scale _split_merge_scale){
│ │ │ │
218 if (!rerun_allowed)
│ │ │ │
219 return -1;
│ │ │ │
220
│ │ │ │ -
221 ptcomparison.split_merge_scale = _split_merge_scale;
│ │ │ │ + │ │ │ │
222
│ │ │ │
223 // restore particle list
│ │ │ │ │ │ │ │
225 init_pleft();
│ │ │ │
226
│ │ │ │
227 // initialise split/merge algorithm
│ │ │ │
228 unsigned int i;
│ │ │ │
229 for (i=0;i<protocones_list.size();i++)
│ │ │ │ -
230 add_protocones(&(protocones_list[i]), R2, _ptmin);
│ │ │ │ + │ │ │ │
231
│ │ │ │
232 // split & merge
│ │ │ │ -
233 return perform(_f, _ptmin);
│ │ │ │ +
233 return perform(_f, _ptmin);
│ │ │ │
234}
│ │ │ │
│ │ │ │
235
│ │ │ │
236// ensure things are initialised
│ │ │ │
237void Csiscone::_initialise_if_needed(){
│ │ │ │
238 // initialise random number generator
│ │ │ │
239 if (init_done) return;
│ │ │ │ @@ -304,32 +304,32 @@ │ │ │ │
242 ranlux_init();
│ │ │ │
243
│ │ │ │
244 // do not do this again
│ │ │ │
245 init_done=true;
│ │ │ │
246
│ │ │ │
247 // print the banner
│ │ │ │
248 if (_banner_ostr != 0){
│ │ │ │ -
249 ios::fmtflags flags_to_restore(_banner_ostr->flags());
│ │ │ │ +
249 ios::fmtflags flags_to_restore(_banner_ostr->flags());
│ │ │ │
250
│ │ │ │ -
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;
│ │ │ │ +
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;
│ │ │ │
264
│ │ │ │
265 _banner_ostr->flush();
│ │ │ │ -
266 _banner_ostr->flags(flags_to_restore);
│ │ │ │ +
266 _banner_ostr->flags(flags_to_restore);
│ │ │ │
267 }
│ │ │ │
268}
│ │ │ │
269
│ │ │ │
270// finally, a bunch of functions to access to
│ │ │ │
271// basic information (package name, version)
│ │ │ │
272//---------------------------------------------
│ │ │ │
273
│ │ │ │ @@ -373,14 +373,15 @@ │ │ │ │
std::vector< Cmomentum > p_uncol_hard
list of particles remaining with collinear clustering
│ │ │ │
std::vector< Cjet > jets
list of jets
│ │ │ │
int init_particles(std::vector< Cmomentum > &_particles)
initialisation function for particle list
│ │ │ │
void init(std::vector< Cmomentum > &_particle_list)
initialisation
│ │ │ │
std::vector< Cmomentum > protocones
list of stable cones
Definition protocones.h:109
│ │ │ │
double R2
cone radius SQUARED
Definition protocones.h:125
│ │ │ │
int get_stable_cones(double _radius)
compute stable cones.
│ │ │ │ +
a circulator that is foreseen to take as template member either a pointer or an iterator;
Definition circulator.h:36
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -58,15 +58,15 @@ │ │ │ │ │ 55// default dtor │ │ │ │ │ 56//-------------- │ │ │ │ │ _5_7_C_s_i_s_c_o_n_e_:_:_~_C_s_i_s_c_o_n_e(){ │ │ │ │ │ 58 rerun_allowed = false; │ │ │ │ │ 59} │ │ │ │ │ 60 │ │ │ │ │ 61bool _C_s_i_s_c_o_n_e_:_:_i_n_i_t___d_o_n_e=false; │ │ │ │ │ -62std::ostream* Csiscone::_banner_ostr = &cout; │ │ │ │ │ +62std::ostream* Csiscone::_banner_ostr = &_c_o_u_t; │ │ │ │ │ 63 │ │ │ │ │ 64/* │ │ │ │ │ 65 * compute the jets from a given particle set doing multiple passes │ │ │ │ │ 66 * such pass N looks for jets among all particles not put into jets │ │ │ │ │ 67 * during previous passes. │ │ │ │ │ 68 * - _particles list of particles │ │ │ │ │ 69 * - _radius cone radius │ │ │ │ │ @@ -75,77 +75,77 @@ │ │ │ │ │ 72 * - _ptmin minimum pT of the protojets │ │ │ │ │ 73 * - _split_merge_scale the scale choice for the split-merge procedure │ │ │ │ │ 74 * NOTE: using pt leads to IR unsafety for some events with momentum │ │ │ │ │ 75 * conservation. So we strongly advise not to change the default │ │ │ │ │ 76 * value. │ │ │ │ │ 77 * return the number of jets found. │ │ │ │ │ 78 **********************************************************************/ │ │ │ │ │ -_7_9int _C_s_i_s_c_o_n_e_:_:_c_o_m_p_u_t_e___j_e_t_s(vector &_particles, double _radius, │ │ │ │ │ -double _f, │ │ │ │ │ -80 int _n_pass_max, double _ptmin, │ │ │ │ │ -81 Esplit_merge_scale _split_merge_scale){ │ │ │ │ │ +_7_9int _C_s_i_s_c_o_n_e_:_:_c_o_m_p_u_t_e___j_e_t_s(_v_e_c_t_o_r_<_C_m_o_m_e_n_t_u_m_> &___p_a_r_t_i_c_l_e_s, double ___r_a_d_i_u_s, │ │ │ │ │ +double ___f, │ │ │ │ │ +80 int ___n___p_a_s_s___m_a_x, double ___p_t_m_i_n, │ │ │ │ │ +81 Esplit_merge_scale ___s_p_l_i_t___m_e_r_g_e___s_c_a_l_e){ │ │ │ │ │ 82 _initialise_if_needed(); │ │ │ │ │ 83 │ │ │ │ │ 84 // run some general safety tests (NB: f will be checked in split-merge) │ │ │ │ │ -85 if (_radius <= 0.0 || _radius >= 0.5*M_PI) { │ │ │ │ │ -86 ostringstream message; │ │ │ │ │ -87 message << "Illegal value for cone radius, R = " << _radius │ │ │ │ │ +85 if (___r_a_d_i_u_s_ _<_=_ _0_._0_ _|_|_ ___r_a_d_i_u_s_ _>= 0.5*M_PI) { │ │ │ │ │ +86 _o_s_t_r_i_n_g_s_t_r_e_a_m message; │ │ │ │ │ +87 message << "Illegal value for cone radius, R = " << ___r_a_d_i_u_s │ │ │ │ │ 88 << " (legal values are 00) && (_n_pass_max!=0)); │ │ │ │ │ +134 ___n___p_a_s_s___m_a_x--; │ │ │ │ │ +135 } while ((!_f_i_n_i_s_h_e_d) && (_n___l_e_f_t>0) && (___n___p_a_s_s___m_a_x!=0)); │ │ │ │ │ 136 │ │ │ │ │ 137 rerun_allowed = true; │ │ │ │ │ 138 │ │ │ │ │ 139 // split & merge │ │ │ │ │ -140 return _p_e_r_f_o_r_m(_f, _ptmin); │ │ │ │ │ +140 return _p_e_r_f_o_r_m(___f, ___p_t_m_i_n); │ │ │ │ │ 141} │ │ │ │ │ 142 │ │ │ │ │ 143 │ │ │ │ │ 144/* │ │ │ │ │ 145 * compute the jets from a given particle set doing multiple passes │ │ │ │ │ 146 * such pass N looks for jets among all particles not put into jets │ │ │ │ │ 147 * during previous passes. │ │ │ │ │ @@ -153,59 +153,59 @@ │ │ │ │ │ 149 * - _radius cone radius │ │ │ │ │ 150 * - _n_pass_max maximum number of runs │ │ │ │ │ 151 * - _ptmin minimum pT of the protojets │ │ │ │ │ 152 * - _ordering_scale the ordering scale to decide which stable │ │ │ │ │ 153 * cone is removed │ │ │ │ │ 154 * return the number of jets found. │ │ │ │ │ 155 **********************************************************************/ │ │ │ │ │ -_1_5_6int _C_s_i_s_c_o_n_e_:_:_c_o_m_p_u_t_e___j_e_t_s___p_r_o_g_r_e_s_s_i_v_e___r_e_m_o_v_a_l(vector │ │ │ │ │ -&_particles, double _radius, │ │ │ │ │ -157 int _n_pass_max, double _ptmin, │ │ │ │ │ -158 Esplit_merge_scale _ordering_scale){ │ │ │ │ │ +_1_5_6int _C_s_i_s_c_o_n_e_:_:_c_o_m_p_u_t_e___j_e_t_s___p_r_o_g_r_e_s_s_i_v_e___r_e_m_o_v_a_l(_v_e_c_t_o_r_<_C_m_o_m_e_n_t_u_m_> │ │ │ │ │ +&___p_a_r_t_i_c_l_e_s, double ___r_a_d_i_u_s, │ │ │ │ │ +157 int ___n___p_a_s_s___m_a_x, double ___p_t_m_i_n, │ │ │ │ │ +158 Esplit_merge_scale ___o_r_d_e_r_i_n_g___s_c_a_l_e){ │ │ │ │ │ 159 _initialise_if_needed(); │ │ │ │ │ 160 │ │ │ │ │ 161 // run some general safety tests (NB: f will be checked in split-merge) │ │ │ │ │ -162 if (_radius <= 0.0 || _radius >= 0.5*M_PI) { │ │ │ │ │ -163 ostringstream message; │ │ │ │ │ -164 message << "Illegal value for cone radius, R = " << _radius │ │ │ │ │ +162 if (___r_a_d_i_u_s_ _<_=_ _0_._0_ _|_|_ ___r_a_d_i_u_s_ _>= 0.5*M_PI) { │ │ │ │ │ +163 _o_s_t_r_i_n_g_s_t_r_e_a_m message; │ │ │ │ │ +164 message << "Illegal value for cone radius, R = " << ___r_a_d_i_u_s │ │ │ │ │ 165 << " (legal values are 00) && (_n_pass_max!=0)); │ │ │ │ │ +197 ___n___p_a_s_s___m_a_x--; │ │ │ │ │ +198 } while ((_u_n_c_l_u_s_t_e_r_e_d___l_e_f_t) && (_n___l_e_f_t>0) && (___n___p_a_s_s___m_a_x!=0)); │ │ │ │ │ 199 │ │ │ │ │ 200 // split & merge │ │ │ │ │ 201 return _j_e_t_s.size(); │ │ │ │ │ 202} │ │ │ │ │ 203 │ │ │ │ │ 204 │ │ │ │ │ 205/* │ │ │ │ │ @@ -215,32 +215,32 @@ │ │ │ │ │ 209 * - _ptmin minimum pT of the protojets │ │ │ │ │ 210 * - _split_merge_scale the scale choice for the split-merge procedure │ │ │ │ │ 211 * NOTE: using pt leads to IR unsafety for some events with momentum │ │ │ │ │ 212 * conservation. So we strongly advise not to change the default │ │ │ │ │ 213 * value. │ │ │ │ │ 214 * return the number of jets found, -1 if recomputation not allowed. │ │ │ │ │ 215 ********************************************************************/ │ │ │ │ │ -_2_1_6int _C_s_i_s_c_o_n_e_:_:_r_e_c_o_m_p_u_t_e___j_e_t_s(double _f, double _ptmin, │ │ │ │ │ -217 Esplit_merge_scale _split_merge_scale){ │ │ │ │ │ +_2_1_6int _C_s_i_s_c_o_n_e_:_:_r_e_c_o_m_p_u_t_e___j_e_t_s(double ___f, double ___p_t_m_i_n, │ │ │ │ │ +217 Esplit_merge_scale ___s_p_l_i_t___m_e_r_g_e___s_c_a_l_e){ │ │ │ │ │ 218 if (!rerun_allowed) │ │ │ │ │ 219 return -1; │ │ │ │ │ 220 │ │ │ │ │ -221 _p_t_c_o_m_p_a_r_i_s_o_n._s_p_l_i_t___m_e_r_g_e___s_c_a_l_e = _split_merge_scale; │ │ │ │ │ +221 _p_t_c_o_m_p_a_r_i_s_o_n._s_p_l_i_t___m_e_r_g_e___s_c_a_l_e = ___s_p_l_i_t___m_e_r_g_e___s_c_a_l_e; │ │ │ │ │ 222 │ │ │ │ │ 223 // restore particle list │ │ │ │ │ 224 _p_a_r_t_i_a_l___c_l_e_a_r(); │ │ │ │ │ 225 _i_n_i_t___p_l_e_f_t(); │ │ │ │ │ 226 │ │ │ │ │ 227 // initialise split/merge algorithm │ │ │ │ │ 228 unsigned int i; │ │ │ │ │ 229 for (i=0;i<_p_r_o_t_o_c_o_n_e_s___l_i_s_t.size();i++) │ │ │ │ │ -230 _a_d_d___p_r_o_t_o_c_o_n_e_s(&(_p_r_o_t_o_c_o_n_e_s___l_i_s_t[i]), _R_2, _ptmin); │ │ │ │ │ +230 _a_d_d___p_r_o_t_o_c_o_n_e_s(&(_p_r_o_t_o_c_o_n_e_s___l_i_s_t[i]), _R_2, ___p_t_m_i_n); │ │ │ │ │ 231 │ │ │ │ │ 232 // split & merge │ │ │ │ │ -233 return _p_e_r_f_o_r_m(_f, _ptmin); │ │ │ │ │ +233 return _p_e_r_f_o_r_m(___f, ___p_t_m_i_n); │ │ │ │ │ 234} │ │ │ │ │ 235 │ │ │ │ │ 236// ensure things are initialised │ │ │ │ │ 237void Csiscone::_initialise_if_needed(){ │ │ │ │ │ 238 // initialise random number generator │ │ │ │ │ 239 if (_i_n_i_t___d_o_n_e) return; │ │ │ │ │ 240 │ │ │ │ │ @@ -248,40 +248,40 @@ │ │ │ │ │ 242 ranlux_init(); │ │ │ │ │ 243 │ │ │ │ │ 244 // do not do this again │ │ │ │ │ 245 _i_n_i_t___d_o_n_e=true; │ │ │ │ │ 246 │ │ │ │ │ 247 // print the banner │ │ │ │ │ 248 if (_banner_ostr != 0){ │ │ │ │ │ -249 ios::fmtflags flags_to_restore(_banner_ostr->flags()); │ │ │ │ │ +249 ios::fmtflags _f_l_a_g_s___t_o___r_e_s_t_o_r_e(_banner_ostr->flags()); │ │ │ │ │ 250 │ │ │ │ │ 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; │ │ │ │ │ +"#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" << _e_n_d_l; │ │ │ │ │ +252 (*_banner_ostr) << "# SISCone version " << _s_e_t_w(28) << _l_e_f_t << │ │ │ │ │ +siscone_version() << "o" << _e_n_d_l; │ │ │ │ │ +253 (*_banner_ostr) << "# http://projects.hepforge.org/siscone o" << _e_n_d_l; │ │ │ │ │ +254 (*_banner_ostr) << "# o" << _e_n_d_l; │ │ │ │ │ 255 (*_banner_ostr) << "# This is SISCone: the Seedless Infrared Safe Cone Jet │ │ │ │ │ -Algorithm o" << endl; │ │ │ │ │ +Algorithm o" << _e_n_d_l; │ │ │ │ │ 256 (*_banner_ostr) << "# SISCone was written by Gavin Salam and Gregory Soyez │ │ │ │ │ -o" << endl; │ │ │ │ │ +o" << _e_n_d_l; │ │ │ │ │ 257 (*_banner_ostr) << "# It is released under the terms of the GNU General │ │ │ │ │ -Public License o" << endl; │ │ │ │ │ -258 (*_banner_ostr) << "# o" << endl; │ │ │ │ │ +Public License o" << _e_n_d_l; │ │ │ │ │ +258 (*_banner_ostr) << "# o" << _e_n_d_l; │ │ │ │ │ 259 (*_banner_ostr) << "# A description of the algorithm is available in the │ │ │ │ │ -publication o" << endl; │ │ │ │ │ +publication o" << _e_n_d_l; │ │ │ │ │ 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; │ │ │ │ │ +_e_n_d_l; │ │ │ │ │ +261 (*_banner_ostr) << "# Please cite it if you use SISCone. o" << _e_n_d_l; │ │ │ │ │ 262 (*_banner_ostr) << │ │ │ │ │ -"#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" << endl; │ │ │ │ │ -263 (*_banner_ostr) << endl; │ │ │ │ │ +"#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" << _e_n_d_l; │ │ │ │ │ +263 (*_banner_ostr) << _e_n_d_l; │ │ │ │ │ 264 │ │ │ │ │ 265 _banner_ostr->flush(); │ │ │ │ │ -266 _banner_ostr->flags(flags_to_restore); │ │ │ │ │ +266 _banner_ostr->flags(_f_l_a_g_s___t_o___r_e_s_t_o_r_e); │ │ │ │ │ 267 } │ │ │ │ │ 268} │ │ │ │ │ 269 │ │ │ │ │ 270// finally, a bunch of functions to access to │ │ │ │ │ 271// basic information (package name, version) │ │ │ │ │ 272//--------------------------------------------- │ │ │ │ │ 273 │ │ │ │ │ @@ -403,11 +403,15 @@ │ │ │ │ │ double R2 │ │ │ │ │ cone radius SQUARED │ │ │ │ │ DDeeffiinniittiioonn _p_r_o_t_o_c_o_n_e_s_._h_:_1_2_5 │ │ │ │ │ _s_i_s_c_o_n_e_:_:_C_s_t_a_b_l_e___c_o_n_e_s_:_:_g_e_t___s_t_a_b_l_e___c_o_n_e_s │ │ │ │ │ int get_stable_cones(double _radius) │ │ │ │ │ compute stable cones. │ │ │ │ │ DDeeffiinniittiioonn _p_r_o_t_o_c_o_n_e_s_._c_p_p_:_1_4_1 │ │ │ │ │ +_s_i_s_c_o_n_e_:_:_c_i_r_c_u_l_a_t_o_r │ │ │ │ │ +a circulator that is foreseen to take as template member either a pointer or an │ │ │ │ │ +iterator; │ │ │ │ │ +DDeeffiinniittiioonn _c_i_r_c_u_l_a_t_o_r_._h_:_3_6 │ │ │ │ │ _d_e_f_i_n_e_s_._h │ │ │ │ │ _r_a_n_l_u_x_._h │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/siscone-doc-html/html/devel/siscone_8h_source.html │ │ │ │ @@ -87,35 +87,35 @@ │ │ │ │
│ │ │ │
48class Csiscone : public Cstable_cones, public Csplit_merge{
│ │ │ │
49 public:
│ │ │ │
51 Csiscone();
│ │ │ │
52
│ │ │ │
54 ~Csiscone();
│ │ │ │
55
│ │ │ │ -
76 int compute_jets(std::vector<Cmomentum> &_particles, double _radius, double _f,
│ │ │ │ -
77 int _n_pass_max=0, double _ptmin=0.0,
│ │ │ │ -
78 Esplit_merge_scale _split_merge_scale=SM_pttilde);
│ │ │ │ +
76 int compute_jets(std::vector<Cmomentum> &_particles, double _radius, double _f,
│ │ │ │ +
77 int _n_pass_max=0, double _ptmin=0.0,
│ │ │ │ +
78 Esplit_merge_scale _split_merge_scale=SM_pttilde);
│ │ │ │
79
│ │ │ │ -
97 int compute_jets_progressive_removal(std::vector<Cmomentum> &_particles, double _radius,
│ │ │ │ -
98 int _n_pass_max=0, double _ptmin=0.0,
│ │ │ │ -
99 Esplit_merge_scale _ordering_scale=SM_pttilde);
│ │ │ │ +
97 int compute_jets_progressive_removal(std::vector<Cmomentum> &_particles, double _radius,
│ │ │ │ +
98 int _n_pass_max=0, double _ptmin=0.0,
│ │ │ │ +
99 Esplit_merge_scale _ordering_scale=SM_pttilde);
│ │ │ │
100
│ │ │ │ -
113 int recompute_jets(double _f, double _ptmin = 0.0,
│ │ │ │ -
114 Esplit_merge_scale _split_merge_scale=SM_pttilde);
│ │ │ │ +
113 int recompute_jets(double _f, double _ptmin = 0.0,
│ │ │ │ +
114 Esplit_merge_scale _split_merge_scale=SM_pttilde);
│ │ │ │
115
│ │ │ │
117 std::vector<std::vector<Cmomentum> > protocones_list;
│ │ │ │
118
│ │ │ │
119 // random number initialisation
│ │ │ │
120 static bool init_done;
│ │ │ │
121
│ │ │ │
122#ifdef DEBUG_STABLE_CONES
│ │ │ │ -
123 int nb_hash_cones_total, nb_hash_occupied_total;
│ │ │ │ + │ │ │ │
124#endif
│ │ │ │
125
│ │ │ │ -
137 static void set_banner_stream(std::ostream * ostr) {_banner_ostr = ostr;}
│ │ │ │ +
137 static void set_banner_stream(std::ostream * ostr) {_banner_ostr = ostr;}
│ │ │ │
138
│ │ │ │
143 static std::ostream * banner_stream() {return _banner_ostr;}
│ │ │ │
144
│ │ │ │
145 private:
│ │ │ │
146 bool rerun_allowed;
│ │ │ │
147 static std::ostream * _banner_ostr;
│ │ │ │
148
│ │ │ │ @@ -143,14 +143,15 @@ │ │ │ │
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.
Definition siscone.cpp:156
│ │ │ │
static bool init_done
check random generator initialisation
Definition siscone.h:120
│ │ │ │
static void set_banner_stream(std::ostream *ostr)
A call to this function modifies the stream used to print banners (by default cout).
Definition siscone.h:137
│ │ │ │
static std::ostream * banner_stream()
returns a pointer to the stream to be used to print banners (cout by default)
Definition siscone.h:143
│ │ │ │
Csiscone()
default ctor
Definition siscone.cpp:51
│ │ │ │
Class used to split and merge jets.
│ │ │ │
Computes the list of stable comes from a particle list.
Definition protocones.h:82
│ │ │ │ +
a circulator that is foreseen to take as template member either a pointer or an iterator;
Definition circulator.h:36
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -37,37 +37,37 @@ │ │ │ │ │ 35 │ │ │ │ │ _4_8class _C_s_i_s_c_o_n_e : public _C_s_t_a_b_l_e___c_o_n_e_s, public _C_s_p_l_i_t___m_e_r_g_e{ │ │ │ │ │ 49 public: │ │ │ │ │ 51 _C_s_i_s_c_o_n_e(); │ │ │ │ │ 52 │ │ │ │ │ 54 _~_C_s_i_s_c_o_n_e(); │ │ │ │ │ 55 │ │ │ │ │ -76 int _c_o_m_p_u_t_e___j_e_t_s(std::vector &_particles, double _radius, double │ │ │ │ │ -_f, │ │ │ │ │ -77 int _n_pass_max=0, double _ptmin=0.0, │ │ │ │ │ -78 Esplit_merge_scale _split_merge_scale=SM_pttilde); │ │ │ │ │ +76 int _c_o_m_p_u_t_e___j_e_t_s(std::vector &___p_a_r_t_i_c_l_e_s, double ___r_a_d_i_u_s, double │ │ │ │ │ +___f, │ │ │ │ │ +77 int ___n___p_a_s_s___m_a_x=0, double ___p_t_m_i_n=0.0, │ │ │ │ │ +78 Esplit_merge_scale ___s_p_l_i_t___m_e_r_g_e___s_c_a_l_e=SM_pttilde); │ │ │ │ │ 79 │ │ │ │ │ -97 int _c_o_m_p_u_t_e___j_e_t_s___p_r_o_g_r_e_s_s_i_v_e___r_e_m_o_v_a_l(std::vector &_particles, │ │ │ │ │ -double _radius, │ │ │ │ │ -98 int _n_pass_max=0, double _ptmin=0.0, │ │ │ │ │ -99 Esplit_merge_scale _ordering_scale=SM_pttilde); │ │ │ │ │ +97 int _c_o_m_p_u_t_e___j_e_t_s___p_r_o_g_r_e_s_s_i_v_e___r_e_m_o_v_a_l(std::vector &___p_a_r_t_i_c_l_e_s, │ │ │ │ │ +double ___r_a_d_i_u_s, │ │ │ │ │ +98 int ___n___p_a_s_s___m_a_x=0, double ___p_t_m_i_n=0.0, │ │ │ │ │ +99 Esplit_merge_scale ___o_r_d_e_r_i_n_g___s_c_a_l_e=SM_pttilde); │ │ │ │ │ 100 │ │ │ │ │ -113 int _r_e_c_o_m_p_u_t_e___j_e_t_s(double _f, double _ptmin = 0.0, │ │ │ │ │ -114 Esplit_merge_scale _split_merge_scale=SM_pttilde); │ │ │ │ │ +113 int _r_e_c_o_m_p_u_t_e___j_e_t_s(double ___f, double ___p_t_m_i_n = 0.0, │ │ │ │ │ +114 Esplit_merge_scale ___s_p_l_i_t___m_e_r_g_e___s_c_a_l_e=SM_pttilde); │ │ │ │ │ 115 │ │ │ │ │ _1_1_7 std::vector > _p_r_o_t_o_c_o_n_e_s___l_i_s_t; │ │ │ │ │ 118 │ │ │ │ │ 119 // random number initialisation │ │ │ │ │ _1_2_0 static bool _i_n_i_t___d_o_n_e; │ │ │ │ │ 121 │ │ │ │ │ 122#ifdef DEBUG_STABLE_CONES │ │ │ │ │ -123 int nb_hash_cones_total, nb_hash_occupied_total; │ │ │ │ │ +123 int _n_b___h_a_s_h___c_o_n_e_s___t_o_t_a_l, _n_b___h_a_s_h___o_c_c_u_p_i_e_d___t_o_t_a_l; │ │ │ │ │ 124#endif │ │ │ │ │ 125 │ │ │ │ │ -_1_3_7 static void _s_e_t___b_a_n_n_e_r___s_t_r_e_a_m(std::ostream * ostr) {_banner_ostr = ostr;} │ │ │ │ │ +_1_3_7 static void _s_e_t___b_a_n_n_e_r___s_t_r_e_a_m(std::ostream * _o_s_t_r) {_banner_ostr = _o_s_t_r;} │ │ │ │ │ 138 │ │ │ │ │ _1_4_3 static std::ostream * _b_a_n_n_e_r___s_t_r_e_a_m() {return _banner_ostr;} │ │ │ │ │ 144 │ │ │ │ │ 145 private: │ │ │ │ │ 146 bool rerun_allowed; │ │ │ │ │ 147 static std::ostream * _banner_ostr; │ │ │ │ │ 148 │ │ │ │ │ @@ -134,9 +134,13 @@ │ │ │ │ │ DDeeffiinniittiioonn _s_i_s_c_o_n_e_._c_p_p_:_5_1 │ │ │ │ │ _s_i_s_c_o_n_e_:_:_C_s_p_l_i_t___m_e_r_g_e │ │ │ │ │ Class used to split and merge jets. │ │ │ │ │ DDeeffiinniittiioonn _s_p_l_i_t___m_e_r_g_e_._h_:_1_8_0 │ │ │ │ │ _s_i_s_c_o_n_e_:_:_C_s_t_a_b_l_e___c_o_n_e_s │ │ │ │ │ Computes the list of stable comes from a particle list. │ │ │ │ │ DDeeffiinniittiioonn _p_r_o_t_o_c_o_n_e_s_._h_:_8_2 │ │ │ │ │ +_s_i_s_c_o_n_e_:_:_c_i_r_c_u_l_a_t_o_r │ │ │ │ │ +a circulator that is foreseen to take as template member either a pointer or an │ │ │ │ │ +iterator; │ │ │ │ │ +DDeeffiinniittiioonn _c_i_r_c_u_l_a_t_o_r_._h_:_3_6 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/siscone-doc-html/html/devel/siscone__error_8h_source.html │ │ │ │ @@ -86,25 +86,25 @@ │ │ │ │
35
│ │ │ │
│ │ │ │ │ │ │ │
39public:
│ │ │ │ │ │ │ │
42
│ │ │ │
│ │ │ │ -
45 Csiscone_error(const std::string & message_in) {
│ │ │ │ -
46 m_message = message_in;
│ │ │ │ -
47 if (m_print_errors) std::cerr << "siscone::Csiscone_error: "<< message_in << std::endl;
│ │ │ │ +
45 Csiscone_error(const std::string & message_in) {
│ │ │ │ +
46 m_message = message_in;
│ │ │ │ +
47 if (m_print_errors) std::cerr << "siscone::Csiscone_error: "<< message_in << std::endl;
│ │ │ │
48 };
│ │ │ │
│ │ │ │
49
│ │ │ │
51 std::string message() const {return m_message;};
│ │ │ │
52
│ │ │ │
│ │ │ │ -
55 static void setm_print_errors(bool print_errors) {
│ │ │ │ -
56 m_print_errors = print_errors;};
│ │ │ │ +
55 static void setm_print_errors(bool print_errors) {
│ │ │ │ +
56 m_print_errors = print_errors;};
│ │ │ │
│ │ │ │
57
│ │ │ │
58private:
│ │ │ │
59 std::string m_message;
│ │ │ │
60 static bool m_print_errors;
│ │ │ │
61};
│ │ │ │
│ │ │ │ @@ -112,14 +112,15 @@ │ │ │ │
63}
│ │ │ │
64#endif
│ │ │ │
class corresponding to errors that will be thrown by siscone
│ │ │ │
Csiscone_error()
default ctor
│ │ │ │
Csiscone_error(const std::string &message_in)
ctor with a given error message
│ │ │ │
std::string message() const
access to the error message
│ │ │ │
static void setm_print_errors(bool print_errors)
switch on/off the error message printing
│ │ │ │ +
a circulator that is foreseen to take as template member either a pointer or an iterator;
Definition circulator.h:36
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -35,24 +35,24 @@ │ │ │ │ │ 33 │ │ │ │ │ 34namespace siscone{ │ │ │ │ │ 35 │ │ │ │ │ _3_8class _C_s_i_s_c_o_n_e___e_r_r_o_r { │ │ │ │ │ 39public: │ │ │ │ │ _4_1 _C_s_i_s_c_o_n_e___e_r_r_o_r() {;}; │ │ │ │ │ 42 │ │ │ │ │ -_4_5 _C_s_i_s_c_o_n_e___e_r_r_o_r(const std::string & message_in) { │ │ │ │ │ -46 m_message = message_in; │ │ │ │ │ -47 if (m_print_errors) std::cerr << "siscone::Csiscone_error: "<< message_in << │ │ │ │ │ +_4_5 _C_s_i_s_c_o_n_e___e_r_r_o_r(const std::string & _m_e_s_s_a_g_e___i_n) { │ │ │ │ │ +46 m_message = _m_e_s_s_a_g_e___i_n; │ │ │ │ │ +47 if (m_print_errors) std::cerr << "siscone::Csiscone_error: "<< _m_e_s_s_a_g_e___i_n << │ │ │ │ │ std::endl; │ │ │ │ │ 48 }; │ │ │ │ │ 49 │ │ │ │ │ _5_1 std::string _m_e_s_s_a_g_e() const {return m_message;}; │ │ │ │ │ 52 │ │ │ │ │ -_5_5 static void _s_e_t_m___p_r_i_n_t___e_r_r_o_r_s(bool print_errors) { │ │ │ │ │ -56 m_print_errors = print_errors;}; │ │ │ │ │ +_5_5 static void _s_e_t_m___p_r_i_n_t___e_r_r_o_r_s(bool _p_r_i_n_t___e_r_r_o_r_s) { │ │ │ │ │ +56 m_print_errors = _p_r_i_n_t___e_r_r_o_r_s;}; │ │ │ │ │ 57 │ │ │ │ │ 58private: │ │ │ │ │ 59 std::string m_message; │ │ │ │ │ 60 static bool m_print_errors; │ │ │ │ │ 61}; │ │ │ │ │ 62 │ │ │ │ │ 63} │ │ │ │ │ @@ -72,9 +72,13 @@ │ │ │ │ │ std::string message() const │ │ │ │ │ access to the error message │ │ │ │ │ DDeeffiinniittiioonn _s_i_s_c_o_n_e___e_r_r_o_r_._h_:_5_1 │ │ │ │ │ _s_i_s_c_o_n_e_:_:_C_s_i_s_c_o_n_e___e_r_r_o_r_:_:_s_e_t_m___p_r_i_n_t___e_r_r_o_r_s │ │ │ │ │ static void setm_print_errors(bool print_errors) │ │ │ │ │ switch on/off the error message printing │ │ │ │ │ DDeeffiinniittiioonn _s_i_s_c_o_n_e___e_r_r_o_r_._h_:_5_5 │ │ │ │ │ +_s_i_s_c_o_n_e_:_:_c_i_r_c_u_l_a_t_o_r │ │ │ │ │ +a circulator that is foreseen to take as template member either a pointer or an │ │ │ │ │ +iterator; │ │ │ │ │ +DDeeffiinniittiioonn _c_i_r_c_u_l_a_t_o_r_._h_:_3_6 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by _[_d_o_x_y_g_e_n_] 1.9.8 ├── siscone-doc-pdf_3.0.5-2_all.deb │ ├── file list │ │ @@ -1,3 +1,3 @@ │ │ -rw-r--r-- 0 0 0 4 2023-01-10 17:32:40.000000 debian-binary │ │ -rw-r--r-- 0 0 0 808 2023-01-10 17:32:40.000000 control.tar.xz │ │ --rw-r--r-- 0 0 0 1608316 2023-01-10 17:32:40.000000 data.tar.xz │ │ +-rw-r--r-- 0 0 0 1609080 2023-01-10 17:32:40.000000 data.tar.xz │ ├── control.tar.xz │ │ ├── control.tar │ │ │ ├── ./md5sums │ │ │ │ ├── ./md5sums │ │ │ │ │┄ Files differ │ ├── data.tar.xz │ │ ├── data.tar │ │ │ ├── file list │ │ │ │ @@ -3,10 +3,10 @@ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2023-01-10 17:32:40.000000 ./usr/share/ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2023-01-10 17:32:40.000000 ./usr/share/doc/ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-pdf/ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 1125 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-pdf/changelog.Debian.gz │ │ │ │ -rw-r--r-- 0 root (0) root (0) 16688 2020-04-24 08:56:01.000000 ./usr/share/doc/siscone-doc-pdf/changelog.gz │ │ │ │ -rw-r--r-- 0 root (0) root (0) 1151 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-pdf/copyright │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-pdf/pdf/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 1592488 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-pdf/pdf/refman.pdf.gz │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 1592838 2023-01-10 17:32:40.000000 ./usr/share/doc/siscone-doc-pdf/pdf/refman.pdf.gz │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2023-01-10 17:32:40.000000 ./usr/share/doc-base/ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 240 2023-01-10 17:32:40.000000 ./usr/share/doc-base/siscone-doc-pdf.siscone-pdf │ │ │ ├── ./usr/share/doc/siscone-doc-pdf/pdf/refman.pdf.gz │ │ │ │ ├── refman.pdf │ │ │ │ │ ├── pdftotext {} - │ │ │ │ │ │ @@ -1661,35 +1661,35 @@ │ │ │ │ │ │ 4.37.2.1 centre . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 │ │ │ │ │ │ 4.37.2.2 is_stable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 │ │ │ │ │ │ 4.37.2.3 next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 │ │ │ │ │ │ 5 File Documentation │ │ │ │ │ │ │ │ │ │ │ │ 175 │ │ │ │ │ │ │ │ │ │ │ │ -5.1 main.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 │ │ │ │ │ │ -5.2 options.cpp │ │ │ │ │ │ +5.1 area.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 │ │ │ │ │ │ +5.2 area.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 │ │ │ │ │ │ +5.3 main.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 │ │ │ │ │ │ +5.4 options.cpp │ │ │ │ │ │ │ │ │ │ │ │ -. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 │ │ │ │ │ │ +. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 │ │ │ │ │ │ │ │ │ │ │ │ -5.3 options.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 │ │ │ │ │ │ -5.4 sample.cpp │ │ │ │ │ │ +5.5 options.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 │ │ │ │ │ │ +5.6 sample.cpp │ │ │ │ │ │ │ │ │ │ │ │ -. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 │ │ │ │ │ │ +. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 │ │ │ │ │ │ │ │ │ │ │ │ -5.5 spherical.cpp │ │ │ │ │ │ +5.7 spherical.cpp │ │ │ │ │ │ │ │ │ │ │ │ -. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 │ │ │ │ │ │ +. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 │ │ │ │ │ │ │ │ │ │ │ │ -5.6 test.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 │ │ │ │ │ │ -5.7 times.cpp │ │ │ │ │ │ +5.8 test.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 │ │ │ │ │ │ +5.9 times.cpp │ │ │ │ │ │ │ │ │ │ │ │ -. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 │ │ │ │ │ │ +. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 │ │ │ │ │ │ │ │ │ │ │ │ -5.8 area.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 │ │ │ │ │ │ -5.9 area.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 │ │ │ │ │ │ 5.10 area.h │ │ │ │ │ │ │ │ │ │ │ │ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 │ │ │ │ │ │ │ │ │ │ │ │ 5.11 circulator.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 │ │ │ │ │ │ │ │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ @@ -1711,64 +1711,64 @@ │ │ │ │ │ │ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 │ │ │ │ │ │ │ │ │ │ │ │ 5.14.2 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 │ │ │ │ │ │ 5.14.2.1 twopi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 │ │ │ │ │ │ 5.15 defines.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 │ │ │ │ │ │ 5.16 geom_2d.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 │ │ │ │ │ │ 5.17 geom_2d.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 │ │ │ │ │ │ -5.18 geom_2d.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 │ │ │ │ │ │ -5.19 geom_2d.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 │ │ │ │ │ │ -5.20 momentum.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 │ │ │ │ │ │ -5.21 momentum.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 │ │ │ │ │ │ -5.22 protocones.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 │ │ │ │ │ │ -5.23 protocones.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 │ │ │ │ │ │ -5.24 quadtree.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 │ │ │ │ │ │ -5.25 quadtree.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 │ │ │ │ │ │ -5.26 ranlux.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 │ │ │ │ │ │ -5.27 siscone/ranlux.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 │ │ │ │ │ │ -5.27.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 │ │ │ │ │ │ -5.27.1.1 ranlux_get() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 │ │ │ │ │ │ -5.27.1.2 ranlux_init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 │ │ │ │ │ │ -5.27.1.3 ranlux_print_state() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 │ │ │ │ │ │ -5.28 ranlux.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 │ │ │ │ │ │ -5.29 reference.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 │ │ │ │ │ │ -5.30 reference.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 │ │ │ │ │ │ -5.31 siscone.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 │ │ │ │ │ │ -5.32 siscone.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 │ │ │ │ │ │ -5.33 siscone.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 │ │ │ │ │ │ -5.34 siscone.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 │ │ │ │ │ │ -5.35 siscone_error.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 │ │ │ │ │ │ -5.36 siscone_error.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 │ │ │ │ │ │ -5.37 hash.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 │ │ │ │ │ │ -5.38 hash.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 │ │ │ │ │ │ -5.39 hash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 │ │ │ │ │ │ -5.40 hash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 │ │ │ │ │ │ -5.41 momentum.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 │ │ │ │ │ │ -5.42 momentum.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241 │ │ │ │ │ │ +5.18 hash.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 │ │ │ │ │ │ +5.19 hash.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 │ │ │ │ │ │ +5.20 hash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 │ │ │ │ │ │ +5.21 hash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 │ │ │ │ │ │ +5.22 momentum.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 │ │ │ │ │ │ +5.23 momentum.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 │ │ │ │ │ │ +5.24 momentum.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 │ │ │ │ │ │ +5.25 momentum.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 │ │ │ │ │ │ +5.26 protocones.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 │ │ │ │ │ │ +5.27 protocones.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 │ │ │ │ │ │ +5.28 protocones.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 │ │ │ │ │ │ +5.29 protocones.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 │ │ │ │ │ │ +5.30 quadtree.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241 │ │ │ │ │ │ +5.31 quadtree.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 │ │ │ │ │ │ +5.32 ranlux.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 │ │ │ │ │ │ +5.33 siscone/ranlux.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 │ │ │ │ │ │ +5.33.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 │ │ │ │ │ │ +5.33.1.1 ranlux_get() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 │ │ │ │ │ │ +5.33.1.2 ranlux_init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 │ │ │ │ │ │ +5.33.1.3 ranlux_print_state() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 │ │ │ │ │ │ +5.34 ranlux.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 │ │ │ │ │ │ +5.35 reference.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 │ │ │ │ │ │ +5.36 reference.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 │ │ │ │ │ │ +5.37 siscone.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 │ │ │ │ │ │ +5.38 siscone.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 │ │ │ │ │ │ +5.39 siscone.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 │ │ │ │ │ │ +5.40 siscone.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 │ │ │ │ │ │ +5.41 siscone_error.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261 │ │ │ │ │ │ +5.42 siscone_error.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261 │ │ │ │ │ │ │ │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ xvi │ │ │ │ │ │ │ │ │ │ │ │ -5.43 protocones.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 │ │ │ │ │ │ -5.44 protocones.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 │ │ │ │ │ │ +5.43 geom_2d.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 │ │ │ │ │ │ +5.44 geom_2d.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 │ │ │ │ │ │ 5.45 split_merge.cpp │ │ │ │ │ │ │ │ │ │ │ │ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 │ │ │ │ │ │ │ │ │ │ │ │ 5.46 split_merge.cpp │ │ │ │ │ │ │ │ │ │ │ │ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278 │ │ │ │ │ │ │ │ │ │ │ │ -5.47 split_merge.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 │ │ │ │ │ │ +5.47 split_merge.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292 │ │ │ │ │ │ 5.48 split_merge.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294 │ │ │ │ │ │ -5.49 vicinity.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 │ │ │ │ │ │ -5.50 vicinity.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 │ │ │ │ │ │ -5.51 vicinity.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299 │ │ │ │ │ │ -5.52 vicinity.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 │ │ │ │ │ │ +5.49 vicinity.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 │ │ │ │ │ │ +5.50 vicinity.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300 │ │ │ │ │ │ +5.51 vicinity.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304 │ │ │ │ │ │ +5.52 vicinity.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305 │ │ │ │ │ │ Index │ │ │ │ │ │ │ │ │ │ │ │ 307 │ │ │ │ │ │ │ │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ Chapter 1 │ │ │ │ │ │ @@ -2026,49 +2026,49 @@ │ │ │ │ │ │ siscone/siscone_error.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . │ │ │ │ │ │ siscone/siscone_error.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . │ │ │ │ │ │ siscone/split_merge.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . │ │ │ │ │ │ siscone/split_merge.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . │ │ │ │ │ │ siscone/vicinity.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . │ │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -185 │ │ │ │ │ │ 175 │ │ │ │ │ │ -176 │ │ │ │ │ │ -179 │ │ │ │ │ │ 180 │ │ │ │ │ │ -181 │ │ │ │ │ │ 182 │ │ │ │ │ │ -184 │ │ │ │ │ │ +185 │ │ │ │ │ │ +185 │ │ │ │ │ │ 187 │ │ │ │ │ │ +188 │ │ │ │ │ │ +189 │ │ │ │ │ │ +176 │ │ │ │ │ │ 191 │ │ │ │ │ │ 192 │ │ │ │ │ │ 193 │ │ │ │ │ │ 194 │ │ │ │ │ │ 195 │ │ │ │ │ │ 198 │ │ │ │ │ │ +262 │ │ │ │ │ │ 202 │ │ │ │ │ │ -233 │ │ │ │ │ │ -238 │ │ │ │ │ │ -239 │ │ │ │ │ │ -204 │ │ │ │ │ │ -245 │ │ │ │ │ │ -208 │ │ │ │ │ │ -212 │ │ │ │ │ │ -215 │ │ │ │ │ │ -216 │ │ │ │ │ │ +207 │ │ │ │ │ │ +209 │ │ │ │ │ │ +214 │ │ │ │ │ │ 218 │ │ │ │ │ │ -220 │ │ │ │ │ │ -221 │ │ │ │ │ │ -222 │ │ │ │ │ │ -229 │ │ │ │ │ │ -231 │ │ │ │ │ │ -232 │ │ │ │ │ │ +237 │ │ │ │ │ │ +241 │ │ │ │ │ │ +245 │ │ │ │ │ │ +245 │ │ │ │ │ │ +247 │ │ │ │ │ │ +249 │ │ │ │ │ │ +251 │ │ │ │ │ │ +252 │ │ │ │ │ │ +259 │ │ │ │ │ │ +261 │ │ │ │ │ │ +261 │ │ │ │ │ │ 278 │ │ │ │ │ │ 294 │ │ │ │ │ │ -303 │ │ │ │ │ │ +300 │ │ │ │ │ │ │ │ │ │ │ │ 6 │ │ │ │ │ │ │ │ │ │ │ │ File Index │ │ │ │ │ │ │ │ │ │ │ │ siscone/vicinity.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . │ │ │ │ │ │ siscone/spherical/geom_2d.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . │ │ │ │ │ │ @@ -2082,29 +2082,29 @@ │ │ │ │ │ │ siscone/spherical/siscone.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . │ │ │ │ │ │ siscone/spherical/siscone.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . │ │ │ │ │ │ siscone/spherical/split_merge.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . │ │ │ │ │ │ siscone/spherical/split_merge.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . │ │ │ │ │ │ siscone/spherical/vicinity.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . │ │ │ │ │ │ siscone/spherical/vicinity.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . │ │ │ │ │ │ │ │ │ │ │ │ -298 │ │ │ │ │ │ +305 │ │ │ │ │ │ 200 │ │ │ │ │ │ -203 │ │ │ │ │ │ -235 │ │ │ │ │ │ +263 │ │ │ │ │ │ +205 │ │ │ │ │ │ +208 │ │ │ │ │ │ +211 │ │ │ │ │ │ +216 │ │ │ │ │ │ +227 │ │ │ │ │ │ 239 │ │ │ │ │ │ -241 │ │ │ │ │ │ -206 │ │ │ │ │ │ -254 │ │ │ │ │ │ -210 │ │ │ │ │ │ -226 │ │ │ │ │ │ -230 │ │ │ │ │ │ +255 │ │ │ │ │ │ +260 │ │ │ │ │ │ 264 │ │ │ │ │ │ -291 │ │ │ │ │ │ -299 │ │ │ │ │ │ +292 │ │ │ │ │ │ 297 │ │ │ │ │ │ +304 │ │ │ │ │ │ │ │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ Chapter 4 │ │ │ │ │ │ │ │ │ │ │ │ Class Documentation │ │ │ │ │ │ │ │ │ │ │ │ @@ -10978,15 +10978,15 @@ │ │ │ │ │ │ • siscone/spherical/hash.h │ │ │ │ │ │ │ │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ Chapter 5 │ │ │ │ │ │ │ │ │ │ │ │ File Documentation │ │ │ │ │ │ -5.1 main.cpp │ │ │ │ │ │ +5.1 area.cpp │ │ │ │ │ │ 00001 │ │ │ │ │ │ 00002 // File: main.cpp │ │ │ │ │ │ // │ │ │ │ │ │ 00003 // Description: main program that runs siscone from the command line │ │ │ │ │ │ // │ │ │ │ │ │ 00004 // This file is part of the SISCone project. │ │ │ │ │ │ // │ │ │ │ │ │ @@ -11021,14 +11021,846 @@ │ │ │ │ │ │ 00019 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ // │ │ │ │ │ │ 00020 // along with this program; if not, write to the Free Software │ │ │ │ │ │ // │ │ │ │ │ │ 00021 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ 00022 // │ │ │ │ │ │ // │ │ │ │ │ │ +00023 // $Revision:: 171 │ │ │ │ │ │ +$// │ │ │ │ │ │ +00024 // $Date:: 2007-06-19 10:26:05 -0400 (Tue, 19 Jun 2007) │ │ │ │ │ │ +$// │ │ │ │ │ │ +00026 │ │ │ │ │ │ +00027 #include │ │ │ │ │ │ +00028 #include │ │ │ │ │ │ +00029 #include │ │ │ │ │ │ +00030 #include "siscone/momentum.h" │ │ │ │ │ │ +00031 #include "siscone/siscone.h" │ │ │ │ │ │ +00032 #include "siscone/area.h" │ │ │ │ │ │ +00033 #include "options.h" │ │ │ │ │ │ +00034 │ │ │ │ │ │ +00035 using namespace std; │ │ │ │ │ │ +00036 using namespace siscone; │ │ │ │ │ │ +00037 │ │ │ │ │ │ +00038 int main(int argc, char *argv[]){ │ │ │ │ │ │ +00039 │ │ │ │ │ │ +vector particles; │ │ │ │ │ │ +00040 │ │ │ │ │ │ +Carea siscone_with_area; │ │ │ │ │ │ +int i,N; │ │ │ │ │ │ +00041 │ │ │ │ │ │ +00042 │ │ │ │ │ │ +double px,py,pz,E; │ │ │ │ │ │ +00043 │ │ │ │ │ │ +Coptions opts; │ │ │ │ │ │ +char fline[512]; │ │ │ │ │ │ +00044 │ │ │ │ │ │ +00045 │ │ │ │ │ │ +if (opts.parse_options(argc, argv)) │ │ │ │ │ │ +00046 │ │ │ │ │ │ +00047 │ │ │ │ │ │ +exit(1); │ │ │ │ │ │ +00048 │ │ │ │ │ │ +00049 │ │ │ │ │ │ +// deal with help message │ │ │ │ │ │ +00050 │ │ │ │ │ │ +if (opts.help_flag){ │ │ │ │ │ │ +00051 │ │ │ │ │ │ +opts.print_help(); │ │ │ │ │ │ +00052 │ │ │ │ │ │ +exit(0); │ │ │ │ │ │ +00053 │ │ │ │ │ │ +} │ │ │ │ │ │ +00054 │ │ │ │ │ │ +00055 │ │ │ │ │ │ +// deal with version flag │ │ │ │ │ │ +00056 │ │ │ │ │ │ +if (opts.version_flag){ │ │ │ │ │ │ +00057 │ │ │ │ │ │ +opts.print_version(); │ │ │ │ │ │ +00058 │ │ │ │ │ │ +exit(0); │ │ │ │ │ │ +00059 │ │ │ │ │ │ +} │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 176 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +00060 │ │ │ │ │ │ +// various files used to read input data and store results │ │ │ │ │ │ +00061 │ │ │ │ │ │ +00062 │ │ │ │ │ │ +FILE *flux; │ │ │ │ │ │ +00063 │ │ │ │ │ │ +FILE *fpart; │ │ │ │ │ │ +00064 │ │ │ │ │ │ +00065 │ │ │ │ │ │ +// read particles │ │ │ │ │ │ +00066 │ │ │ │ │ │ +if (opts.verbose_flag) cout « "reading particles" « endl; │ │ │ │ │ │ +00067 │ │ │ │ │ │ +flux = fopen(opts.ev_name, "r"); │ │ │ │ │ │ +if (flux==NULL){ │ │ │ │ │ │ +00068 │ │ │ │ │ │ +00069 │ │ │ │ │ │ +cerr « "cannot read event" « endl; │ │ │ │ │ │ +00070 │ │ │ │ │ │ +return 1; │ │ │ │ │ │ +00071 │ │ │ │ │ │ +} │ │ │ │ │ │ +00072 │ │ │ │ │ │ +00073 │ │ │ │ │ │ +N=0; │ │ │ │ │ │ +00074 │ │ │ │ │ │ +fpart = fopen("particles.dat", "w+"); │ │ │ │ │ │ +while ((opts.N_stop!=0) && (fgets(fline, 512, flux)!=NULL)){ │ │ │ │ │ │ +00075 │ │ │ │ │ │ +00076 │ │ │ │ │ │ +if (fline[0]!=’#’){ // skip lines beginning with ’#’ │ │ │ │ │ │ +00077 │ │ │ │ │ │ +if (sscanf(fline, "%le%le%le%le", &px, &py, &pz, &E)==4){ │ │ │ │ │ │ +00078 │ │ │ │ │ │ +particles.push_back(Cmomentum(px, py, pz, E)); │ │ │ │ │ │ +particles[N].eta, particles[N].phi); │ │ │ │ │ │ +00079 │ │ │ │ │ │ +fprintf(fpart, "%e\t%e\n", │ │ │ │ │ │ +00080 │ │ │ │ │ │ +N++; │ │ │ │ │ │ +00081 │ │ │ │ │ │ +opts.N_stop--; │ │ │ │ │ │ +00082 │ │ │ │ │ │ +} else { │ │ │ │ │ │ +00083 │ │ │ │ │ │ +cout « "error in reading event file Giving up." « endl; │ │ │ │ │ │ +00084 │ │ │ │ │ │ +fclose(flux); │ │ │ │ │ │ +00085 │ │ │ │ │ │ +fclose(fpart); │ │ │ │ │ │ +00086 │ │ │ │ │ │ +exit(2); │ │ │ │ │ │ +00087 │ │ │ │ │ │ +} │ │ │ │ │ │ +00088 │ │ │ │ │ │ +} │ │ │ │ │ │ +00089 │ │ │ │ │ │ +} │ │ │ │ │ │ +00090 │ │ │ │ │ │ +fclose(flux); │ │ │ │ │ │ +00091 │ │ │ │ │ │ +fclose(fpart); │ │ │ │ │ │ +if (opts.verbose_flag) │ │ │ │ │ │ +00092 │ │ │ │ │ │ +00093 │ │ │ │ │ │ +cout « " working with " « N « " particles" « endl; │ │ │ │ │ │ +00094 │ │ │ │ │ │ +// compute jets │ │ │ │ │ │ +00095 │ │ │ │ │ │ +00096 │ │ │ │ │ │ +if (opts.verbose_flag) cout « "computing jet contents" « endl; │ │ │ │ │ │ +00097 │ │ │ │ │ │ +i=siscone_with_area.compute_areas(particles, opts.R, opts.f, opts.npass, opts.SM_var); │ │ │ │ │ │ +if (opts.verbose_flag){ │ │ │ │ │ │ +00098 │ │ │ │ │ │ +unsigned int pass; │ │ │ │ │ │ +00099 │ │ │ │ │ │ +00100 │ │ │ │ │ │ +for (pass=0;pass::iterator ja; │ │ │ │ │ │ +for (ja=siscone_with_area.jet_areas.begin();ja!=siscone_with_area.jet_areas.end();ja++){ │ │ │ │ │ │ +00111 │ │ │ │ │ │ +00112 │ │ │ │ │ │ +fprintf(flux, "%e\t%e\t%e\t%e\t%e\n", │ │ │ │ │ │ +00113 │ │ │ │ │ │ +ja->v.perp(), ja->v.eta, ja->v.phi, │ │ │ │ │ │ +00114 │ │ │ │ │ │ +ja->active_area, ja->passive_area); │ │ │ │ │ │ +00115 │ │ │ │ │ │ +} │ │ │ │ │ │ +00116 │ │ │ │ │ │ +00117 │ │ │ │ │ │ +fclose(flux); │ │ │ │ │ │ +00118 │ │ │ │ │ │ +if (opts.verbose_flag) │ │ │ │ │ │ +00119 │ │ │ │ │ │ +00120 │ │ │ │ │ │ +cout « "bye..." « endl; │ │ │ │ │ │ +00121 │ │ │ │ │ │ +return 0; │ │ │ │ │ │ +00122 │ │ │ │ │ │ +00123 } │ │ │ │ │ │ + │ │ │ │ │ │ +5.2 area.cpp │ │ │ │ │ │ +00001 // -*- C++ -*00003 // File: area.h │ │ │ │ │ │ +00004 // Description: header file for the computation of jet area │ │ │ │ │ │ +00005 // This file is part of the SISCone project. │ │ │ │ │ │ +00006 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ +00007 // │ │ │ │ │ │ +00008 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ +00009 // │ │ │ │ │ │ +00010 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ +00011 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ +00012 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ +00013 // (at your option) any later version. │ │ │ │ │ │ +00014 // │ │ │ │ │ │ +00015 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ +00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ +00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ + │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.2 area.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +00018 // GNU General Public License for more details. │ │ │ │ │ │ +// │ │ │ │ │ │ +00019 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00020 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ +// │ │ │ │ │ │ +00021 // along with this program; if not, write to the Free Software │ │ │ │ │ │ +// │ │ │ │ │ │ +00022 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ +00023 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00024 // $Revision:: 149 │ │ │ │ │ │ +$// │ │ │ │ │ │ +00025 // $Date:: 2007-03-15 00:13:58 +0100 (Thu, 15 Mar 2007) │ │ │ │ │ │ +$// │ │ │ │ │ │ +00027 │ │ │ │ │ │ +00028 #include "area.h" │ │ │ │ │ │ +00029 #include "momentum.h" │ │ │ │ │ │ +00030 #include │ │ │ │ │ │ +00031 #include │ │ │ │ │ │ +00032 │ │ │ │ │ │ +00033 namespace siscone{ │ │ │ │ │ │ +00034 using namespace std; │ │ │ │ │ │ +00035 │ │ │ │ │ │ +00036 /******************************************************* │ │ │ │ │ │ +00037 * Cjet_area implementation │ │ │ │ │ │ +* │ │ │ │ │ │ +00038 * real Jet information, including its area(s) │ │ │ │ │ │ +* │ │ │ │ │ │ +00039 * │ │ │ │ │ │ +* │ │ │ │ │ │ +00040 * This class contains information for one single jet. * │ │ │ │ │ │ +00041 * That is, first, its momentum carrying information │ │ │ │ │ │ +* │ │ │ │ │ │ +00042 * about its centre and pT, and second, its particle │ │ │ │ │ │ +* │ │ │ │ │ │ +00043 * contents (from CJeT). │ │ │ │ │ │ +* │ │ │ │ │ │ +00044 * Compared to the Cjet class, it also includes the │ │ │ │ │ │ +* │ │ │ │ │ │ +00045 * passive and active areas of the jet computed using * │ │ │ │ │ │ +00046 * the Carea class. │ │ │ │ │ │ +* │ │ │ │ │ │ +00047 *******************************************************/ │ │ │ │ │ │ +00048 │ │ │ │ │ │ +00049 // default ctor │ │ │ │ │ │ +00050 //-------------00051 Cjet_area::Cjet_area(){ │ │ │ │ │ │ +00052 │ │ │ │ │ │ +active_area = passive_area = 0.0; │ │ │ │ │ │ +00053 } │ │ │ │ │ │ +00054 │ │ │ │ │ │ +00055 // jet-initiated ctor │ │ │ │ │ │ +00056 //------------------00057 Cjet_area::Cjet_area(Cjet &j){ │ │ │ │ │ │ +00058 │ │ │ │ │ │ +v = j.v; │ │ │ │ │ │ +00059 │ │ │ │ │ │ +n = j.n; │ │ │ │ │ │ +00060 │ │ │ │ │ │ +contents = j.contents; │ │ │ │ │ │ +00061 │ │ │ │ │ │ +00062 │ │ │ │ │ │ +pass = j.pass; │ │ │ │ │ │ +00063 │ │ │ │ │ │ +00064 │ │ │ │ │ │ +pt_tilde = j.pt_tilde; │ │ │ │ │ │ +00065 │ │ │ │ │ │ +sm_var2 = j.sm_var2; │ │ │ │ │ │ +00066 │ │ │ │ │ │ +00067 │ │ │ │ │ │ +active_area = passive_area = 0.0; │ │ │ │ │ │ +00068 } │ │ │ │ │ │ +00069 │ │ │ │ │ │ +00070 // default dtor │ │ │ │ │ │ +00071 //-------------00072 Cjet_area::~Cjet_area(){ │ │ │ │ │ │ +00073 │ │ │ │ │ │ +00074 } │ │ │ │ │ │ +00075 │ │ │ │ │ │ +00076 │ │ │ │ │ │ +00077 /****************************************************************** │ │ │ │ │ │ +00078 * Csiscone_area implementation │ │ │ │ │ │ +* │ │ │ │ │ │ +00079 * class for the computation of jet areas. │ │ │ │ │ │ +* │ │ │ │ │ │ +00080 * │ │ │ │ │ │ +* │ │ │ │ │ │ +00081 * This is the class user should use whenever you want to compute * │ │ │ │ │ │ +00082 * the jet area (passive and active). │ │ │ │ │ │ +* │ │ │ │ │ │ +00083 * It uses the SISCone algorithm to perform the jet analysis. │ │ │ │ │ │ +* │ │ │ │ │ │ +00084 ******************************************************************/ │ │ │ │ │ │ +00085 │ │ │ │ │ │ +00086 // default ctor │ │ │ │ │ │ +00087 //------------00088 Carea::Carea(){ │ │ │ │ │ │ +// 3600 particles added │ │ │ │ │ │ +00089 │ │ │ │ │ │ +grid_size = 60; │ │ │ │ │ │ +00090 │ │ │ │ │ │ +grid_eta_max = 6.0; // maybe having twice more points in eta than in phi should be nice │ │ │ │ │ │ +00091 │ │ │ │ │ │ +grid_shift = 0.5; │ │ │ │ │ │ +// 50% "shacking" │ │ │ │ │ │ +00092 │ │ │ │ │ │ +00093 │ │ │ │ │ │ +pt_soft = 1e-100; │ │ │ │ │ │ +00094 │ │ │ │ │ │ +pt_shift = 0.05; │ │ │ │ │ │ +00095 │ │ │ │ │ │ +pt_soft_min = 1e-90; │ │ │ │ │ │ +00096 } │ │ │ │ │ │ +00097 │ │ │ │ │ │ +00098 // default dtor │ │ │ │ │ │ +00099 //------------00100 Carea::~Carea(){ │ │ │ │ │ │ +00101 │ │ │ │ │ │ +00102 } │ │ │ │ │ │ +00103 │ │ │ │ │ │ +00104 /* │ │ │ │ │ │ +00105 * compute the jet areas from a given particle set. │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +177 │ │ │ │ │ │ + │ │ │ │ │ │ + 178 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +00106 * The parameters of this method are the ones which control the jet clustering alghorithm. │ │ │ │ │ │ +00107 * Note that the pt_min is not allowed here soince the jet-area determination involves soft │ │ │ │ │ │ +00108 * particles/jets and thus is used internally. │ │ │ │ │ │ +00109 * - _particles │ │ │ │ │ │ +list of particles │ │ │ │ │ │ +00110 * - _radius │ │ │ │ │ │ +cone radius │ │ │ │ │ │ +shared energy threshold for splitting&merging │ │ │ │ │ │ +00111 * - _f │ │ │ │ │ │ +00112 * - _n_pass_max maximum number of passes (0=full search, the default) │ │ │ │ │ │ +the scale choice for the split-merge procedure │ │ │ │ │ │ +00113 * - _split_merge_scale │ │ │ │ │ │ +00114 * │ │ │ │ │ │ +NOTE: SM_pt leads to IR unsafety for some events with momentum conservation. │ │ │ │ │ │ +00115 * │ │ │ │ │ │ +SM_Et is IR safe but not boost invariant and not implemented(!) │ │ │ │ │ │ +SM_mt is IR safe for hadronic events, but not for decays of two │ │ │ │ │ │ +00116 * │ │ │ │ │ │ +00117 * │ │ │ │ │ │ +back-to-back particles of identical mass │ │ │ │ │ │ +SM_pttilde │ │ │ │ │ │ +00118 * │ │ │ │ │ │ +00119 * │ │ │ │ │ │ +is always IR safe, and also boost invariant (default) │ │ │ │ │ │ +when this is set on, only hard jets are computed │ │ │ │ │ │ +00120 * - _hard_only │ │ │ │ │ │ +00121 * │ │ │ │ │ │ +and not the purely ghosted jets (default: false) │ │ │ │ │ │ +00122 * return the jets together with their areas │ │ │ │ │ │ +00123 * The return value is the number of jets (including pure-ghost ones if they are included) │ │ │ │ │ │ +00124 ********************************************************************************************/ │ │ │ │ │ │ +00125 int Carea::compute_areas(std::vector &_particles, double _radius, double _f, │ │ │ │ │ │ +int _n_pass_max, Esplit_merge_scale _split_merge_scale, │ │ │ │ │ │ +00126 │ │ │ │ │ │ +00127 │ │ │ │ │ │ +bool _hard_only){ │ │ │ │ │ │ +00128 │ │ │ │ │ │ +00129 │ │ │ │ │ │ +vector all_particles; │ │ │ │ │ │ +00130 │ │ │ │ │ │ +// put "hardest cut-off" if needed │ │ │ │ │ │ +00131 │ │ │ │ │ │ +00132 │ │ │ │ │ │ +// this avoids computation of ghosted jets when not required and │ │ │ │ │ │ +00133 │ │ │ │ │ │ +// significantly shortens the SM. │ │ │ │ │ │ +00134 │ │ │ │ │ │ +if (_hard_only){ │ │ │ │ │ │ +00135 │ │ │ │ │ │ +SM_var2_hardest_cut_off = pt_soft_min*pt_soft_min; │ │ │ │ │ │ +00136 │ │ │ │ │ │ +} │ │ │ │ │ │ +00137 │ │ │ │ │ │ +// clear potential previous runs │ │ │ │ │ │ +00138 │ │ │ │ │ │ +00139 │ │ │ │ │ │ +jet_areas.clear(); │ │ │ │ │ │ +00140 │ │ │ │ │ │ +// put initial set of particles in the list │ │ │ │ │ │ +00141 │ │ │ │ │ │ +00142 │ │ │ │ │ │ +int n_hard = _particles.size(); │ │ │ │ │ │ +00143 │ │ │ │ │ │ +all_particles = _particles; │ │ │ │ │ │ +00144 │ │ │ │ │ │ +// build the set of ghost particles and add them to the particle list │ │ │ │ │ │ +00145 │ │ │ │ │ │ +00146 │ │ │ │ │ │ +int i,j; │ │ │ │ │ │ +00147 │ │ │ │ │ │ +double eta_g,phi_g,pt_g; │ │ │ │ │ │ +00148 │ │ │ │ │ │ +for (i=0;i= n_hard │ │ │ │ │ │ +00167 │ │ │ │ │ │ +// and deduce the number of ghosts in the jet, hence the area. │ │ │ │ │ │ +00168 │ │ │ │ │ │ +double area_factor = (2.0*grid_eta_max/grid_size)*(twopi/grid_size); │ │ │ │ │ │ +00169 │ │ │ │ │ │ +for (i=0;i<(int) jets.size();i++){ │ │ │ │ │ │ +00170 │ │ │ │ │ │ +00171 │ │ │ │ │ │ +jet_areas.push_back(jets[i]); │ │ │ │ │ │ +00172 │ │ │ │ │ │ +j=0; │ │ │ │ │ │ +00173 │ │ │ │ │ │ +while ((j &_particles, double _radius, double _f, │ │ │ │ │ │ +00218 │ │ │ │ │ │ +int _n_pass_max, Esplit_merge_scale _split_merge_scale){ │ │ │ │ │ │ +00219 │ │ │ │ │ │ +00220 │ │ │ │ │ │ +vector all_particles; │ │ │ │ │ │ +00221 │ │ │ │ │ │ +// in the case of passive area, we do not need │ │ │ │ │ │ +00222 │ │ │ │ │ │ +00223 │ │ │ │ │ │ +// to put the ghosts in the stable-cone search │ │ │ │ │ │ +00224 │ │ │ │ │ │ +// (they do no influence the list of stable cones) │ │ │ │ │ │ +00225 │ │ │ │ │ │ +// Here’s how it goes... │ │ │ │ │ │ +00226 │ │ │ │ │ │ +stable_cone_soft_pt2_cutoff = pt_soft_min*pt_soft_min; │ │ │ │ │ │ +00227 │ │ │ │ │ │ +00228 │ │ │ │ │ │ +// clear potential previous runs │ │ │ │ │ │ +00229 │ │ │ │ │ │ +jet_areas.clear(); │ │ │ │ │ │ +00230 │ │ │ │ │ │ +// put initial set of particles in the list │ │ │ │ │ │ +00231 │ │ │ │ │ │ +00232 │ │ │ │ │ │ +int n_hard = _particles.size(); │ │ │ │ │ │ +00233 │ │ │ │ │ │ +all_particles = _particles; │ │ │ │ │ │ +00234 │ │ │ │ │ │ +00235 │ │ │ │ │ │ +// build the set of ghost particles and add them to the particle list │ │ │ │ │ │ +00236 │ │ │ │ │ │ +int i,j; │ │ │ │ │ │ +00237 │ │ │ │ │ │ +double eta_g,phi_g,pt_g; │ │ │ │ │ │ +00238 │ │ │ │ │ │ +for (i=0;i= n_hard │ │ │ │ │ │ +00257 │ │ │ │ │ │ +// and deduce the number of ghosts in the jet, hence the area. │ │ │ │ │ │ +00258 │ │ │ │ │ │ +double area_factor = (2.0*grid_eta_max/grid_size)*(twopi/grid_size); │ │ │ │ │ │ +for (i=0;i<(int) jets.size();i++){ │ │ │ │ │ │ +00259 │ │ │ │ │ │ +00260 │ │ │ │ │ │ +j=0; │ │ │ │ │ │ +while ((j &_particles, double _radius, double _f, │ │ │ │ │ │ +00292 │ │ │ │ │ │ +int _n_pass_max, Esplit_merge_scale _split_merge_scale, │ │ │ │ │ │ +bool _hard_only){ │ │ │ │ │ │ +00293 │ │ │ │ │ │ +00294 │ │ │ │ │ │ +00295 │ │ │ │ │ │ +vector all_particles; │ │ │ │ │ │ +00296 │ │ │ │ │ │ +00297 │ │ │ │ │ │ +// put "hardest cut-off" if needed │ │ │ │ │ │ +00298 │ │ │ │ │ │ +// this avoids computation of ghosted jets when not required and │ │ │ │ │ │ +00299 │ │ │ │ │ │ +// significantly shortens the SM. │ │ │ │ │ │ +00300 │ │ │ │ │ │ +if (_hard_only){ │ │ │ │ │ │ +00301 │ │ │ │ │ │ +SM_var2_hardest_cut_off = pt_soft_min*pt_soft_min; │ │ │ │ │ │ +00302 │ │ │ │ │ │ +} │ │ │ │ │ │ +00303 │ │ │ │ │ │ +// clear potential previous runs │ │ │ │ │ │ +00304 │ │ │ │ │ │ +00305 │ │ │ │ │ │ +jet_areas.clear(); │ │ │ │ │ │ +00306 │ │ │ │ │ │ +00307 │ │ │ │ │ │ +// put initial set of particles in the list │ │ │ │ │ │ +00308 │ │ │ │ │ │ +int n_hard = _particles.size(); │ │ │ │ │ │ +00309 │ │ │ │ │ │ +all_particles = _particles; │ │ │ │ │ │ +00310 │ │ │ │ │ │ +00311 │ │ │ │ │ │ +// build the set of ghost particles and add them to the particle list │ │ │ │ │ │ +00312 │ │ │ │ │ │ +int i,j; │ │ │ │ │ │ +00313 │ │ │ │ │ │ +double eta_g,phi_g,pt_g; │ │ │ │ │ │ +00314 │ │ │ │ │ │ +for (i=0;i= n_hard │ │ │ │ │ │ +00333 │ │ │ │ │ │ +// and deduce the number of ghosts in the jet, hence the area. │ │ │ │ │ │ +00334 │ │ │ │ │ │ +double area_factor = (2.0*grid_eta_max/grid_size)*(twopi/grid_size); │ │ │ │ │ │ +00335 │ │ │ │ │ │ +for (i=0;i<(int) jets.size();i++){ │ │ │ │ │ │ +00336 │ │ │ │ │ │ +00337 │ │ │ │ │ │ +jet_areas.push_back(jets[i]); │ │ │ │ │ │ +00338 │ │ │ │ │ │ +j=0; │ │ │ │ │ │ +00339 │ │ │ │ │ │ +while ((j │ │ │ │ │ │ 00028 #include │ │ │ │ │ │ @@ -11041,57 +11873,50 @@ │ │ │ │ │ │ 00035 using namespace siscone; │ │ │ │ │ │ 00036 │ │ │ │ │ │ 00037 int main(int argc, char *argv[]){ │ │ │ │ │ │ 00038 │ │ │ │ │ │ vector particles; │ │ │ │ │ │ 00039 │ │ │ │ │ │ Csiscone siscone; │ │ │ │ │ │ -00040 │ │ │ │ │ │ int i,N; │ │ │ │ │ │ +00040 │ │ │ │ │ │ 00041 │ │ │ │ │ │ double px,py,pz,E; │ │ │ │ │ │ 00042 │ │ │ │ │ │ Coptions opts; │ │ │ │ │ │ char fline[512]; │ │ │ │ │ │ 00043 │ │ │ │ │ │ 00044 │ │ │ │ │ │ if (opts.parse_options(argc, argv)) │ │ │ │ │ │ 00045 │ │ │ │ │ │ 00046 │ │ │ │ │ │ exit(1); │ │ │ │ │ │ 00047 │ │ │ │ │ │ -00048 │ │ │ │ │ │ // deal with help message │ │ │ │ │ │ +00048 │ │ │ │ │ │ 00049 │ │ │ │ │ │ if (opts.help_flag){ │ │ │ │ │ │ 00050 │ │ │ │ │ │ opts.print_help(); │ │ │ │ │ │ 00051 │ │ │ │ │ │ exit(0); │ │ │ │ │ │ 00052 │ │ │ │ │ │ } │ │ │ │ │ │ 00053 │ │ │ │ │ │ -// deal with version flag │ │ │ │ │ │ 00054 │ │ │ │ │ │ +// deal with version flag │ │ │ │ │ │ 00055 │ │ │ │ │ │ if (opts.version_flag){ │ │ │ │ │ │ 00056 │ │ │ │ │ │ opts.print_version(); │ │ │ │ │ │ 00057 │ │ │ │ │ │ exit(0); │ │ │ │ │ │ 00058 │ │ │ │ │ │ } │ │ │ │ │ │ 00059 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 176 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00060 │ │ │ │ │ │ // various files used to read input data and store results │ │ │ │ │ │ 00061 │ │ │ │ │ │ FILE *flux; │ │ │ │ │ │ 00062 │ │ │ │ │ │ FILE *fpart; │ │ │ │ │ │ 00063 │ │ │ │ │ │ @@ -11147,43 +11972,52 @@ │ │ │ │ │ │ } │ │ │ │ │ │ 00089 │ │ │ │ │ │ } │ │ │ │ │ │ 00090 │ │ │ │ │ │ fclose(flux); │ │ │ │ │ │ 00091 │ │ │ │ │ │ fclose(fpart); │ │ │ │ │ │ -if (opts.verbose_flag) │ │ │ │ │ │ 00092 │ │ │ │ │ │ +if (opts.verbose_flag) │ │ │ │ │ │ 00093 │ │ │ │ │ │ cout « " working with " « N « " particles" « endl; │ │ │ │ │ │ 00094 │ │ │ │ │ │ // compute jets │ │ │ │ │ │ 00095 │ │ │ │ │ │ 00096 │ │ │ │ │ │ if (opts.verbose_flag) cout « "computing jet contents" « endl; │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +181 │ │ │ │ │ │ + │ │ │ │ │ │ + 182 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00097 │ │ │ │ │ │ i=siscone.compute_jets(particles, opts.R, opts.f, opts.npass, opts.ptmin, opts.SM_var); │ │ │ │ │ │ if (opts.verbose_flag){ │ │ │ │ │ │ 00098 │ │ │ │ │ │ -unsigned int pass; │ │ │ │ │ │ 00099 │ │ │ │ │ │ -00100 │ │ │ │ │ │ +unsigned int pass; │ │ │ │ │ │ for (pass=0;pass │ │ │ │ │ │ 00029 #include │ │ │ │ │ │ 00030 #include │ │ │ │ │ │ 00031 │ │ │ │ │ │ 00032 using namespace std; │ │ │ │ │ │ @@ -11278,161 +12109,154 @@ │ │ │ │ │ │ * │ │ │ │ │ │ 00045 * options for the ’cone’ sample │ │ │ │ │ │ * │ │ │ │ │ │ 00046 *******************************************/ │ │ │ │ │ │ 00047 │ │ │ │ │ │ 00048 // default ctor │ │ │ │ │ │ 00049 //-------------00050 Coptions::Coptions(){ │ │ │ │ │ │ -// set default flags values │ │ │ │ │ │ 00051 │ │ │ │ │ │ +// set default flags values │ │ │ │ │ │ 00052 │ │ │ │ │ │ help_flag=0; │ │ │ │ │ │ 00053 │ │ │ │ │ │ version_flag=0; │ │ │ │ │ │ 00054 │ │ │ │ │ │ verbose_flag=1; │ │ │ │ │ │ 00055 │ │ │ │ │ │ -// set default options values │ │ │ │ │ │ 00056 │ │ │ │ │ │ +// set default options values │ │ │ │ │ │ 00057 │ │ │ │ │ │ N_stop = N_DEFAULT; │ │ │ │ │ │ 00058 │ │ │ │ │ │ R = R_DEFAULT; │ │ │ │ │ │ 00059 │ │ │ │ │ │ f = THRESHOLD_DEFAULT; │ │ │ │ │ │ 00060 │ │ │ │ │ │ npass = NPASS_DEFAULT; │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.4 options.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +183 │ │ │ │ │ │ + │ │ │ │ │ │ 00061 │ │ │ │ │ │ ev_name = NULL; │ │ │ │ │ │ 00062 │ │ │ │ │ │ SM_var = SM_DEFAULT; │ │ │ │ │ │ 00063 } │ │ │ │ │ │ 00064 │ │ │ │ │ │ 00065 │ │ │ │ │ │ 00066 // default dtor │ │ │ │ │ │ 00067 //-------------00068 Coptions::~Coptions(){ │ │ │ │ │ │ -00069 │ │ │ │ │ │ if (ev_name!=NULL) │ │ │ │ │ │ -delete[] ev_name; │ │ │ │ │ │ +00069 │ │ │ │ │ │ 00070 │ │ │ │ │ │ +delete[] ev_name; │ │ │ │ │ │ 00071 } │ │ │ │ │ │ 00072 │ │ │ │ │ │ 00073 │ │ │ │ │ │ 00074 // parse oprions │ │ │ │ │ │ 00075 // - argc number of arguments from the command line │ │ │ │ │ │ 00076 // - argv arguments from the command line │ │ │ │ │ │ 00077 // return 1 on error, 0 on success │ │ │ │ │ │ 00078 //--------------------------------00079 int Coptions::parse_options(int argc, char **argv){ │ │ │ │ │ │ 00080 │ │ │ │ │ │ int opt_param; │ │ │ │ │ │ -00081 │ │ │ │ │ │ int option_index; │ │ │ │ │ │ -bool stop=false; │ │ │ │ │ │ +00081 │ │ │ │ │ │ 00082 │ │ │ │ │ │ +bool stop=false; │ │ │ │ │ │ 00083 │ │ │ │ │ │ -00084 │ │ │ │ │ │ // browse the command-line options{ │ │ │ │ │ │ +00084 │ │ │ │ │ │ 00085 │ │ │ │ │ │ static struct option siscone_options[]={ │ │ │ │ │ │ -00086 │ │ │ │ │ │ // options that set a flag │ │ │ │ │ │ +00086 │ │ │ │ │ │ 00087 │ │ │ │ │ │ {"verbose", no_argument, &verbose_flag, 1}, │ │ │ │ │ │ +no_argument, &verbose_flag, 0}, │ │ │ │ │ │ 00088 │ │ │ │ │ │ {"quiet", │ │ │ │ │ │ -no_argument, &verbose_flag, 0}, │ │ │ │ │ │ -no_argument, &help_flag │ │ │ │ │ │ -, 1}, │ │ │ │ │ │ 00089 │ │ │ │ │ │ {"help", │ │ │ │ │ │ +no_argument, &help_flag │ │ │ │ │ │ +, 1}, │ │ │ │ │ │ 00090 │ │ │ │ │ │ {"version", no_argument, &version_flag, 1}, │ │ │ │ │ │ -00091 │ │ │ │ │ │ // options setting parameters │ │ │ │ │ │ +00091 │ │ │ │ │ │ 00092 │ │ │ │ │ │ {"number", │ │ │ │ │ │ required_argument, NULL, ’N’}, │ │ │ │ │ │ +required_argument, NULL, ’R’}, │ │ │ │ │ │ 00093 │ │ │ │ │ │ {"radius", │ │ │ │ │ │ -required_argument, NULL, ’R’}, │ │ │ │ │ │ 00094 │ │ │ │ │ │ {"fraction", required_argument, NULL, ’f’}, │ │ │ │ │ │ +required_argument, NULL, ’p’}, │ │ │ │ │ │ 00095 │ │ │ │ │ │ {"ptmin", │ │ │ │ │ │ -required_argument, NULL, ’p’}, │ │ │ │ │ │ -required_argument, NULL, ’n’}, │ │ │ │ │ │ 00096 │ │ │ │ │ │ {"npass", │ │ │ │ │ │ +required_argument, NULL, ’n’}, │ │ │ │ │ │ 00097 │ │ │ │ │ │ {"event", │ │ │ │ │ │ required_argument, NULL, ’e’}, │ │ │ │ │ │ +required_argument, NULL, ’s’}, │ │ │ │ │ │ 00098 │ │ │ │ │ │ {"sm", │ │ │ │ │ │ -required_argument, NULL, ’s’}, │ │ │ │ │ │ 00099 │ │ │ │ │ │ {0,0,0,0} │ │ │ │ │ │ 00100 │ │ │ │ │ │ }; │ │ │ │ │ │ 00101 │ │ │ │ │ │ 00102 │ │ │ │ │ │ -do{ │ │ │ │ │ │ 00103 │ │ │ │ │ │ +do{ │ │ │ │ │ │ 00104 │ │ │ │ │ │ // getopt_long stores the option index here. │ │ │ │ │ │ 00105 │ │ │ │ │ │ option_index=0; │ │ │ │ │ │ 00106 │ │ │ │ │ │ // retreive options │ │ │ │ │ │ 00107 │ │ │ │ │ │ 00108 │ │ │ │ │ │ opt_param = getopt_long(argc, argv, "hvqN:R:f:p:n:e:s:", │ │ │ │ │ │ 00109 │ │ │ │ │ │ siscone_options, &option_index); │ │ │ │ │ │ 00110 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -177 │ │ │ │ │ │ - │ │ │ │ │ │ -$// │ │ │ │ │ │ -$// │ │ │ │ │ │ - │ │ │ │ │ │ - 178 │ │ │ │ │ │ - │ │ │ │ │ │ 00111 │ │ │ │ │ │ +// Detect the end of the options. │ │ │ │ │ │ 00112 │ │ │ │ │ │ +if (opt_param == -1) │ │ │ │ │ │ 00113 │ │ │ │ │ │ +stop=true; │ │ │ │ │ │ 00114 │ │ │ │ │ │ +// branch according to ’opt_param’ │ │ │ │ │ │ 00115 │ │ │ │ │ │ 00116 │ │ │ │ │ │ -00117 │ │ │ │ │ │ -00118 │ │ │ │ │ │ -00119 │ │ │ │ │ │ -00120 │ │ │ │ │ │ -00121 │ │ │ │ │ │ -00122 │ │ │ │ │ │ -00123 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -// Detect the end of the options. │ │ │ │ │ │ -if (opt_param == -1) │ │ │ │ │ │ -stop=true; │ │ │ │ │ │ - │ │ │ │ │ │ -// branch according to ’opt_param’ │ │ │ │ │ │ switch (opt_param){ │ │ │ │ │ │ case ’h’: help_flag = 1; │ │ │ │ │ │ break; // help │ │ │ │ │ │ +00117 │ │ │ │ │ │ +00118 │ │ │ │ │ │ case ’v’: verbose_flag = 1; │ │ │ │ │ │ break; // verbose │ │ │ │ │ │ +00119 │ │ │ │ │ │ case ’q’: verbose_flag = 0; │ │ │ │ │ │ break; // quiet │ │ │ │ │ │ +00120 │ │ │ │ │ │ case ’N’: // max number of paprticles │ │ │ │ │ │ +00121 │ │ │ │ │ │ sscanf(optarg, "%d", &N_stop); │ │ │ │ │ │ if (N_stop<=0){ │ │ │ │ │ │ +00122 │ │ │ │ │ │ +00123 │ │ │ │ │ │ cout « "Warning: the specified number of particles must be positive. Using default one" « │ │ │ │ │ │ endl; │ │ │ │ │ │ 00124 │ │ │ │ │ │ N_stop = N_DEFAULT; │ │ │ │ │ │ 00125 │ │ │ │ │ │ } │ │ │ │ │ │ break; │ │ │ │ │ │ @@ -11460,59 +12284,67 @@ │ │ │ │ │ │ 00137 │ │ │ │ │ │ cout « "Warning: the specified split/merge threshold must be in [0,1]. Using default one" « │ │ │ │ │ │ endl; │ │ │ │ │ │ 00138 │ │ │ │ │ │ f = THRESHOLD_DEFAULT; │ │ │ │ │ │ 00139 │ │ │ │ │ │ } │ │ │ │ │ │ -break; │ │ │ │ │ │ 00140 │ │ │ │ │ │ +break; │ │ │ │ │ │ case ’p’: │ │ │ │ │ │ 00141 │ │ │ │ │ │ 00142 │ │ │ │ │ │ sscanf(optarg, "%lf", &ptmin); │ │ │ │ │ │ if (ptmin<0){ │ │ │ │ │ │ 00143 │ │ │ │ │ │ 00144 │ │ │ │ │ │ cout « "Warning: the specified minimal pT must be non-negative. Using default one" « endl; │ │ │ │ │ │ 00145 │ │ │ │ │ │ ptmin = PTMIN_DEFAULT; │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 184 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00146 │ │ │ │ │ │ -} │ │ │ │ │ │ -break; │ │ │ │ │ │ 00147 │ │ │ │ │ │ -case ’n’: // max number of paprticles │ │ │ │ │ │ 00148 │ │ │ │ │ │ 00149 │ │ │ │ │ │ -sscanf(optarg, "%d", &npass); │ │ │ │ │ │ 00150 │ │ │ │ │ │ -if (npass<0){ │ │ │ │ │ │ 00151 │ │ │ │ │ │ + │ │ │ │ │ │ +} │ │ │ │ │ │ +break; │ │ │ │ │ │ +case ’n’: // max number of paprticles │ │ │ │ │ │ +sscanf(optarg, "%d", &npass); │ │ │ │ │ │ +if (npass<0){ │ │ │ │ │ │ cout « "Warning: the specified number of passes must be non negative. Using default one" « │ │ │ │ │ │ endl; │ │ │ │ │ │ 00152 │ │ │ │ │ │ npass = NPASS_DEFAULT; │ │ │ │ │ │ 00153 │ │ │ │ │ │ } │ │ │ │ │ │ break; │ │ │ │ │ │ 00154 │ │ │ │ │ │ 00155 │ │ │ │ │ │ case ’e’: │ │ │ │ │ │ -00156 │ │ │ │ │ │ if (ev_name==NULL){ │ │ │ │ │ │ +00156 │ │ │ │ │ │ 00157 │ │ │ │ │ │ ev_name = new char[strlen(optarg)+1]; │ │ │ │ │ │ 00158 │ │ │ │ │ │ strcpy(ev_name, optarg); │ │ │ │ │ │ 00159 │ │ │ │ │ │ } │ │ │ │ │ │ break; │ │ │ │ │ │ 00160 │ │ │ │ │ │ -case ’s’: │ │ │ │ │ │ 00161 │ │ │ │ │ │ +case ’s’: │ │ │ │ │ │ 00162 │ │ │ │ │ │ char tmp[512]; │ │ │ │ │ │ 00163 │ │ │ │ │ │ strcpy(tmp, optarg); │ │ │ │ │ │ if (strcmp(tmp, "pttilde")==0){ │ │ │ │ │ │ 00164 │ │ │ │ │ │ 00165 │ │ │ │ │ │ @@ -11534,56 +12366,49 @@ │ │ │ │ │ │ 00173 │ │ │ │ │ │ cout « "Warning: the specified varible for split--merge is not valid (should be pttilde, pt, │ │ │ │ │ │ mt or Et). Using pttilde as the default one." « endl; │ │ │ │ │ │ 00174 │ │ │ │ │ │ SM_var = SM_pttilde; │ │ │ │ │ │ 00175 │ │ │ │ │ │ } │ │ │ │ │ │ -00176 │ │ │ │ │ │ break; │ │ │ │ │ │ -case 0: │ │ │ │ │ │ +00176 │ │ │ │ │ │ 00177 │ │ │ │ │ │ -00178 │ │ │ │ │ │ +case 0: │ │ │ │ │ │ case -1: │ │ │ │ │ │ -break; │ │ │ │ │ │ +00178 │ │ │ │ │ │ 00179 │ │ │ │ │ │ +break; │ │ │ │ │ │ 00180 │ │ │ │ │ │ case ’?’: │ │ │ │ │ │ 00181 │ │ │ │ │ │ fprintf(stderr, "Giving up.\n"); │ │ │ │ │ │ -return 1; │ │ │ │ │ │ 00182 │ │ │ │ │ │ -00183 │ │ │ │ │ │ +return 1; │ │ │ │ │ │ break; │ │ │ │ │ │ -default: │ │ │ │ │ │ +00183 │ │ │ │ │ │ 00184 │ │ │ │ │ │ +default: │ │ │ │ │ │ 00185 │ │ │ │ │ │ if (!help_flag){ │ │ │ │ │ │ 00186 │ │ │ │ │ │ fprintf(stderr, "unrecognized option %c. Giving up.\n", opt_param); │ │ │ │ │ │ 00187 │ │ │ │ │ │ return 1; │ │ │ │ │ │ 00188 │ │ │ │ │ │ } │ │ │ │ │ │ 00189 │ │ │ │ │ │ } │ │ │ │ │ │ 00190 │ │ │ │ │ │ } while (!stop); │ │ │ │ │ │ 00191 │ │ │ │ │ │ -if (ev_name==NULL){ │ │ │ │ │ │ 00192 │ │ │ │ │ │ +if (ev_name==NULL){ │ │ │ │ │ │ 00193 │ │ │ │ │ │ ev_name = new char[strlen(DEFAULT_EVENT)+1]; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.3 options.h │ │ │ │ │ │ - │ │ │ │ │ │ -179 │ │ │ │ │ │ - │ │ │ │ │ │ 00194 │ │ │ │ │ │ strcpy(ev_name, DEFAULT_EVENT); │ │ │ │ │ │ 00195 │ │ │ │ │ │ } │ │ │ │ │ │ 00196 │ │ │ │ │ │ return 0; │ │ │ │ │ │ 00197 │ │ │ │ │ │ @@ -11612,20 +12437,20 @@ │ │ │ │ │ │ 00212 │ │ │ │ │ │ cout « " -p , --ptmin= │ │ │ │ │ │ endl; │ │ │ │ │ │ : set the maximal number of passes (0 for no limit) (" « │ │ │ │ │ │ 00213 │ │ │ │ │ │ cout « " -n , --npass= │ │ │ │ │ │ NPASS_DEFAULT « ")" « endl; │ │ │ │ │ │ +: set the event filename (" « DEFAULT_EVENT « ")" « endl; │ │ │ │ │ │ 00214 │ │ │ │ │ │ cout « " -e , --event= │ │ │ │ │ │ -: set the event filename (" « DEFAULT_EVENT « ")" « endl; │ │ │ │ │ │ -: variable for split--merge: pttilde, mt, pt or Et (pttilde)" « │ │ │ │ │ │ 00215 │ │ │ │ │ │ cout « " -s , --sm= │ │ │ │ │ │ +: variable for split--merge: pttilde, mt, pt or Et (pttilde)" « │ │ │ │ │ │ endl; │ │ │ │ │ │ 00216 │ │ │ │ │ │ cout « endl; │ │ │ │ │ │ 00217 │ │ │ │ │ │ cout « "Output flags" « endl; │ │ │ │ │ │ : show version information" « endl; │ │ │ │ │ │ 00218 │ │ │ │ │ │ @@ -11641,14 +12466,19 @@ │ │ │ │ │ │ cout « endl; │ │ │ │ │ │ 00223 │ │ │ │ │ │ 00224 │ │ │ │ │ │ return 0; │ │ │ │ │ │ 00225 } │ │ │ │ │ │ 00226 │ │ │ │ │ │ 00227 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.5 options.h │ │ │ │ │ │ + │ │ │ │ │ │ 00228 // print program version │ │ │ │ │ │ 00229 //----------------------00230 int Coptions::print_version(){ │ │ │ │ │ │ 00231 │ │ │ │ │ │ cout « siscone_package_name() « " " « siscone_version() « endl; │ │ │ │ │ │ 00232 │ │ │ │ │ │ cout « "Copyright (C) 2006." « endl; │ │ │ │ │ │ 00233 │ │ │ │ │ │ @@ -11666,18 +12496,18 @@ │ │ │ │ │ │ 00239 │ │ │ │ │ │ cout « "Please send bugs or comments to AUTHORS" « endl; │ │ │ │ │ │ 00240 │ │ │ │ │ │ return 0; │ │ │ │ │ │ 00241 │ │ │ │ │ │ 00242 } │ │ │ │ │ │ │ │ │ │ │ │ -5.3 options.h │ │ │ │ │ │ +5.5 options.h │ │ │ │ │ │ 00001 │ │ │ │ │ │ -// │ │ │ │ │ │ 00002 // File: options.h │ │ │ │ │ │ +// │ │ │ │ │ │ 00003 // Description: management of the cmdline options of the main program │ │ │ │ │ │ // │ │ │ │ │ │ 00004 // This file is part of the SISCone project. │ │ │ │ │ │ // │ │ │ │ │ │ 00005 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ // │ │ │ │ │ │ 00006 // │ │ │ │ │ │ @@ -11717,72 +12547,74 @@ │ │ │ │ │ │ $// │ │ │ │ │ │ 00024 // $Date:: 2007-10-03 19:21:19 +0200 (Wed, 03 Oct 2007) │ │ │ │ │ │ $// │ │ │ │ │ │ 00026 │ │ │ │ │ │ 00027 #ifndef __OPTIONS_H__ │ │ │ │ │ │ 00028 #define __OPTIONS_H__ │ │ │ │ │ │ 00029 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 180 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00030 #include "siscone/siscone.h" │ │ │ │ │ │ 00031 │ │ │ │ │ │ 00037 class Coptions{ │ │ │ │ │ │ 00038 public: │ │ │ │ │ │ 00040 │ │ │ │ │ │ Coptions(); │ │ │ │ │ │ 00041 │ │ │ │ │ │ 00043 │ │ │ │ │ │ ~Coptions(); │ │ │ │ │ │ 00044 │ │ │ │ │ │ 00049 │ │ │ │ │ │ int parse_options(int argc, char **argv); │ │ │ │ │ │ 00050 │ │ │ │ │ │ -00052 │ │ │ │ │ │ int print_help(); │ │ │ │ │ │ +00052 │ │ │ │ │ │ 00053 │ │ │ │ │ │ -int print_version(); │ │ │ │ │ │ 00055 │ │ │ │ │ │ +int print_version(); │ │ │ │ │ │ 00056 │ │ │ │ │ │ // flags │ │ │ │ │ │ 00057 │ │ │ │ │ │ 00058 │ │ │ │ │ │ int help_flag; │ │ │ │ │ │ 00059 │ │ │ │ │ │ int version_flag; │ │ │ │ │ │ -00060 │ │ │ │ │ │ int verbose_flag; │ │ │ │ │ │ +00060 │ │ │ │ │ │ 00061 │ │ │ │ │ │ -// options │ │ │ │ │ │ 00062 │ │ │ │ │ │ +// options │ │ │ │ │ │ 00063 │ │ │ │ │ │ int N_stop; │ │ │ │ │ │ 00064 │ │ │ │ │ │ double R; │ │ │ │ │ │ -00065 │ │ │ │ │ │ double f; │ │ │ │ │ │ -double ptmin; │ │ │ │ │ │ +00065 │ │ │ │ │ │ 00066 │ │ │ │ │ │ -00067 │ │ │ │ │ │ +double ptmin; │ │ │ │ │ │ char *ev_name; │ │ │ │ │ │ -int npass; │ │ │ │ │ │ +00067 │ │ │ │ │ │ 00068 │ │ │ │ │ │ +int npass; │ │ │ │ │ │ 00069 │ │ │ │ │ │ 00071 │ │ │ │ │ │ siscone::Esplit_merge_scale SM_var; │ │ │ │ │ │ 00072 }; │ │ │ │ │ │ 00073 │ │ │ │ │ │ 00074 #endif │ │ │ │ │ │ │ │ │ │ │ │ -5.4 sample.cpp │ │ │ │ │ │ +5.6 sample.cpp │ │ │ │ │ │ 00001 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +185 │ │ │ │ │ │ + │ │ │ │ │ │ + 186 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00002 // File: sample.cpp │ │ │ │ │ │ // │ │ │ │ │ │ 00003 // Description: example program for the Csiscone class (see documentation) │ │ │ │ │ │ // │ │ │ │ │ │ 00004 // This file is part of the SISCone project. │ │ │ │ │ │ // │ │ │ │ │ │ 00005 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ @@ -11827,16 +12659,16 @@ │ │ │ │ │ │ 00026 │ │ │ │ │ │ 00027 #include │ │ │ │ │ │ 00028 #include │ │ │ │ │ │ 00029 #include │ │ │ │ │ │ 00030 #include "siscone/momentum.h" │ │ │ │ │ │ 00031 #include "siscone/siscone.h" │ │ │ │ │ │ 00032 │ │ │ │ │ │ -00033 #define R │ │ │ │ │ │ 0.7 │ │ │ │ │ │ +00033 #define R │ │ │ │ │ │ 00034 #define f │ │ │ │ │ │ 0.5 │ │ │ │ │ │ 00035 #define f_alt 0.75 │ │ │ │ │ │ 00036 │ │ │ │ │ │ 00037 using namespace std; │ │ │ │ │ │ 00038 using namespace siscone; │ │ │ │ │ │ 00039 │ │ │ │ │ │ @@ -11856,121 +12688,122 @@ │ │ │ │ │ │ 00045 │ │ │ │ │ │ double px,py,pz,E; │ │ │ │ │ │ // particles 4-momentum │ │ │ │ │ │ 00046 │ │ │ │ │ │ char fline[512]; │ │ │ │ │ │ // line to read from a file │ │ │ │ │ │ 00047 │ │ │ │ │ │ -// read particles │ │ │ │ │ │ 00048 │ │ │ │ │ │ +// read particles │ │ │ │ │ │ 00049 │ │ │ │ │ │ FILE *flux; │ │ │ │ │ │ 00050 │ │ │ │ │ │ flux = fopen("events/single-event.dat", "r"); │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.5 spherical.cpp │ │ │ │ │ │ - │ │ │ │ │ │ 00051 │ │ │ │ │ │ +if (flux==NULL){ │ │ │ │ │ │ 00052 │ │ │ │ │ │ +cerr « "cannot read event" « endl; │ │ │ │ │ │ 00053 │ │ │ │ │ │ +return 1; │ │ │ │ │ │ 00054 │ │ │ │ │ │ +} │ │ │ │ │ │ 00055 │ │ │ │ │ │ 00056 │ │ │ │ │ │ +N=0; │ │ │ │ │ │ +while (fgets(fline, 512, flux)!=NULL){ │ │ │ │ │ │ 00057 │ │ │ │ │ │ 00058 │ │ │ │ │ │ +if (fline[0]!=’#’){ // skip lines beginning with ’#’ │ │ │ │ │ │ 00059 │ │ │ │ │ │ +if (sscanf(fline, "%le%le%le%le", &px, &py, &pz, &E)==4){ │ │ │ │ │ │ 00060 │ │ │ │ │ │ +particles.push_back(Cmomentum(px, py, pz, E)); │ │ │ │ │ │ 00061 │ │ │ │ │ │ +N++; │ │ │ │ │ │ 00062 │ │ │ │ │ │ +} else { │ │ │ │ │ │ 00063 │ │ │ │ │ │ +cout « "error in reading event file Giving up." « endl; │ │ │ │ │ │ 00064 │ │ │ │ │ │ +fclose(flux); │ │ │ │ │ │ +return 2; │ │ │ │ │ │ 00065 │ │ │ │ │ │ 00066 │ │ │ │ │ │ +} │ │ │ │ │ │ 00067 │ │ │ │ │ │ +} │ │ │ │ │ │ 00068 │ │ │ │ │ │ +} │ │ │ │ │ │ 00069 │ │ │ │ │ │ +fclose(flux); │ │ │ │ │ │ 00070 │ │ │ │ │ │ 00071 │ │ │ │ │ │ +// compute jets │ │ │ │ │ │ 00072 │ │ │ │ │ │ +// first compute with multiple passes (default) │ │ │ │ │ │ 00073 │ │ │ │ │ │ +i=siscone.compute_jets(particles, R, f); │ │ │ │ │ │ 00074 │ │ │ │ │ │ +cout « " " « i « " jets found in multi-pass run" « endl; │ │ │ │ │ │ 00075 │ │ │ │ │ │ +// then, recompute it with a different f │ │ │ │ │ │ 00076 │ │ │ │ │ │ 00077 │ │ │ │ │ │ +i=siscone.recompute_jets(f_alt); │ │ │ │ │ │ 00078 │ │ │ │ │ │ +cout « " " « i « " jets found with alternative f" « endl; │ │ │ │ │ │ 00079 │ │ │ │ │ │ +// one pass │ │ │ │ │ │ 00080 │ │ │ │ │ │ 00081 │ │ │ │ │ │ +i=siscone.compute_jets(particles, R, f, 1); │ │ │ │ │ │ 00082 │ │ │ │ │ │ +cout « " " « i « " jets found in single-pass run" « endl; │ │ │ │ │ │ 00083 │ │ │ │ │ │ 00084 │ │ │ │ │ │ -00085 │ │ │ │ │ │ -00086 │ │ │ │ │ │ -00087 │ │ │ │ │ │ - │ │ │ │ │ │ -181 │ │ │ │ │ │ - │ │ │ │ │ │ -if (flux==NULL){ │ │ │ │ │ │ -cerr « "cannot read event" « endl; │ │ │ │ │ │ -return 1; │ │ │ │ │ │ -} │ │ │ │ │ │ -N=0; │ │ │ │ │ │ -while (fgets(fline, 512, flux)!=NULL){ │ │ │ │ │ │ -if (fline[0]!=’#’){ // skip lines beginning with ’#’ │ │ │ │ │ │ -if (sscanf(fline, "%le%le%le%le", &px, &py, &pz, &E)==4){ │ │ │ │ │ │ -particles.push_back(Cmomentum(px, py, pz, E)); │ │ │ │ │ │ -N++; │ │ │ │ │ │ -} else { │ │ │ │ │ │ -cout « "error in reading event file Giving up." « endl; │ │ │ │ │ │ -fclose(flux); │ │ │ │ │ │ -return 2; │ │ │ │ │ │ -} │ │ │ │ │ │ -} │ │ │ │ │ │ -} │ │ │ │ │ │ -fclose(flux); │ │ │ │ │ │ -// compute jets │ │ │ │ │ │ -// first compute with multiple passes (default) │ │ │ │ │ │ -i=siscone.compute_jets(particles, R, f); │ │ │ │ │ │ -cout « " " « i « " jets found in multi-pass run" « endl; │ │ │ │ │ │ -// then, recompute it with a different f │ │ │ │ │ │ -i=siscone.recompute_jets(f_alt); │ │ │ │ │ │ -cout « " " « i « " jets found with alternative f" « endl; │ │ │ │ │ │ -// one pass │ │ │ │ │ │ -i=siscone.compute_jets(particles, R, f, 1); │ │ │ │ │ │ -cout « " " « i « " jets found in single-pass run" « endl; │ │ │ │ │ │ - │ │ │ │ │ │ // show jets │ │ │ │ │ │ +00085 │ │ │ │ │ │ vector::iterator it_j; │ │ │ │ │ │ +00086 │ │ │ │ │ │ int i1; │ │ │ │ │ │ -fprintf(stdout, "# │ │ │ │ │ │ pT │ │ │ │ │ │ eta │ │ │ │ │ │ phi │ │ │ │ │ │ px │ │ │ │ │ │ py │ │ │ │ │ │ +00087 │ │ │ │ │ │ +fprintf(stdout, "# │ │ │ │ │ │ \n"); │ │ │ │ │ │ 00088 │ │ │ │ │ │ for (it_j = siscone.jets.begin(), i1=0 ; │ │ │ │ │ │ + │ │ │ │ │ │ +pz │ │ │ │ │ │ + │ │ │ │ │ │ +E │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.7 spherical.cpp │ │ │ │ │ │ + │ │ │ │ │ │ 00089 │ │ │ │ │ │ -it_j != siscone.jets.end() ; it_j++, i1++){ │ │ │ │ │ │ 00090 │ │ │ │ │ │ -fprintf(stdout, "Jet %3d: %10.3f %8.3f %8.3f %10.3f %10.3f %10.3f %10.3f\n", │ │ │ │ │ │ 00091 │ │ │ │ │ │ + │ │ │ │ │ │ +it_j != siscone.jets.end() ; it_j++, i1++){ │ │ │ │ │ │ +fprintf(stdout, "Jet %3d: %10.3f %8.3f %8.3f %10.3f %10.3f %10.3f %10.3f\n", │ │ │ │ │ │ i1, it_j->v.perp(), it_j->v.eta, it_j->v.phi, it_j->v.px, it_j->v.py, │ │ │ │ │ │ it_j->v.E); │ │ │ │ │ │ 00092 │ │ │ │ │ │ } │ │ │ │ │ │ 00093 │ │ │ │ │ │ -return 0; │ │ │ │ │ │ 00094 │ │ │ │ │ │ +return 0; │ │ │ │ │ │ 00095 } │ │ │ │ │ │ │ │ │ │ │ │ -5.5 spherical.cpp │ │ │ │ │ │ +5.7 spherical.cpp │ │ │ │ │ │ 00001 │ │ │ │ │ │ // │ │ │ │ │ │ 00002 // File: spherical.cpp │ │ │ │ │ │ 00003 // Description: example program for the CSphsiscone class (spherical SISCone)// │ │ │ │ │ │ 00004 // This file is part of the SISCone project. │ │ │ │ │ │ // │ │ │ │ │ │ 00005 // WARNING: this is not the main SISCone trunk but │ │ │ │ │ │ @@ -12020,27 +12853,14 @@ │ │ │ │ │ │ 00028 │ │ │ │ │ │ 00029 #include │ │ │ │ │ │ 00030 #include │ │ │ │ │ │ 00031 #include │ │ │ │ │ │ 00032 #include "siscone/spherical/momentum.h" │ │ │ │ │ │ 00033 #include "siscone/spherical/siscone.h" │ │ │ │ │ │ 00034 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -pz │ │ │ │ │ │ - │ │ │ │ │ │ -it_j->v.pz, │ │ │ │ │ │ - │ │ │ │ │ │ -E │ │ │ │ │ │ - │ │ │ │ │ │ - 182 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00035 #define R │ │ │ │ │ │ 0.7 │ │ │ │ │ │ 00036 #define f │ │ │ │ │ │ 0.5 │ │ │ │ │ │ 00037 #define f_alt 0.75 │ │ │ │ │ │ 00038 │ │ │ │ │ │ 00039 using namespace std; │ │ │ │ │ │ @@ -12078,16 +12898,16 @@ │ │ │ │ │ │ return 1; │ │ │ │ │ │ 00055 │ │ │ │ │ │ 00056 │ │ │ │ │ │ } │ │ │ │ │ │ 00057 │ │ │ │ │ │ 00058 │ │ │ │ │ │ N=0; │ │ │ │ │ │ -while (fgets(fline, 512, flux)!=NULL){ │ │ │ │ │ │ 00059 │ │ │ │ │ │ +while (fgets(fline, 512, flux)!=NULL){ │ │ │ │ │ │ if (fline[0]!=’#’){ // skip lines beginning with ’#’ │ │ │ │ │ │ 00060 │ │ │ │ │ │ 00061 │ │ │ │ │ │ if (sscanf(fline, "%le%le%le%le", &px, &py, &pz, &E)==4){ │ │ │ │ │ │ 00062 │ │ │ │ │ │ particles.push_back(CSphmomentum(px, py, pz, E)); │ │ │ │ │ │ 00063 │ │ │ │ │ │ @@ -12105,16 +12925,27 @@ │ │ │ │ │ │ 00069 │ │ │ │ │ │ } │ │ │ │ │ │ 00070 │ │ │ │ │ │ } │ │ │ │ │ │ 00071 │ │ │ │ │ │ fclose(flux); │ │ │ │ │ │ 00072 │ │ │ │ │ │ -// compute jets │ │ │ │ │ │ 00073 │ │ │ │ │ │ +// compute jets │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +187 │ │ │ │ │ │ + │ │ │ │ │ │ +it_j->v.pz, │ │ │ │ │ │ + │ │ │ │ │ │ + 188 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00074 │ │ │ │ │ │ // first compute with multiple passes (default) │ │ │ │ │ │ 00075 │ │ │ │ │ │ i=siscone.compute_jets(particles, R, f); │ │ │ │ │ │ 00076 │ │ │ │ │ │ cout « " " « i « " jets found in multi-pass run" « endl; │ │ │ │ │ │ 00077 │ │ │ │ │ │ @@ -12132,23 +12963,23 @@ │ │ │ │ │ │ 00084 │ │ │ │ │ │ cout « " " « i « " jets found in single-pass run" « endl; │ │ │ │ │ │ 00085 │ │ │ │ │ │ // show jets │ │ │ │ │ │ 00086 │ │ │ │ │ │ 00087 │ │ │ │ │ │ vector::iterator it_j; │ │ │ │ │ │ -int i1; │ │ │ │ │ │ 00088 │ │ │ │ │ │ -00089 │ │ │ │ │ │ -fprintf(stdout, "# │ │ │ │ │ │ +int i1; │ │ │ │ │ │ theta │ │ │ │ │ │ phi │ │ │ │ │ │ px │ │ │ │ │ │ py │ │ │ │ │ │ pz │ │ │ │ │ │ +00089 │ │ │ │ │ │ +fprintf(stdout, "# │ │ │ │ │ │ 00090 │ │ │ │ │ │ for (it_j = siscone.jets.begin(), i1=0 ; │ │ │ │ │ │ 00091 │ │ │ │ │ │ it_j != siscone.jets.end() ; it_j++, i1++){ │ │ │ │ │ │ 00092 │ │ │ │ │ │ fprintf(stdout, "Jet %3d: %8.3f %8.3f %10.3f %10.3f %10.3f %10.3f\n", │ │ │ │ │ │ 00093 │ │ │ │ │ │ @@ -12162,58 +12993,49 @@ │ │ │ │ │ │ │ │ │ │ │ │ E │ │ │ │ │ │ │ │ │ │ │ │ \n"); │ │ │ │ │ │ │ │ │ │ │ │ it_j->v.E); │ │ │ │ │ │ │ │ │ │ │ │ -5.6 test.cpp │ │ │ │ │ │ +5.8 test.cpp │ │ │ │ │ │ 00001 │ │ │ │ │ │ +// │ │ │ │ │ │ 00002 // File: test.cpp │ │ │ │ │ │ -00003 // Description: example program that implements tests with random particles │ │ │ │ │ │ +00003 // Description: example program that implements tests with random particles // │ │ │ │ │ │ 00004 // │ │ │ │ │ │ and output various informations │ │ │ │ │ │ +// │ │ │ │ │ │ 00005 // │ │ │ │ │ │ +// │ │ │ │ │ │ 00006 // Note: for a usage example of SISCone, we advise looking at main.cpp │ │ │ │ │ │ +// │ │ │ │ │ │ 00007 // │ │ │ │ │ │ or http://projects.hepforge.org/siscone/usage.html │ │ │ │ │ │ -00008 // │ │ │ │ │ │ -00009 // This file is part of the SISCone project. │ │ │ │ │ │ -00010 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ -00011 // │ │ │ │ │ │ -00012 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ -00013 // │ │ │ │ │ │ -00014 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ -00015 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ -00016 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ -00017 // (at your option) any later version. │ │ │ │ │ │ - │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ // │ │ │ │ │ │ +00008 // │ │ │ │ │ │ // │ │ │ │ │ │ +00009 // This file is part of the SISCone project. │ │ │ │ │ │ // │ │ │ │ │ │ +00010 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ // │ │ │ │ │ │ +00011 // │ │ │ │ │ │ // │ │ │ │ │ │ +00012 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ // │ │ │ │ │ │ +00013 // │ │ │ │ │ │ // │ │ │ │ │ │ +00014 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ // │ │ │ │ │ │ +00015 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ // │ │ │ │ │ │ +00016 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ // │ │ │ │ │ │ +00017 // (at your option) any later version. │ │ │ │ │ │ // │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.6 test.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -183 │ │ │ │ │ │ - │ │ │ │ │ │ 00018 // │ │ │ │ │ │ // │ │ │ │ │ │ 00019 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ // │ │ │ │ │ │ 00020 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ // │ │ │ │ │ │ 00021 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ @@ -12264,31 +13086,38 @@ │ │ │ │ │ │ 00053 │ │ │ │ │ │ 00054 │ │ │ │ │ │ 00055 │ │ │ │ │ │ unsigned int i; │ │ │ │ │ │ 00056 │ │ │ │ │ │ FILE *flux; │ │ │ │ │ │ 00057 │ │ │ │ │ │ -if (argc==1){ │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.9 times.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +189 │ │ │ │ │ │ + │ │ │ │ │ │ 00058 │ │ │ │ │ │ -00059 │ │ │ │ │ │ +if (argc==1){ │ │ │ │ │ │ //cout « "using default number of particles" « endl; │ │ │ │ │ │ +00059 │ │ │ │ │ │ 00060 │ │ │ │ │ │ N = N_default; │ │ │ │ │ │ 00061 │ │ │ │ │ │ } else { │ │ │ │ │ │ 00062 │ │ │ │ │ │ sscanf(argv[1], "%u", &N); │ │ │ │ │ │ -//cout « "using " « N « " particles" « endl; │ │ │ │ │ │ 00063 │ │ │ │ │ │ +//cout « "using " « N « " particles" « endl; │ │ │ │ │ │ 00064 │ │ │ │ │ │ } │ │ │ │ │ │ 00065 │ │ │ │ │ │ -// Initialise random number generator │ │ │ │ │ │ 00066 │ │ │ │ │ │ +// Initialise random number generator │ │ │ │ │ │ 00067 │ │ │ │ │ │ timeval timestamp; │ │ │ │ │ │ 00068 │ │ │ │ │ │ gettimeofday(×tamp, NULL); │ │ │ │ │ │ 00069 │ │ │ │ │ │ srand(timestamp.tv_usec); │ │ │ │ │ │ 00070 │ │ │ │ │ │ @@ -12296,16 +13125,16 @@ │ │ │ │ │ │ 00071 │ │ │ │ │ │ 00072 │ │ │ │ │ │ cout « "build particle list" « endl; │ │ │ │ │ │ 00073 │ │ │ │ │ │ flux = fopen("particles.dat", "w+"); │ │ │ │ │ │ 00074 │ │ │ │ │ │ for (i=0;i particles; │ │ │ │ │ │ 00066 │ │ │ │ │ │ Csiscone siscone; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.8 area.cpp │ │ │ │ │ │ - │ │ │ │ │ │ 00067 │ │ │ │ │ │ double eta,phi; │ │ │ │ │ │ 00068 │ │ │ │ │ │ // number of events and particles │ │ │ │ │ │ 00069 │ │ │ │ │ │ 00070 │ │ │ │ │ │ int i, N; │ │ │ │ │ │ @@ -12512,16 +13337,16 @@ │ │ │ │ │ │ int time_siscone; │ │ │ │ │ │ 00075 │ │ │ │ │ │ // save files │ │ │ │ │ │ 00076 │ │ │ │ │ │ 00077 │ │ │ │ │ │ FILE *flux; │ │ │ │ │ │ 00078 │ │ │ │ │ │ -// initialise random number generator │ │ │ │ │ │ 00079 │ │ │ │ │ │ +// initialise random number generator │ │ │ │ │ │ 00080 │ │ │ │ │ │ cout « "initialise random number generator" « endl; │ │ │ │ │ │ 00081 │ │ │ │ │ │ timeval timestamp; │ │ │ │ │ │ 00082 │ │ │ │ │ │ 00083 │ │ │ │ │ │ gettimeofday(×tamp, NULL); │ │ │ │ │ │ @@ -12538,905 +13363,74 @@ │ │ │ │ │ │ do{ │ │ │ │ │ │ 00090 │ │ │ │ │ │ 00091 │ │ │ │ │ │ fprintf(stdout, "\r%5d particles\n", N); │ │ │ │ │ │ 00092 │ │ │ │ │ │ time_siscone=0; │ │ │ │ │ │ 00093 │ │ │ │ │ │ -for (n_ev=0;n_ev │ │ │ │ │ │ -00028 #include │ │ │ │ │ │ -00029 #include │ │ │ │ │ │ -00030 #include "siscone/momentum.h" │ │ │ │ │ │ -00031 #include "siscone/siscone.h" │ │ │ │ │ │ -00032 #include "siscone/area.h" │ │ │ │ │ │ -00033 #include "options.h" │ │ │ │ │ │ -00034 │ │ │ │ │ │ -00035 using namespace std; │ │ │ │ │ │ -00036 using namespace siscone; │ │ │ │ │ │ -00037 │ │ │ │ │ │ -00038 int main(int argc, char *argv[]){ │ │ │ │ │ │ -00039 │ │ │ │ │ │ -vector particles; │ │ │ │ │ │ -00040 │ │ │ │ │ │ -Carea siscone_with_area; │ │ │ │ │ │ -00041 │ │ │ │ │ │ -int i,N; │ │ │ │ │ │ -double px,py,pz,E; │ │ │ │ │ │ -00042 │ │ │ │ │ │ -00043 │ │ │ │ │ │ -Coptions opts; │ │ │ │ │ │ -char fline[512]; │ │ │ │ │ │ -00044 │ │ │ │ │ │ -00045 │ │ │ │ │ │ -00046 │ │ │ │ │ │ -if (opts.parse_options(argc, argv)) │ │ │ │ │ │ -00047 │ │ │ │ │ │ -exit(1); │ │ │ │ │ │ -00048 │ │ │ │ │ │ -// deal with help message │ │ │ │ │ │ -00049 │ │ │ │ │ │ -00050 │ │ │ │ │ │ -if (opts.help_flag){ │ │ │ │ │ │ -00051 │ │ │ │ │ │ -opts.print_help(); │ │ │ │ │ │ -00052 │ │ │ │ │ │ -exit(0); │ │ │ │ │ │ -00053 │ │ │ │ │ │ -} │ │ │ │ │ │ -00054 │ │ │ │ │ │ -// deal with version flag │ │ │ │ │ │ -00055 │ │ │ │ │ │ -00056 │ │ │ │ │ │ -if (opts.version_flag){ │ │ │ │ │ │ -00057 │ │ │ │ │ │ -opts.print_version(); │ │ │ │ │ │ -00058 │ │ │ │ │ │ -exit(0); │ │ │ │ │ │ -00059 │ │ │ │ │ │ -} │ │ │ │ │ │ -00060 │ │ │ │ │ │ -00061 │ │ │ │ │ │ -// various files used to read input data and store results │ │ │ │ │ │ -00062 │ │ │ │ │ │ -FILE *flux; │ │ │ │ │ │ -00063 │ │ │ │ │ │ -FILE *fpart; │ │ │ │ │ │ -00064 │ │ │ │ │ │ -00065 │ │ │ │ │ │ -// read particles │ │ │ │ │ │ -00066 │ │ │ │ │ │ -if (opts.verbose_flag) cout « "reading particles" « endl; │ │ │ │ │ │ -00067 │ │ │ │ │ │ -flux = fopen(opts.ev_name, "r"); │ │ │ │ │ │ -if (flux==NULL){ │ │ │ │ │ │ -00068 │ │ │ │ │ │ -00069 │ │ │ │ │ │ -cerr « "cannot read event" « endl; │ │ │ │ │ │ -return 1; │ │ │ │ │ │ -00070 │ │ │ │ │ │ -00071 │ │ │ │ │ │ -} │ │ │ │ │ │ -00072 │ │ │ │ │ │ -00073 │ │ │ │ │ │ -N=0; │ │ │ │ │ │ -00074 │ │ │ │ │ │ -fpart = fopen("particles.dat", "w+"); │ │ │ │ │ │ -while ((opts.N_stop!=0) && (fgets(fline, 512, flux)!=NULL)){ │ │ │ │ │ │ -00075 │ │ │ │ │ │ -00076 │ │ │ │ │ │ -if (fline[0]!=’#’){ // skip lines beginning with ’#’ │ │ │ │ │ │ -00077 │ │ │ │ │ │ -if (sscanf(fline, "%le%le%le%le", &px, &py, &pz, &E)==4){ │ │ │ │ │ │ -00078 │ │ │ │ │ │ -particles.push_back(Cmomentum(px, py, pz, E)); │ │ │ │ │ │ -00079 │ │ │ │ │ │ -fprintf(fpart, "%e\t%e\n", │ │ │ │ │ │ -particles[N].eta, particles[N].phi); │ │ │ │ │ │ -00080 │ │ │ │ │ │ -N++; │ │ │ │ │ │ -00081 │ │ │ │ │ │ -opts.N_stop--; │ │ │ │ │ │ -00082 │ │ │ │ │ │ -} else { │ │ │ │ │ │ -00083 │ │ │ │ │ │ -cout « "error in reading event file Giving up." « endl; │ │ │ │ │ │ -00084 │ │ │ │ │ │ -fclose(flux); │ │ │ │ │ │ -00085 │ │ │ │ │ │ -fclose(fpart); │ │ │ │ │ │ -00086 │ │ │ │ │ │ -exit(2); │ │ │ │ │ │ -00087 │ │ │ │ │ │ -} │ │ │ │ │ │ -00088 │ │ │ │ │ │ -} │ │ │ │ │ │ -00089 │ │ │ │ │ │ -} │ │ │ │ │ │ -00090 │ │ │ │ │ │ -fclose(flux); │ │ │ │ │ │ -00091 │ │ │ │ │ │ -fclose(fpart); │ │ │ │ │ │ -00092 │ │ │ │ │ │ -if (opts.verbose_flag) │ │ │ │ │ │ -00093 │ │ │ │ │ │ -cout « " working with " « N « " particles" « endl; │ │ │ │ │ │ -00094 │ │ │ │ │ │ -// compute jets │ │ │ │ │ │ -00095 │ │ │ │ │ │ -00096 │ │ │ │ │ │ -if (opts.verbose_flag) cout « "computing jet contents" « endl; │ │ │ │ │ │ -00097 │ │ │ │ │ │ -i=siscone_with_area.compute_areas(particles, opts.R, opts.f, opts.npass, opts.SM_var); │ │ │ │ │ │ -00098 │ │ │ │ │ │ -if (opts.verbose_flag){ │ │ │ │ │ │ -unsigned int pass; │ │ │ │ │ │ -00099 │ │ │ │ │ │ -00100 │ │ │ │ │ │ -for (pass=0;pass::iterator ja; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.9 area.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -00111 │ │ │ │ │ │ -for (ja=siscone_with_area.jet_areas.begin();ja!=siscone_with_area.jet_areas.end();ja++){ │ │ │ │ │ │ -00112 │ │ │ │ │ │ -fprintf(flux, "%e\t%e\t%e\t%e\t%e\n", │ │ │ │ │ │ -00113 │ │ │ │ │ │ -ja->v.perp(), ja->v.eta, ja->v.phi, │ │ │ │ │ │ -00114 │ │ │ │ │ │ -ja->active_area, ja->passive_area); │ │ │ │ │ │ -00115 │ │ │ │ │ │ -} │ │ │ │ │ │ -00116 │ │ │ │ │ │ -00117 │ │ │ │ │ │ -fclose(flux); │ │ │ │ │ │ -00118 │ │ │ │ │ │ -00119 │ │ │ │ │ │ -if (opts.verbose_flag) │ │ │ │ │ │ -00120 │ │ │ │ │ │ -cout « "bye..." « endl; │ │ │ │ │ │ -00121 │ │ │ │ │ │ return 0; │ │ │ │ │ │ -00122 │ │ │ │ │ │ -00123 } │ │ │ │ │ │ - │ │ │ │ │ │ -5.9 area.cpp │ │ │ │ │ │ -00001 // -*- C++ -*00003 // File: area.h │ │ │ │ │ │ -// │ │ │ │ │ │ -00004 // Description: header file for the computation of jet area │ │ │ │ │ │ -// │ │ │ │ │ │ -00005 // This file is part of the SISCone project. │ │ │ │ │ │ -// │ │ │ │ │ │ -00006 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ -// │ │ │ │ │ │ -00007 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00008 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ -// │ │ │ │ │ │ -00009 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00010 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ -// │ │ │ │ │ │ -00011 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ -// │ │ │ │ │ │ -00012 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ -// │ │ │ │ │ │ -00013 // (at your option) any later version. │ │ │ │ │ │ -// │ │ │ │ │ │ -00014 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00015 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ -// │ │ │ │ │ │ -00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ -// │ │ │ │ │ │ -00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ -// │ │ │ │ │ │ -00018 // GNU General Public License for more details. │ │ │ │ │ │ -// │ │ │ │ │ │ -00019 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00020 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ -// │ │ │ │ │ │ -00021 // along with this program; if not, write to the Free Software │ │ │ │ │ │ -// │ │ │ │ │ │ -00022 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ -00023 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00024 // $Revision:: 149 │ │ │ │ │ │ -$// │ │ │ │ │ │ -00025 // $Date:: 2007-03-15 00:13:58 +0100 (Thu, 15 Mar 2007) │ │ │ │ │ │ -$// │ │ │ │ │ │ -00027 │ │ │ │ │ │ -00028 #include "area.h" │ │ │ │ │ │ -00029 #include "momentum.h" │ │ │ │ │ │ -00030 #include │ │ │ │ │ │ -00031 #include │ │ │ │ │ │ -00032 │ │ │ │ │ │ -00033 namespace siscone{ │ │ │ │ │ │ -00034 using namespace std; │ │ │ │ │ │ -00035 │ │ │ │ │ │ -00036 /******************************************************* │ │ │ │ │ │ -00037 * Cjet_area implementation │ │ │ │ │ │ -* │ │ │ │ │ │ -00038 * real Jet information, including its area(s) │ │ │ │ │ │ -* │ │ │ │ │ │ -00039 * │ │ │ │ │ │ -* │ │ │ │ │ │ -00040 * This class contains information for one single jet. * │ │ │ │ │ │ -00041 * That is, first, its momentum carrying information │ │ │ │ │ │ -* │ │ │ │ │ │ -00042 * about its centre and pT, and second, its particle │ │ │ │ │ │ -* │ │ │ │ │ │ -00043 * contents (from CJeT). │ │ │ │ │ │ -* │ │ │ │ │ │ -00044 * Compared to the Cjet class, it also includes the │ │ │ │ │ │ -* │ │ │ │ │ │ -00045 * passive and active areas of the jet computed using * │ │ │ │ │ │ -00046 * the Carea class. │ │ │ │ │ │ -* │ │ │ │ │ │ -00047 *******************************************************/ │ │ │ │ │ │ -00048 │ │ │ │ │ │ -00049 // default ctor │ │ │ │ │ │ -00050 //-------------00051 Cjet_area::Cjet_area(){ │ │ │ │ │ │ -00052 │ │ │ │ │ │ -active_area = passive_area = 0.0; │ │ │ │ │ │ -00053 } │ │ │ │ │ │ -00054 │ │ │ │ │ │ -00055 // jet-initiated ctor │ │ │ │ │ │ -00056 //------------------00057 Cjet_area::Cjet_area(Cjet &j){ │ │ │ │ │ │ -00058 │ │ │ │ │ │ -v = j.v; │ │ │ │ │ │ -00059 │ │ │ │ │ │ -n = j.n; │ │ │ │ │ │ -00060 │ │ │ │ │ │ -contents = j.contents; │ │ │ │ │ │ -00061 │ │ │ │ │ │ -00062 │ │ │ │ │ │ -pass = j.pass; │ │ │ │ │ │ -00063 │ │ │ │ │ │ -00064 │ │ │ │ │ │ -pt_tilde = j.pt_tilde; │ │ │ │ │ │ -00065 │ │ │ │ │ │ -sm_var2 = j.sm_var2; │ │ │ │ │ │ -00066 │ │ │ │ │ │ -00067 │ │ │ │ │ │ -active_area = passive_area = 0.0; │ │ │ │ │ │ -00068 } │ │ │ │ │ │ -00069 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -187 │ │ │ │ │ │ - │ │ │ │ │ │ - 188 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00070 // default dtor │ │ │ │ │ │ -00071 //-------------00072 Cjet_area::~Cjet_area(){ │ │ │ │ │ │ -00073 │ │ │ │ │ │ -00074 } │ │ │ │ │ │ -00075 │ │ │ │ │ │ -00076 │ │ │ │ │ │ -00077 /****************************************************************** │ │ │ │ │ │ -00078 * Csiscone_area implementation │ │ │ │ │ │ -* │ │ │ │ │ │ -00079 * class for the computation of jet areas. │ │ │ │ │ │ -* │ │ │ │ │ │ -00080 * │ │ │ │ │ │ -* │ │ │ │ │ │ -00081 * This is the class user should use whenever you want to compute * │ │ │ │ │ │ -00082 * the jet area (passive and active). │ │ │ │ │ │ -* │ │ │ │ │ │ -00083 * It uses the SISCone algorithm to perform the jet analysis. │ │ │ │ │ │ -* │ │ │ │ │ │ -00084 ******************************************************************/ │ │ │ │ │ │ -00085 │ │ │ │ │ │ -00086 // default ctor │ │ │ │ │ │ -00087 //------------00088 Carea::Carea(){ │ │ │ │ │ │ -00089 │ │ │ │ │ │ -grid_size = 60; │ │ │ │ │ │ -// 3600 particles added │ │ │ │ │ │ -00090 │ │ │ │ │ │ -grid_eta_max = 6.0; // maybe having twice more points in eta than in phi should be nice │ │ │ │ │ │ -00091 │ │ │ │ │ │ -grid_shift = 0.5; │ │ │ │ │ │ -// 50% "shacking" │ │ │ │ │ │ -00092 │ │ │ │ │ │ -00093 │ │ │ │ │ │ -pt_soft = 1e-100; │ │ │ │ │ │ -00094 │ │ │ │ │ │ -pt_shift = 0.05; │ │ │ │ │ │ -00095 │ │ │ │ │ │ -pt_soft_min = 1e-90; │ │ │ │ │ │ -00096 } │ │ │ │ │ │ -00097 │ │ │ │ │ │ -00098 // default dtor │ │ │ │ │ │ -00099 //------------00100 Carea::~Carea(){ │ │ │ │ │ │ -00101 │ │ │ │ │ │ -00102 } │ │ │ │ │ │ -00103 │ │ │ │ │ │ -00104 /* │ │ │ │ │ │ -00105 * compute the jet areas from a given particle set. │ │ │ │ │ │ -00106 * The parameters of this method are the ones which control the jet clustering alghorithm. │ │ │ │ │ │ -00107 * Note that the pt_min is not allowed here soince the jet-area determination involves soft │ │ │ │ │ │ -00108 * particles/jets and thus is used internally. │ │ │ │ │ │ -00109 * - _particles │ │ │ │ │ │ -list of particles │ │ │ │ │ │ -cone radius │ │ │ │ │ │ -00110 * - _radius │ │ │ │ │ │ -shared energy threshold for splitting&merging │ │ │ │ │ │ -00111 * - _f │ │ │ │ │ │ -00112 * - _n_pass_max maximum number of passes (0=full search, the default) │ │ │ │ │ │ -the scale choice for the split-merge procedure │ │ │ │ │ │ -00113 * - _split_merge_scale │ │ │ │ │ │ -00114 * │ │ │ │ │ │ -NOTE: SM_pt leads to IR unsafety for some events with momentum conservation. │ │ │ │ │ │ -SM_Et is IR safe but not boost invariant and not implemented(!) │ │ │ │ │ │ -00115 * │ │ │ │ │ │ -00116 * │ │ │ │ │ │ -SM_mt is IR safe for hadronic events, but not for decays of two │ │ │ │ │ │ -00117 * │ │ │ │ │ │ -back-to-back particles of identical mass │ │ │ │ │ │ -SM_pttilde │ │ │ │ │ │ -00118 * │ │ │ │ │ │ -00119 * │ │ │ │ │ │ -is always IR safe, and also boost invariant (default) │ │ │ │ │ │ -when this is set on, only hard jets are computed │ │ │ │ │ │ -00120 * - _hard_only │ │ │ │ │ │ -00121 * │ │ │ │ │ │ -and not the purely ghosted jets (default: false) │ │ │ │ │ │ -00122 * return the jets together with their areas │ │ │ │ │ │ -00123 * The return value is the number of jets (including pure-ghost ones if they are included) │ │ │ │ │ │ -00124 ********************************************************************************************/ │ │ │ │ │ │ -00125 int Carea::compute_areas(std::vector &_particles, double _radius, double _f, │ │ │ │ │ │ -int _n_pass_max, Esplit_merge_scale _split_merge_scale, │ │ │ │ │ │ -00126 │ │ │ │ │ │ -00127 │ │ │ │ │ │ -bool _hard_only){ │ │ │ │ │ │ -00128 │ │ │ │ │ │ -00129 │ │ │ │ │ │ -vector all_particles; │ │ │ │ │ │ -00130 │ │ │ │ │ │ -00131 │ │ │ │ │ │ -// put "hardest cut-off" if needed │ │ │ │ │ │ -00132 │ │ │ │ │ │ -// this avoids computation of ghosted jets when not required and │ │ │ │ │ │ -00133 │ │ │ │ │ │ -// significantly shortens the SM. │ │ │ │ │ │ -00134 │ │ │ │ │ │ -if (_hard_only){ │ │ │ │ │ │ -00135 │ │ │ │ │ │ -SM_var2_hardest_cut_off = pt_soft_min*pt_soft_min; │ │ │ │ │ │ -00136 │ │ │ │ │ │ -} │ │ │ │ │ │ -00137 │ │ │ │ │ │ -00138 │ │ │ │ │ │ -// clear potential previous runs │ │ │ │ │ │ -00139 │ │ │ │ │ │ -jet_areas.clear(); │ │ │ │ │ │ -00140 │ │ │ │ │ │ -// put initial set of particles in the list │ │ │ │ │ │ -00141 │ │ │ │ │ │ -00142 │ │ │ │ │ │ -int n_hard = _particles.size(); │ │ │ │ │ │ -00143 │ │ │ │ │ │ -all_particles = _particles; │ │ │ │ │ │ -00144 │ │ │ │ │ │ -00145 │ │ │ │ │ │ -// build the set of ghost particles and add them to the particle list │ │ │ │ │ │ -00146 │ │ │ │ │ │ -int i,j; │ │ │ │ │ │ -double eta_g,phi_g,pt_g; │ │ │ │ │ │ -00147 │ │ │ │ │ │ -00148 │ │ │ │ │ │ -for (i=0;i= n_hard │ │ │ │ │ │ -00167 │ │ │ │ │ │ -// and deduce the number of ghosts in the jet, hence the area. │ │ │ │ │ │ -00168 │ │ │ │ │ │ -double area_factor = (2.0*grid_eta_max/grid_size)*(twopi/grid_size); │ │ │ │ │ │ -00169 │ │ │ │ │ │ -for (i=0;i<(int) jets.size();i++){ │ │ │ │ │ │ -00170 │ │ │ │ │ │ -00171 │ │ │ │ │ │ -jet_areas.push_back(jets[i]); │ │ │ │ │ │ -00172 │ │ │ │ │ │ -j=0; │ │ │ │ │ │ -00173 │ │ │ │ │ │ -while ((j &_particles, double _radius, double _f, │ │ │ │ │ │ -00218 │ │ │ │ │ │ -int _n_pass_max, Esplit_merge_scale _split_merge_scale){ │ │ │ │ │ │ -00219 │ │ │ │ │ │ -00220 │ │ │ │ │ │ -vector all_particles; │ │ │ │ │ │ -00221 │ │ │ │ │ │ -// in the case of passive area, we do not need │ │ │ │ │ │ -00222 │ │ │ │ │ │ -00223 │ │ │ │ │ │ -// to put the ghosts in the stable-cone search │ │ │ │ │ │ -00224 │ │ │ │ │ │ -// (they do no influence the list of stable cones) │ │ │ │ │ │ -00225 │ │ │ │ │ │ -// Here’s how it goes... │ │ │ │ │ │ -00226 │ │ │ │ │ │ -stable_cone_soft_pt2_cutoff = pt_soft_min*pt_soft_min; │ │ │ │ │ │ -00227 │ │ │ │ │ │ -// clear potential previous runs │ │ │ │ │ │ -00228 │ │ │ │ │ │ -00229 │ │ │ │ │ │ -jet_areas.clear(); │ │ │ │ │ │ -00230 │ │ │ │ │ │ -00231 │ │ │ │ │ │ -// put initial set of particles in the list │ │ │ │ │ │ -00232 │ │ │ │ │ │ -int n_hard = _particles.size(); │ │ │ │ │ │ -00233 │ │ │ │ │ │ -all_particles = _particles; │ │ │ │ │ │ -00234 │ │ │ │ │ │ -// build the set of ghost particles and add them to the particle list │ │ │ │ │ │ -00235 │ │ │ │ │ │ -00236 │ │ │ │ │ │ -int i,j; │ │ │ │ │ │ -00237 │ │ │ │ │ │ -double eta_g,phi_g,pt_g; │ │ │ │ │ │ -00238 │ │ │ │ │ │ -for (i=0;i= n_hard │ │ │ │ │ │ -00257 │ │ │ │ │ │ -// and deduce the number of ghosts in the jet, hence the area. │ │ │ │ │ │ -00258 │ │ │ │ │ │ -double area_factor = (2.0*grid_eta_max/grid_size)*(twopi/grid_size); │ │ │ │ │ │ -00259 │ │ │ │ │ │ -for (i=0;i<(int) jets.size();i++){ │ │ │ │ │ │ -00260 │ │ │ │ │ │ -j=0; │ │ │ │ │ │ -while ((j &_particles, double _radius, double _f, │ │ │ │ │ │ -00292 │ │ │ │ │ │ -int _n_pass_max, Esplit_merge_scale _split_merge_scale, │ │ │ │ │ │ -bool _hard_only){ │ │ │ │ │ │ -00293 │ │ │ │ │ │ -00294 │ │ │ │ │ │ -00295 │ │ │ │ │ │ -vector all_particles; │ │ │ │ │ │ -00296 │ │ │ │ │ │ -00297 │ │ │ │ │ │ -// put "hardest cut-off" if needed │ │ │ │ │ │ -00298 │ │ │ │ │ │ -// this avoids computation of ghosted jets when not required and │ │ │ │ │ │ -00299 │ │ │ │ │ │ -// significantly shortens the SM. │ │ │ │ │ │ -00300 │ │ │ │ │ │ -if (_hard_only){ │ │ │ │ │ │ -00301 │ │ │ │ │ │ -SM_var2_hardest_cut_off = pt_soft_min*pt_soft_min; │ │ │ │ │ │ -00302 │ │ │ │ │ │ -} │ │ │ │ │ │ -00303 │ │ │ │ │ │ -00304 │ │ │ │ │ │ -// clear potential previous runs │ │ │ │ │ │ -00305 │ │ │ │ │ │ -jet_areas.clear(); │ │ │ │ │ │ -00306 │ │ │ │ │ │ -// put initial set of particles in the list │ │ │ │ │ │ -00307 │ │ │ │ │ │ -00308 │ │ │ │ │ │ -int n_hard = _particles.size(); │ │ │ │ │ │ -00309 │ │ │ │ │ │ -all_particles = _particles; │ │ │ │ │ │ -00310 │ │ │ │ │ │ -00311 │ │ │ │ │ │ -// build the set of ghost particles and add them to the particle list │ │ │ │ │ │ -00312 │ │ │ │ │ │ -int i,j; │ │ │ │ │ │ -00313 │ │ │ │ │ │ -double eta_g,phi_g,pt_g; │ │ │ │ │ │ -00314 │ │ │ │ │ │ -for (i=0;i= n_hard │ │ │ │ │ │ -00333 │ │ │ │ │ │ -// and deduce the number of ghosts in the jet, hence the area. │ │ │ │ │ │ -00334 │ │ │ │ │ │ -double area_factor = (2.0*grid_eta_max/grid_size)*(twopi/grid_size); │ │ │ │ │ │ -00335 │ │ │ │ │ │ -for (i=0;i<(int) jets.size();i++){ │ │ │ │ │ │ -00336 │ │ │ │ │ │ -00337 │ │ │ │ │ │ -jet_areas.push_back(jets[i]); │ │ │ │ │ │ -00338 │ │ │ │ │ │ -j=0; │ │ │ │ │ │ -00339 │ │ │ │ │ │ -while ((j &_particles, double _radius, double _f, │ │ │ │ │ │ 00101 │ │ │ │ │ │ int _n_pass_max=0, Esplit_merge_scale _split_merge_scale=SM_pttilde, │ │ │ │ │ │ bool _hard_only=false); │ │ │ │ │ │ 00102 │ │ │ │ │ │ 00103 │ │ │ │ │ │ -00112 │ │ │ │ │ │ int compute_active_areas(std::vector &_particles, double _radius, double _f, │ │ │ │ │ │ -int _n_pass_max=0, Esplit_merge_scale _split_merge_scale=SM_pttilde, │ │ │ │ │ │ +00112 │ │ │ │ │ │ 00113 │ │ │ │ │ │ +int _n_pass_max=0, Esplit_merge_scale _split_merge_scale=SM_pttilde, │ │ │ │ │ │ bool _hard_only=false); │ │ │ │ │ │ 00114 │ │ │ │ │ │ +00115 │ │ │ │ │ │ +int compute_passive_areas(std::vector &_particles, double _radius, double _f, │ │ │ │ │ │ +00123 │ │ │ │ │ │ │ │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ 191 │ │ │ │ │ │ │ │ │ │ │ │ 192 │ │ │ │ │ │ │ │ │ │ │ │ File Documentation │ │ │ │ │ │ │ │ │ │ │ │ -00115 │ │ │ │ │ │ -int compute_passive_areas(std::vector &_particles, double _radius, double _f, │ │ │ │ │ │ -00123 │ │ │ │ │ │ 00124 │ │ │ │ │ │ int _n_pass_max=0, Esplit_merge_scale _split_merge_scale=SM_pttilde); │ │ │ │ │ │ 00125 │ │ │ │ │ │ int grid_size; │ │ │ │ │ │ 00126 │ │ │ │ │ │ -00127 │ │ │ │ │ │ double grid_eta_max; │ │ │ │ │ │ -double grid_shift; │ │ │ │ │ │ +00127 │ │ │ │ │ │ 00128 │ │ │ │ │ │ +double grid_shift; │ │ │ │ │ │ 00129 │ │ │ │ │ │ double pt_soft; │ │ │ │ │ │ 00130 │ │ │ │ │ │ 00131 │ │ │ │ │ │ double pt_shift; │ │ │ │ │ │ -00132 │ │ │ │ │ │ double pt_soft_min; │ │ │ │ │ │ +00132 │ │ │ │ │ │ 00133 │ │ │ │ │ │ 00135 │ │ │ │ │ │ std::vector jet_areas; │ │ │ │ │ │ 00136 }; │ │ │ │ │ │ 00137 │ │ │ │ │ │ 00138 } │ │ │ │ │ │ 00139 #endif │ │ │ │ │ │ @@ -13649,36 +13643,36 @@ │ │ │ │ │ │ 00066 │ │ │ │ │ │ 00068 │ │ │ │ │ │ inline circulator & operator--() { │ │ │ │ │ │ if (m_here == m_begin) m_here = m_end; │ │ │ │ │ │ 00069 │ │ │ │ │ │ 00070 │ │ │ │ │ │ --m_here; │ │ │ │ │ │ -00071 │ │ │ │ │ │ return *this; │ │ │ │ │ │ +00071 │ │ │ │ │ │ 00072 │ │ │ │ │ │ } │ │ │ │ │ │ 00073 │ │ │ │ │ │ 00077 │ │ │ │ │ │ bool operator==(const circulator & other) const {return m_here == other.m_here;} │ │ │ │ │ │ 00078 │ │ │ │ │ │ bool operator!=(const circulator & other) const {return m_here != other.m_here;} │ │ │ │ │ │ 00082 │ │ │ │ │ │ 00083 │ │ │ │ │ │ 00084 private: │ │ │ │ │ │ 00085 │ │ │ │ │ │ T m_here, m_begin, m_end; │ │ │ │ │ │ 00086 }; │ │ │ │ │ │ +00087 │ │ │ │ │ │ +00088 } │ │ │ │ │ │ │ │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ 5.12 config.h │ │ │ │ │ │ │ │ │ │ │ │ -00087 │ │ │ │ │ │ -00088 } │ │ │ │ │ │ 00089 │ │ │ │ │ │ 00090 #endif // __CIRCULATOR_H__ │ │ │ │ │ │ │ │ │ │ │ │ 5.12 config.h │ │ │ │ │ │ 00001 #ifndef _SISCONE_CONFIG_H │ │ │ │ │ │ 00002 #define _SISCONE_CONFIG_H 1 │ │ │ │ │ │ 00003 │ │ │ │ │ │ @@ -13751,25 +13745,25 @@ │ │ │ │ │ │ 00070 #define SISCONE_PACKAGE "siscone" │ │ │ │ │ │ 00071 #endif │ │ │ │ │ │ 00072 │ │ │ │ │ │ 00073 /* Define to the address where bug reports for this package should be sent. */ │ │ │ │ │ │ 00074 #ifndef SISCONE_PACKAGE_BUGREPORT │ │ │ │ │ │ 00075 #define SISCONE_PACKAGE_BUGREPORT "" │ │ │ │ │ │ 00076 #endif │ │ │ │ │ │ +00077 │ │ │ │ │ │ +00078 /* Define to the full name of this package. */ │ │ │ │ │ │ │ │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ 193 │ │ │ │ │ │ │ │ │ │ │ │ 194 │ │ │ │ │ │ │ │ │ │ │ │ File Documentation │ │ │ │ │ │ │ │ │ │ │ │ -00077 │ │ │ │ │ │ -00078 /* Define to the full name of this package. */ │ │ │ │ │ │ 00079 #ifndef SISCONE_PACKAGE_NAME │ │ │ │ │ │ 00080 #define SISCONE_PACKAGE_NAME "SISCone" │ │ │ │ │ │ 00081 #endif │ │ │ │ │ │ 00082 │ │ │ │ │ │ 00083 /* Define to the full name and version of this package. */ │ │ │ │ │ │ 00084 #ifndef SISCONE_PACKAGE_STRING │ │ │ │ │ │ 00085 #define SISCONE_PACKAGE_STRING "SISCone 3.0.5" │ │ │ │ │ │ @@ -13809,15 +13803,15 @@ │ │ │ │ │ │ 00117 #define SISCONE_VERSION "3.0.5" │ │ │ │ │ │ 00118 #endif │ │ │ │ │ │ 00119 │ │ │ │ │ │ 00120 /* once: _SISCONE_CONFIG_H */ │ │ │ │ │ │ 00121 #endif │ │ │ │ │ │ │ │ │ │ │ │ 5.13 config_raw.h │ │ │ │ │ │ -00001 /* siscone/config_raw.h. Generated from config.h.in by configure. │ │ │ │ │ │ +00001 /* siscone/config_raw.h. Generated from config.h.in by configure. */ │ │ │ │ │ │ 00002 /* config.h.in. Generated from configure.ac by autoheader. */ │ │ │ │ │ │ 00003 │ │ │ │ │ │ 00004 /* Define to 1 if you have the header file. */ │ │ │ │ │ │ 00005 #define HAVE_DLFCN_H 1 │ │ │ │ │ │ 00006 │ │ │ │ │ │ 00007 /* Define to 1 if you have the header file. */ │ │ │ │ │ │ 00008 #define HAVE_INTTYPES_H 1 │ │ │ │ │ │ @@ -13844,25 +13838,23 @@ │ │ │ │ │ │ 00029 #define HAVE_SYS_STAT_H 1 │ │ │ │ │ │ 00030 │ │ │ │ │ │ 00031 /* Define to 1 if you have the header file. */ │ │ │ │ │ │ 00032 #define HAVE_SYS_TYPES_H 1 │ │ │ │ │ │ 00033 │ │ │ │ │ │ 00034 /* Define to 1 if you have the header file. */ │ │ │ │ │ │ 00035 #define HAVE_UNISTD_H 1 │ │ │ │ │ │ - │ │ │ │ │ │ -*/ │ │ │ │ │ │ +00036 │ │ │ │ │ │ +00037 /* Define to the sub-directory where libtool stores uninstalled libraries. */ │ │ │ │ │ │ │ │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ 5.14 siscone/defines.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ 195 │ │ │ │ │ │ │ │ │ │ │ │ -00036 │ │ │ │ │ │ -00037 /* Define to the sub-directory where libtool stores uninstalled libraries. */ │ │ │ │ │ │ 00038 #define LT_OBJDIR ".libs/" │ │ │ │ │ │ 00039 │ │ │ │ │ │ 00040 /* Name of package */ │ │ │ │ │ │ 00041 #define PACKAGE "siscone" │ │ │ │ │ │ 00042 │ │ │ │ │ │ 00043 /* Define to the address where bug reports for this package should be sent. */ │ │ │ │ │ │ 00044 #define PACKAGE_BUGREPORT "" │ │ │ │ │ │ @@ -14703,216 +14695,903 @@ │ │ │ │ │ │ 00174 │ │ │ │ │ │ return tmp; │ │ │ │ │ │ 00175 │ │ │ │ │ │ 00176 } │ │ │ │ │ │ 00177 │ │ │ │ │ │ 00178 } │ │ │ │ │ │ │ │ │ │ │ │ -5.18 geom_2d.h │ │ │ │ │ │ -00001 // -*- C++ -*00003 // File: geom_2d.h │ │ │ │ │ │ +5.18 hash.cpp │ │ │ │ │ │ +00001 │ │ │ │ │ │ // │ │ │ │ │ │ -00004 // Description: header file for two-dimensional geometry tools │ │ │ │ │ │ +00002 // File: hash.cpp │ │ │ │ │ │ +00003 // Description: source file for classes hash_element and hash_cones │ │ │ │ │ │ // │ │ │ │ │ │ -00005 // This file is part of the SISCone project. │ │ │ │ │ │ +00004 // This file is part of the SISCone project. │ │ │ │ │ │ // │ │ │ │ │ │ -00006 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ +00005 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ // │ │ │ │ │ │ -00007 // │ │ │ │ │ │ +00006 // │ │ │ │ │ │ // │ │ │ │ │ │ -00008 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ +00007 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ // │ │ │ │ │ │ -00009 // │ │ │ │ │ │ +00008 // │ │ │ │ │ │ // │ │ │ │ │ │ -00010 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ +00009 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ // │ │ │ │ │ │ -00011 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ +00010 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ // │ │ │ │ │ │ -00012 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ +00011 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ // │ │ │ │ │ │ -00013 // (at your option) any later version. │ │ │ │ │ │ +00012 // (at your option) any later version. │ │ │ │ │ │ // │ │ │ │ │ │ -00014 // │ │ │ │ │ │ +00013 // │ │ │ │ │ │ // │ │ │ │ │ │ -00015 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ +00014 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ // │ │ │ │ │ │ -00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ +00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ // │ │ │ │ │ │ -00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ +00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ // │ │ │ │ │ │ -00018 // GNU General Public License for more details. │ │ │ │ │ │ +00017 // GNU General Public License for more details. │ │ │ │ │ │ // │ │ │ │ │ │ -00019 // │ │ │ │ │ │ +00018 // │ │ │ │ │ │ // │ │ │ │ │ │ -00020 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ +00019 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ // │ │ │ │ │ │ -00021 // along with this program; if not, write to the Free Software │ │ │ │ │ │ +00020 // along with this program; if not, write to the Free Software │ │ │ │ │ │ // │ │ │ │ │ │ -00022 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ -00023 // │ │ │ │ │ │ +00021 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ +00022 // │ │ │ │ │ │ // │ │ │ │ │ │ -00024 // $Revision:: 422 │ │ │ │ │ │ +00023 // $Revision:: 225 │ │ │ │ │ │ $// │ │ │ │ │ │ -00025 // $Date:: 2020-04-22 11:51:09 +0200 (Wed, 22 Apr 2020) │ │ │ │ │ │ +00024 // $Date:: 2008-05-20 16:59:47 +0200 (Tue, 20 May 2008) │ │ │ │ │ │ $// │ │ │ │ │ │ -00027 │ │ │ │ │ │ -00028 #ifndef __GEOM_2D_H__ │ │ │ │ │ │ -00029 #define __GEOM_2D_H__ │ │ │ │ │ │ -00030 │ │ │ │ │ │ -00031 #include │ │ │ │ │ │ -00032 #include │ │ │ │ │ │ -00033 #include "defines.h" │ │ │ │ │ │ -00034 │ │ │ │ │ │ -00035 #ifndef M_PI │ │ │ │ │ │ -00036 #define M_PI 3.141592653589793238462643383279502884197 │ │ │ │ │ │ -00037 #endif │ │ │ │ │ │ -00038 │ │ │ │ │ │ -00039 namespace siscone{ │ │ │ │ │ │ -00040 │ │ │ │ │ │ -00043 inline double phi_in_range(double phi) { │ │ │ │ │ │ -00044 │ │ │ │ │ │ -if │ │ │ │ │ │ -(phi <= -M_PI) phi += twopi; │ │ │ │ │ │ -else if (phi > │ │ │ │ │ │ -M_PI) phi -= twopi; │ │ │ │ │ │ -00045 │ │ │ │ │ │ -return phi; │ │ │ │ │ │ -00046 │ │ │ │ │ │ -00047 } │ │ │ │ │ │ +00026 │ │ │ │ │ │ +00027 #include │ │ │ │ │ │ +00028 #include │ │ │ │ │ │ +00029 #include "hash.h" │ │ │ │ │ │ +00030 #include │ │ │ │ │ │ +00031 │ │ │ │ │ │ +00032 namespace siscone{ │ │ │ │ │ │ +00033 │ │ │ │ │ │ +00034 using namespace std; │ │ │ │ │ │ +00035 │ │ │ │ │ │ +00036 /************************************************************** │ │ │ │ │ │ +00037 * implementation of hash_cones │ │ │ │ │ │ +* │ │ │ │ │ │ +00038 * list of cones candidates. │ │ │ │ │ │ +* │ │ │ │ │ │ +00039 * We store in this class all the hash_elements and give │ │ │ │ │ │ +* │ │ │ │ │ │ +00040 * functions to manipulate them. │ │ │ │ │ │ +* │ │ │ │ │ │ +00041 **************************************************************/ │ │ │ │ │ │ +00042 │ │ │ │ │ │ +00043 // constructor with initialisation │ │ │ │ │ │ +00044 // - _Np number of particles │ │ │ │ │ │ │ │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 5.19 geom_2d.h │ │ │ │ │ │ - │ │ │ │ │ │ -203 │ │ │ │ │ │ + 5.18 hash.cpp │ │ │ │ │ │ │ │ │ │ │ │ +00045 // - _R2 cone radius (squared) │ │ │ │ │ │ +00046 //----------------------------------00047 hash_cones::hash_cones(int _Np, double _R2){ │ │ │ │ │ │ +int i; │ │ │ │ │ │ 00048 │ │ │ │ │ │ -00052 inline double dphi(double phi1, double phi2) { │ │ │ │ │ │ -00053 │ │ │ │ │ │ -return phi_in_range(phi1-phi2); │ │ │ │ │ │ -00054 } │ │ │ │ │ │ +00049 │ │ │ │ │ │ +00050 │ │ │ │ │ │ +n_cones = 0; │ │ │ │ │ │ +00051 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ +00052 │ │ │ │ │ │ +n_occupied_cells = 0; │ │ │ │ │ │ +00053 #endif │ │ │ │ │ │ +00054 │ │ │ │ │ │ 00055 │ │ │ │ │ │ +// determine hash size │ │ │ │ │ │ 00056 │ │ │ │ │ │ -00060 inline double abs_dphi(double phi1, double phi2) { │ │ │ │ │ │ +// for a ymax=5 and R=0.7, we observed an occupancy around 1/8 N^2 ~ N2 R2/4 │ │ │ │ │ │ +00057 │ │ │ │ │ │ +//mask = 1 « (int) (2*log(double(_Np))/log(2.0)); │ │ │ │ │ │ +00058 │ │ │ │ │ │ +//if (mask<=1) mask=2; │ │ │ │ │ │ +00059 │ │ │ │ │ │ +int nbits = (int) (log(_Np*_R2*_Np/4.0)/log(2.0)); │ │ │ │ │ │ +if (nbits<1) nbits=1; │ │ │ │ │ │ +00060 │ │ │ │ │ │ 00061 │ │ │ │ │ │ -double delta = fabs(phi1-phi2); │ │ │ │ │ │ -return delta > M_PI ? twopi-delta : delta; │ │ │ │ │ │ +mask = 1 « nbits; │ │ │ │ │ │ 00062 │ │ │ │ │ │ -00063 } │ │ │ │ │ │ +00063 │ │ │ │ │ │ +// create hash │ │ │ │ │ │ 00064 │ │ │ │ │ │ -00066 inline double pow2(double x) {return x*x;} │ │ │ │ │ │ +hash_array = new hash_element*[mask]; │ │ │ │ │ │ +00065 │ │ │ │ │ │ +mask--; │ │ │ │ │ │ +00066 │ │ │ │ │ │ 00067 │ │ │ │ │ │ +// set the array to 0 │ │ │ │ │ │ 00068 │ │ │ │ │ │ -00073 class Ctwovect { │ │ │ │ │ │ -00074 public: │ │ │ │ │ │ -00076 │ │ │ │ │ │ -Ctwovect() : x(0.0), y(0.0) {} │ │ │ │ │ │ -00077 │ │ │ │ │ │ +//? needed ? │ │ │ │ │ │ +00069 │ │ │ │ │ │ +for (i=0;inext; │ │ │ │ │ │ 00085 │ │ │ │ │ │ +delete elm; │ │ │ │ │ │ +00086 │ │ │ │ │ │ +} │ │ │ │ │ │ 00087 │ │ │ │ │ │ -inline double mod2() const {return pow2(x)+pow2(y);} │ │ │ │ │ │ +} │ │ │ │ │ │ 00088 │ │ │ │ │ │ -inline double modulus() const {return sqrt(mod2());} │ │ │ │ │ │ -00090 │ │ │ │ │ │ -00091 }; │ │ │ │ │ │ +delete[] hash_array; │ │ │ │ │ │ +00089 │ │ │ │ │ │ +00090 } │ │ │ │ │ │ +00091 │ │ │ │ │ │ 00092 │ │ │ │ │ │ -00093 │ │ │ │ │ │ -00098 inline double dot_product(const Ctwovect & a, const Ctwovect & b) { │ │ │ │ │ │ -00099 │ │ │ │ │ │ -return a.x*b.x + a.y*b.y; │ │ │ │ │ │ -00100 } │ │ │ │ │ │ -00101 │ │ │ │ │ │ -00102 │ │ │ │ │ │ -00107 inline double cross_product(const Ctwovect & a, const Ctwovect & b) { │ │ │ │ │ │ -return a.x*b.y - a.y*b.x; │ │ │ │ │ │ +00093 /* │ │ │ │ │ │ +00094 * insert a new candidate into the hash. │ │ │ │ │ │ +4-momentum of the cone to add │ │ │ │ │ │ +00095 * - v │ │ │ │ │ │ +00096 * - parent parent particle defining the cone │ │ │ │ │ │ +child particle defining the cone │ │ │ │ │ │ +00097 * - child │ │ │ │ │ │ +00098 * - p_io │ │ │ │ │ │ +whether the parent has to belong to the cone or not │ │ │ │ │ │ +00099 * - c_io │ │ │ │ │ │ +whether the child has to belong to the cone or not │ │ │ │ │ │ +00100 * return 0 on success, 1 on error │ │ │ │ │ │ +00101 ***********************************************************************/ │ │ │ │ │ │ +00102 int hash_cones::insert(Cmomentum *v, Cmomentum *parent, Cmomentum *child, bool p_io, bool c_io){ │ │ │ │ │ │ +00103 │ │ │ │ │ │ +hash_element *elm; │ │ │ │ │ │ +int index = (v->ref.ref[0]) & mask; │ │ │ │ │ │ +00104 │ │ │ │ │ │ +00105 │ │ │ │ │ │ +// check the array cell corresponding to our reference │ │ │ │ │ │ +00106 │ │ │ │ │ │ +00107 │ │ │ │ │ │ +elm = hash_array[index]; │ │ │ │ │ │ 00108 │ │ │ │ │ │ -00109 } │ │ │ │ │ │ +00109 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ 00110 │ │ │ │ │ │ +if (elm==NULL) │ │ │ │ │ │ 00111 │ │ │ │ │ │ -00120 class Ceta_phi_range{ │ │ │ │ │ │ -00121 public: │ │ │ │ │ │ +n_occupied_cells++; │ │ │ │ │ │ +00112 #endif │ │ │ │ │ │ +00113 │ │ │ │ │ │ +00114 │ │ │ │ │ │ +do{ │ │ │ │ │ │ +// if it is not present, add it │ │ │ │ │ │ +00115 │ │ │ │ │ │ +00116 │ │ │ │ │ │ +if (elm==NULL){ │ │ │ │ │ │ +// create element │ │ │ │ │ │ +00117 │ │ │ │ │ │ +00118 │ │ │ │ │ │ +elm = new hash_element; │ │ │ │ │ │ +00119 │ │ │ │ │ │ +// set its varibles │ │ │ │ │ │ +00120 │ │ │ │ │ │ +00121 │ │ │ │ │ │ +// Note: at this level, eta and phi have already been computed │ │ │ │ │ │ +00122 │ │ │ │ │ │ +// │ │ │ │ │ │ +through Cmomentum::build_etaphi. │ │ │ │ │ │ 00123 │ │ │ │ │ │ -Ceta_phi_range(); │ │ │ │ │ │ +elm->ref = v->ref; │ │ │ │ │ │ 00124 │ │ │ │ │ │ +//compute vectors centre │ │ │ │ │ │ +00125 │ │ │ │ │ │ +00126 │ │ │ │ │ │ +v->build_etaphi(); │ │ │ │ │ │ +00127 │ │ │ │ │ │ +elm->eta = v->eta; │ │ │ │ │ │ +00128 │ │ │ │ │ │ +elm->phi = v->phi; │ │ │ │ │ │ +// if at least one of the two is_inside tests gives a result != from the expected, │ │ │ │ │ │ +00129 │ │ │ │ │ │ 00130 │ │ │ │ │ │ -Ceta_phi_range(double c_eta, double c_phi, double R); │ │ │ │ │ │ +// the || will be true hence !(...) false as wanted │ │ │ │ │ │ 00131 │ │ │ │ │ │ +elm->is_stable = !((is_inside(v, parent)^p_io)||(is_inside(v, child)^c_io)); │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +203 │ │ │ │ │ │ + │ │ │ │ │ │ + 204 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +00132 │ │ │ │ │ │ +//cout « "-- new status of " « v->ref[0] « ":" « elm->is_stable « endl; │ │ │ │ │ │ +00133 │ │ │ │ │ │ 00134 │ │ │ │ │ │ -Ceta_phi_range& operator = (const Ceta_phi_range &r); │ │ │ │ │ │ +// update hash │ │ │ │ │ │ 00135 │ │ │ │ │ │ -int add_particle(const double eta, const double phi); │ │ │ │ │ │ +elm->next = hash_array[index]; │ │ │ │ │ │ +00136 │ │ │ │ │ │ +hash_array[index] = elm; │ │ │ │ │ │ +00137 │ │ │ │ │ │ +00138 │ │ │ │ │ │ +n_cones++; │ │ │ │ │ │ +00139 │ │ │ │ │ │ +return 0; │ │ │ │ │ │ 00140 │ │ │ │ │ │ +} │ │ │ │ │ │ 00141 │ │ │ │ │ │ +00142 │ │ │ │ │ │ +// if the cone is already there, simply update stability status │ │ │ │ │ │ 00143 │ │ │ │ │ │ -unsigned int eta_range; │ │ │ │ │ │ +if (v->ref == elm->ref){ │ │ │ │ │ │ 00144 │ │ │ │ │ │ -unsigned int phi_range; │ │ │ │ │ │ +// there is only an update to perform to see if the cone is still stable │ │ │ │ │ │ +00145 │ │ │ │ │ │ +if (elm->is_stable){ │ │ │ │ │ │ 00146 │ │ │ │ │ │ +v->build_etaphi(); │ │ │ │ │ │ 00147 │ │ │ │ │ │ -// extremal value for eta │ │ │ │ │ │ +elm->is_stable = !((is_inside(v, parent)^p_io)||(is_inside(v, child)^c_io)); │ │ │ │ │ │ 00148 │ │ │ │ │ │ +//cout « " parent/child: " │ │ │ │ │ │ 00149 │ │ │ │ │ │ -static double eta_min; │ │ │ │ │ │ +// │ │ │ │ │ │ +« parent->ref[0] « ":" « is_inside(v, parent) « ":" « p_io « " " │ │ │ │ │ │ 00150 │ │ │ │ │ │ -static double eta_max; │ │ │ │ │ │ +// │ │ │ │ │ │ +« child->ref[0] « ":" « is_inside(v, child) « ":" « c_io « endl; │ │ │ │ │ │ 00151 │ │ │ │ │ │ -00152 private: │ │ │ │ │ │ +//cout « "-- rep status of " « v->ref[0] « ":" « elm->is_stable « endl; │ │ │ │ │ │ +00152 │ │ │ │ │ │ +//cout « v->eta « " " « v->phi « endl; │ │ │ │ │ │ +00153 │ │ │ │ │ │ +//cout « (child->eta) « " " « child->phi « endl; │ │ │ │ │ │ 00154 │ │ │ │ │ │ -inline unsigned int get_eta_cell(double eta){ │ │ │ │ │ │ -return (unsigned int) (1u « ((int) (32*((eta-eta_min)/(eta_max-eta_min))))); │ │ │ │ │ │ +} │ │ │ │ │ │ +return 0; │ │ │ │ │ │ 00155 │ │ │ │ │ │ 00156 │ │ │ │ │ │ } │ │ │ │ │ │ 00157 │ │ │ │ │ │ +00158 │ │ │ │ │ │ +elm = elm->next; │ │ │ │ │ │ 00159 │ │ │ │ │ │ -inline unsigned int get_phi_cell(double phi){ │ │ │ │ │ │ +} while (1); │ │ │ │ │ │ 00160 │ │ │ │ │ │ -return (unsigned int) (1u « ((int) (32*phi/twopi+16)%32)); │ │ │ │ │ │ 00161 │ │ │ │ │ │ -} │ │ │ │ │ │ -00162 }; │ │ │ │ │ │ +return 1; │ │ │ │ │ │ +00162 } │ │ │ │ │ │ 00163 │ │ │ │ │ │ -00168 bool is_range_overlap(const Ceta_phi_range &r1, const Ceta_phi_range &r2); │ │ │ │ │ │ -00169 │ │ │ │ │ │ -00175 const Ceta_phi_range range_union(const Ceta_phi_range &r1, const Ceta_phi_range &r2); │ │ │ │ │ │ +00164 /* │ │ │ │ │ │ +00165 * insert a new candidate into the hash. │ │ │ │ │ │ +00166 * - v │ │ │ │ │ │ +4-momentum of te cone to add │ │ │ │ │ │ +00167 * Note, in this case, we assume stability. We also assume │ │ │ │ │ │ +00168 * that eta and phi are computed for v │ │ │ │ │ │ +00169 * return 0 on success, 1 on error │ │ │ │ │ │ +00170 ***********************************************************************/ │ │ │ │ │ │ +00171 int hash_cones::insert(Cmomentum *v){ │ │ │ │ │ │ +00172 │ │ │ │ │ │ +hash_element *elm; │ │ │ │ │ │ +00173 │ │ │ │ │ │ +int index = (v->ref.ref[0]) & mask; │ │ │ │ │ │ +//cout « "-- stable candidate: " « v->ref[0] « ":" « endl; │ │ │ │ │ │ +00174 │ │ │ │ │ │ +00175 │ │ │ │ │ │ +// check the array cell corresponding to our reference │ │ │ │ │ │ 00176 │ │ │ │ │ │ -00177 } │ │ │ │ │ │ +00177 │ │ │ │ │ │ +elm = hash_array[index]; │ │ │ │ │ │ +do{ │ │ │ │ │ │ 00178 │ │ │ │ │ │ -00179 #endif │ │ │ │ │ │ +00179 │ │ │ │ │ │ +// if it is not present, add it │ │ │ │ │ │ +00180 │ │ │ │ │ │ +if (elm==NULL){ │ │ │ │ │ │ +// create element │ │ │ │ │ │ +00181 │ │ │ │ │ │ +00182 │ │ │ │ │ │ +elm = new hash_element; │ │ │ │ │ │ +00183 │ │ │ │ │ │ +// set its varibles │ │ │ │ │ │ +00184 │ │ │ │ │ │ +00185 │ │ │ │ │ │ +// Note: at this level, eta and phi have already been computed │ │ │ │ │ │ +00186 │ │ │ │ │ │ +// │ │ │ │ │ │ +through Cmomentum::build_etaphi. │ │ │ │ │ │ +00187 │ │ │ │ │ │ +elm->ref = v->ref; │ │ │ │ │ │ +00188 │ │ │ │ │ │ +elm->eta = v->eta; │ │ │ │ │ │ +00189 │ │ │ │ │ │ +elm->phi = v->phi; │ │ │ │ │ │ +00190 │ │ │ │ │ │ +elm->is_stable = true; │ │ │ │ │ │ +00191 │ │ │ │ │ │ +00192 │ │ │ │ │ │ +// update hash │ │ │ │ │ │ +00193 │ │ │ │ │ │ +elm->next = hash_array[index]; │ │ │ │ │ │ +00194 │ │ │ │ │ │ +hash_array[index] = elm; │ │ │ │ │ │ +00195 │ │ │ │ │ │ +00196 │ │ │ │ │ │ +n_cones++; │ │ │ │ │ │ +return 0; │ │ │ │ │ │ +00197 │ │ │ │ │ │ +00198 │ │ │ │ │ │ +} │ │ │ │ │ │ +00199 │ │ │ │ │ │ +00200 │ │ │ │ │ │ +// if the cone is already there, we have nothing to do │ │ │ │ │ │ +00201 │ │ │ │ │ │ +if (v->ref == elm->ref){ │ │ │ │ │ │ +return 0; │ │ │ │ │ │ +00202 │ │ │ │ │ │ +00203 │ │ │ │ │ │ +} │ │ │ │ │ │ +00204 │ │ │ │ │ │ +00205 │ │ │ │ │ │ +elm = elm->next; │ │ │ │ │ │ +00206 │ │ │ │ │ │ +} while (1); │ │ │ │ │ │ +00207 │ │ │ │ │ │ +return 1; │ │ │ │ │ │ +00208 │ │ │ │ │ │ +00209 } │ │ │ │ │ │ +00210 │ │ │ │ │ │ +00211 /* │ │ │ │ │ │ +00212 * test if a particle is inside a cone of given centre. │ │ │ │ │ │ +00213 * check if the particle of coordinates ’v’ is inside the circle of radius R │ │ │ │ │ │ +00214 * centered at ’centre’. │ │ │ │ │ │ +centre of the circle │ │ │ │ │ │ +00215 * - centre │ │ │ │ │ │ +particle to test │ │ │ │ │ │ +00216 * - v │ │ │ │ │ │ +00217 * return true if inside, false if outside │ │ │ │ │ │ +00218 ******************************************************************************/ │ │ │ │ │ │ │ │ │ │ │ │ -5.19 geom_2d.h │ │ │ │ │ │ -00001 // -*- C++ -*00003 // File: geom_2d.h │ │ │ │ │ │ -00004 // Description: header file for two-dimensional geometry tools │ │ │ │ │ │ -00005 // This file is part of the SISCone project. │ │ │ │ │ │ -00006 // WARNING: this is not the main SISCone trunk but │ │ │ │ │ │ -00007 // │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.19 hash.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +205 │ │ │ │ │ │ + │ │ │ │ │ │ +00219 inline bool hash_cones::is_inside(Cmomentum *centre, Cmomentum *v){ │ │ │ │ │ │ +double dx, dy; │ │ │ │ │ │ +00220 │ │ │ │ │ │ +00221 │ │ │ │ │ │ +00222 │ │ │ │ │ │ +dx = centre->eta - v->eta; │ │ │ │ │ │ +00223 │ │ │ │ │ │ +dy = fabs(centre->phi - v->phi); │ │ │ │ │ │ +00224 │ │ │ │ │ │ +if (dy>M_PI) │ │ │ │ │ │ +00225 │ │ │ │ │ │ +dy -= 2.0*M_PI; │ │ │ │ │ │ +00226 │ │ │ │ │ │ +return dx*dx+dy*dy │ │ │ │ │ │ +00030 #include │ │ │ │ │ │ +00031 #include "hash.h" │ │ │ │ │ │ +00032 #include │ │ │ │ │ │ +00033 │ │ │ │ │ │ +00034 namespace siscone_spherical{ │ │ │ │ │ │ +00035 │ │ │ │ │ │ +00036 using namespace std; │ │ │ │ │ │ +00037 │ │ │ │ │ │ +00038 /************************************************************** │ │ │ │ │ │ +00039 * implementation of sph_hash_cones │ │ │ │ │ │ +* │ │ │ │ │ │ +00040 * list of cones candidates. │ │ │ │ │ │ +* │ │ │ │ │ │ +00041 * We store in this class all the sph_hash_element and give │ │ │ │ │ │ +* │ │ │ │ │ │ +00042 * functions to manipulate them. │ │ │ │ │ │ +* │ │ │ │ │ │ +00043 **************************************************************/ │ │ │ │ │ │ +00044 │ │ │ │ │ │ +00045 // constructor with initialisation │ │ │ │ │ │ +00046 // - _Np │ │ │ │ │ │ +number of particles │ │ │ │ │ │ +00047 // - _radius cone radius │ │ │ │ │ │ +00048 //----------------------------------00049 sph_hash_cones::sph_hash_cones(int _Np, double _radius){ │ │ │ │ │ │ +00050 │ │ │ │ │ │ +int i; │ │ │ │ │ │ +00051 │ │ │ │ │ │ +00052 │ │ │ │ │ │ +n_cones = 0; │ │ │ │ │ │ +00053 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ +00054 │ │ │ │ │ │ +n_occupied_cells = 0; │ │ │ │ │ │ +00055 #endif │ │ │ │ │ │ +00056 │ │ │ │ │ │ +00057 │ │ │ │ │ │ +// determine hash size │ │ │ │ │ │ +00058 │ │ │ │ │ │ +// for a ymax=5 and R=0.7, we observed an occupancy around 1/8 N^2 ~ N2 R2/4 │ │ │ │ │ │ +00059 │ │ │ │ │ │ +//mask = 1 « (int) (2*log(double(_Np))/log(2.0)); │ │ │ │ │ │ +00060 │ │ │ │ │ │ +//if (mask<=1) mask=2; │ │ │ │ │ │ +00061 │ │ │ │ │ │ +int nbits = (int) (log(_Np*_radius*_radius*_Np/4.0)/log(2.0)); │ │ │ │ │ │ +00062 │ │ │ │ │ │ +if (nbits<1) nbits=1; │ │ │ │ │ │ +00063 │ │ │ │ │ │ +mask = 1 « nbits; │ │ │ │ │ │ +00064 │ │ │ │ │ │ +00065 │ │ │ │ │ │ +// create hash │ │ │ │ │ │ +00066 │ │ │ │ │ │ +hash_array = new sph_hash_element*[mask]; │ │ │ │ │ │ +00067 │ │ │ │ │ │ +mask--; │ │ │ │ │ │ +00068 │ │ │ │ │ │ +// set the array to 0 │ │ │ │ │ │ +00069 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ + 206 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +00070 │ │ │ │ │ │ +//? needed ? │ │ │ │ │ │ +00071 │ │ │ │ │ │ +for (i=0;inext; │ │ │ │ │ │ +00088 │ │ │ │ │ │ +delete elm; │ │ │ │ │ │ +00089 │ │ │ │ │ │ +} │ │ │ │ │ │ +00090 │ │ │ │ │ │ +} │ │ │ │ │ │ +00091 │ │ │ │ │ │ +00092 │ │ │ │ │ │ +delete[] hash_array; │ │ │ │ │ │ +00093 } │ │ │ │ │ │ +00094 │ │ │ │ │ │ +00095 │ │ │ │ │ │ +00096 /* │ │ │ │ │ │ +00097 * insert a new candidate into the hash. │ │ │ │ │ │ +00098 * - v │ │ │ │ │ │ +4-momentum of the cone to add │ │ │ │ │ │ +00099 * - parent parent particle defining the cone │ │ │ │ │ │ +00100 * - child │ │ │ │ │ │ +child particle defining the cone │ │ │ │ │ │ +whether the parent has to belong to the cone or not │ │ │ │ │ │ +00101 * - p_io │ │ │ │ │ │ +00102 * - c_io │ │ │ │ │ │ +whether the child has to belong to the cone or not │ │ │ │ │ │ +00103 * return 0 on success, 1 on error │ │ │ │ │ │ +00104 ***********************************************************************/ │ │ │ │ │ │ +00105 int sph_hash_cones::insert(CSphmomentum *v, CSphmomentum *parent, CSphmomentum *child, bool p_io, bool │ │ │ │ │ │ +c_io){ │ │ │ │ │ │ +00106 │ │ │ │ │ │ +sph_hash_element *elm; │ │ │ │ │ │ +int index = (v->ref.ref[0]) & mask; │ │ │ │ │ │ +00107 │ │ │ │ │ │ +00108 │ │ │ │ │ │ +// check the array cell corresponding to our reference │ │ │ │ │ │ +00109 │ │ │ │ │ │ +00110 │ │ │ │ │ │ +elm = hash_array[index]; │ │ │ │ │ │ +00111 │ │ │ │ │ │ +00112 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ +00113 │ │ │ │ │ │ +if (elm==NULL) │ │ │ │ │ │ +00114 │ │ │ │ │ │ +n_occupied_cells++; │ │ │ │ │ │ +00115 #endif │ │ │ │ │ │ +00116 │ │ │ │ │ │ +00117 │ │ │ │ │ │ +do{ │ │ │ │ │ │ +// if it is not present, add it │ │ │ │ │ │ +00118 │ │ │ │ │ │ +00119 │ │ │ │ │ │ +if (elm==NULL){ │ │ │ │ │ │ +// create element │ │ │ │ │ │ +00120 │ │ │ │ │ │ +00121 │ │ │ │ │ │ +elm = new sph_hash_element; │ │ │ │ │ │ +00122 │ │ │ │ │ │ +// set its varibles │ │ │ │ │ │ +00123 │ │ │ │ │ │ +00124 │ │ │ │ │ │ +// Note: at this level, eta and phi have already been computed │ │ │ │ │ │ +00125 │ │ │ │ │ │ +// │ │ │ │ │ │ +through CSphmomentum::build_thetaphi. │ │ │ │ │ │ +00126 │ │ │ │ │ │ +elm->centre = *v; │ │ │ │ │ │ +00127 │ │ │ │ │ │ +// if at least one of the two is_closer tests gives a result != from the expected, │ │ │ │ │ │ +00128 │ │ │ │ │ │ +00129 │ │ │ │ │ │ +// the || will be true hence !(...) false as wanted │ │ │ │ │ │ +00130 │ │ │ │ │ │ +elm->is_stable = !((is_closer(v, parent, tan2R)^p_io)||(is_closer(v, child, tan2R)^c_io)); │ │ │ │ │ │ +00131 │ │ │ │ │ │ +//cout « "-- new status of " « v->ref[0] « ":" « elm->is_stable « endl; │ │ │ │ │ │ +00132 │ │ │ │ │ │ +00133 │ │ │ │ │ │ +// update hash │ │ │ │ │ │ +00134 │ │ │ │ │ │ +elm->next = hash_array[index]; │ │ │ │ │ │ +00135 │ │ │ │ │ │ +hash_array[index] = elm; │ │ │ │ │ │ +00136 │ │ │ │ │ │ +00137 │ │ │ │ │ │ +n_cones++; │ │ │ │ │ │ +00138 │ │ │ │ │ │ +return 0; │ │ │ │ │ │ +00139 │ │ │ │ │ │ +} │ │ │ │ │ │ +00140 │ │ │ │ │ │ +// if the cone is already there, simply update stability status │ │ │ │ │ │ +00141 │ │ │ │ │ │ +00142 │ │ │ │ │ │ +if (v->ref == elm->centre.ref){ │ │ │ │ │ │ +00143 │ │ │ │ │ │ +// there is only an update to perform to see if the cone is still stable │ │ │ │ │ │ +00144 │ │ │ │ │ │ +if (elm->is_stable){ │ │ │ │ │ │ +00145 │ │ │ │ │ │ +elm->is_stable = !((is_closer(v, parent, tan2R)^p_io)||(is_closer(v, child, tan2R)^c_io)); │ │ │ │ │ │ +//cout « " parent/child: " │ │ │ │ │ │ +00146 │ │ │ │ │ │ +00147 │ │ │ │ │ │ +// │ │ │ │ │ │ +« parent->ref[0] « ":" « is_closer(v, parent) « ":" « p_io « " " │ │ │ │ │ │ +00148 │ │ │ │ │ │ +// │ │ │ │ │ │ +« child->ref[0] « ":" « is_closer(v, child) « ":" « c_io « endl; │ │ │ │ │ │ +00149 │ │ │ │ │ │ +//cout « "-- rep status of " « v->ref[0] « ":" « elm->is_stable « endl; │ │ │ │ │ │ +00150 │ │ │ │ │ │ +//cout « v->eta « " " « v->phi « endl; │ │ │ │ │ │ +00151 │ │ │ │ │ │ +//cout « (child->eta) « " " « child->phi « endl; │ │ │ │ │ │ +00152 │ │ │ │ │ │ +} │ │ │ │ │ │ +return 0; │ │ │ │ │ │ +00153 │ │ │ │ │ │ +00154 │ │ │ │ │ │ +} │ │ │ │ │ │ +00155 │ │ │ │ │ │ │ │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ + 5.20 hash.h │ │ │ │ │ │ + │ │ │ │ │ │ +00156 │ │ │ │ │ │ +elm = elm->next; │ │ │ │ │ │ +00157 │ │ │ │ │ │ +} while (1); │ │ │ │ │ │ +00158 │ │ │ │ │ │ +return 1; │ │ │ │ │ │ +00159 │ │ │ │ │ │ +00160 } │ │ │ │ │ │ +00161 │ │ │ │ │ │ +00162 /* │ │ │ │ │ │ +00163 * insert a new candidate into the hash. │ │ │ │ │ │ +00164 * - v │ │ │ │ │ │ +4-momentum of te cone to add │ │ │ │ │ │ +00165 * Note, in this case, we assume stability. We also assume │ │ │ │ │ │ +00166 * that eta and phi are computed for v │ │ │ │ │ │ +00167 * return 0 on success, 1 on error │ │ │ │ │ │ +00168 ***********************************************************************/ │ │ │ │ │ │ +00169 int sph_hash_cones::insert(CSphmomentum *v){ │ │ │ │ │ │ +00170 │ │ │ │ │ │ +sph_hash_element *elm; │ │ │ │ │ │ +int index = (v->ref.ref[0]) & mask; │ │ │ │ │ │ +00171 │ │ │ │ │ │ +00172 │ │ │ │ │ │ +//cout « "-- stable candidate: " « v->ref[0] « ":" « endl; │ │ │ │ │ │ +00173 │ │ │ │ │ │ +// check the array cell corresponding to our reference │ │ │ │ │ │ +00174 │ │ │ │ │ │ +00175 │ │ │ │ │ │ +elm = hash_array[index]; │ │ │ │ │ │ +do{ │ │ │ │ │ │ +00176 │ │ │ │ │ │ +00177 │ │ │ │ │ │ +// if it is not present, add it │ │ │ │ │ │ +00178 │ │ │ │ │ │ +if (elm==NULL){ │ │ │ │ │ │ +// create element │ │ │ │ │ │ +00179 │ │ │ │ │ │ +00180 │ │ │ │ │ │ +elm = new sph_hash_element; │ │ │ │ │ │ +00181 │ │ │ │ │ │ +// set its varibles │ │ │ │ │ │ +00182 │ │ │ │ │ │ +00183 │ │ │ │ │ │ +// Note: at this level, eta and phi have already been computed │ │ │ │ │ │ +00184 │ │ │ │ │ │ +// │ │ │ │ │ │ +through CSphmomentum::build_thetaphi. │ │ │ │ │ │ +00185 │ │ │ │ │ │ +elm->centre = *v; │ │ │ │ │ │ +00186 │ │ │ │ │ │ +elm->is_stable = true; │ │ │ │ │ │ +00187 │ │ │ │ │ │ +// update hash │ │ │ │ │ │ +00188 │ │ │ │ │ │ +00189 │ │ │ │ │ │ +elm->next = hash_array[index]; │ │ │ │ │ │ +00190 │ │ │ │ │ │ +hash_array[index] = elm; │ │ │ │ │ │ +00191 │ │ │ │ │ │ +00192 │ │ │ │ │ │ +n_cones++; │ │ │ │ │ │ +return 0; │ │ │ │ │ │ +00193 │ │ │ │ │ │ +00194 │ │ │ │ │ │ +} │ │ │ │ │ │ +00195 │ │ │ │ │ │ +00196 │ │ │ │ │ │ +// if the cone is already there, we have nothing to do │ │ │ │ │ │ +00197 │ │ │ │ │ │ +if (v->ref == elm->centre.ref){ │ │ │ │ │ │ +return 0; │ │ │ │ │ │ +00198 │ │ │ │ │ │ +00199 │ │ │ │ │ │ +} │ │ │ │ │ │ +00200 │ │ │ │ │ │ +00201 │ │ │ │ │ │ +elm = elm->next; │ │ │ │ │ │ +00202 │ │ │ │ │ │ +} while (1); │ │ │ │ │ │ +00203 │ │ │ │ │ │ +00204 │ │ │ │ │ │ +return 1; │ │ │ │ │ │ +00205 } │ │ │ │ │ │ +00206 │ │ │ │ │ │ +00207 } │ │ │ │ │ │ + │ │ │ │ │ │ +5.20 hash.h │ │ │ │ │ │ +00001 // -*- C++ -*00003 // File: hash.h │ │ │ │ │ │ +// │ │ │ │ │ │ +00004 // Description: header file for classes hash_element and hash_cones │ │ │ │ │ │ +// │ │ │ │ │ │ +00005 // This file is part of the SISCone project. │ │ │ │ │ │ +// │ │ │ │ │ │ +00006 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ +// │ │ │ │ │ │ +00007 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00008 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ +// │ │ │ │ │ │ +00009 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00010 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ // │ │ │ │ │ │ +00011 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ +// │ │ │ │ │ │ +00012 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ +// │ │ │ │ │ │ +00013 // (at your option) any later version. │ │ │ │ │ │ +// │ │ │ │ │ │ +00014 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00015 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ +// │ │ │ │ │ │ +00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ +// │ │ │ │ │ │ +00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ +// │ │ │ │ │ │ +00018 // GNU General Public License for more details. │ │ │ │ │ │ // │ │ │ │ │ │ +00019 // │ │ │ │ │ │ // │ │ │ │ │ │ +00020 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ // │ │ │ │ │ │ +00021 // along with this program; if not, write to the Free Software │ │ │ │ │ │ // │ │ │ │ │ │ +00022 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ +00023 // │ │ │ │ │ │ // │ │ │ │ │ │ +00024 // $Revision:: 224 │ │ │ │ │ │ +$// │ │ │ │ │ │ +00025 // $Date:: 2008-05-16 19:58:30 +0200 (Fri, 16 May 2008) │ │ │ │ │ │ +$// │ │ │ │ │ │ +00027 │ │ │ │ │ │ +00028 #ifndef __HASH_H__ │ │ │ │ │ │ +00029 #define __HASH_H__ │ │ │ │ │ │ +00030 │ │ │ │ │ │ │ │ │ │ │ │ - 204 │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +207 │ │ │ │ │ │ + │ │ │ │ │ │ + 208 │ │ │ │ │ │ │ │ │ │ │ │ File Documentation │ │ │ │ │ │ │ │ │ │ │ │ +00031 #include "momentum.h" │ │ │ │ │ │ +00032 #include "reference.h" │ │ │ │ │ │ +00033 │ │ │ │ │ │ +00034 namespace siscone{ │ │ │ │ │ │ +00035 │ │ │ │ │ │ +00045 class hash_element{ │ │ │ │ │ │ +00046 public: │ │ │ │ │ │ +00047 │ │ │ │ │ │ +Creference ref; │ │ │ │ │ │ +double eta; │ │ │ │ │ │ +00048 │ │ │ │ │ │ +00049 │ │ │ │ │ │ +double phi; │ │ │ │ │ │ +00050 │ │ │ │ │ │ +bool is_stable; │ │ │ │ │ │ +00051 │ │ │ │ │ │ +00052 │ │ │ │ │ │ +hash_element *next; │ │ │ │ │ │ +00053 }; │ │ │ │ │ │ +00054 │ │ │ │ │ │ +00062 class hash_cones{ │ │ │ │ │ │ +00063 public: │ │ │ │ │ │ +00067 │ │ │ │ │ │ +hash_cones(int _Np, double _R2); │ │ │ │ │ │ +00068 │ │ │ │ │ │ +00070 │ │ │ │ │ │ +~hash_cones(); │ │ │ │ │ │ +00071 │ │ │ │ │ │ +int insert(Cmomentum *v, Cmomentum *parent, Cmomentum *child, bool p_io, bool c_io); │ │ │ │ │ │ +00081 │ │ │ │ │ │ +00082 │ │ │ │ │ │ +int insert(Cmomentum *v); │ │ │ │ │ │ +00090 │ │ │ │ │ │ +00091 │ │ │ │ │ │ +00093 │ │ │ │ │ │ +hash_element **hash_array; │ │ │ │ │ │ +00094 │ │ │ │ │ │ +int n_cones; │ │ │ │ │ │ +00096 │ │ │ │ │ │ +00097 │ │ │ │ │ │ +00099 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ +00100 │ │ │ │ │ │ +int n_occupied_cells; │ │ │ │ │ │ +00101 #endif │ │ │ │ │ │ +00102 │ │ │ │ │ │ +00104 │ │ │ │ │ │ +int mask; │ │ │ │ │ │ +00105 │ │ │ │ │ │ +double R2; │ │ │ │ │ │ +00108 │ │ │ │ │ │ +00109 │ │ │ │ │ │ +inline bool is_inside(Cmomentum *centre, Cmomentum *v); │ │ │ │ │ │ +00118 │ │ │ │ │ │ +00119 }; │ │ │ │ │ │ +00120 │ │ │ │ │ │ +00121 } │ │ │ │ │ │ +00122 #endif │ │ │ │ │ │ + │ │ │ │ │ │ +5.21 hash.h │ │ │ │ │ │ +00001 // -*- C++ -*00003 // File: hash.h │ │ │ │ │ │ +// │ │ │ │ │ │ +00004 // Description: header file for classes hash_element and hash_cones │ │ │ │ │ │ +// │ │ │ │ │ │ +00005 // This file is part of the SISCone project. │ │ │ │ │ │ +// │ │ │ │ │ │ +00006 // WARNING: this is not the main SISCone trunk but │ │ │ │ │ │ +// │ │ │ │ │ │ +00007 // │ │ │ │ │ │ +an adaptation to spherical coordinates │ │ │ │ │ │ +// │ │ │ │ │ │ +00008 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ +// │ │ │ │ │ │ 00009 // │ │ │ │ │ │ // │ │ │ │ │ │ 00010 // Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez │ │ │ │ │ │ -// │ │ │ │ │ │ 00011 // │ │ │ │ │ │ // │ │ │ │ │ │ 00012 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ // │ │ │ │ │ │ 00013 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ // │ │ │ │ │ │ 00014 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ @@ -14934,123 +15613,784 @@ │ │ │ │ │ │ 00022 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ // │ │ │ │ │ │ 00023 // along with this program; if not, write to the Free Software │ │ │ │ │ │ // │ │ │ │ │ │ 00024 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ 00025 // │ │ │ │ │ │ // │ │ │ │ │ │ -00026 // $Revision:: 422 │ │ │ │ │ │ +00026 // $Revision:: 294 │ │ │ │ │ │ $// │ │ │ │ │ │ -00027 // $Date:: 2020-04-22 11:51:09 +0200 (Wed, 22 Apr 2020) │ │ │ │ │ │ +00027 // $Date:: 2009-05-01 17:15:04 +0200 (Fri, 01 May 2009) │ │ │ │ │ │ $// │ │ │ │ │ │ 00029 │ │ │ │ │ │ -00030 #ifndef __SPH_GEOM_2D_H__ │ │ │ │ │ │ -00031 #define __SPH_GEOM_2D_H__ │ │ │ │ │ │ +00030 #ifndef __SPH_HASH_H__ │ │ │ │ │ │ +00031 #define __SPH_HASH_H__ │ │ │ │ │ │ 00032 │ │ │ │ │ │ -00033 #include │ │ │ │ │ │ -00034 #include │ │ │ │ │ │ -00035 #include │ │ │ │ │ │ -00036 #include │ │ │ │ │ │ -00037 │ │ │ │ │ │ -00038 #ifndef M_PI │ │ │ │ │ │ -00039 #define M_PI 3.141592653589793238462643383279502884197 │ │ │ │ │ │ -00040 #endif │ │ │ │ │ │ -00041 │ │ │ │ │ │ -00042 namespace siscone_spherical{ │ │ │ │ │ │ +00033 #include "momentum.h" │ │ │ │ │ │ +00034 │ │ │ │ │ │ +00035 namespace siscone_spherical{ │ │ │ │ │ │ +00036 │ │ │ │ │ │ +00046 class sph_hash_element{ │ │ │ │ │ │ +00047 public: │ │ │ │ │ │ +00048 │ │ │ │ │ │ +CSph3vector centre; │ │ │ │ │ │ +bool is_stable; │ │ │ │ │ │ +00049 │ │ │ │ │ │ + │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.22 momentum.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +00050 │ │ │ │ │ │ +00051 │ │ │ │ │ │ +sph_hash_element *next; │ │ │ │ │ │ +00052 }; │ │ │ │ │ │ +00053 │ │ │ │ │ │ +00061 class sph_hash_cones{ │ │ │ │ │ │ +00062 public: │ │ │ │ │ │ +00065 │ │ │ │ │ │ +sph_hash_cones(int _Np, double _radius); │ │ │ │ │ │ +00066 │ │ │ │ │ │ +00068 │ │ │ │ │ │ +~sph_hash_cones(); │ │ │ │ │ │ +00069 │ │ │ │ │ │ +00079 │ │ │ │ │ │ +int insert(CSphmomentum *v, CSphmomentum *parent, CSphmomentum *child, bool p_io, bool c_io); │ │ │ │ │ │ +00080 │ │ │ │ │ │ +int insert(CSphmomentum *v); │ │ │ │ │ │ +00088 │ │ │ │ │ │ +00089 │ │ │ │ │ │ +00091 │ │ │ │ │ │ +sph_hash_element **hash_array; │ │ │ │ │ │ +00092 │ │ │ │ │ │ +int n_cones; │ │ │ │ │ │ +00094 │ │ │ │ │ │ +00095 │ │ │ │ │ │ +00097 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ +00098 │ │ │ │ │ │ +int n_occupied_cells; │ │ │ │ │ │ +00099 #endif │ │ │ │ │ │ +00100 │ │ │ │ │ │ +00102 │ │ │ │ │ │ +int mask; │ │ │ │ │ │ +00103 │ │ │ │ │ │ +double R2; │ │ │ │ │ │ +00106 │ │ │ │ │ │ +00107 │ │ │ │ │ │ +double tan2R; │ │ │ │ │ │ +00109 │ │ │ │ │ │ +00110 }; │ │ │ │ │ │ +00111 │ │ │ │ │ │ +00112 } │ │ │ │ │ │ +00113 #endif │ │ │ │ │ │ + │ │ │ │ │ │ +5.22 momentum.cpp │ │ │ │ │ │ +00001 │ │ │ │ │ │ +00002 // File: momentum.cpp │ │ │ │ │ │ +// │ │ │ │ │ │ +00003 // Description: source file for 4-momentum class Cmomentum │ │ │ │ │ │ +// │ │ │ │ │ │ +00004 // This file is part of the SISCone project. │ │ │ │ │ │ +// │ │ │ │ │ │ +00005 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ +// │ │ │ │ │ │ +00006 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00007 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ +// │ │ │ │ │ │ +00008 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00009 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ +// │ │ │ │ │ │ +00010 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ +// │ │ │ │ │ │ +00011 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ +// │ │ │ │ │ │ +00012 // (at your option) any later version. │ │ │ │ │ │ +// │ │ │ │ │ │ +00013 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00014 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ +// │ │ │ │ │ │ +00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ +// │ │ │ │ │ │ +00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ +// │ │ │ │ │ │ +00017 // GNU General Public License for more details. │ │ │ │ │ │ +// │ │ │ │ │ │ +00018 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00019 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ +// │ │ │ │ │ │ +00020 // along with this program; if not, write to the Free Software │ │ │ │ │ │ +// │ │ │ │ │ │ +00021 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ +00022 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00023 // $Revision:: 123 │ │ │ │ │ │ +$// │ │ │ │ │ │ +00024 // $Date:: 2007-03-01 02:52:16 +0100 (Thu, 01 Mar 2007) │ │ │ │ │ │ +$// │ │ │ │ │ │ +00026 │ │ │ │ │ │ +00027 #include "momentum.h" │ │ │ │ │ │ +00028 #include │ │ │ │ │ │ +00029 #include │ │ │ │ │ │ +00030 │ │ │ │ │ │ +00031 namespace siscone{ │ │ │ │ │ │ +00032 │ │ │ │ │ │ +00033 /************************************************************************* │ │ │ │ │ │ +00034 * class Cmomentum │ │ │ │ │ │ +* │ │ │ │ │ │ +00035 * This class contains the information for particle or group of │ │ │ │ │ │ +* │ │ │ │ │ │ +00036 * particles management. │ │ │ │ │ │ +* │ │ │ │ │ │ +00037 * It includes all Lorentz properties as well as tools for summing them. * │ │ │ │ │ │ +00038 *************************************************************************/ │ │ │ │ │ │ +00039 │ │ │ │ │ │ +00040 // default ctor │ │ │ │ │ │ +00041 //-------------00042 Cmomentum::Cmomentum(){ │ │ │ │ │ │ 00043 │ │ │ │ │ │ -00052 class CSphtheta_phi_range{ │ │ │ │ │ │ -00053 public: │ │ │ │ │ │ +eta = 0.0; │ │ │ │ │ │ +00044 │ │ │ │ │ │ +phi = 0.0; │ │ │ │ │ │ +00045 │ │ │ │ │ │ +px = py = pz = E = 0.0; │ │ │ │ │ │ +00046 │ │ │ │ │ │ +ref = Creference(); │ │ │ │ │ │ +00047 │ │ │ │ │ │ +index = -1; │ │ │ │ │ │ +00048 } │ │ │ │ │ │ +00049 │ │ │ │ │ │ +00050 // ctor with initialisation │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +209 │ │ │ │ │ │ + │ │ │ │ │ │ + 210 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +00051 //-------------------------00052 Cmomentum::Cmomentum(double _px, double _py, double _pz, double _E){ │ │ │ │ │ │ +00053 │ │ │ │ │ │ +px = _px; │ │ │ │ │ │ +00054 │ │ │ │ │ │ +py = _py; │ │ │ │ │ │ 00055 │ │ │ │ │ │ -CSphtheta_phi_range(); │ │ │ │ │ │ +pz = _pz; │ │ │ │ │ │ 00056 │ │ │ │ │ │ +E = _E; │ │ │ │ │ │ +00057 │ │ │ │ │ │ +00058 │ │ │ │ │ │ +// compute eta and phi │ │ │ │ │ │ +00059 │ │ │ │ │ │ +build_etaphi(); │ │ │ │ │ │ +00060 │ │ │ │ │ │ +ref = Creference(); │ │ │ │ │ │ +00061 } │ │ │ │ │ │ 00062 │ │ │ │ │ │ -CSphtheta_phi_range(double c_theta, double c_phi, double R); │ │ │ │ │ │ -00063 │ │ │ │ │ │ +00063 // ctor with detailed initialisation │ │ │ │ │ │ +00064 //----------------------------------00065 Cmomentum::Cmomentum(double _eta, double _phi, Creference _ref){ │ │ │ │ │ │ 00066 │ │ │ │ │ │ -CSphtheta_phi_range& operator = (const CSphtheta_phi_range &r); │ │ │ │ │ │ +eta = _eta; │ │ │ │ │ │ 00067 │ │ │ │ │ │ -int add_particle(const double theta, const double phi); │ │ │ │ │ │ +phi = _phi; │ │ │ │ │ │ +00068 │ │ │ │ │ │ +00069 │ │ │ │ │ │ +ref = _ref; │ │ │ │ │ │ +00070 } │ │ │ │ │ │ +00071 │ │ │ │ │ │ +00072 // default dtor │ │ │ │ │ │ +00073 //-------------00074 Cmomentum::~Cmomentum(){ │ │ │ │ │ │ +00075 │ │ │ │ │ │ +00076 } │ │ │ │ │ │ +00077 │ │ │ │ │ │ +00078 // assignment of vectors │ │ │ │ │ │ +00079 //----------------------00080 Cmomentum& Cmomentum::operator = (const Cmomentum &v){ │ │ │ │ │ │ +00081 │ │ │ │ │ │ +px = v.px; │ │ │ │ │ │ +00082 │ │ │ │ │ │ +py = v.py; │ │ │ │ │ │ +00083 │ │ │ │ │ │ +pz = v.pz; │ │ │ │ │ │ +00084 │ │ │ │ │ │ +E = v.E; │ │ │ │ │ │ +00085 │ │ │ │ │ │ +00086 │ │ │ │ │ │ +eta = v.eta; │ │ │ │ │ │ +00087 │ │ │ │ │ │ +phi = v.phi; │ │ │ │ │ │ +00088 │ │ │ │ │ │ +00089 │ │ │ │ │ │ +ref = v.ref; │ │ │ │ │ │ +return *this; │ │ │ │ │ │ +00090 │ │ │ │ │ │ +00091 } │ │ │ │ │ │ +00092 │ │ │ │ │ │ +00093 // addition of vectors │ │ │ │ │ │ +00094 // !!! WARNING !!! no updating of eta and phi !!! │ │ │ │ │ │ +00095 //-----------------------------------------------00096 const Cmomentum Cmomentum::operator + (const Cmomentum &v){ │ │ │ │ │ │ +00097 │ │ │ │ │ │ +Cmomentum tmp = *this; │ │ │ │ │ │ +00098 │ │ │ │ │ │ +return tmp+=v; │ │ │ │ │ │ +00099 } │ │ │ │ │ │ +00100 │ │ │ │ │ │ +00101 // incrementation of vectors │ │ │ │ │ │ +00102 // !!! WARNING !!! no updating of eta and phi !!! │ │ │ │ │ │ +00103 //-----------------------------------------------00104 Cmomentum& Cmomentum::operator += (const Cmomentum &v){ │ │ │ │ │ │ +00105 │ │ │ │ │ │ +px+=v.px; │ │ │ │ │ │ +00106 │ │ │ │ │ │ +py+=v.py; │ │ │ │ │ │ +00107 │ │ │ │ │ │ +pz+=v.pz; │ │ │ │ │ │ +00108 │ │ │ │ │ │ +E +=v.E; │ │ │ │ │ │ +00109 │ │ │ │ │ │ +00110 │ │ │ │ │ │ +ref+=v.ref; │ │ │ │ │ │ +00111 │ │ │ │ │ │ +00112 │ │ │ │ │ │ +return *this; │ │ │ │ │ │ +00113 } │ │ │ │ │ │ +00114 │ │ │ │ │ │ +00115 // incrementation of vectors │ │ │ │ │ │ +00116 // !!! WARNING !!! no updating of eta and phi !!! │ │ │ │ │ │ +00117 //-----------------------------------------------00118 Cmomentum& Cmomentum::operator -= (const Cmomentum &v){ │ │ │ │ │ │ +00119 │ │ │ │ │ │ +px-=v.px; │ │ │ │ │ │ +00120 │ │ │ │ │ │ +py-=v.py; │ │ │ │ │ │ +00121 │ │ │ │ │ │ +pz-=v.pz; │ │ │ │ │ │ +00122 │ │ │ │ │ │ +E -=v.E; │ │ │ │ │ │ +00123 │ │ │ │ │ │ +00124 │ │ │ │ │ │ +ref-=v.ref; │ │ │ │ │ │ +return *this; │ │ │ │ │ │ +00125 │ │ │ │ │ │ +00126 } │ │ │ │ │ │ +00127 │ │ │ │ │ │ +00128 // build eta-phi from 4-momentum info │ │ │ │ │ │ +00129 // !!! │ │ │ │ │ │ +WARNING │ │ │ │ │ │ +!!! │ │ │ │ │ │ +00130 // !!! computing eta and phi is time-consuming !!! │ │ │ │ │ │ +00131 // !!! use this whenever you need eta or phi │ │ │ │ │ │ +!!! │ │ │ │ │ │ +00132 // !!! automatically called for single-particle !!! │ │ │ │ │ │ +00133 //-------------------------------------------------00134 void Cmomentum::build_etaphi(){ │ │ │ │ │ │ +// note: the factor n (ref.nb) cancels in all expressions !! │ │ │ │ │ │ +00135 │ │ │ │ │ │ +00136 │ │ │ │ │ │ +eta = 0.5*log((E+pz)/(E-pz)); │ │ │ │ │ │ +00137 │ │ │ │ │ │ +phi = atan2(py,px); │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.23 momentum.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +211 │ │ │ │ │ │ + │ │ │ │ │ │ +00138 } │ │ │ │ │ │ +00139 │ │ │ │ │ │ +00140 │ │ │ │ │ │ +00141 // ordering of two vectors │ │ │ │ │ │ +00142 // the default ordering is w.r.t. their references │ │ │ │ │ │ +00143 //------------------------------------------------00144 bool operator < (const Cmomentum &v1, const Cmomentum &v2){ │ │ │ │ │ │ +00145 │ │ │ │ │ │ +return v1.ref < v2.ref; │ │ │ │ │ │ +00146 } │ │ │ │ │ │ +00147 │ │ │ │ │ │ +00148 // ordering of vectors in eta (e.g. used in collinear tests) │ │ │ │ │ │ +00149 //----------------------------------------------------------00150 bool momentum_eta_less(const Cmomentum &v1, const Cmomentum &v2){ │ │ │ │ │ │ +return v1.eta < v2.eta; │ │ │ │ │ │ +00151 │ │ │ │ │ │ +00152 } │ │ │ │ │ │ +00153 │ │ │ │ │ │ +00154 // ordering of vectors in pt │ │ │ │ │ │ +00155 //--------------------------00156 bool momentum_pt_less(const Cmomentum &v1, const Cmomentum &v2){ │ │ │ │ │ │ +00157 │ │ │ │ │ │ +return v1.perp2() < v2.perp2(); │ │ │ │ │ │ +00158 } │ │ │ │ │ │ +00159 │ │ │ │ │ │ +00160 } │ │ │ │ │ │ +00161 │ │ │ │ │ │ + │ │ │ │ │ │ +5.23 momentum.cpp │ │ │ │ │ │ +00001 │ │ │ │ │ │ +00002 // File: momentum.cpp │ │ │ │ │ │ +// │ │ │ │ │ │ +00003 // Description: source file for 4-momentum class Cmomentum │ │ │ │ │ │ +// │ │ │ │ │ │ +00004 // This file is part of the SISCone project. │ │ │ │ │ │ +// │ │ │ │ │ │ +00005 // WARNING: this is not the main SISCone trunk but │ │ │ │ │ │ +// │ │ │ │ │ │ +00006 // │ │ │ │ │ │ +an adaptation to spherical coordinates │ │ │ │ │ │ +// │ │ │ │ │ │ +00007 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ +// │ │ │ │ │ │ +00008 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00009 // Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez │ │ │ │ │ │ +00010 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00011 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ +// │ │ │ │ │ │ +00012 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ +// │ │ │ │ │ │ +00013 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ +// │ │ │ │ │ │ +00014 // (at your option) any later version. │ │ │ │ │ │ +// │ │ │ │ │ │ +00015 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00016 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ +// │ │ │ │ │ │ +00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ +// │ │ │ │ │ │ +00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ +// │ │ │ │ │ │ +00019 // GNU General Public License for more details. │ │ │ │ │ │ +// │ │ │ │ │ │ +00020 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00021 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ +// │ │ │ │ │ │ +00022 // along with this program; if not, write to the Free Software │ │ │ │ │ │ +// │ │ │ │ │ │ +00023 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ +00024 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00025 // $Revision:: 255 │ │ │ │ │ │ +$// │ │ │ │ │ │ +00026 // $Date:: 2008-07-12 17:40:35 +0200 (Sat, 12 Jul 2008) │ │ │ │ │ │ +$// │ │ │ │ │ │ +00028 │ │ │ │ │ │ +00029 #include "momentum.h" │ │ │ │ │ │ +00030 #include │ │ │ │ │ │ +00031 #include │ │ │ │ │ │ +00032 │ │ │ │ │ │ +00033 namespace siscone_spherical{ │ │ │ │ │ │ +00034 │ │ │ │ │ │ +00035 /************************************************************************* │ │ │ │ │ │ +00036 * class CSph3vector │ │ │ │ │ │ +* │ │ │ │ │ │ +00037 * This class contains the information for particle or group of │ │ │ │ │ │ +* │ │ │ │ │ │ +00038 * particles management. │ │ │ │ │ │ +* │ │ │ │ │ │ +00039 *************************************************************************/ │ │ │ │ │ │ +00040 │ │ │ │ │ │ +00041 // default ctor │ │ │ │ │ │ +00042 //-------------00043 CSph3vector::CSph3vector(){ │ │ │ │ │ │ +00044 │ │ │ │ │ │ +_theta = _phi = _norm = 0.0; │ │ │ │ │ │ +00045 │ │ │ │ │ │ +px = py = pz = 0.0; │ │ │ │ │ │ +00046 │ │ │ │ │ │ +ref = siscone::Creference(); │ │ │ │ │ │ +00047 } │ │ │ │ │ │ +00048 │ │ │ │ │ │ +00049 // ctor with initialisation │ │ │ │ │ │ +00050 //-------------------------00051 CSph3vector::CSph3vector(double _px, double _py, double _pz){ │ │ │ │ │ │ +00052 │ │ │ │ │ │ +px = _px; │ │ │ │ │ │ +00053 │ │ │ │ │ │ +py = _py; │ │ │ │ │ │ +00054 │ │ │ │ │ │ +pz = _pz; │ │ │ │ │ │ +00055 │ │ │ │ │ │ +00056 │ │ │ │ │ │ +// compute the norm │ │ │ │ │ │ +00057 │ │ │ │ │ │ +build_norm(); │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ + 212 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +00058 │ │ │ │ │ │ +00059 │ │ │ │ │ │ +ref = siscone::Creference(); │ │ │ │ │ │ +00060 } │ │ │ │ │ │ +00061 │ │ │ │ │ │ +00062 // default dtor │ │ │ │ │ │ +00063 //-------------00064 CSph3vector::~CSph3vector(){ │ │ │ │ │ │ +00065 │ │ │ │ │ │ +00066 } │ │ │ │ │ │ +00067 │ │ │ │ │ │ +00068 │ │ │ │ │ │ +00069 // assignment of vectors │ │ │ │ │ │ +00070 //----------------------00071 CSph3vector& CSph3vector::operator = (const CSph3vector &v){ │ │ │ │ │ │ 00072 │ │ │ │ │ │ +px = v.px; │ │ │ │ │ │ 00073 │ │ │ │ │ │ -unsigned int theta_range; │ │ │ │ │ │ +py = v.py; │ │ │ │ │ │ +00074 │ │ │ │ │ │ +pz = v.pz; │ │ │ │ │ │ 00075 │ │ │ │ │ │ 00076 │ │ │ │ │ │ -unsigned int phi_range; │ │ │ │ │ │ +_norm = v._norm; │ │ │ │ │ │ +00077 │ │ │ │ │ │ +_theta = v._theta; │ │ │ │ │ │ 00078 │ │ │ │ │ │ +_phi │ │ │ │ │ │ += v._phi; │ │ │ │ │ │ 00079 │ │ │ │ │ │ +00080 │ │ │ │ │ │ +ref = v.ref; │ │ │ │ │ │ 00081 │ │ │ │ │ │ -static double theta_min; │ │ │ │ │ │ -static double theta_max; │ │ │ │ │ │ -00082 │ │ │ │ │ │ +return *this; │ │ │ │ │ │ +00082 } │ │ │ │ │ │ 00083 │ │ │ │ │ │ -00084 private: │ │ │ │ │ │ -00086 │ │ │ │ │ │ -inline unsigned int get_theta_cell(double theta){ │ │ │ │ │ │ -if (theta>=theta_max) return 1u«31; │ │ │ │ │ │ +00084 // addition of vectors │ │ │ │ │ │ +00085 //-----------------------------------------------00086 const CSph3vector CSph3vector::operator + (const CSph3vector &v){ │ │ │ │ │ │ 00087 │ │ │ │ │ │ +CSph3vector tmp = *this; │ │ │ │ │ │ 00088 │ │ │ │ │ │ -return (unsigned int) (1u « ((int) (32*((theta-theta_min)/(theta_max-theta_min))))); │ │ │ │ │ │ -00089 │ │ │ │ │ │ -} │ │ │ │ │ │ +return tmp+=v; │ │ │ │ │ │ +00089 } │ │ │ │ │ │ 00090 │ │ │ │ │ │ -00092 │ │ │ │ │ │ -inline unsigned int get_phi_cell(double phi){ │ │ │ │ │ │ -return (unsigned int) (1u « ((int) (32*phi/twopi+16)%32)); │ │ │ │ │ │ -00093 │ │ │ │ │ │ +00091 // subtraction of vectors │ │ │ │ │ │ +00092 //-----------------------------------------------00093 const CSph3vector CSph3vector::operator - (const CSph3vector &v){ │ │ │ │ │ │ 00094 │ │ │ │ │ │ -} │ │ │ │ │ │ -00095 }; │ │ │ │ │ │ -00096 │ │ │ │ │ │ -00101 bool is_range_overlap(const CSphtheta_phi_range &r1, const CSphtheta_phi_range &r2); │ │ │ │ │ │ +CSph3vector tmp = *this; │ │ │ │ │ │ +00095 │ │ │ │ │ │ +return tmp-=v; │ │ │ │ │ │ +00096 } │ │ │ │ │ │ +00097 │ │ │ │ │ │ +00098 // division by constant │ │ │ │ │ │ +00099 //-----------------------------------------------00100 const CSph3vector CSph3vector::operator / (const double &r){ │ │ │ │ │ │ +00101 │ │ │ │ │ │ +CSph3vector tmp = *this; │ │ │ │ │ │ 00102 │ │ │ │ │ │ -00108 const CSphtheta_phi_range range_union(const CSphtheta_phi_range &r1, const CSphtheta_phi_range &r2); │ │ │ │ │ │ +return tmp/=r; │ │ │ │ │ │ +00103 } │ │ │ │ │ │ +00104 │ │ │ │ │ │ +00105 // incrementation │ │ │ │ │ │ +00106 //-----------------------------------------------00107 CSph3vector& CSph3vector::operator += (const CSph3vector &v){ │ │ │ │ │ │ +00108 │ │ │ │ │ │ +px+=v.px; │ │ │ │ │ │ 00109 │ │ │ │ │ │ -00110 } │ │ │ │ │ │ +py+=v.py; │ │ │ │ │ │ +00110 │ │ │ │ │ │ +pz+=v.pz; │ │ │ │ │ │ 00111 │ │ │ │ │ │ -00112 #endif │ │ │ │ │ │ +return *this; │ │ │ │ │ │ +00112 │ │ │ │ │ │ +00113 } │ │ │ │ │ │ +00114 │ │ │ │ │ │ +00115 // decrementation │ │ │ │ │ │ +00116 //-----------------------------------------------00117 CSph3vector& CSph3vector::operator -= (const CSph3vector &v){ │ │ │ │ │ │ +00118 │ │ │ │ │ │ +px-=v.px; │ │ │ │ │ │ +00119 │ │ │ │ │ │ +py-=v.py; │ │ │ │ │ │ +00120 │ │ │ │ │ │ +pz-=v.pz; │ │ │ │ │ │ +00121 │ │ │ │ │ │ +00122 │ │ │ │ │ │ +return *this; │ │ │ │ │ │ +00123 } │ │ │ │ │ │ +00124 │ │ │ │ │ │ +00125 // multiplication by a constant │ │ │ │ │ │ +00126 //-----------------------------------------------00127 CSph3vector& CSph3vector::operator *= (const double &r){ │ │ │ │ │ │ +00128 │ │ │ │ │ │ +px*=r; │ │ │ │ │ │ +00129 │ │ │ │ │ │ +py*=r; │ │ │ │ │ │ +00130 │ │ │ │ │ │ +pz*=r; │ │ │ │ │ │ +00131 │ │ │ │ │ │ +00132 │ │ │ │ │ │ +return *this; │ │ │ │ │ │ +00133 } │ │ │ │ │ │ +00134 │ │ │ │ │ │ +00135 // division by a constant │ │ │ │ │ │ +00136 //-----------------------------------------------00137 CSph3vector& CSph3vector::operator /= (const double &r){ │ │ │ │ │ │ +00138 │ │ │ │ │ │ +px/=r; │ │ │ │ │ │ +00139 │ │ │ │ │ │ +py/=r; │ │ │ │ │ │ +00140 │ │ │ │ │ │ +pz/=r; │ │ │ │ │ │ +00141 │ │ │ │ │ │ +00142 │ │ │ │ │ │ +_norm/=r; │ │ │ │ │ │ +00143 │ │ │ │ │ │ +00144 │ │ │ │ │ │ +return *this; │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.23 momentum.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +00145 } │ │ │ │ │ │ +00146 │ │ │ │ │ │ +00147 // build norm from 3-momentum info │ │ │ │ │ │ +00148 void CSph3vector::build_norm(){ │ │ │ │ │ │ +00149 │ │ │ │ │ │ +_norm = norm(); │ │ │ │ │ │ +00150 } │ │ │ │ │ │ +00151 │ │ │ │ │ │ +00152 // build norm from 3-momentum info │ │ │ │ │ │ +00153 void CSph3vector::build_thetaphi(){ │ │ │ │ │ │ +00154 │ │ │ │ │ │ +_theta = theta(); │ │ │ │ │ │ +00155 │ │ │ │ │ │ +_phi = phi(); │ │ │ │ │ │ +00156 } │ │ │ │ │ │ +00157 │ │ │ │ │ │ +00158 │ │ │ │ │ │ +00159 // for this direction, compute the two reference directions │ │ │ │ │ │ +00160 // used to measure angles │ │ │ │ │ │ +00161 void CSph3vector::get_angular_directions(CSph3vector &angular_dir1, CSph3vector &angular_dir2){ │ │ │ │ │ │ +00162 │ │ │ │ │ │ +if (px < py){ │ │ │ │ │ │ +if (pz < px){ │ │ │ │ │ │ +00163 │ │ │ │ │ │ +00164 │ │ │ │ │ │ +// z smallest │ │ │ │ │ │ +00165 │ │ │ │ │ │ +angular_dir1 = CSph3vector(-py, px, 0.0); │ │ │ │ │ │ +00166 │ │ │ │ │ │ +} else { │ │ │ │ │ │ +00167 │ │ │ │ │ │ +// x smallest │ │ │ │ │ │ +00168 │ │ │ │ │ │ +angular_dir1 = CSph3vector(0.0, -pz, py); │ │ │ │ │ │ +00169 │ │ │ │ │ │ +} │ │ │ │ │ │ +00170 │ │ │ │ │ │ +} else { │ │ │ │ │ │ +00171 │ │ │ │ │ │ +if (pz < py){ │ │ │ │ │ │ +// z smallest │ │ │ │ │ │ +00172 │ │ │ │ │ │ +00173 │ │ │ │ │ │ +angular_dir1 = CSph3vector(-py, px, 0.0); │ │ │ │ │ │ +00174 │ │ │ │ │ │ +} else { │ │ │ │ │ │ +// y smallest │ │ │ │ │ │ +00175 │ │ │ │ │ │ +00176 │ │ │ │ │ │ +angular_dir1 = CSph3vector(-pz, 0.0, px); │ │ │ │ │ │ +00177 │ │ │ │ │ │ +} │ │ │ │ │ │ +00178 │ │ │ │ │ │ +} │ │ │ │ │ │ +00179 │ │ │ │ │ │ +angular_dir2 = cross_product3(*this, angular_dir1); │ │ │ │ │ │ +00180 │ │ │ │ │ │ +// We’ll simply take x & y so the reflection symmetry is not broken │ │ │ │ │ │ +00181 │ │ │ │ │ │ +//angular_dir1 = CSph3vector(0.0, -pz, py); │ │ │ │ │ │ +00182 │ │ │ │ │ │ +//angular_dir2 = CSph3vector(-pz, 0.0, -px); │ │ │ │ │ │ +00183 } │ │ │ │ │ │ +00184 │ │ │ │ │ │ +00185 /************************************************************************* │ │ │ │ │ │ +00186 * class CSphmomentum │ │ │ │ │ │ +* │ │ │ │ │ │ +00187 * This class contains the information for particle or group of │ │ │ │ │ │ +* │ │ │ │ │ │ +00188 * particles management. │ │ │ │ │ │ +* │ │ │ │ │ │ +00189 * It includes all Lorentz properties as well as tools for summing them. * │ │ │ │ │ │ +00190 *************************************************************************/ │ │ │ │ │ │ +00191 │ │ │ │ │ │ +00192 // default ctor │ │ │ │ │ │ +00193 //-------------00194 CSphmomentum::CSphmomentum(){ │ │ │ │ │ │ +00195 │ │ │ │ │ │ +E=0.0; │ │ │ │ │ │ +00196 │ │ │ │ │ │ +index = -1; │ │ │ │ │ │ +00197 } │ │ │ │ │ │ +00198 │ │ │ │ │ │ +00199 // ctor with initialisation │ │ │ │ │ │ +00200 //-------------------------00201 CSphmomentum::CSphmomentum(double _px, double _py, double _pz, double _E) │ │ │ │ │ │ +00202 │ │ │ │ │ │ +: CSph3vector(_px, _py, _pz) { │ │ │ │ │ │ +00203 │ │ │ │ │ │ +E = _E; │ │ │ │ │ │ +00204 │ │ │ │ │ │ +00205 │ │ │ │ │ │ +// compute the angles │ │ │ │ │ │ +00206 │ │ │ │ │ │ +build_thetaphi(); │ │ │ │ │ │ +00207 } │ │ │ │ │ │ +00208 │ │ │ │ │ │ +00209 // ctor with initialisation │ │ │ │ │ │ +00210 //-------------------------00211 CSphmomentum::CSphmomentum(CSph3vector &_v, double _E) │ │ │ │ │ │ +00212 │ │ │ │ │ │ +: CSph3vector(_v.px, _v.py, _v.pz) { │ │ │ │ │ │ +00213 │ │ │ │ │ │ +E = _E; │ │ │ │ │ │ +00214 } │ │ │ │ │ │ +00215 │ │ │ │ │ │ +00216 // default dtor │ │ │ │ │ │ +00217 //-------------00218 CSphmomentum::~CSphmomentum(){ │ │ │ │ │ │ +00219 │ │ │ │ │ │ +00220 } │ │ │ │ │ │ +00221 │ │ │ │ │ │ +00222 // assignment of vectors │ │ │ │ │ │ +00223 //----------------------00224 CSphmomentum& CSphmomentum::operator = (const CSphmomentum &v){ │ │ │ │ │ │ +00225 │ │ │ │ │ │ +px = v.px; │ │ │ │ │ │ +00226 │ │ │ │ │ │ +py = v.py; │ │ │ │ │ │ +00227 │ │ │ │ │ │ +pz = v.pz; │ │ │ │ │ │ +00228 │ │ │ │ │ │ +E = v.E; │ │ │ │ │ │ +00229 │ │ │ │ │ │ +00230 │ │ │ │ │ │ +_norm = v._norm; │ │ │ │ │ │ +00231 │ │ │ │ │ │ +_theta = v._theta; │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +213 │ │ │ │ │ │ + │ │ │ │ │ │ + 214 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +00232 │ │ │ │ │ │ +_phi │ │ │ │ │ │ += v._phi; │ │ │ │ │ │ +00233 │ │ │ │ │ │ +00234 │ │ │ │ │ │ +ref = v.ref; │ │ │ │ │ │ +return *this; │ │ │ │ │ │ +00235 │ │ │ │ │ │ +00236 } │ │ │ │ │ │ +00237 │ │ │ │ │ │ +00238 // addition of vectors │ │ │ │ │ │ +00239 // !!! WARNING !!! no updating of eta and phi !!! │ │ │ │ │ │ +00240 //-----------------------------------------------00241 const CSphmomentum CSphmomentum::operator + (const CSphmomentum &v){ │ │ │ │ │ │ +00242 │ │ │ │ │ │ +CSphmomentum tmp = *this; │ │ │ │ │ │ +00243 │ │ │ │ │ │ +return tmp+=v; │ │ │ │ │ │ +00244 } │ │ │ │ │ │ +00245 │ │ │ │ │ │ +00246 // incrementation of vectors │ │ │ │ │ │ +00247 // !!! WARNING !!! no updating of eta and phi !!! │ │ │ │ │ │ +00248 //-----------------------------------------------00249 CSphmomentum& CSphmomentum::operator += (const CSphmomentum &v){ │ │ │ │ │ │ +00250 │ │ │ │ │ │ +px+=v.px; │ │ │ │ │ │ +00251 │ │ │ │ │ │ +py+=v.py; │ │ │ │ │ │ +00252 │ │ │ │ │ │ +pz+=v.pz; │ │ │ │ │ │ +00253 │ │ │ │ │ │ +E +=v.E; │ │ │ │ │ │ +00254 │ │ │ │ │ │ +00255 │ │ │ │ │ │ +ref+=v.ref; │ │ │ │ │ │ +00256 │ │ │ │ │ │ +return *this; │ │ │ │ │ │ +00257 │ │ │ │ │ │ +00258 } │ │ │ │ │ │ +00259 │ │ │ │ │ │ +00260 // decrementation of vectors │ │ │ │ │ │ +00261 // !!! WARNING !!! no updating of eta and phi !!! │ │ │ │ │ │ +00262 //-----------------------------------------------00263 CSphmomentum& CSphmomentum::operator -= (const CSphmomentum &v){ │ │ │ │ │ │ +00264 │ │ │ │ │ │ +px-=v.px; │ │ │ │ │ │ +00265 │ │ │ │ │ │ +py-=v.py; │ │ │ │ │ │ +00266 │ │ │ │ │ │ +pz-=v.pz; │ │ │ │ │ │ +00267 │ │ │ │ │ │ +E -=v.E; │ │ │ │ │ │ +00268 │ │ │ │ │ │ +00269 │ │ │ │ │ │ +ref-=v.ref; │ │ │ │ │ │ +return *this; │ │ │ │ │ │ +00270 │ │ │ │ │ │ +00271 } │ │ │ │ │ │ +00272 │ │ │ │ │ │ +00273 │ │ │ │ │ │ +00274 // ordering of two vectors │ │ │ │ │ │ +00275 // the default ordering is w.r.t. their references │ │ │ │ │ │ +00276 //------------------------------------------------00277 bool operator < (const CSphmomentum &v1, const CSphmomentum &v2){ │ │ │ │ │ │ +return v1.ref < v2.ref; │ │ │ │ │ │ +00278 │ │ │ │ │ │ +00279 } │ │ │ │ │ │ +00280 │ │ │ │ │ │ +00281 // ordering of vectors in eta (e.g. used in collinear tests) │ │ │ │ │ │ +00282 //----------------------------------------------------------00283 bool momentum_theta_less(const CSphmomentum &v1, const CSphmomentum &v2){ │ │ │ │ │ │ +00284 │ │ │ │ │ │ +return v1._theta < v2._theta; │ │ │ │ │ │ +00285 } │ │ │ │ │ │ +00286 │ │ │ │ │ │ +00287 // ordering of vectors in pt │ │ │ │ │ │ +00288 //--------------------------00289 bool momentum_pt_less(const CSphmomentum &v1, const CSphmomentum &v2){ │ │ │ │ │ │ +return v1.perp2() < v2.perp2(); │ │ │ │ │ │ +00290 │ │ │ │ │ │ +00291 } │ │ │ │ │ │ +00292 │ │ │ │ │ │ +00293 } │ │ │ │ │ │ +00294 │ │ │ │ │ │ │ │ │ │ │ │ -5.20 momentum.h │ │ │ │ │ │ +5.24 momentum.h │ │ │ │ │ │ 00001 // -*- C++ -*00003 // File: momentum.h │ │ │ │ │ │ 00004 // Description: header file for 4-momentum class Cmomentum │ │ │ │ │ │ 00005 // This file is part of the SISCone project. │ │ │ │ │ │ 00006 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ 00007 // │ │ │ │ │ │ 00008 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ 00009 // │ │ │ │ │ │ 00010 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ 00011 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ 00012 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ +00013 // (at your option) any later version. │ │ │ │ │ │ +00014 // │ │ │ │ │ │ +00015 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ +00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ +00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ +00018 // GNU General Public License for more details. │ │ │ │ │ │ │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.20 momentum.h │ │ │ │ │ │ - │ │ │ │ │ │ -00013 // (at your option) any later version. │ │ │ │ │ │ // │ │ │ │ │ │ -00014 // │ │ │ │ │ │ // │ │ │ │ │ │ -00015 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ // │ │ │ │ │ │ -00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ // │ │ │ │ │ │ -00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ // │ │ │ │ │ │ -00018 // GNU General Public License for more details. │ │ │ │ │ │ // │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.24 momentum.h │ │ │ │ │ │ + │ │ │ │ │ │ 00019 // │ │ │ │ │ │ // │ │ │ │ │ │ 00020 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ // │ │ │ │ │ │ 00021 // along with this program; if not, write to the Free Software │ │ │ │ │ │ // │ │ │ │ │ │ 00022 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ @@ -15082,34 +16422,34 @@ │ │ │ │ │ │ 00056 │ │ │ │ │ │ 00058 │ │ │ │ │ │ Cmomentum(double _eta, double _phi, Creference _ref); │ │ │ │ │ │ 00059 │ │ │ │ │ │ 00061 │ │ │ │ │ │ ~Cmomentum(); │ │ │ │ │ │ 00062 │ │ │ │ │ │ -inline double perp() const {return sqrt(perp2());} │ │ │ │ │ │ 00064 │ │ │ │ │ │ +inline double perp() const {return sqrt(perp2());} │ │ │ │ │ │ 00065 │ │ │ │ │ │ inline double perp2() const {return px*px+py*py;} │ │ │ │ │ │ 00067 │ │ │ │ │ │ 00068 │ │ │ │ │ │ inline double mass() const {return sqrt(mass2());} │ │ │ │ │ │ 00070 │ │ │ │ │ │ 00071 │ │ │ │ │ │ -00073 │ │ │ │ │ │ inline double mass2() const {return perpmass2()-perp2();} │ │ │ │ │ │ +00073 │ │ │ │ │ │ 00074 │ │ │ │ │ │ inline double perpmass() const {return sqrt((E-pz)*(E+pz));} │ │ │ │ │ │ 00076 │ │ │ │ │ │ 00077 │ │ │ │ │ │ inline double perpmass2() const {return (E-pz)*(E+pz);} │ │ │ │ │ │ 00079 │ │ │ │ │ │ 00080 │ │ │ │ │ │ -inline double Et() const {return E/sqrt(1.0+pz*pz/perp2());} │ │ │ │ │ │ 00082 │ │ │ │ │ │ +inline double Et() const {return E/sqrt(1.0+pz*pz/perp2());} │ │ │ │ │ │ 00083 │ │ │ │ │ │ inline double Et2() const {return E*E/(1.0+pz*pz/perp2());} │ │ │ │ │ │ 00085 │ │ │ │ │ │ 00086 │ │ │ │ │ │ 00088 │ │ │ │ │ │ Cmomentum& operator = (const Cmomentum &v); │ │ │ │ │ │ 00089 │ │ │ │ │ │ @@ -15121,31 +16461,31 @@ │ │ │ │ │ │ 00097 │ │ │ │ │ │ 00100 │ │ │ │ │ │ Cmomentum& operator -= (const Cmomentum &v); │ │ │ │ │ │ 00101 │ │ │ │ │ │ void build_etaphi(); │ │ │ │ │ │ 00107 │ │ │ │ │ │ 00108 │ │ │ │ │ │ -double px; │ │ │ │ │ │ 00109 │ │ │ │ │ │ -00110 │ │ │ │ │ │ +double px; │ │ │ │ │ │ double py; │ │ │ │ │ │ -double pz; │ │ │ │ │ │ +00110 │ │ │ │ │ │ 00111 │ │ │ │ │ │ -00112 │ │ │ │ │ │ +double pz; │ │ │ │ │ │ double E; │ │ │ │ │ │ +00112 │ │ │ │ │ │ 00113 │ │ │ │ │ │ -double eta; │ │ │ │ │ │ 00114 │ │ │ │ │ │ -00115 │ │ │ │ │ │ +double eta; │ │ │ │ │ │ double phi; │ │ │ │ │ │ -int parent_index; │ │ │ │ │ │ +00115 │ │ │ │ │ │ 00116 │ │ │ │ │ │ -00117 │ │ │ │ │ │ +int parent_index; │ │ │ │ │ │ int index; │ │ │ │ │ │ +00117 │ │ │ │ │ │ 00118 │ │ │ │ │ │ // the following part is used for checksums // │ │ │ │ │ │ 00120 │ │ │ │ │ │ 00122 │ │ │ │ │ │ Creference ref; │ │ │ │ │ │ 00123 }; │ │ │ │ │ │ 00124 │ │ │ │ │ │ @@ -15158,41 +16498,41 @@ │ │ │ │ │ │ 00135 │ │ │ │ │ │ 00137 // some handy utilities // │ │ │ │ │ │ 00139 │ │ │ │ │ │ 00144 inline double get_distance(double eta, double phi, Cmomentum *v){ │ │ │ │ │ │ double dx, dy; │ │ │ │ │ │ 00145 │ │ │ │ │ │ 00146 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -205 │ │ │ │ │ │ - │ │ │ │ │ │ - 206 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00147 │ │ │ │ │ │ dx = eta - v->eta; │ │ │ │ │ │ 00148 │ │ │ │ │ │ dy = fabs(phi - v->phi); │ │ │ │ │ │ -if (dy>M_PI) │ │ │ │ │ │ 00149 │ │ │ │ │ │ +if (dy>M_PI) │ │ │ │ │ │ 00150 │ │ │ │ │ │ dy -= twopi; │ │ │ │ │ │ 00151 │ │ │ │ │ │ 00152 │ │ │ │ │ │ return dx*dx+dy*dy; │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +215 │ │ │ │ │ │ + │ │ │ │ │ │ + 216 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00153 } │ │ │ │ │ │ 00154 │ │ │ │ │ │ 00155 } │ │ │ │ │ │ 00156 │ │ │ │ │ │ 00157 #endif │ │ │ │ │ │ │ │ │ │ │ │ -5.21 momentum.h │ │ │ │ │ │ +5.25 momentum.h │ │ │ │ │ │ 00001 // -*- C++ -*00003 // File: momentum.h │ │ │ │ │ │ // │ │ │ │ │ │ 00004 // Description: header file for 4-momentum class Cmomentum │ │ │ │ │ │ // │ │ │ │ │ │ 00005 // This file is part of the SISCone project. │ │ │ │ │ │ // │ │ │ │ │ │ 00006 // WARNING: this is not the main SISCone trunk but │ │ │ │ │ │ @@ -15288,53 +16628,53 @@ │ │ │ │ │ │ 00095 │ │ │ │ │ │ inline double perp() const {return sqrt(perp2());} │ │ │ │ │ │ 00097 │ │ │ │ │ │ 00098 │ │ │ │ │ │ inline double perp2() const {return px*px+py*py;} │ │ │ │ │ │ 00100 │ │ │ │ │ │ 00101 │ │ │ │ │ │ -00103 │ │ │ │ │ │ inline double norm() const {return sqrt(px*px+py*py+pz*pz);} │ │ │ │ │ │ +00103 │ │ │ │ │ │ 00104 │ │ │ │ │ │ inline double norm2() const {return px*px+py*py+pz*pz;} │ │ │ │ │ │ 00106 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.21 momentum.h │ │ │ │ │ │ - │ │ │ │ │ │ 00107 │ │ │ │ │ │ inline double phi() const {return atan2(py, px);} │ │ │ │ │ │ 00109 │ │ │ │ │ │ 00110 │ │ │ │ │ │ -inline double theta() const {return atan2(perp(),pz);} │ │ │ │ │ │ 00112 │ │ │ │ │ │ +inline double theta() const {return atan2(perp(),pz);} │ │ │ │ │ │ 00113 │ │ │ │ │ │ -00120 │ │ │ │ │ │ void build_norm(); │ │ │ │ │ │ +00120 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.25 momentum.h │ │ │ │ │ │ + │ │ │ │ │ │ 00121 │ │ │ │ │ │ void build_thetaphi(); │ │ │ │ │ │ 00125 │ │ │ │ │ │ 00126 │ │ │ │ │ │ void get_angular_directions(CSph3vector &angular_dir1, CSph3vector &angular_dir2); │ │ │ │ │ │ 00129 │ │ │ │ │ │ 00130 │ │ │ │ │ │ -double px; │ │ │ │ │ │ 00131 │ │ │ │ │ │ -00132 │ │ │ │ │ │ +double px; │ │ │ │ │ │ double py; │ │ │ │ │ │ -double pz; │ │ │ │ │ │ +00132 │ │ │ │ │ │ 00133 │ │ │ │ │ │ +double pz; │ │ │ │ │ │ 00134 │ │ │ │ │ │ double _norm; │ │ │ │ │ │ 00135 │ │ │ │ │ │ 00136 │ │ │ │ │ │ double _theta; │ │ │ │ │ │ -00137 │ │ │ │ │ │ double _phi; │ │ │ │ │ │ +00137 │ │ │ │ │ │ 00138 │ │ │ │ │ │ // the following part is used for checksums // │ │ │ │ │ │ 00140 │ │ │ │ │ │ 00142 │ │ │ │ │ │ siscone::Creference ref; │ │ │ │ │ │ 00143 }; │ │ │ │ │ │ 00144 │ │ │ │ │ │ @@ -15360,16 +16700,16 @@ │ │ │ │ │ │ 00177 │ │ │ │ │ │ inline double mass2() const {return perpmass2()-perp2();} │ │ │ │ │ │ 00179 │ │ │ │ │ │ 00180 │ │ │ │ │ │ inline double perpmass() const {return sqrt((E-pz)*(E+pz));} │ │ │ │ │ │ 00182 │ │ │ │ │ │ 00183 │ │ │ │ │ │ -00185 │ │ │ │ │ │ inline double perpmass2() const {return (E-pz)*(E+pz);} │ │ │ │ │ │ +00185 │ │ │ │ │ │ 00186 │ │ │ │ │ │ inline double Et() const {return E/sqrt(1.0+pz*pz/perp2());} │ │ │ │ │ │ 00188 │ │ │ │ │ │ 00189 │ │ │ │ │ │ inline double Et2() const {return E*E/(1.0+pz*pz/perp2());} │ │ │ │ │ │ 00191 │ │ │ │ │ │ 00192 │ │ │ │ │ │ @@ -15381,21 +16721,21 @@ │ │ │ │ │ │ 00199 │ │ │ │ │ │ 00202 │ │ │ │ │ │ CSphmomentum& operator += (const CSphmomentum &v); │ │ │ │ │ │ 00203 │ │ │ │ │ │ 00206 │ │ │ │ │ │ CSphmomentum& operator -= (const CSphmomentum &v); │ │ │ │ │ │ 00207 │ │ │ │ │ │ -00208 │ │ │ │ │ │ double E; │ │ │ │ │ │ +00208 │ │ │ │ │ │ 00209 │ │ │ │ │ │ int parent_index; │ │ │ │ │ │ 00210 │ │ │ │ │ │ -int index; │ │ │ │ │ │ 00211 │ │ │ │ │ │ +int index; │ │ │ │ │ │ 00212 }; │ │ │ │ │ │ 00213 │ │ │ │ │ │ 00216 bool operator < (const CSphmomentum &v1, const CSphmomentum &v2); │ │ │ │ │ │ 00217 │ │ │ │ │ │ 00219 bool momentum_theta_less(const CSphmomentum &v1, const CSphmomentum &v2); │ │ │ │ │ │ 00220 │ │ │ │ │ │ 00222 bool momentum_pt_less(const CSphmomentum &v1, const CSphmomentum &v2); │ │ │ │ │ │ @@ -15428,166 +16768,3048 @@ │ │ │ │ │ │ 00244 } │ │ │ │ │ │ 00245 │ │ │ │ │ │ 00249 inline CSph3vector cross_product3(const CSph3vector &v1, const CSph3vector &v2){ │ │ │ │ │ │ //CSph3vector tmp; │ │ │ │ │ │ 00250 │ │ │ │ │ │ 00251 │ │ │ │ │ │ //tmp.px = v1.py*v2.pz-v1.pz*v2.py; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -207 │ │ │ │ │ │ - │ │ │ │ │ │ - 208 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00252 │ │ │ │ │ │ //tmp.py = v1.pz*v2.px-v1.px*v2.pz; │ │ │ │ │ │ 00253 │ │ │ │ │ │ //tmp.pz = v1.px*v2.py-v1.py*v2.px; │ │ │ │ │ │ 00254 │ │ │ │ │ │ //return tmp; │ │ │ │ │ │ 00255 │ │ │ │ │ │ return CSph3vector(v1.py*v2.pz-v1.pz*v2.py, │ │ │ │ │ │ 00256 │ │ │ │ │ │ v1.pz*v2.px-v1.px*v2.pz, │ │ │ │ │ │ 00257 │ │ │ │ │ │ v1.px*v2.py-v1.py*v2.px); │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +217 │ │ │ │ │ │ + │ │ │ │ │ │ + 218 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00258 } │ │ │ │ │ │ 00259 │ │ │ │ │ │ 00263 inline double norm2_cross_product3(const CSph3vector &v1, const CSph3vector &v2){ │ │ │ │ │ │ -00264 │ │ │ │ │ │ return sqr(v1.py*v2.pz-v1.pz*v2.py) + sqr(v1.pz*v2.px-v1.px*v2.pz) + sqr(v1.px*v2.py-v1.py*v2.px); │ │ │ │ │ │ +00264 │ │ │ │ │ │ 00265 } │ │ │ │ │ │ 00266 │ │ │ │ │ │ 00270 inline double get_tan2_distance(const CSphmomentum &v1, const CSphmomentum &v2){ │ │ │ │ │ │ -return norm2_cross_product3(v1,v2)/sqr(dot_product3(v1,v2)); │ │ │ │ │ │ 00271 │ │ │ │ │ │ +return norm2_cross_product3(v1,v2)/sqr(dot_product3(v1,v2)); │ │ │ │ │ │ 00272 } │ │ │ │ │ │ 00273 │ │ │ │ │ │ 00277 inline double get_distance(const CSph3vector *v1, const CSph3vector *v2){ │ │ │ │ │ │ -00278 │ │ │ │ │ │ return atan2(sqrt(norm2_cross_product3(*v1,*v2)), dot_product3(*v1,*v2)); │ │ │ │ │ │ +00278 │ │ │ │ │ │ 00279 } │ │ │ │ │ │ 00280 │ │ │ │ │ │ 00289 inline bool is_closer(const CSph3vector *v1, const CSph3vector *v2, const double tan2R){ │ │ │ │ │ │ -00290 │ │ │ │ │ │ double dot = dot_product3(*v1,*v2); │ │ │ │ │ │ +00290 │ │ │ │ │ │ 00291 │ │ │ │ │ │ return (dot>=0) && (norm2_cross_product3(*v1,*v2)<=tan2R*dot*dot); │ │ │ │ │ │ 00292 } │ │ │ │ │ │ 00293 │ │ │ │ │ │ 00299 inline bool is_closer_safer(const CSph3vector *v1, const CSph3vector *v2, const double cosR){ │ │ │ │ │ │ -00300 │ │ │ │ │ │ return dot_product3(*v1,*v2)>=cosR*sqrt(v1->norm2()*v2->norm2()); │ │ │ │ │ │ -//double dot = dot_product3(*v1,*v2); │ │ │ │ │ │ +00300 │ │ │ │ │ │ 00301 │ │ │ │ │ │ +//double dot = dot_product3(*v1,*v2); │ │ │ │ │ │ 00302 │ │ │ │ │ │ //return (dot>=0) && (norm2_cross_product3(*v1,*v2) │ │ │ │ │ │ -00034 #include │ │ │ │ │ │ -00035 #include │ │ │ │ │ │ -00036 #include "hash.h" │ │ │ │ │ │ -00037 │ │ │ │ │ │ -00038 #include "defines.h" │ │ │ │ │ │ -00039 │ │ │ │ │ │ -00040 namespace siscone{ │ │ │ │ │ │ -00041 │ │ │ │ │ │ -00053 class Cborder_store{ │ │ │ │ │ │ -00054 public: │ │ │ │ │ │ -00056 │ │ │ │ │ │ -Cborder_store(Cmomentum * momentum, double centre_eta, double centre_phi) : │ │ │ │ │ │ -00057 │ │ │ │ │ │ -mom(momentum), is_in(false) { │ │ │ │ │ │ +00026 │ │ │ │ │ │ +00027 /******************************************************* │ │ │ │ │ │ +00028 * Introductory note: │ │ │ │ │ │ +* │ │ │ │ │ │ +00029 * Since this file has many member functions, we have * │ │ │ │ │ │ +00030 * structured them in categories: │ │ │ │ │ │ +* │ │ │ │ │ │ +00031 * INITIALISATION FUNCTIONS │ │ │ │ │ │ +* │ │ │ │ │ │ +00032 * - ctor() │ │ │ │ │ │ +* │ │ │ │ │ │ +00033 * - ctor(particle_list) │ │ │ │ │ │ +* │ │ │ │ │ │ +00034 * - dtor() │ │ │ │ │ │ +* │ │ │ │ │ │ +00035 * - init(particle_list) │ │ │ │ │ │ +* │ │ │ │ │ │ +00036 * ALGORITHM MAIN ENTRY │ │ │ │ │ │ +* │ │ │ │ │ │ +00037 * - get_stable_cone(radius) │ │ │ │ │ │ +* │ │ │ │ │ │ +00038 * ALGORITHM MAIN STEPS │ │ │ │ │ │ +* │ │ │ │ │ │ +00039 * - init_cone() │ │ │ │ │ │ +* │ │ │ │ │ │ +00040 * - test_cone() │ │ │ │ │ │ +* │ │ │ │ │ │ +00041 * - update_cone() │ │ │ │ │ │ +* │ │ │ │ │ │ +00042 * - proceed_with_stability() │ │ │ │ │ │ +* │ │ │ │ │ │ +00043 * ALGORITHM MAIN STEPS FOR COCIRCULAR SITUATIONS │ │ │ │ │ │ +* │ │ │ │ │ │ +00044 * - cocircular_pt_less(v1, v2) │ │ │ │ │ │ +* │ │ │ │ │ │ +00045 * - prepare_cocircular_list() │ │ │ │ │ │ +* │ │ │ │ │ │ +00046 * - test_cone_cocircular() │ │ │ │ │ │ +* │ │ │ │ │ │ +00047 * - test_stability(candidate, border_list) │ │ │ │ │ │ +* │ │ │ │ │ │ +00048 * - updat_cone_cocircular() │ │ │ │ │ │ +* │ │ │ │ │ │ +00049 * RECOMPUTATION OF CONE CONTENTS │ │ │ │ │ │ +* │ │ │ │ │ │ +00050 * - compute_cone_contents() │ │ │ │ │ │ +* │ │ │ │ │ │ │ │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 5.22 protocones.h │ │ │ │ │ │ + 5.26 protocones.cpp │ │ │ │ │ │ │ │ │ │ │ │ +00051 * - recompute_cone_contents() │ │ │ │ │ │ +* │ │ │ │ │ │ +00052 * - recompute_cone_contents_if_needed() │ │ │ │ │ │ +* │ │ │ │ │ │ +00053 * VARIOUS TOOLS │ │ │ │ │ │ +* │ │ │ │ │ │ +00054 * - circle_intersect() │ │ │ │ │ │ +* │ │ │ │ │ │ +00055 * - is_inside() │ │ │ │ │ │ +* │ │ │ │ │ │ +00056 * - abs_dangle() │ │ │ │ │ │ +* │ │ │ │ │ │ +00057 *******************************************************/ │ │ │ │ │ │ 00058 │ │ │ │ │ │ -angle = atan2(mom->phi - centre_phi, mom->eta - centre_eta); │ │ │ │ │ │ -00059 │ │ │ │ │ │ -} │ │ │ │ │ │ -00060 │ │ │ │ │ │ -00061 │ │ │ │ │ │ -Cmomentum * mom; │ │ │ │ │ │ -double angle; │ │ │ │ │ │ -00062 │ │ │ │ │ │ -00063 │ │ │ │ │ │ -bool │ │ │ │ │ │ -is_in; │ │ │ │ │ │ -00064 }; │ │ │ │ │ │ -00065 │ │ │ │ │ │ +00059 #include "protocones.h" │ │ │ │ │ │ +00060 #include "siscone_error.h" │ │ │ │ │ │ +00061 #include "defines.h" │ │ │ │ │ │ +00062 #include │ │ │ │ │ │ +00063 #include │ │ │ │ │ │ +00064 #include "circulator.h" │ │ │ │ │ │ +00065 #include │ │ │ │ │ │ 00066 │ │ │ │ │ │ -00069 inline bool operator<(const Cborder_store & a, const Cborder_store & b) { │ │ │ │ │ │ -00070 │ │ │ │ │ │ +00067 namespace siscone{ │ │ │ │ │ │ +00068 │ │ │ │ │ │ +00069 using namespace std; │ │ │ │ │ │ +00070 │ │ │ │ │ │ +00071 /********************************************************************** │ │ │ │ │ │ +00072 * Cstable_cones implementation │ │ │ │ │ │ +* │ │ │ │ │ │ +00073 * Computes the list of stable comes from a particle list. │ │ │ │ │ │ +* │ │ │ │ │ │ +00074 * This class does the first fundamental task of te cone algorithm: │ │ │ │ │ │ +* │ │ │ │ │ │ +00075 * it is used to compute the list of stable cones given a list │ │ │ │ │ │ +* │ │ │ │ │ │ +00076 * of particles. │ │ │ │ │ │ +* │ │ │ │ │ │ +00077 **********************************************************************/ │ │ │ │ │ │ +00078 │ │ │ │ │ │ +00080 // INITIALISATION FUNCTIONS │ │ │ │ │ │ +// │ │ │ │ │ │ +00081 // - ctor() │ │ │ │ │ │ +// │ │ │ │ │ │ +00082 // - ctor(particle_list) │ │ │ │ │ │ +// │ │ │ │ │ │ +00083 // - dtor() │ │ │ │ │ │ +// │ │ │ │ │ │ +00084 // - init(particle_list) │ │ │ │ │ │ +// │ │ │ │ │ │ +00086 │ │ │ │ │ │ +00087 // default ctor │ │ │ │ │ │ +00088 //-------------00089 Cstable_cones::Cstable_cones(){ │ │ │ │ │ │ +00090 │ │ │ │ │ │ +nb_tot = 0; │ │ │ │ │ │ +00091 │ │ │ │ │ │ +hc = NULL; │ │ │ │ │ │ +00092 } │ │ │ │ │ │ +00093 │ │ │ │ │ │ +00094 // ctor with initialisation │ │ │ │ │ │ +00095 //-------------------------00096 Cstable_cones::Cstable_cones(vector &_particle_list) │ │ │ │ │ │ +00097 │ │ │ │ │ │ +: Cvicinity(_particle_list){ │ │ │ │ │ │ +00098 │ │ │ │ │ │ +00099 │ │ │ │ │ │ +nb_tot = 0; │ │ │ │ │ │ +00100 │ │ │ │ │ │ +hc = NULL; │ │ │ │ │ │ +00101 } │ │ │ │ │ │ +00102 │ │ │ │ │ │ +00103 // default dtor │ │ │ │ │ │ +00104 //-------------00105 Cstable_cones::~Cstable_cones(){ │ │ │ │ │ │ +if (hc!=NULL) delete hc; │ │ │ │ │ │ +00106 │ │ │ │ │ │ +00107 } │ │ │ │ │ │ +00108 │ │ │ │ │ │ +00109 /* │ │ │ │ │ │ +00110 * initialisation │ │ │ │ │ │ +00111 * - _particle_list list of particles │ │ │ │ │ │ +00112 * - _n │ │ │ │ │ │ +number of particles │ │ │ │ │ │ +00113 *********************************************************************/ │ │ │ │ │ │ +00114 void Cstable_cones::init(vector &_particle_list){ │ │ │ │ │ │ +00115 │ │ │ │ │ │ +// check already allocated mem │ │ │ │ │ │ +00116 │ │ │ │ │ │ +if (hc!=NULL){ │ │ │ │ │ │ +00117 │ │ │ │ │ │ +delete hc; │ │ │ │ │ │ +00118 │ │ │ │ │ │ +} │ │ │ │ │ │ +if (protocones.size()!=0) │ │ │ │ │ │ +00119 │ │ │ │ │ │ +00120 │ │ │ │ │ │ +protocones.clear(); │ │ │ │ │ │ +00121 │ │ │ │ │ │ +00122 │ │ │ │ │ │ +multiple_centre_done.clear(); │ │ │ │ │ │ +00123 │ │ │ │ │ │ +00124 │ │ │ │ │ │ +// initialisation │ │ │ │ │ │ +00125 │ │ │ │ │ │ +set_particle_list(_particle_list); │ │ │ │ │ │ +00126 } │ │ │ │ │ │ +00127 │ │ │ │ │ │ +00128 │ │ │ │ │ │ +00130 // ALGORITHM MAIN ENTRY │ │ │ │ │ │ +// │ │ │ │ │ │ +00131 // - get_stable_cone(radius) │ │ │ │ │ │ +// │ │ │ │ │ │ +00133 │ │ │ │ │ │ +00134 /* │ │ │ │ │ │ +00135 * compute stable cones. │ │ │ │ │ │ +00136 * This function really does the job i.e. computes │ │ │ │ │ │ +00137 * the list of stable cones (in a seedless way) │ │ │ │ │ │ +00138 * - _radius: radius of the cones │ │ │ │ │ │ +00139 * The number of stable cones found is returned │ │ │ │ │ │ +00140 *********************************************************************/ │ │ │ │ │ │ +00141 int Cstable_cones::get_stable_cones(double _radius){ │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +219 │ │ │ │ │ │ + │ │ │ │ │ │ + 220 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +00142 │ │ │ │ │ │ +int p_idx; │ │ │ │ │ │ +00143 │ │ │ │ │ │ +// check if everything is correctly initialised │ │ │ │ │ │ +00144 │ │ │ │ │ │ +00145 │ │ │ │ │ │ +if (n_part==0){ │ │ │ │ │ │ +00146 │ │ │ │ │ │ +return 0; │ │ │ │ │ │ +00147 │ │ │ │ │ │ +} │ │ │ │ │ │ +00148 │ │ │ │ │ │ +00149 │ │ │ │ │ │ +R = _radius; │ │ │ │ │ │ +00150 │ │ │ │ │ │ +R2 = R*R; │ │ │ │ │ │ +00151 │ │ │ │ │ │ +00152 │ │ │ │ │ │ +// allow hash for cones candidates │ │ │ │ │ │ +00153 │ │ │ │ │ │ +hc = new hash_cones(n_part, R2); │ │ │ │ │ │ +00154 │ │ │ │ │ │ +// browse all particles │ │ │ │ │ │ +00155 │ │ │ │ │ │ +00156 │ │ │ │ │ │ +for (p_idx=0;p_idxv; │ │ │ │ │ │ +00216 │ │ │ │ │ │ +centre_idx = first_cone; │ │ │ │ │ │ +00217 │ │ │ │ │ │ +00218 │ │ │ │ │ │ +// build the initial cone (nodist: avoids calculating distances -00219 │ │ │ │ │ │ +// just deduces contents by circulating around all in/out operations) │ │ │ │ │ │ +00220 │ │ │ │ │ │ +// this function also sets the list of included particles │ │ │ │ │ │ +00221 │ │ │ │ │ │ +compute_cone_contents(); │ │ │ │ │ │ +00222 │ │ │ │ │ │ +return 0; │ │ │ │ │ │ +00223 │ │ │ │ │ │ +00224 } │ │ │ │ │ │ +00225 │ │ │ │ │ │ +00226 │ │ │ │ │ │ +00227 /* │ │ │ │ │ │ +00228 * test cones. │ │ │ │ │ │ +00229 * We check if the cone(s) built with the present parent and child │ │ │ │ │ │ +00230 * are stable │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.26 protocones.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +00231 * return 0 on success 1 on error │ │ │ │ │ │ +00232 *********************************************************************/ │ │ │ │ │ │ +00233 int Cstable_cones::test_cone(){ │ │ │ │ │ │ +00234 │ │ │ │ │ │ +Creference weighted_cone_ref; │ │ │ │ │ │ +00235 │ │ │ │ │ │ +00236 │ │ │ │ │ │ +// depending on the side we are taking the child particle, │ │ │ │ │ │ +00237 │ │ │ │ │ │ +// we test different configuration. │ │ │ │ │ │ +00238 │ │ │ │ │ │ +// Each time, two configurations are tested in such a way that │ │ │ │ │ │ +00239 │ │ │ │ │ │ +// all 4 possible cases (parent or child in or out the cone) │ │ │ │ │ │ +00240 │ │ │ │ │ │ +// are tested when taking the pair of particle parent+child │ │ │ │ │ │ +00241 │ │ │ │ │ │ +// and child+parent. │ │ │ │ │ │ +00242 │ │ │ │ │ │ +00243 │ │ │ │ │ │ +// here are the tests entering the first series: │ │ │ │ │ │ +00244 │ │ │ │ │ │ +// 1. check if the cone is already inserted │ │ │ │ │ │ +00245 │ │ │ │ │ │ +// 2. check cone stability for the parent and child particles │ │ │ │ │ │ +00246 │ │ │ │ │ │ +00247 │ │ │ │ │ │ +if (centre->side){ │ │ │ │ │ │ +00248 │ │ │ │ │ │ +// test when both particles are not in the cone │ │ │ │ │ │ +00249 │ │ │ │ │ │ +// or when both are in. │ │ │ │ │ │ +00250 │ │ │ │ │ │ +// Note: for the totally exclusive case, test emptyness before │ │ │ │ │ │ +00251 │ │ │ │ │ │ +cone_candidate = cone; │ │ │ │ │ │ +00252 │ │ │ │ │ │ +if (cone.ref.not_empty()){ │ │ │ │ │ │ +00253 │ │ │ │ │ │ +hc->insert(&cone_candidate, parent, child, false, false); │ │ │ │ │ │ +00254 │ │ │ │ │ │ +} │ │ │ │ │ │ +00255 │ │ │ │ │ │ +00256 │ │ │ │ │ │ +cone_candidate = cone; │ │ │ │ │ │ +00257 │ │ │ │ │ │ +cone_candidate+= *parent + *child; │ │ │ │ │ │ +00258 │ │ │ │ │ │ +hc->insert(&cone_candidate, parent, child, true, true); │ │ │ │ │ │ +00259 │ │ │ │ │ │ +} else { │ │ │ │ │ │ +00260 │ │ │ │ │ │ +// test when 1! of the particles is in the cone │ │ │ │ │ │ +00261 │ │ │ │ │ │ +cone_candidate = cone + *parent; │ │ │ │ │ │ +00262 │ │ │ │ │ │ +hc->insert(&cone_candidate, parent, child, true, false); │ │ │ │ │ │ +00263 │ │ │ │ │ │ +00264 │ │ │ │ │ │ +cone_candidate = cone + *child; │ │ │ │ │ │ +00265 │ │ │ │ │ │ +hc->insert(&cone_candidate, parent, child, false, true); │ │ │ │ │ │ +00266 │ │ │ │ │ │ +} │ │ │ │ │ │ +00267 │ │ │ │ │ │ +00268 │ │ │ │ │ │ +nb_tot+=2; │ │ │ │ │ │ +00269 │ │ │ │ │ │ +return 0; │ │ │ │ │ │ +00270 │ │ │ │ │ │ +00271 } │ │ │ │ │ │ +00272 │ │ │ │ │ │ +00273 │ │ │ │ │ │ +00274 /* │ │ │ │ │ │ +00275 * update the cone │ │ │ │ │ │ +00276 * go to the next child for that parent and update ’cone’ appropriately │ │ │ │ │ │ +00277 * return 0 if update candidate found, 1 otherwise │ │ │ │ │ │ +00278 ***********************************************************************/ │ │ │ │ │ │ +00279 int Cstable_cones::update_cone(){ │ │ │ │ │ │ +// get the next child and centre │ │ │ │ │ │ +00280 │ │ │ │ │ │ +00281 │ │ │ │ │ │ +centre_idx++; │ │ │ │ │ │ +if (centre_idx==vicinity_size) │ │ │ │ │ │ +00282 │ │ │ │ │ │ +00283 │ │ │ │ │ │ +centre_idx=0; │ │ │ │ │ │ +if (centre_idx==first_cone) │ │ │ │ │ │ +00284 │ │ │ │ │ │ +00285 │ │ │ │ │ │ +return 1; │ │ │ │ │ │ +00286 │ │ │ │ │ │ +// update the cone w.r.t. the old child │ │ │ │ │ │ +00287 │ │ │ │ │ │ +00288 │ │ │ │ │ │ +// only required if the old child is entering inside in which │ │ │ │ │ │ +00289 │ │ │ │ │ │ +// case we need to add it. We also know that the child is │ │ │ │ │ │ +00290 │ │ │ │ │ │ +// inside iff its side is -. │ │ │ │ │ │ +00291 │ │ │ │ │ │ +if (!centre->side){ │ │ │ │ │ │ +// update cone │ │ │ │ │ │ +00292 │ │ │ │ │ │ +00293 │ │ │ │ │ │ +cone += (*child); │ │ │ │ │ │ +00294 │ │ │ │ │ │ +// update info on particles inside │ │ │ │ │ │ +00295 │ │ │ │ │ │ +00296 │ │ │ │ │ │ +centre->is_inside->cone = true; │ │ │ │ │ │ +00297 │ │ │ │ │ │ +00298 │ │ │ │ │ │ +// update stability check quantities │ │ │ │ │ │ +00299 │ │ │ │ │ │ +dpt += fabs(child->px)+fabs(child->py); │ │ │ │ │ │ +00300 │ │ │ │ │ │ +} │ │ │ │ │ │ +00301 │ │ │ │ │ │ +00302 │ │ │ │ │ │ +// update centre and child to correspond to the new position │ │ │ │ │ │ +00303 │ │ │ │ │ │ +centre = vicinity[centre_idx]; │ │ │ │ │ │ +00304 │ │ │ │ │ │ +child = centre->v; │ │ │ │ │ │ +00305 │ │ │ │ │ │ +00306 │ │ │ │ │ │ +// check cocircularity │ │ │ │ │ │ +00307 │ │ │ │ │ │ +// note that if cocirculaity is detected (i.e. if we receive 1 │ │ │ │ │ │ +00308 │ │ │ │ │ │ +// in the next test), we need to recall ’update_cone’ directly │ │ │ │ │ │ +00309 │ │ │ │ │ │ +// since tests and remaining part of te update has been performed │ │ │ │ │ │ +00310 │ │ │ │ │ │ +//if (cocircular_check()) │ │ │ │ │ │ +00311 │ │ │ │ │ │ +if (cocircular_check()) │ │ │ │ │ │ +00312 │ │ │ │ │ │ +return update_cone(); │ │ │ │ │ │ +00313 │ │ │ │ │ │ +00314 │ │ │ │ │ │ +// update the cone w.r.t. the new child │ │ │ │ │ │ +00315 │ │ │ │ │ │ +00316 │ │ │ │ │ │ +// only required if the new child was already inside in which │ │ │ │ │ │ +00317 │ │ │ │ │ │ +// case we need to remove it. We also know that the child is │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +221 │ │ │ │ │ │ + │ │ │ │ │ │ + 222 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +00318 │ │ │ │ │ │ +// inside iff its side is +. │ │ │ │ │ │ +00319 │ │ │ │ │ │ +if ((centre->side) && (cone.ref.not_empty())){ │ │ │ │ │ │ +00320 │ │ │ │ │ │ +// update cone │ │ │ │ │ │ +00321 │ │ │ │ │ │ +cone -= (*child); │ │ │ │ │ │ +00322 │ │ │ │ │ │ +00323 │ │ │ │ │ │ +// update info on particles inside │ │ │ │ │ │ +00324 │ │ │ │ │ │ +centre->is_inside->cone = false; │ │ │ │ │ │ +00325 │ │ │ │ │ │ +// update stability check quantities │ │ │ │ │ │ +00326 │ │ │ │ │ │ +00327 │ │ │ │ │ │ +dpt += fabs(child->px)+fabs(child->py); //child->perp2(); │ │ │ │ │ │ +00328 │ │ │ │ │ │ +} │ │ │ │ │ │ +00329 │ │ │ │ │ │ +// check that the addition and subtraction of vectors does │ │ │ │ │ │ +00330 │ │ │ │ │ │ +00331 │ │ │ │ │ │ +// not lead to too much rounding error │ │ │ │ │ │ +00332 │ │ │ │ │ │ +// for that, we compute the sum of pt modifications and of |pt| │ │ │ │ │ │ +00333 │ │ │ │ │ │ +// since last recomputation and once the ratio overpasses a threshold │ │ │ │ │ │ +00334 │ │ │ │ │ │ +// we recompute vicinity. │ │ │ │ │ │ +00335 │ │ │ │ │ │ +if ((dpt>PT_TSHOLD*(fabs(cone.px)+fabs(cone.py))) && (cone.ref.not_empty())){ │ │ │ │ │ │ +00336 │ │ │ │ │ │ +recompute_cone_contents(); │ │ │ │ │ │ +00337 │ │ │ │ │ │ +} │ │ │ │ │ │ +if (cone.ref.is_empty()){ │ │ │ │ │ │ +00338 │ │ │ │ │ │ +00339 │ │ │ │ │ │ +cone = Cmomentum(); │ │ │ │ │ │ +00340 │ │ │ │ │ │ +dpt=0.0; │ │ │ │ │ │ +00341 │ │ │ │ │ │ +} │ │ │ │ │ │ +00342 │ │ │ │ │ │ +return 0; │ │ │ │ │ │ +00343 │ │ │ │ │ │ +00344 } │ │ │ │ │ │ +00345 │ │ │ │ │ │ +00346 │ │ │ │ │ │ +00347 /* │ │ │ │ │ │ +00348 * compute stability of all enumerated candidates. │ │ │ │ │ │ +00349 * For all candidate cones which are stable w.r.t. their border particles, │ │ │ │ │ │ +00350 * pass the last test: stability with quadtree intersection │ │ │ │ │ │ +00351 ************************************************************************/ │ │ │ │ │ │ +00352 int Cstable_cones::proceed_with_stability(){ │ │ │ │ │ │ +00353 │ │ │ │ │ │ +int i; // ,n; │ │ │ │ │ │ +00354 │ │ │ │ │ │ +hash_element *elm; │ │ │ │ │ │ +00355 │ │ │ │ │ │ +//n=0; │ │ │ │ │ │ +00356 │ │ │ │ │ │ +00357 │ │ │ │ │ │ +for (i=0;i<=hc->mask;i++){ │ │ │ │ │ │ +00358 │ │ │ │ │ │ +// test ith cell of the hash array │ │ │ │ │ │ +00359 │ │ │ │ │ │ +elm = hc->hash_array[i]; │ │ │ │ │ │ +00360 │ │ │ │ │ │ +// browse elements therein │ │ │ │ │ │ +00361 │ │ │ │ │ │ +00362 │ │ │ │ │ │ +while (elm!=NULL){ │ │ │ │ │ │ +00363 │ │ │ │ │ │ +// test stability │ │ │ │ │ │ +00364 │ │ │ │ │ │ +if (elm->is_stable){ │ │ │ │ │ │ +00365 │ │ │ │ │ │ +// stability is not ensured by all pairs of "edges" already browsed │ │ │ │ │ │ +00366 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ +00367 │ │ │ │ │ │ +// => testing stability with quadtree intersection │ │ │ │ │ │ +00368 │ │ │ │ │ │ +if (quadtree->circle_intersect(elm->eta, elm->phi, R2)==elm->ref){ │ │ │ │ │ │ +00369 #else │ │ │ │ │ │ +00370 │ │ │ │ │ │ +// => testing stability with the particle-list intersection │ │ │ │ │ │ +00371 │ │ │ │ │ │ +if (circle_intersect(elm->eta, elm->phi)==elm->ref){ │ │ │ │ │ │ +00372 #endif │ │ │ │ │ │ +00373 │ │ │ │ │ │ +// add it to the list of protocones │ │ │ │ │ │ +00374 │ │ │ │ │ │ +// note that in its present form, we do not allocate the │ │ │ │ │ │ +00375 │ │ │ │ │ │ +// 4-vector components of the momentum. There’s no need to │ │ │ │ │ │ +00376 │ │ │ │ │ │ +// do it here as it will be recomputed in │ │ │ │ │ │ +00377 │ │ │ │ │ │ +// │ │ │ │ │ │ +Csplit_merge::add_protocones │ │ │ │ │ │ +00378 │ │ │ │ │ │ +protocones.push_back(Cmomentum(elm->eta, elm->phi, elm->ref)); │ │ │ │ │ │ +00379 │ │ │ │ │ │ +} │ │ │ │ │ │ +00380 │ │ │ │ │ │ +} │ │ │ │ │ │ +00381 │ │ │ │ │ │ +// jump to the next one │ │ │ │ │ │ +00382 │ │ │ │ │ │ +00383 │ │ │ │ │ │ +elm = elm->next; │ │ │ │ │ │ +00384 │ │ │ │ │ │ +} │ │ │ │ │ │ +00385 │ │ │ │ │ │ +} │ │ │ │ │ │ +00386 │ │ │ │ │ │ +00387 │ │ │ │ │ │ +// free hash │ │ │ │ │ │ +00388 │ │ │ │ │ │ +// we do that at this level because hash eats rather a lot of memory │ │ │ │ │ │ +00389 │ │ │ │ │ │ +// we want to free it before running the split/merge algorithm │ │ │ │ │ │ +00390 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ +00391 │ │ │ │ │ │ +nb_hash_cones = hc->n_cones; │ │ │ │ │ │ +00392 │ │ │ │ │ │ +nb_hash_occupied = hc->n_occupied_cells; │ │ │ │ │ │ +00393 #endif │ │ │ │ │ │ +00394 │ │ │ │ │ │ +delete hc; │ │ │ │ │ │ +00395 │ │ │ │ │ │ +00396 │ │ │ │ │ │ +hc=NULL; │ │ │ │ │ │ +00397 │ │ │ │ │ │ +00398 │ │ │ │ │ │ +return protocones.size(); │ │ │ │ │ │ +00399 } │ │ │ │ │ │ +00400 │ │ │ │ │ │ +00401 │ │ │ │ │ │ +// │ │ │ │ │ │ +00403 // ALGORITHM MAIN STEPS FOR COCIRCULAR SITUATIONS │ │ │ │ │ │ +00404 // - cocircular_pt_less(v1, v2) │ │ │ │ │ │ +// │ │ │ │ │ │ +00405 // - prepare_cocircular_list() │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.26 protocones.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +00406 // - test_cone_cocircular() │ │ │ │ │ │ +// │ │ │ │ │ │ +00407 // - test_stability(candidate, border_vect) │ │ │ │ │ │ +// │ │ │ │ │ │ +00408 // - updat_cone_cocircular() │ │ │ │ │ │ +// │ │ │ │ │ │ +00410 │ │ │ │ │ │ +00412 bool cocircular_pt_less(Cmomentum *v1, Cmomentum *v2){ │ │ │ │ │ │ +00413 │ │ │ │ │ │ +return v1->perp2() < v2->perp2(); │ │ │ │ │ │ +00414 } │ │ │ │ │ │ +00415 │ │ │ │ │ │ +00416 /* │ │ │ │ │ │ +00417 * run through the vicinity of the current parent and for each child │ │ │ │ │ │ +00418 * establish which other members are cocircular... Note that the list │ │ │ │ │ │ +00419 * associated with each child contains references to vicinity │ │ │ │ │ │ +00420 * elements: thus two vicinity elements each associated with one given │ │ │ │ │ │ +00421 * particle may appear in a list -- this needs to be watched out for │ │ │ │ │ │ +00422 * later on... │ │ │ │ │ │ +00423 **********************************************************************/ │ │ │ │ │ │ +00424 void Cstable_cones::prepare_cocircular_lists() { │ │ │ │ │ │ +00425 │ │ │ │ │ │ +circulator::iterator > here(vicinity.begin(), │ │ │ │ │ │ +00426 │ │ │ │ │ │ +vicinity.begin(), │ │ │ │ │ │ +00427 │ │ │ │ │ │ +vicinity.end()); │ │ │ │ │ │ +00428 │ │ │ │ │ │ +00429 │ │ │ │ │ │ +circulator::iterator > search(here); │ │ │ │ │ │ +00430 │ │ │ │ │ │ +00431 │ │ │ │ │ │ +do { │ │ │ │ │ │ +00432 │ │ │ │ │ │ +Cvicinity_elm* here_pntr = *here(); │ │ │ │ │ │ +00433 │ │ │ │ │ │ +search.set_position(here); │ │ │ │ │ │ +00434 │ │ │ │ │ │ +// search forwards for things that should have "here" included in │ │ │ │ │ │ +00435 │ │ │ │ │ │ +00436 │ │ │ │ │ │ +// their cocircularity list │ │ │ │ │ │ +00437 │ │ │ │ │ │ +while (true) { │ │ │ │ │ │ +00438 │ │ │ │ │ │ +++search; │ │ │ │ │ │ +if ( abs_dphi((*search())->angle, here_pntr->angle) < │ │ │ │ │ │ +00439 │ │ │ │ │ │ +00440 │ │ │ │ │ │ +here_pntr->cocircular_range │ │ │ │ │ │ +00441 │ │ │ │ │ │ +&& search() != here()) { │ │ │ │ │ │ +00442 │ │ │ │ │ │ +(*search())->cocircular.push_back(here_pntr); │ │ │ │ │ │ +00443 │ │ │ │ │ │ +} else { │ │ │ │ │ │ +00444 │ │ │ │ │ │ +break; │ │ │ │ │ │ +00445 │ │ │ │ │ │ +} │ │ │ │ │ │ +00446 │ │ │ │ │ │ +} │ │ │ │ │ │ +00447 │ │ │ │ │ │ +// search backwards │ │ │ │ │ │ +00448 │ │ │ │ │ │ +00449 │ │ │ │ │ │ +search.set_position(here); │ │ │ │ │ │ +while (true) { │ │ │ │ │ │ +00450 │ │ │ │ │ │ +00451 │ │ │ │ │ │ +--search; │ │ │ │ │ │ +if ( abs_dphi((*search())->angle, here_pntr->angle) < │ │ │ │ │ │ +00452 │ │ │ │ │ │ +00453 │ │ │ │ │ │ +here_pntr->cocircular_range │ │ │ │ │ │ +00454 │ │ │ │ │ │ +&& search() != here()) { │ │ │ │ │ │ +00455 │ │ │ │ │ │ +(*search())->cocircular.push_back(here_pntr); │ │ │ │ │ │ +00456 │ │ │ │ │ │ +} else { │ │ │ │ │ │ +break; │ │ │ │ │ │ +00457 │ │ │ │ │ │ +00458 │ │ │ │ │ │ +} │ │ │ │ │ │ +00459 │ │ │ │ │ │ +} │ │ │ │ │ │ +00460 │ │ │ │ │ │ +00461 │ │ │ │ │ │ +++here; │ │ │ │ │ │ +00462 │ │ │ │ │ │ +} while (here() != vicinity.begin()); │ │ │ │ │ │ +00463 │ │ │ │ │ │ +00464 } │ │ │ │ │ │ +00465 │ │ │ │ │ │ +00466 /* │ │ │ │ │ │ +00467 * Testing cocircular configurations in p^3 time, │ │ │ │ │ │ +00468 * rather than 2^p time; we will test all contiguous subsets of points │ │ │ │ │ │ +00469 * on the border --- note that this is till probably overkill, since │ │ │ │ │ │ +00470 * in principle we only have to test situations where up to a │ │ │ │ │ │ +00471 * half-circle is filled (but going to a full circle is simpler) │ │ │ │ │ │ +00472 ******************************************************************/ │ │ │ │ │ │ +00473 void Cstable_cones::test_cone_cocircular(Cmomentum & borderless_cone, │ │ │ │ │ │ +00474 │ │ │ │ │ │ +list & border_list) { │ │ │ │ │ │ +00475 │ │ │ │ │ │ +vector border_vect; │ │ │ │ │ │ +00476 │ │ │ │ │ │ +00477 │ │ │ │ │ │ +border_vect.reserve(border_list.size()); │ │ │ │ │ │ +00478 │ │ │ │ │ │ +for (list::iterator it = border_list.begin(); │ │ │ │ │ │ +00479 │ │ │ │ │ │ +it != border_list.end(); it++) { │ │ │ │ │ │ +00480 │ │ │ │ │ │ +border_vect.push_back(Cborder_store(*it, centre->eta, centre->phi)); │ │ │ │ │ │ +00481 │ │ │ │ │ │ +} │ │ │ │ │ │ +00482 │ │ │ │ │ │ +// get them into order of angle │ │ │ │ │ │ +00483 │ │ │ │ │ │ +00484 │ │ │ │ │ │ +sort(border_vect.begin(), border_vect.end()); │ │ │ │ │ │ +00485 │ │ │ │ │ │ +// set up some circulators, since these will help us go around the │ │ │ │ │ │ +00486 │ │ │ │ │ │ +00487 │ │ │ │ │ │ +// circle easily │ │ │ │ │ │ +00488 │ │ │ │ │ │ +circulator::iterator > │ │ │ │ │ │ +00489 │ │ │ │ │ │ +start(border_vect.begin(), border_vect.begin(),border_vect.end()); │ │ │ │ │ │ +00490 │ │ │ │ │ │ +circulator::iterator > mid(start), end(start); │ │ │ │ │ │ +00491 │ │ │ │ │ │ +00492 │ │ │ │ │ │ +// test the borderless cone │ │ │ │ │ │ +00493 │ │ │ │ │ │ +Cmomentum candidate = borderless_cone; │ │ │ │ │ │ +00494 │ │ │ │ │ │ +candidate.build_etaphi(); │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +223 │ │ │ │ │ │ + │ │ │ │ │ │ + 224 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +00495 │ │ │ │ │ │ +if (candidate.ref.not_empty()) │ │ │ │ │ │ +00496 │ │ │ │ │ │ +test_stability(candidate, border_vect); │ │ │ │ │ │ +00497 │ │ │ │ │ │ +do { │ │ │ │ │ │ +00498 │ │ │ │ │ │ +00499 │ │ │ │ │ │ +// reset status wrt inclusion in the cone │ │ │ │ │ │ +00500 │ │ │ │ │ │ +mid = start; │ │ │ │ │ │ +do { │ │ │ │ │ │ +00501 │ │ │ │ │ │ +00502 │ │ │ │ │ │ +mid()->is_in = false; │ │ │ │ │ │ +00503 │ │ │ │ │ │ +} while (++mid != start); │ │ │ │ │ │ +00504 │ │ │ │ │ │ +00505 │ │ │ │ │ │ +// now run over all inclusion possibilities with this starting point │ │ │ │ │ │ +00506 │ │ │ │ │ │ +candidate = borderless_cone; │ │ │ │ │ │ +00507 │ │ │ │ │ │ +while (++mid != start) { │ │ │ │ │ │ +// will begin with start+1 and go up to start-1 │ │ │ │ │ │ +00508 │ │ │ │ │ │ +00509 │ │ │ │ │ │ +mid()->is_in = true; │ │ │ │ │ │ +00510 │ │ │ │ │ │ +candidate += *(mid()->mom); │ │ │ │ │ │ +00511 │ │ │ │ │ │ +test_stability(candidate, border_vect); │ │ │ │ │ │ +00512 │ │ │ │ │ │ +} │ │ │ │ │ │ +00513 │ │ │ │ │ │ +00514 │ │ │ │ │ │ +} while (++start != end); │ │ │ │ │ │ +00515 │ │ │ │ │ │ +// mid corresponds to momentum that we need to include to get the │ │ │ │ │ │ +00516 │ │ │ │ │ │ +00517 │ │ │ │ │ │ +// full cone │ │ │ │ │ │ +00518 │ │ │ │ │ │ +mid()->is_in = true; │ │ │ │ │ │ +00519 │ │ │ │ │ │ +candidate += *(mid()->mom); │ │ │ │ │ │ +00520 │ │ │ │ │ │ +test_stability(candidate, border_vect); │ │ │ │ │ │ +00521 } │ │ │ │ │ │ +00522 │ │ │ │ │ │ +00523 │ │ │ │ │ │ +00530 void Cstable_cones::test_stability(Cmomentum & candidate, const vector & border_vect) { │ │ │ │ │ │ +00531 │ │ │ │ │ │ +// this almost certainly has not been done... │ │ │ │ │ │ +00532 │ │ │ │ │ │ +00533 │ │ │ │ │ │ +candidate.build_etaphi(); │ │ │ │ │ │ +00534 │ │ │ │ │ │ +bool stable = true; │ │ │ │ │ │ +00535 │ │ │ │ │ │ +00536 │ │ │ │ │ │ +for (unsigned i = 0; i < border_vect.size(); i++) { │ │ │ │ │ │ +00537 │ │ │ │ │ │ +if (is_inside(&candidate, border_vect[i].mom) ^ (border_vect[i].is_in)) { │ │ │ │ │ │ +00538 │ │ │ │ │ │ +stable = false; │ │ │ │ │ │ +00539 │ │ │ │ │ │ +break; // it’s unstable so there’s no point continuing │ │ │ │ │ │ +00540 │ │ │ │ │ │ +} │ │ │ │ │ │ +00541 │ │ │ │ │ │ +} │ │ │ │ │ │ +00542 │ │ │ │ │ │ +00543 │ │ │ │ │ │ +if (stable) hc->insert(&candidate); │ │ │ │ │ │ +00544 } │ │ │ │ │ │ +00545 │ │ │ │ │ │ +00546 /* │ │ │ │ │ │ +00547 * check if we are in a situation of cocircularity. │ │ │ │ │ │ +00548 * if it is the case, update and test in the corresponding way │ │ │ │ │ │ +00549 * return ’false’ if no cocircularity detected, ’true’ otherwise │ │ │ │ │ │ +00550 * Note that if cocircularity is detected, we need to │ │ │ │ │ │ +00551 * recall ’update’ from ’update’ !!! │ │ │ │ │ │ +00552 ***************************************************************/ │ │ │ │ │ │ +00553 bool Cstable_cones::cocircular_check(){ │ │ │ │ │ │ +// check if many configurations have the same centre. │ │ │ │ │ │ +00554 │ │ │ │ │ │ +00555 │ │ │ │ │ │ +// if this is the case, branch on the algorithm for this │ │ │ │ │ │ +00556 │ │ │ │ │ │ +// special case. │ │ │ │ │ │ +00557 │ │ │ │ │ │ +// Note that those situation, being considered separately in │ │ │ │ │ │ +00558 │ │ │ │ │ │ +// test_cone_multiple, must only be considered here if all │ │ │ │ │ │ +00559 │ │ │ │ │ │ +// angles are on the same side (this avoid multiple counting) │ │ │ │ │ │ +00560 │ │ │ │ │ │ +00561 │ │ │ │ │ │ +if (centre->cocircular.empty()) return false; │ │ │ │ │ │ +00562 │ │ │ │ │ │ +// first get cone into status required at end... │ │ │ │ │ │ +00563 │ │ │ │ │ │ +00564 │ │ │ │ │ │ +if ((centre->side) && (cone.ref.not_empty())){ │ │ │ │ │ │ +00565 │ │ │ │ │ │ +// update cone │ │ │ │ │ │ +00566 │ │ │ │ │ │ +cone -= (*child); │ │ │ │ │ │ +00567 │ │ │ │ │ │ +00568 │ │ │ │ │ │ +// update info on particles inside │ │ │ │ │ │ +00569 │ │ │ │ │ │ +centre->is_inside->cone = false; │ │ │ │ │ │ +00570 │ │ │ │ │ │ +// update stability check quantities │ │ │ │ │ │ +00571 │ │ │ │ │ │ +00572 │ │ │ │ │ │ +dpt += fabs(child->px)+fabs(child->py); //child->perp2(); │ │ │ │ │ │ +00573 │ │ │ │ │ │ +} │ │ │ │ │ │ +00574 │ │ │ │ │ │ +00575 │ │ │ │ │ │ +00576 │ │ │ │ │ │ +// now establish the list of unique children in the list │ │ │ │ │ │ +00577 │ │ │ │ │ │ +// first make sure parent and child are in! │ │ │ │ │ │ +00578 │ │ │ │ │ │ +00579 │ │ │ │ │ │ +list removed_from_cone; │ │ │ │ │ │ +00580 │ │ │ │ │ │ +list put_in_border; │ │ │ │ │ │ +00581 │ │ │ │ │ │ +list border_list; │ │ │ │ │ │ +00582 │ │ │ │ │ │ +00583 │ │ │ │ │ │ +Cmomentum cone_removal; │ │ │ │ │ │ +00584 │ │ │ │ │ │ +Cmomentum border = *parent; │ │ │ │ │ │ +00585 │ │ │ │ │ │ +border_list.push_back(parent); │ │ │ │ │ │ +00586 │ │ │ │ │ │ +00587 │ │ │ │ │ │ +// make sure child appears in the border region │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.26 protocones.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +00588 │ │ │ │ │ │ +centre->cocircular.push_back(centre); │ │ │ │ │ │ +00589 │ │ │ │ │ │ +// now establish the full contents of the cone minus the cocircular │ │ │ │ │ │ +00590 │ │ │ │ │ │ +00591 │ │ │ │ │ │ +// region and of the cocircular region itself │ │ │ │ │ │ +00592 │ │ │ │ │ │ +for(list::iterator it = centre->cocircular.begin(); │ │ │ │ │ │ +00593 │ │ │ │ │ │ +it != centre->cocircular.end(); it++) { │ │ │ │ │ │ +00594 │ │ │ │ │ │ +00595 │ │ │ │ │ │ +if ((*it)->is_inside->cone) { │ │ │ │ │ │ +00596 │ │ │ │ │ │ +cone_removal │ │ │ │ │ │ ++= *((*it)->v); │ │ │ │ │ │ +00597 │ │ │ │ │ │ +(*it)->is_inside->cone = false; │ │ │ │ │ │ +00598 │ │ │ │ │ │ +removed_from_cone.push_back((*it)->is_inside); │ │ │ │ │ │ +00599 │ │ │ │ │ │ +} │ │ │ │ │ │ +00600 │ │ │ │ │ │ +// if a point appears twice (i.e. with + and - sign) in the list of │ │ │ │ │ │ +00601 │ │ │ │ │ │ +00602 │ │ │ │ │ │ +// points on the border, we take care not to include it twice. │ │ │ │ │ │ +00603 │ │ │ │ │ │ +// Note that this situation may appear when a point is at a distance │ │ │ │ │ │ +00604 │ │ │ │ │ │ +// close to 2R from the parent │ │ │ │ │ │ +00605 │ │ │ │ │ │ +if (!(*it)->is_inside->cocirc) { │ │ │ │ │ │ +00606 │ │ │ │ │ │ +border += *((*it)->v); │ │ │ │ │ │ +00607 │ │ │ │ │ │ +(*it)->is_inside->cocirc = true; │ │ │ │ │ │ +00608 │ │ │ │ │ │ +put_in_border.push_back((*it)->is_inside); │ │ │ │ │ │ +00609 │ │ │ │ │ │ +border_list.push_back((*it)->v); │ │ │ │ │ │ +00610 │ │ │ │ │ │ +} │ │ │ │ │ │ +00611 │ │ │ │ │ │ +} │ │ │ │ │ │ +00612 │ │ │ │ │ │ +00613 │ │ │ │ │ │ +// figure out whether this pairing has been observed before │ │ │ │ │ │ +00614 │ │ │ │ │ │ +00615 │ │ │ │ │ │ +Cmomentum borderless_cone = cone; │ │ │ │ │ │ +00616 │ │ │ │ │ │ +borderless_cone -= cone_removal; │ │ │ │ │ │ +00617 │ │ │ │ │ │ +bool consider = true; │ │ │ │ │ │ +for (unsigned int i=0;i(borderless_cone.ref, │ │ │ │ │ │ +00628 │ │ │ │ │ │ +border.ref)); │ │ │ │ │ │ +00629 │ │ │ │ │ │ +00630 │ │ │ │ │ │ +// first figure out whether our cone momentum is good │ │ │ │ │ │ +00631 │ │ │ │ │ │ +double local_dpt = fabs(cone_removal.px) + fabs(cone_removal.py); │ │ │ │ │ │ +double total_dpt = dpt + local_dpt; │ │ │ │ │ │ +00632 │ │ │ │ │ │ +00633 │ │ │ │ │ │ +00634 │ │ │ │ │ │ +recompute_cone_contents_if_needed(borderless_cone, total_dpt); │ │ │ │ │ │ +00635 │ │ │ │ │ │ +if (total_dpt == 0) { │ │ │ │ │ │ +00636 │ │ │ │ │ │ +// a recomputation has taken place -- so take advantage of this │ │ │ │ │ │ +00637 │ │ │ │ │ │ +// and update the member cone momentum │ │ │ │ │ │ +00638 │ │ │ │ │ │ +cone = borderless_cone + cone_removal; │ │ │ │ │ │ +00639 │ │ │ │ │ │ +dpt = local_dpt; │ │ │ │ │ │ +00640 │ │ │ │ │ │ +} │ │ │ │ │ │ +00641 │ │ │ │ │ │ +00642 │ │ │ │ │ │ +test_cone_cocircular(borderless_cone, border_list); │ │ │ │ │ │ +00643 │ │ │ │ │ │ +} │ │ │ │ │ │ +00644 │ │ │ │ │ │ +00645 │ │ │ │ │ │ +// relabel things that were in the cone but got removed │ │ │ │ │ │ +00646 │ │ │ │ │ │ +00647 │ │ │ │ │ │ +for(list::iterator is_in = removed_from_cone.begin(); │ │ │ │ │ │ +00648 │ │ │ │ │ │ +is_in != removed_from_cone.end(); is_in++) { │ │ │ │ │ │ +00649 │ │ │ │ │ │ +(*is_in)->cone = true; │ │ │ │ │ │ +00650 │ │ │ │ │ │ +} │ │ │ │ │ │ +00651 │ │ │ │ │ │ +00652 │ │ │ │ │ │ +// relabel things that got put into the border │ │ │ │ │ │ +00653 │ │ │ │ │ │ +for(list::iterator is_in = put_in_border.begin(); │ │ │ │ │ │ +00654 │ │ │ │ │ │ +is_in != put_in_border.end(); is_in++) { │ │ │ │ │ │ +00655 │ │ │ │ │ │ +(*is_in)->cocirc = false; │ │ │ │ │ │ +00656 │ │ │ │ │ │ +} │ │ │ │ │ │ +00657 │ │ │ │ │ │ +// we’re done with everything -- return true to signal to user that we’ve │ │ │ │ │ │ +00658 │ │ │ │ │ │ +00659 │ │ │ │ │ │ +// been through the co-circularity rigmarole │ │ │ │ │ │ +00660 │ │ │ │ │ │ +return true; │ │ │ │ │ │ +00661 } │ │ │ │ │ │ +00662 │ │ │ │ │ │ +00663 │ │ │ │ │ │ +00665 // RECOMPUTATION OF CONE CONTENTS │ │ │ │ │ │ +// │ │ │ │ │ │ +00666 // - compute_cone_contents() │ │ │ │ │ │ +// │ │ │ │ │ │ +00667 // - recompute_cone_contents() │ │ │ │ │ │ +// │ │ │ │ │ │ +00668 // - recompute_cone_contents_if_needed() │ │ │ │ │ │ +// │ │ │ │ │ │ +00670 │ │ │ │ │ │ +00679 void Cstable_cones::compute_cone_contents() { │ │ │ │ │ │ +00680 │ │ │ │ │ │ +circulator::iterator > │ │ │ │ │ │ +00681 │ │ │ │ │ │ +start(vicinity.begin()+first_cone, vicinity.begin(), vicinity.end()); │ │ │ │ │ │ +00682 │ │ │ │ │ │ +00683 │ │ │ │ │ │ +circulator::iterator > here(start); │ │ │ │ │ │ +00684 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +225 │ │ │ │ │ │ + │ │ │ │ │ │ + 226 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +00685 │ │ │ │ │ │ +// note that in the following algorithm, the cone contents never includes │ │ │ │ │ │ +00686 │ │ │ │ │ │ +// the child. Indeed, if it has positive sign, then it will be set as │ │ │ │ │ │ +00687 │ │ │ │ │ │ +// outside at the last step in the loop. If it has negative sign, then the │ │ │ │ │ │ +00688 │ │ │ │ │ │ +// loop will at some point go to the corresponding situation with positive │ │ │ │ │ │ +00689 │ │ │ │ │ │ +// sign and set the inclusion status to 0. │ │ │ │ │ │ +00690 │ │ │ │ │ │ +do { │ │ │ │ │ │ +00691 │ │ │ │ │ │ +00692 │ │ │ │ │ │ +// as we leave this position a particle enters if its side is │ │ │ │ │ │ +00693 │ │ │ │ │ │ +// negative (i.e. the centre is the one at -ve angle wrt to the │ │ │ │ │ │ +00694 │ │ │ │ │ │ +// parent-child line │ │ │ │ │ │ +00695 │ │ │ │ │ │ +if (!(*here())->side) ((*here())->is_inside->cone) = 1; │ │ │ │ │ │ +00696 │ │ │ │ │ │ +// move on to the next position │ │ │ │ │ │ +00697 │ │ │ │ │ │ +00698 │ │ │ │ │ │ +++here; │ │ │ │ │ │ +00699 │ │ │ │ │ │ +// as we arrive at this position a particle leaves if its side is positive │ │ │ │ │ │ +00700 │ │ │ │ │ │ +00701 │ │ │ │ │ │ +if ((*here())->side) ((*here())->is_inside->cone) = 0; │ │ │ │ │ │ +00702 │ │ │ │ │ │ +} while (here != start); │ │ │ │ │ │ +00703 │ │ │ │ │ │ +// once we’ve reached the start the ’is_inside’ information should be │ │ │ │ │ │ +00704 │ │ │ │ │ │ +00705 │ │ │ │ │ │ +// 100% complete, so we can use it to calculate the cone contents │ │ │ │ │ │ +00706 │ │ │ │ │ │ +// and then exit │ │ │ │ │ │ +00707 │ │ │ │ │ │ +recompute_cone_contents(); │ │ │ │ │ │ +return; │ │ │ │ │ │ +00708 │ │ │ │ │ │ +00709 │ │ │ │ │ │ +00710 } │ │ │ │ │ │ +00711 │ │ │ │ │ │ +00712 │ │ │ │ │ │ +00713 /* │ │ │ │ │ │ +00714 * compute the cone momentum from particle list. │ │ │ │ │ │ +00715 * in this version, we use the ’pincluded’ information │ │ │ │ │ │ +00716 * from the Cvicinity class │ │ │ │ │ │ +00717 */ │ │ │ │ │ │ +00718 void Cstable_cones::recompute_cone_contents(){ │ │ │ │ │ │ +unsigned int i; │ │ │ │ │ │ +00719 │ │ │ │ │ │ +00720 │ │ │ │ │ │ +00721 │ │ │ │ │ │ +// set momentum to 0 │ │ │ │ │ │ +00722 │ │ │ │ │ │ +cone = Cmomentum(); │ │ │ │ │ │ +00723 │ │ │ │ │ │ +// Important note: we can browse only the particles │ │ │ │ │ │ +00724 │ │ │ │ │ │ +00725 │ │ │ │ │ │ +// in vicinity since all particles in the cone are │ │ │ │ │ │ +00726 │ │ │ │ │ │ +// withing a distance 2R w.r.t. parent hence in vicinity. │ │ │ │ │ │ +00727 │ │ │ │ │ │ +// Among those, we only add the particles for which ’is_inside’ is true ! │ │ │ │ │ │ +00728 │ │ │ │ │ │ +// This methos rather than a direct comparison avoids rounding errors │ │ │ │ │ │ +00729 │ │ │ │ │ │ +for (i=0;iside) && (vicinity[i]->is_inside->cone)) │ │ │ │ │ │ +00732 │ │ │ │ │ │ +cone += *vicinity[i]->v; │ │ │ │ │ │ +00733 │ │ │ │ │ │ +} │ │ │ │ │ │ +00734 │ │ │ │ │ │ +00735 │ │ │ │ │ │ +// set check variables back to 0 │ │ │ │ │ │ +00736 │ │ │ │ │ │ +dpt = 0.0; │ │ │ │ │ │ +00737 } │ │ │ │ │ │ +00738 │ │ │ │ │ │ +00739 │ │ │ │ │ │ +00740 /* │ │ │ │ │ │ +00741 * if we have gone beyond the acceptable threshold of change, compute │ │ │ │ │ │ +00742 * the cone momentum from particle list. in this version, we use the │ │ │ │ │ │ +00743 * ’pincluded’ information from the Cvicinity class, but we don’t │ │ │ │ │ │ +00744 * change the member cone, only the locally supplied one │ │ │ │ │ │ +00745 */ │ │ │ │ │ │ +00746 void Cstable_cones::recompute_cone_contents_if_needed(Cmomentum & this_cone, │ │ │ │ │ │ +00747 │ │ │ │ │ │ +double & this_dpt){ │ │ │ │ │ │ +00748 │ │ │ │ │ │ +if (this_dpt > PT_TSHOLD*(fabs(this_cone.px)+fabs(this_cone.py))) { │ │ │ │ │ │ +00749 │ │ │ │ │ │ +if (cone.ref.is_empty()) { │ │ │ │ │ │ +00750 │ │ │ │ │ │ +00751 │ │ │ │ │ │ +this_cone = Cmomentum(); │ │ │ │ │ │ +00752 │ │ │ │ │ │ +} else { │ │ │ │ │ │ +// set momentum to 0 │ │ │ │ │ │ +00753 │ │ │ │ │ │ +00754 │ │ │ │ │ │ +this_cone = Cmomentum(); │ │ │ │ │ │ +00755 │ │ │ │ │ │ +// Important note: we can browse only the particles │ │ │ │ │ │ +00756 │ │ │ │ │ │ +00757 │ │ │ │ │ │ +// in vicinity since all particles in the this_cone are │ │ │ │ │ │ +00758 │ │ │ │ │ │ +// withing a distance 2R w.r.t. parent hence in vicinity. │ │ │ │ │ │ +00759 │ │ │ │ │ │ +// Among those, we only add the particles for which ’is_inside’ is true ! │ │ │ │ │ │ +00760 │ │ │ │ │ │ +// This methos rather than a direct comparison avoids rounding errors │ │ │ │ │ │ +00761 │ │ │ │ │ │ +for (unsigned int i=0;iside) && (vicinity[i]->is_inside->cone)) │ │ │ │ │ │ +00764 │ │ │ │ │ │ +this_cone += *vicinity[i]->v; │ │ │ │ │ │ +00765 │ │ │ │ │ │ +} │ │ │ │ │ │ +00766 │ │ │ │ │ │ +00767 │ │ │ │ │ │ +} │ │ │ │ │ │ +00768 │ │ │ │ │ │ +// set check variables back to 0 │ │ │ │ │ │ +00769 │ │ │ │ │ │ +this_dpt = 0.0; │ │ │ │ │ │ +00770 │ │ │ │ │ │ +} │ │ │ │ │ │ +00771 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.27 protocones.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +227 │ │ │ │ │ │ + │ │ │ │ │ │ +00772 } │ │ │ │ │ │ +00773 │ │ │ │ │ │ +00774 │ │ │ │ │ │ +// │ │ │ │ │ │ +00776 // VARIOUS TOOLS │ │ │ │ │ │ +00777 // - circle_intersect() │ │ │ │ │ │ +// │ │ │ │ │ │ +00778 // - is_inside() │ │ │ │ │ │ +// │ │ │ │ │ │ +00779 // - abs_dangle() │ │ │ │ │ │ +// │ │ │ │ │ │ +00781 │ │ │ │ │ │ +00782 │ │ │ │ │ │ +00783 /* │ │ │ │ │ │ +00784 * circle intersection. │ │ │ │ │ │ +00785 * computes the intersection with a circle of given centre and radius. │ │ │ │ │ │ +00786 * The output takes the form of a checkxor of the intersection’s particles │ │ │ │ │ │ +00787 * - cx │ │ │ │ │ │ +circle centre x coordinate │ │ │ │ │ │ +circle centre y coordinate │ │ │ │ │ │ +00788 * - cy │ │ │ │ │ │ +00789 * return the checkxor for the intersection │ │ │ │ │ │ +00790 ******************************************************************/ │ │ │ │ │ │ +00791 Creference Cstable_cones::circle_intersect(double cx, double cy){ │ │ │ │ │ │ +00792 │ │ │ │ │ │ +Creference intersection; │ │ │ │ │ │ +int i; │ │ │ │ │ │ +00793 │ │ │ │ │ │ +double dx, dy; │ │ │ │ │ │ +00794 │ │ │ │ │ │ +00795 │ │ │ │ │ │ +00796 │ │ │ │ │ │ +for (i=0;iM_PI) │ │ │ │ │ │ +00803 │ │ │ │ │ │ +dy -= twopi; │ │ │ │ │ │ +00804 │ │ │ │ │ │ +// really check if the distance is less than VR │ │ │ │ │ │ +00805 │ │ │ │ │ │ +00806 │ │ │ │ │ │ +if (dx*dx+dy*dyeta - v->eta; │ │ │ │ │ │ +00825 │ │ │ │ │ │ +dy = fabs(centre_in->phi - v->phi); │ │ │ │ │ │ +if (dy>M_PI) │ │ │ │ │ │ +00826 │ │ │ │ │ │ +00827 │ │ │ │ │ │ +dy -= twopi; │ │ │ │ │ │ +00828 │ │ │ │ │ │ +00829 │ │ │ │ │ │ +return dx*dx+dy*dyM_PI) │ │ │ │ │ │ +00844 │ │ │ │ │ │ +dphi = dphi-twopi; │ │ │ │ │ │ +00845 │ │ │ │ │ │ +return dphi; │ │ │ │ │ │ +00846 │ │ │ │ │ │ +00847 } │ │ │ │ │ │ +00848 │ │ │ │ │ │ +00849 } │ │ │ │ │ │ + │ │ │ │ │ │ +5.27 protocones.cpp │ │ │ │ │ │ +00001 │ │ │ │ │ │ +00002 // File: protocones.cpp │ │ │ │ │ │ +00003 // Description: source file for stable cones determination (Cstable_cones) │ │ │ │ │ │ +00004 // This file is part of the SISCone project. │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ + 228 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +00005 // WARNING: this is not the main SISCone trunk but │ │ │ │ │ │ +// │ │ │ │ │ │ +00006 // │ │ │ │ │ │ +an adaptation to spherical coordinates │ │ │ │ │ │ +// │ │ │ │ │ │ +00007 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ +// │ │ │ │ │ │ +00008 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00009 // Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez │ │ │ │ │ │ +// │ │ │ │ │ │ +00010 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00011 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ +// │ │ │ │ │ │ +00012 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ +// │ │ │ │ │ │ +00013 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ +// │ │ │ │ │ │ +00014 // (at your option) any later version. │ │ │ │ │ │ +// │ │ │ │ │ │ +00015 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00016 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ +// │ │ │ │ │ │ +00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ +// │ │ │ │ │ │ +00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ +// │ │ │ │ │ │ +00019 // GNU General Public License for more details. │ │ │ │ │ │ +// │ │ │ │ │ │ +00020 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00021 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ +// │ │ │ │ │ │ +00022 // along with this program; if not, write to the Free Software │ │ │ │ │ │ +// │ │ │ │ │ │ +00023 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ +00024 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00025 // $Revision:: 311 │ │ │ │ │ │ +$// │ │ │ │ │ │ +00026 // $Date:: 2011-10-05 23:27:09 +0200 (Wed, 05 Oct 2011) │ │ │ │ │ │ +$// │ │ │ │ │ │ +00028 │ │ │ │ │ │ +00029 /******************************************************* │ │ │ │ │ │ +00030 * Introductory note: │ │ │ │ │ │ +* │ │ │ │ │ │ +00031 * Since this file has many member functions, we have * │ │ │ │ │ │ +00032 * structured them in categories: │ │ │ │ │ │ +* │ │ │ │ │ │ +00033 * INITIALISATION FUNCTIONS │ │ │ │ │ │ +* │ │ │ │ │ │ +00034 * - ctor() │ │ │ │ │ │ +* │ │ │ │ │ │ +00035 * - ctor(particle_list) │ │ │ │ │ │ +* │ │ │ │ │ │ +00036 * - dtor() │ │ │ │ │ │ +* │ │ │ │ │ │ +00037 * - init(particle_list) │ │ │ │ │ │ +* │ │ │ │ │ │ +00038 * ALGORITHM MAIN ENTRY │ │ │ │ │ │ +* │ │ │ │ │ │ +00039 * - get_stable_cone(radius) │ │ │ │ │ │ +* │ │ │ │ │ │ +00040 * ALGORITHM MAIN STEPS │ │ │ │ │ │ +* │ │ │ │ │ │ +00041 * - init_cone() │ │ │ │ │ │ +* │ │ │ │ │ │ +00042 * - test_cone() │ │ │ │ │ │ +* │ │ │ │ │ │ +00043 * - update_cone() │ │ │ │ │ │ +* │ │ │ │ │ │ +00044 * - proceed_with_stability() │ │ │ │ │ │ +* │ │ │ │ │ │ +00045 * ALGORITHM MAIN STEPS FOR COCIRCULAR SITUATIONS │ │ │ │ │ │ +* │ │ │ │ │ │ +00046 * - cocircular_pt_less(v1, v2) │ │ │ │ │ │ +* │ │ │ │ │ │ +00047 * - prepare_cocircular_list() │ │ │ │ │ │ +* │ │ │ │ │ │ +00048 * - test_cone_cocircular() │ │ │ │ │ │ +* │ │ │ │ │ │ +00049 * - test_stability(candidate, border_list) │ │ │ │ │ │ +* │ │ │ │ │ │ +00050 * - updat_cone_cocircular() │ │ │ │ │ │ +* │ │ │ │ │ │ +00051 * RECOMPUTATION OF CONE CONTENTS │ │ │ │ │ │ +* │ │ │ │ │ │ +00052 * - compute_cone_contents() │ │ │ │ │ │ +* │ │ │ │ │ │ +00053 * - recompute_cone_contents() │ │ │ │ │ │ +* │ │ │ │ │ │ +00054 * - recompute_cone_contents_if_needed() │ │ │ │ │ │ +* │ │ │ │ │ │ +00055 * VARIOUS TOOLS │ │ │ │ │ │ +* │ │ │ │ │ │ +00056 * - circle_intersect() │ │ │ │ │ │ +* │ │ │ │ │ │ +00057 * - is_inside() │ │ │ │ │ │ +* │ │ │ │ │ │ +00058 * - abs_dangle() │ │ │ │ │ │ +* │ │ │ │ │ │ +00059 *******************************************************/ │ │ │ │ │ │ +00060 │ │ │ │ │ │ +00061 #include │ │ │ │ │ │ +00062 #include │ │ │ │ │ │ +00063 #include │ │ │ │ │ │ +00064 #include "protocones.h" │ │ │ │ │ │ +00065 #include │ │ │ │ │ │ +00066 #include │ │ │ │ │ │ +00067 #include │ │ │ │ │ │ +00068 │ │ │ │ │ │ +00069 namespace siscone_spherical{ │ │ │ │ │ │ +00070 │ │ │ │ │ │ +00071 using namespace std; │ │ │ │ │ │ +00072 │ │ │ │ │ │ +00073 /********************************************************************** │ │ │ │ │ │ +00074 * CSphstable_cones implementation │ │ │ │ │ │ +* │ │ │ │ │ │ +00075 * Computes the list of stable comes from a particle list. │ │ │ │ │ │ +* │ │ │ │ │ │ +00076 * This class does the first fundamental task of te cone algorithm: │ │ │ │ │ │ +* │ │ │ │ │ │ +00077 * it is used to compute the list of stable cones given a list │ │ │ │ │ │ +* │ │ │ │ │ │ +00078 * of particles. │ │ │ │ │ │ +* │ │ │ │ │ │ +00079 **********************************************************************/ │ │ │ │ │ │ +00080 │ │ │ │ │ │ +// │ │ │ │ │ │ +00082 // INITIALISATION FUNCTIONS │ │ │ │ │ │ +00083 // - ctor() │ │ │ │ │ │ +// │ │ │ │ │ │ +00084 // - ctor(particle_list) │ │ │ │ │ │ +// │ │ │ │ │ │ +00085 // - dtor() │ │ │ │ │ │ +// │ │ │ │ │ │ +00086 // - init(particle_list) │ │ │ │ │ │ +// │ │ │ │ │ │ +00088 │ │ │ │ │ │ +00089 // default ctor │ │ │ │ │ │ +00090 //-------------00091 CSphstable_cones::CSphstable_cones(){ │ │ │ │ │ │ +00092 │ │ │ │ │ │ +nb_tot = 0; │ │ │ │ │ │ +00093 │ │ │ │ │ │ +hc = NULL; │ │ │ │ │ │ +00094 } │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.27 protocones.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +00095 │ │ │ │ │ │ +00096 // ctor with initialisation │ │ │ │ │ │ +00097 //-------------------------00098 CSphstable_cones::CSphstable_cones(vector &_particle_list) │ │ │ │ │ │ +00099 │ │ │ │ │ │ +: CSphvicinity(_particle_list){ │ │ │ │ │ │ +00100 │ │ │ │ │ │ +00101 │ │ │ │ │ │ +nb_tot = 0; │ │ │ │ │ │ +00102 │ │ │ │ │ │ +hc = NULL; │ │ │ │ │ │ +00103 } │ │ │ │ │ │ +00104 │ │ │ │ │ │ +00105 // default dtor │ │ │ │ │ │ +00106 //-------------00107 CSphstable_cones::~CSphstable_cones(){ │ │ │ │ │ │ +if (hc!=NULL) delete hc; │ │ │ │ │ │ +00108 │ │ │ │ │ │ +00109 } │ │ │ │ │ │ +00110 │ │ │ │ │ │ +00111 /* │ │ │ │ │ │ +00112 * initialisation │ │ │ │ │ │ +00113 * - _particle_list list of particles │ │ │ │ │ │ +number of particles │ │ │ │ │ │ +00114 * - _n │ │ │ │ │ │ +00115 *********************************************************************/ │ │ │ │ │ │ +00116 void CSphstable_cones::init(vector &_particle_list){ │ │ │ │ │ │ +00117 │ │ │ │ │ │ +// check already allocated mem │ │ │ │ │ │ +00118 │ │ │ │ │ │ +if (hc!=NULL){ │ │ │ │ │ │ +00119 │ │ │ │ │ │ +delete hc; │ │ │ │ │ │ +00120 │ │ │ │ │ │ +} │ │ │ │ │ │ +if (protocones.size()!=0) │ │ │ │ │ │ +00121 │ │ │ │ │ │ +00122 │ │ │ │ │ │ +protocones.clear(); │ │ │ │ │ │ +00123 │ │ │ │ │ │ +00124 │ │ │ │ │ │ +multiple_centre_done.clear(); │ │ │ │ │ │ +00125 │ │ │ │ │ │ +// initialisation │ │ │ │ │ │ +00126 │ │ │ │ │ │ +00127 │ │ │ │ │ │ +set_particle_list(_particle_list); │ │ │ │ │ │ +00128 } │ │ │ │ │ │ +00129 │ │ │ │ │ │ +00130 │ │ │ │ │ │ +00132 // ALGORITHM MAIN ENTRY │ │ │ │ │ │ +// │ │ │ │ │ │ +00133 // - get_stable_cone(radius) │ │ │ │ │ │ +// │ │ │ │ │ │ +00135 │ │ │ │ │ │ +00136 /* │ │ │ │ │ │ +00137 * compute stable cones. │ │ │ │ │ │ +00138 * This function really does the job i.e. computes │ │ │ │ │ │ +00139 * the list of stable cones (in a seedless way) │ │ │ │ │ │ +00140 * - _radius: radius of the cones │ │ │ │ │ │ +00141 * The number of stable cones found is returned │ │ │ │ │ │ +00142 *********************************************************************/ │ │ │ │ │ │ +00143 int CSphstable_cones::get_stable_cones(double _radius){ │ │ │ │ │ │ +00144 │ │ │ │ │ │ +int p_idx; │ │ │ │ │ │ +00145 │ │ │ │ │ │ +// check if everything is correctly initialised │ │ │ │ │ │ +00146 │ │ │ │ │ │ +00147 │ │ │ │ │ │ +if (n_part==0){ │ │ │ │ │ │ +return 0; │ │ │ │ │ │ +00148 │ │ │ │ │ │ +00149 │ │ │ │ │ │ +} │ │ │ │ │ │ +00150 │ │ │ │ │ │ +00151 │ │ │ │ │ │ +R = _radius; │ │ │ │ │ │ +00152 │ │ │ │ │ │ +R2 = R*R; │ │ │ │ │ │ +00153 │ │ │ │ │ │ +tan2R = tan(R); │ │ │ │ │ │ +00154 │ │ │ │ │ │ +tan2R *= tan2R; │ │ │ │ │ │ +00155 │ │ │ │ │ │ +00156 │ │ │ │ │ │ +// allow hash for cones candidates │ │ │ │ │ │ +00157 │ │ │ │ │ │ +hc = new sph_hash_cones(n_part, R); │ │ │ │ │ │ +00158 │ │ │ │ │ │ +// browse all particles │ │ │ │ │ │ +00159 │ │ │ │ │ │ +00160 │ │ │ │ │ │ +for (p_idx=0;p_idx_phi « ", " « parent->_theta « endl; │ │ │ │ │ │ +00177 #endif │ │ │ │ │ │ +00178 │ │ │ │ │ │ +// step 1: initialise with the first cone candidate │ │ │ │ │ │ +00179 │ │ │ │ │ │ +00180 │ │ │ │ │ │ +init_cone(); │ │ │ │ │ │ +00181 │ │ │ │ │ │ +do{ │ │ │ │ │ │ +00182 │ │ │ │ │ │ +00183 │ │ │ │ │ │ +// step 2: test cone stability for that pair (P,C) │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +229 │ │ │ │ │ │ + │ │ │ │ │ │ + 230 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +00184 │ │ │ │ │ │ +test_cone(); │ │ │ │ │ │ +00185 │ │ │ │ │ │ +// step 3: go to the next cone child candidate C │ │ │ │ │ │ +00186 │ │ │ │ │ │ +00187 │ │ │ │ │ │ +} while (!update_cone()); │ │ │ │ │ │ +00188 │ │ │ │ │ │ +} │ │ │ │ │ │ +00189 │ │ │ │ │ │ +00190 │ │ │ │ │ │ +return proceed_with_stability(); │ │ │ │ │ │ +00191 } │ │ │ │ │ │ +00192 │ │ │ │ │ │ +00193 │ │ │ │ │ │ +00195 // ALGORITHM MAIN STEPS │ │ │ │ │ │ +// │ │ │ │ │ │ +00196 // - init_cone() │ │ │ │ │ │ +// │ │ │ │ │ │ +00197 // - test_cone() │ │ │ │ │ │ +// │ │ │ │ │ │ +00198 // - update_cone() │ │ │ │ │ │ +// │ │ │ │ │ │ +00199 // - proceed_with_stability() │ │ │ │ │ │ +// │ │ │ │ │ │ +00201 │ │ │ │ │ │ +00202 /* │ │ │ │ │ │ +00203 * initialise the cone. │ │ │ │ │ │ +00204 * We take the first particle in the angular ordering to compute │ │ │ │ │ │ +00205 * this one │ │ │ │ │ │ +00206 * return 0 on success, 1 on error │ │ │ │ │ │ +00207 *********************************************************************/ │ │ │ │ │ │ +00208 int CSphstable_cones::init_cone(){ │ │ │ │ │ │ +// The previous version of the algorithm was starting the │ │ │ │ │ │ +00209 │ │ │ │ │ │ +00210 │ │ │ │ │ │ +// loop around vicinity elements with the "most isolated" child. │ │ │ │ │ │ +00211 │ │ │ │ │ │ +// given the nodist method to calculate the cone contents, we no │ │ │ │ │ │ +00212 │ │ │ │ │ │ +// longer need to worry about which cone comes first... │ │ │ │ │ │ +00213 │ │ │ │ │ │ +first_cone=0; │ │ │ │ │ │ +00214 │ │ │ │ │ │ +00215 │ │ │ │ │ │ +// now make sure we have lists of the cocircular particles │ │ │ │ │ │ +00216 │ │ │ │ │ │ +prepare_cocircular_lists(); │ │ │ │ │ │ +00217 │ │ │ │ │ │ +//TODO? deal with a configuration with only degeneracies ? │ │ │ │ │ │ +00218 │ │ │ │ │ │ +00219 │ │ │ │ │ │ +// The only possibility seems a regular hexagon with a parent point │ │ │ │ │ │ +00220 │ │ │ │ │ │ +// in the centre. And this situation is by itself unclear. │ │ │ │ │ │ +00221 │ │ │ │ │ │ +// Hence, we do nothing here ! │ │ │ │ │ │ +00222 │ │ │ │ │ │ +// init set child C │ │ │ │ │ │ +00223 │ │ │ │ │ │ +00224 │ │ │ │ │ │ +centre = vicinity[first_cone]; │ │ │ │ │ │ +00225 │ │ │ │ │ │ +child = centre->v; │ │ │ │ │ │ +00226 │ │ │ │ │ │ +centre_idx = first_cone; │ │ │ │ │ │ +00227 │ │ │ │ │ │ +// build the initial cone (nodist: avoids calculating distances -00228 │ │ │ │ │ │ +00229 │ │ │ │ │ │ +// just deduces contents by circulating around all in/out operations) │ │ │ │ │ │ +00230 │ │ │ │ │ │ +// this function also sets the list of included particles │ │ │ │ │ │ +00231 │ │ │ │ │ │ +compute_cone_contents(); │ │ │ │ │ │ +00232 │ │ │ │ │ │ +return 0; │ │ │ │ │ │ +00233 │ │ │ │ │ │ +00234 } │ │ │ │ │ │ +00235 │ │ │ │ │ │ +00236 │ │ │ │ │ │ +00237 /* │ │ │ │ │ │ +00238 * test cones. │ │ │ │ │ │ +00239 * We check if the cone(s) built with the present parent and child │ │ │ │ │ │ +00240 * are stable │ │ │ │ │ │ +00241 * return 0 on success 1 on error │ │ │ │ │ │ +00242 *********************************************************************/ │ │ │ │ │ │ +00243 int CSphstable_cones::test_cone(){ │ │ │ │ │ │ +00244 │ │ │ │ │ │ +siscone::Creference weighted_cone_ref; │ │ │ │ │ │ +00245 │ │ │ │ │ │ +00246 │ │ │ │ │ │ +// depending on the side we are taking the child particle, │ │ │ │ │ │ +00247 │ │ │ │ │ │ +// we test different configuration. │ │ │ │ │ │ +00248 │ │ │ │ │ │ +// Each time, two configurations are tested in such a way that │ │ │ │ │ │ +00249 │ │ │ │ │ │ +// all 4 possible cases (parent or child in or out the cone) │ │ │ │ │ │ +00250 │ │ │ │ │ │ +// are tested when taking the pair of particle parent+child │ │ │ │ │ │ +00251 │ │ │ │ │ │ +// and child+parent. │ │ │ │ │ │ +00252 │ │ │ │ │ │ +00253 │ │ │ │ │ │ +// here are the tests entering the first series: │ │ │ │ │ │ +00254 │ │ │ │ │ │ +// 1. check if the cone is already inserted │ │ │ │ │ │ +00255 │ │ │ │ │ │ +// 2. check cone stability for the parent and child particles │ │ │ │ │ │ +00256 │ │ │ │ │ │ +00257 │ │ │ │ │ │ +//UPDATED(see below): if (centre->side){ │ │ │ │ │ │ +00258 │ │ │ │ │ │ +//UPDATED(see below): │ │ │ │ │ │ +// test when both particles are not in the cone │ │ │ │ │ │ +00259 │ │ │ │ │ │ +//UPDATED(see below): │ │ │ │ │ │ +// or when both are in. │ │ │ │ │ │ +00260 │ │ │ │ │ │ +//UPDATED(see below): │ │ │ │ │ │ +// Note: for the totally exclusive case, test emptyness before │ │ │ │ │ │ +00261 │ │ │ │ │ │ +//UPDATED(see below): │ │ │ │ │ │ +cone_candidate = cone; │ │ │ │ │ │ +00262 │ │ │ │ │ │ +//UPDATED(see below): │ │ │ │ │ │ +if (cone.ref.not_empty()){ │ │ │ │ │ │ +00263 │ │ │ │ │ │ +//UPDATED(see below): │ │ │ │ │ │ +hc->insert(&cone_candidate, parent, child, false, false); │ │ │ │ │ │ +00264 │ │ │ │ │ │ +//UPDATED(see below): │ │ │ │ │ │ +} │ │ │ │ │ │ +00265 │ │ │ │ │ │ +//UPDATED(see below): │ │ │ │ │ │ +00266 │ │ │ │ │ │ +//UPDATED(see below): │ │ │ │ │ │ +cone_candidate = cone; │ │ │ │ │ │ +00267 │ │ │ │ │ │ +//UPDATED(see below): │ │ │ │ │ │ +cone_candidate+= *parent + *child; │ │ │ │ │ │ +00268 │ │ │ │ │ │ +//UPDATED(see below): │ │ │ │ │ │ +hc->insert(&cone_candidate, parent, child, true, true); │ │ │ │ │ │ +00269 │ │ │ │ │ │ +//UPDATED(see below): } else { │ │ │ │ │ │ +00270 │ │ │ │ │ │ +//UPDATED(see below): │ │ │ │ │ │ +// test when 1! of the particles is in the cone │ │ │ │ │ │ +00271 │ │ │ │ │ │ +//UPDATED(see below): │ │ │ │ │ │ +cone_candidate = cone + *parent; │ │ │ │ │ │ +00272 │ │ │ │ │ │ +//UPDATED(see below): │ │ │ │ │ │ +hc->insert(&cone_candidate, parent, child, true, false); │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.27 protocones.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +00273 │ │ │ │ │ │ +//UPDATED(see below): │ │ │ │ │ │ +00274 │ │ │ │ │ │ +//UPDATED(see below): │ │ │ │ │ │ +cone_candidate = cone + *child; │ │ │ │ │ │ +00275 │ │ │ │ │ │ +//UPDATED(see below): │ │ │ │ │ │ +hc->insert(&cone_candidate, parent, child, false, true); │ │ │ │ │ │ +00276 │ │ │ │ │ │ +//UPDATED(see below): } │ │ │ │ │ │ +00277 │ │ │ │ │ │ +//UPDATED(see below): │ │ │ │ │ │ +00278 │ │ │ │ │ │ +//UPDATED(see below): nb_tot+=2; │ │ │ │ │ │ +00279 │ │ │ │ │ │ +00280 │ │ │ │ │ │ +// instead of testing 2 inclusion/exclusion states for every pair, we test the 4 of them │ │ │ │ │ │ +00281 │ │ │ │ │ │ +// when the parent has an energy bigger than the child │ │ │ │ │ │ +00282 │ │ │ │ │ │ +if (parent->E >= child->E){ │ │ │ │ │ │ +00283 │ │ │ │ │ │ +// test when both particles are not in the cone │ │ │ │ │ │ +00284 │ │ │ │ │ │ +// Note: for the totally exclusive case, test emptiness before │ │ │ │ │ │ +00285 │ │ │ │ │ │ +cone_candidate = cone; │ │ │ │ │ │ +if (cone.ref.not_empty()){ │ │ │ │ │ │ +00286 │ │ │ │ │ │ +00287 │ │ │ │ │ │ +hc->insert(&cone_candidate, parent, child, false, false); │ │ │ │ │ │ +00288 │ │ │ │ │ │ +} │ │ │ │ │ │ +00289 │ │ │ │ │ │ +00290 │ │ │ │ │ │ +// test when 1! of the particles is in the cone │ │ │ │ │ │ +00291 │ │ │ │ │ │ +cone_candidate += *parent; │ │ │ │ │ │ +00292 │ │ │ │ │ │ +hc->insert(&cone_candidate, parent, child, true, false); │ │ │ │ │ │ +00293 │ │ │ │ │ │ +00294 │ │ │ │ │ │ +cone_candidate = cone; │ │ │ │ │ │ +00295 │ │ │ │ │ │ +cone_candidate += *child; │ │ │ │ │ │ +00296 │ │ │ │ │ │ +hc->insert(&cone_candidate, parent, child, false, true); │ │ │ │ │ │ +00297 │ │ │ │ │ │ +// test when both are in. │ │ │ │ │ │ +00298 │ │ │ │ │ │ +00299 │ │ │ │ │ │ +cone_candidate += *parent; │ │ │ │ │ │ +00300 │ │ │ │ │ │ +hc->insert(&cone_candidate, parent, child, true, true); │ │ │ │ │ │ +00301 │ │ │ │ │ │ +00302 │ │ │ │ │ │ +nb_tot += 4; │ │ │ │ │ │ +00303 │ │ │ │ │ │ +} │ │ │ │ │ │ +00304 │ │ │ │ │ │ +00305 │ │ │ │ │ │ +return 0; │ │ │ │ │ │ +00306 │ │ │ │ │ │ +00307 } │ │ │ │ │ │ +00308 │ │ │ │ │ │ +00309 │ │ │ │ │ │ +00310 /* │ │ │ │ │ │ +00311 * update the cone │ │ │ │ │ │ +00312 * go to the next child for that parent and update ’cone’ appropriately │ │ │ │ │ │ +00313 * return 0 if update candidate found, 1 otherwise │ │ │ │ │ │ +00314 ***********************************************************************/ │ │ │ │ │ │ +00315 int CSphstable_cones::update_cone(){ │ │ │ │ │ │ +00316 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ +00317 │ │ │ │ │ │ +cout « "call ’circles_plot.gp’ ’" « centre->centre.px « "’ ’" │ │ │ │ │ │ +00318 │ │ │ │ │ │ +« centre->centre.py « "’ ’" « centre->centre.pz « "’" « endl │ │ │ │ │ │ +00319 │ │ │ │ │ │ +« "pause -1 ’(" « centre->angle « " " « (centre->side ? ’+’ : ’-’) « ")"; │ │ │ │ │ │ +00320 #endif │ │ │ │ │ │ +00321 │ │ │ │ │ │ +// get the next child and centre │ │ │ │ │ │ +00322 │ │ │ │ │ │ +00323 │ │ │ │ │ │ +centre_idx++; │ │ │ │ │ │ +if (centre_idx==vicinity_size) │ │ │ │ │ │ +00324 │ │ │ │ │ │ +00325 │ │ │ │ │ │ +centre_idx=0; │ │ │ │ │ │ +if (centre_idx==first_cone) │ │ │ │ │ │ +00326 │ │ │ │ │ │ +00327 │ │ │ │ │ │ +return 1; │ │ │ │ │ │ +00328 │ │ │ │ │ │ +// update the cone w.r.t. the old child │ │ │ │ │ │ +00329 │ │ │ │ │ │ +00330 │ │ │ │ │ │ +// only required if the old child is entering inside in which │ │ │ │ │ │ +00331 │ │ │ │ │ │ +// case we need to add it. We also know that the child is │ │ │ │ │ │ +00332 │ │ │ │ │ │ +// inside iff its side is -. │ │ │ │ │ │ +00333 │ │ │ │ │ │ +if (!centre->side){ │ │ │ │ │ │ +00334 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ +00335 │ │ │ │ │ │ +cout « " old_enter"; │ │ │ │ │ │ +00336 #endif │ │ │ │ │ │ +00337 │ │ │ │ │ │ +// update cone │ │ │ │ │ │ +00338 │ │ │ │ │ │ +cone += (*child); │ │ │ │ │ │ +00339 │ │ │ │ │ │ +00340 │ │ │ │ │ │ +// update info on particles inside │ │ │ │ │ │ +00341 │ │ │ │ │ │ +centre->is_inside->cone = true; │ │ │ │ │ │ +00342 │ │ │ │ │ │ +// update stability check quantities │ │ │ │ │ │ +00343 │ │ │ │ │ │ +00344 │ │ │ │ │ │ +dpt += fabs(child->px)+fabs(child->py)+fabs(child->pz); │ │ │ │ │ │ +00345 │ │ │ │ │ │ +} │ │ │ │ │ │ +00346 │ │ │ │ │ │ +00347 │ │ │ │ │ │ +// update centre and child to correspond to the new position │ │ │ │ │ │ +00348 │ │ │ │ │ │ +centre = vicinity[centre_idx]; │ │ │ │ │ │ +00349 │ │ │ │ │ │ +child = centre->v; │ │ │ │ │ │ +00350 │ │ │ │ │ │ +00351 │ │ │ │ │ │ +// check cocircularity │ │ │ │ │ │ +00352 │ │ │ │ │ │ +// note that if cocirculaity is detected (i.e. if we receive 1 │ │ │ │ │ │ +00353 │ │ │ │ │ │ +// in the next test), we need to recall ’update_cone’ directly │ │ │ │ │ │ +00354 │ │ │ │ │ │ +// since tests and remaining part of te update has been performed │ │ │ │ │ │ +00355 │ │ │ │ │ │ +//if (cocircular_check()) │ │ │ │ │ │ +00356 │ │ │ │ │ │ +if (cocircular_check()){ │ │ │ │ │ │ +00357 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ +00358 │ │ │ │ │ │ +cout « " Co-circular case detected" « endl; │ │ │ │ │ │ +00359 #endif │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +231 │ │ │ │ │ │ + │ │ │ │ │ │ + 232 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +00360 │ │ │ │ │ │ +return update_cone(); │ │ │ │ │ │ +00361 │ │ │ │ │ │ +} │ │ │ │ │ │ +00362 │ │ │ │ │ │ +// update the cone w.r.t. the new child │ │ │ │ │ │ +00363 │ │ │ │ │ │ +00364 │ │ │ │ │ │ +// only required if the new child was already inside in which │ │ │ │ │ │ +00365 │ │ │ │ │ │ +// case we need to remove it. We also know that the child is │ │ │ │ │ │ +00366 │ │ │ │ │ │ +// inside iff its side is +. │ │ │ │ │ │ +00367 │ │ │ │ │ │ +if ((centre->side) && (cone.ref.not_empty())){ │ │ │ │ │ │ +00368 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ +00369 │ │ │ │ │ │ +cout « " new exit"; │ │ │ │ │ │ +00370 #endif │ │ │ │ │ │ +00371 │ │ │ │ │ │ +00372 │ │ │ │ │ │ +// update cone │ │ │ │ │ │ +00373 │ │ │ │ │ │ +cone -= (*child); │ │ │ │ │ │ +00374 │ │ │ │ │ │ +// update info on particles inside │ │ │ │ │ │ +00375 │ │ │ │ │ │ +00376 │ │ │ │ │ │ +centre->is_inside->cone = false; │ │ │ │ │ │ +00377 │ │ │ │ │ │ +// update stability check quantities │ │ │ │ │ │ +00378 │ │ │ │ │ │ +00379 │ │ │ │ │ │ +dpt += fabs(child->px)+fabs(child->py)+fabs(child->pz); //child->perp2(); │ │ │ │ │ │ +00380 │ │ │ │ │ │ +} │ │ │ │ │ │ +00381 │ │ │ │ │ │ +00382 │ │ │ │ │ │ +// check that the addition and subtraction of vectors does │ │ │ │ │ │ +00383 │ │ │ │ │ │ +// not lead to too much rounding error │ │ │ │ │ │ +00384 │ │ │ │ │ │ +// for that, we compute the sum of pt modifications and of |pt| │ │ │ │ │ │ +00385 │ │ │ │ │ │ +// since last recomputation and once the ratio overpasses a threshold │ │ │ │ │ │ +00386 │ │ │ │ │ │ +// we recompute vicinity. │ │ │ │ │ │ +00387 │ │ │ │ │ │ +if ((dpt>PT_TSHOLD*(fabs(cone.px)+fabs(cone.py)+fabs(cone.pz))) && (cone.ref.not_empty())){ │ │ │ │ │ │ +00388 │ │ │ │ │ │ +recompute_cone_contents(); │ │ │ │ │ │ +00389 │ │ │ │ │ │ +} │ │ │ │ │ │ +00390 │ │ │ │ │ │ +if (cone.ref.is_empty()){ │ │ │ │ │ │ +00391 │ │ │ │ │ │ +cone = CSphmomentum(); │ │ │ │ │ │ +00392 │ │ │ │ │ │ +dpt=0.0; │ │ │ │ │ │ +00393 │ │ │ │ │ │ +} │ │ │ │ │ │ +00394 │ │ │ │ │ │ +00395 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ +00396 │ │ │ │ │ │ +cout « "’" « endl; │ │ │ │ │ │ +00397 #endif │ │ │ │ │ │ +00398 │ │ │ │ │ │ +return 0; │ │ │ │ │ │ +00399 │ │ │ │ │ │ +00400 } │ │ │ │ │ │ +00401 │ │ │ │ │ │ +00402 │ │ │ │ │ │ +00403 /* │ │ │ │ │ │ +00404 * compute stability of all enumerated candidates. │ │ │ │ │ │ +00405 * For all candidate cones which are stable w.r.t. their border particles, │ │ │ │ │ │ +00406 * pass the last test: stability with quadtree intersection │ │ │ │ │ │ +00407 ************************************************************************/ │ │ │ │ │ │ +00408 int CSphstable_cones::proceed_with_stability(){ │ │ │ │ │ │ +int i; │ │ │ │ │ │ +00409 │ │ │ │ │ │ +00410 │ │ │ │ │ │ +sph_hash_element *elm; │ │ │ │ │ │ +00411 │ │ │ │ │ │ +00412 │ │ │ │ │ │ +for (i=0;i<=hc->mask;i++){ │ │ │ │ │ │ +// test ith cell of the hash array │ │ │ │ │ │ +00413 │ │ │ │ │ │ +00414 │ │ │ │ │ │ +elm = hc->hash_array[i]; │ │ │ │ │ │ +00415 │ │ │ │ │ │ +// browse elements therein │ │ │ │ │ │ +00416 │ │ │ │ │ │ +00417 │ │ │ │ │ │ +while (elm!=NULL){ │ │ │ │ │ │ +// test stability │ │ │ │ │ │ +00418 │ │ │ │ │ │ +00419 │ │ │ │ │ │ +if (elm->is_stable){ │ │ │ │ │ │ +00420 │ │ │ │ │ │ +// stability is not ensured by all pairs of "edges" already browsed │ │ │ │ │ │ +00421 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ +00422 │ │ │ │ │ │ +// => testing stability with quadtree intersection │ │ │ │ │ │ +00423 │ │ │ │ │ │ +if (quadtree->circle_intersect(elm->eta, elm->phi, R2)==elm->ref) │ │ │ │ │ │ +00424 #else │ │ │ │ │ │ +00425 │ │ │ │ │ │ +// => testing stability with the particle-list intersection │ │ │ │ │ │ +00426 │ │ │ │ │ │ +if (circle_intersect(elm->centre)==elm->centre.ref) │ │ │ │ │ │ +00427 #endif │ │ │ │ │ │ +00428 │ │ │ │ │ │ +protocones.push_back(CSphmomentum(elm->centre,1.0)); │ │ │ │ │ │ +00429 │ │ │ │ │ │ +} │ │ │ │ │ │ +00430 │ │ │ │ │ │ +00431 │ │ │ │ │ │ +// jump to the next one │ │ │ │ │ │ +00432 │ │ │ │ │ │ +elm = elm->next; │ │ │ │ │ │ +00433 │ │ │ │ │ │ +} │ │ │ │ │ │ +00434 │ │ │ │ │ │ +} │ │ │ │ │ │ +00435 │ │ │ │ │ │ +00436 │ │ │ │ │ │ +// free hash │ │ │ │ │ │ +00437 │ │ │ │ │ │ +// we do that at this level because hash eats rather a lot of memory │ │ │ │ │ │ +00438 │ │ │ │ │ │ +// we want to free it before running the split/merge algorithm │ │ │ │ │ │ +00439 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ +00440 │ │ │ │ │ │ +nb_hash_cones = hc->n_cones; │ │ │ │ │ │ +00441 │ │ │ │ │ │ +nb_hash_occupied = hc->n_occupied_cells; │ │ │ │ │ │ +00442 #endif │ │ │ │ │ │ +00443 │ │ │ │ │ │ +delete hc; │ │ │ │ │ │ +00444 │ │ │ │ │ │ +00445 │ │ │ │ │ │ +hc=NULL; │ │ │ │ │ │ +00446 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.27 protocones.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +00447 │ │ │ │ │ │ +return protocones.size(); │ │ │ │ │ │ +00448 } │ │ │ │ │ │ +00449 │ │ │ │ │ │ +00450 │ │ │ │ │ │ +// │ │ │ │ │ │ +00452 // ALGORITHM MAIN STEPS FOR COCIRCULAR SITUATIONS │ │ │ │ │ │ +00453 // - cocircular_pt_less(v1, v2) │ │ │ │ │ │ +// │ │ │ │ │ │ +00454 // - prepare_cocircular_list() │ │ │ │ │ │ +// │ │ │ │ │ │ +00455 // - test_cone_cocircular() │ │ │ │ │ │ +// │ │ │ │ │ │ +00456 // - test_stability(candidate, border_vect) │ │ │ │ │ │ +// │ │ │ │ │ │ +00457 // - updat_cone_cocircular() │ │ │ │ │ │ +// │ │ │ │ │ │ +00459 │ │ │ │ │ │ +00461 //NEVER USED │ │ │ │ │ │ +00462 //bool cocircular_pt_less(CSphmomentum *v1, CSphmomentum *v2){ │ │ │ │ │ │ +00463 // return v1->perp2() < v2->perp2(); │ │ │ │ │ │ +00464 //} │ │ │ │ │ │ +00465 │ │ │ │ │ │ +00466 /* │ │ │ │ │ │ +00467 * run through the vicinity of the current parent and for each child │ │ │ │ │ │ +00468 * establish which other members are cocircular... Note that the list │ │ │ │ │ │ +00469 * associated with each child contains references to vicinity │ │ │ │ │ │ +00470 * elements: thus two vicinity elements each associated with one given │ │ │ │ │ │ +00471 * particle may appear in a list -- this needs to be watched out for │ │ │ │ │ │ +00472 * later on... │ │ │ │ │ │ +00473 **********************************************************************/ │ │ │ │ │ │ +00474 void CSphstable_cones::prepare_cocircular_lists() { │ │ │ │ │ │ +00475 │ │ │ │ │ │ +siscone::circulator::iterator > here(vicinity.begin(), │ │ │ │ │ │ +00476 │ │ │ │ │ │ +vicinity.begin(), │ │ │ │ │ │ +00477 │ │ │ │ │ │ +vicinity.end()); │ │ │ │ │ │ +00478 │ │ │ │ │ │ +00479 │ │ │ │ │ │ +siscone::circulator::iterator > search(here); │ │ │ │ │ │ +00480 │ │ │ │ │ │ +do { │ │ │ │ │ │ +00481 │ │ │ │ │ │ +00482 │ │ │ │ │ │ +CSphvicinity_elm* here_pntr = *here(); │ │ │ │ │ │ +00483 │ │ │ │ │ │ +search.set_position(here); │ │ │ │ │ │ +00484 │ │ │ │ │ │ +// search forwards for things that should have "here" included in │ │ │ │ │ │ +00485 │ │ │ │ │ │ +00486 │ │ │ │ │ │ +// their cocircularity list │ │ │ │ │ │ +00487 │ │ │ │ │ │ +while (true) { │ │ │ │ │ │ +00488 │ │ │ │ │ │ +++search; │ │ │ │ │ │ +if ( siscone::abs_dphi((*search())->angle, here_pntr->angle) < │ │ │ │ │ │ +00489 │ │ │ │ │ │ +00490 │ │ │ │ │ │ +here_pntr->cocircular_range │ │ │ │ │ │ +00491 │ │ │ │ │ │ +&& search() != here()) { │ │ │ │ │ │ +00492 │ │ │ │ │ │ +(*search())->cocircular.push_back(here_pntr); │ │ │ │ │ │ +00493 │ │ │ │ │ │ +} else { │ │ │ │ │ │ +break; │ │ │ │ │ │ +00494 │ │ │ │ │ │ +00495 │ │ │ │ │ │ +} │ │ │ │ │ │ +00496 │ │ │ │ │ │ +} │ │ │ │ │ │ +00497 │ │ │ │ │ │ +00498 │ │ │ │ │ │ +// search backwards │ │ │ │ │ │ +00499 │ │ │ │ │ │ +search.set_position(here); │ │ │ │ │ │ +00500 │ │ │ │ │ │ +while (true) { │ │ │ │ │ │ +00501 │ │ │ │ │ │ +--search; │ │ │ │ │ │ +if ( siscone::abs_dphi((*search())->angle, here_pntr->angle) < │ │ │ │ │ │ +00502 │ │ │ │ │ │ +00503 │ │ │ │ │ │ +here_pntr->cocircular_range │ │ │ │ │ │ +00504 │ │ │ │ │ │ +&& search() != here()) { │ │ │ │ │ │ +00505 │ │ │ │ │ │ +(*search())->cocircular.push_back(here_pntr); │ │ │ │ │ │ +00506 │ │ │ │ │ │ +} else { │ │ │ │ │ │ +00507 │ │ │ │ │ │ +break; │ │ │ │ │ │ +00508 │ │ │ │ │ │ +} │ │ │ │ │ │ +00509 │ │ │ │ │ │ +} │ │ │ │ │ │ +00510 │ │ │ │ │ │ +00511 │ │ │ │ │ │ +++here; │ │ │ │ │ │ +00512 │ │ │ │ │ │ +} while (here() != vicinity.begin()); │ │ │ │ │ │ +00513 } │ │ │ │ │ │ +00514 │ │ │ │ │ │ +00515 /* │ │ │ │ │ │ +00516 * Testing cocircular configurations in p^3 time, │ │ │ │ │ │ +00517 * rather than 2^p time; we will test all contiguous subsets of points │ │ │ │ │ │ +00518 * on the border --- note that this is till probably overkill, since │ │ │ │ │ │ +00519 * in principle we only have to test situations where up to a │ │ │ │ │ │ +00520 * half-circle is filled (but going to a full circle is simpler) │ │ │ │ │ │ +00521 ******************************************************************/ │ │ │ │ │ │ +00522 void CSphstable_cones::test_cone_cocircular(CSphmomentum & borderless_cone, │ │ │ │ │ │ +00523 │ │ │ │ │ │ +list & border_list) { │ │ │ │ │ │ +00524 │ │ │ │ │ │ +// in spherical coordinates, we don’t have a universal x-y axis system │ │ │ │ │ │ +00525 │ │ │ │ │ │ +// to measure the angles. So we first determine one minimising │ │ │ │ │ │ +00526 │ │ │ │ │ │ +// the uncertainties │ │ │ │ │ │ +00527 │ │ │ │ │ │ +CSph3vector angl_dir1, angl_dir2; │ │ │ │ │ │ +00528 │ │ │ │ │ │ +centre->centre.get_angular_directions(angl_dir1, angl_dir2); │ │ │ │ │ │ +00529 │ │ │ │ │ │ +angl_dir1/=angl_dir1._norm; │ │ │ │ │ │ +00530 │ │ │ │ │ │ +angl_dir2/=angl_dir2._norm; │ │ │ │ │ │ +00531 │ │ │ │ │ │ +00532 │ │ │ │ │ │ +// now we have te reference axis, create the CSphborder_store structure │ │ │ │ │ │ +00533 │ │ │ │ │ │ +vector border_vect; │ │ │ │ │ │ +00534 │ │ │ │ │ │ +border_vect.reserve(border_list.size()); │ │ │ │ │ │ +for (list::iterator it = border_list.begin(); │ │ │ │ │ │ +00535 │ │ │ │ │ │ +00536 │ │ │ │ │ │ +it != border_list.end(); it++) { │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +233 │ │ │ │ │ │ + │ │ │ │ │ │ + 234 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +00537 │ │ │ │ │ │ +border_vect.push_back(CSphborder_store(*it, centre->centre, angl_dir1, angl_dir2)); │ │ │ │ │ │ +00538 │ │ │ │ │ │ +} │ │ │ │ │ │ +00539 │ │ │ │ │ │ +// get them into order of angle │ │ │ │ │ │ +00540 │ │ │ │ │ │ +00541 │ │ │ │ │ │ +sort(border_vect.begin(), border_vect.end()); │ │ │ │ │ │ +00542 │ │ │ │ │ │ +// set up some circulators, since these will help us go around the │ │ │ │ │ │ +00543 │ │ │ │ │ │ +00544 │ │ │ │ │ │ +// circle easily │ │ │ │ │ │ +00545 │ │ │ │ │ │ +siscone::circulator::iterator > │ │ │ │ │ │ +00546 │ │ │ │ │ │ +start(border_vect.begin(), border_vect.begin(),border_vect.end()); │ │ │ │ │ │ +00547 │ │ │ │ │ │ +siscone::circulator::iterator > mid(start), end(start); │ │ │ │ │ │ +00548 │ │ │ │ │ │ +00549 │ │ │ │ │ │ +// test the borderless cone │ │ │ │ │ │ +00550 │ │ │ │ │ │ +CSphmomentum candidate = borderless_cone; │ │ │ │ │ │ +00551 │ │ │ │ │ │ +//candidate.build_etaphi(); │ │ │ │ │ │ +00552 │ │ │ │ │ │ +if (candidate.ref.not_empty()) │ │ │ │ │ │ +00553 │ │ │ │ │ │ +test_stability(candidate, border_vect); │ │ │ │ │ │ +00554 │ │ │ │ │ │ +00555 │ │ │ │ │ │ +do { │ │ │ │ │ │ +00556 │ │ │ │ │ │ +// reset status wrt inclusion in the cone │ │ │ │ │ │ +00557 │ │ │ │ │ │ +mid = start; │ │ │ │ │ │ +00558 │ │ │ │ │ │ +do { │ │ │ │ │ │ +00559 │ │ │ │ │ │ +mid()->is_in = false; │ │ │ │ │ │ +00560 │ │ │ │ │ │ +} while (++mid != start); │ │ │ │ │ │ +00561 │ │ │ │ │ │ +// now run over all inclusion possibilities with this starting point │ │ │ │ │ │ +00562 │ │ │ │ │ │ +00563 │ │ │ │ │ │ +candidate = borderless_cone; │ │ │ │ │ │ +while (++mid != start) { │ │ │ │ │ │ +00564 │ │ │ │ │ │ +00565 │ │ │ │ │ │ +// will begin with start+1 and go up to start-1 │ │ │ │ │ │ +00566 │ │ │ │ │ │ +mid()->is_in = true; │ │ │ │ │ │ +00567 │ │ │ │ │ │ +candidate += *(mid()->mom); │ │ │ │ │ │ +00568 │ │ │ │ │ │ +test_stability(candidate, border_vect); │ │ │ │ │ │ +00569 │ │ │ │ │ │ +} │ │ │ │ │ │ +00570 │ │ │ │ │ │ +00571 │ │ │ │ │ │ +} while (++start != end); │ │ │ │ │ │ +00572 │ │ │ │ │ │ +00573 │ │ │ │ │ │ +// mid corresponds to momentum that we need to include to get the │ │ │ │ │ │ +00574 │ │ │ │ │ │ +// full cone │ │ │ │ │ │ +00575 │ │ │ │ │ │ +mid()->is_in = true; │ │ │ │ │ │ +00576 │ │ │ │ │ │ +candidate += *(mid()->mom); │ │ │ │ │ │ +00577 │ │ │ │ │ │ +test_stability(candidate, border_vect); │ │ │ │ │ │ +00578 } │ │ │ │ │ │ +00579 │ │ │ │ │ │ +00580 │ │ │ │ │ │ +00587 void CSphstable_cones::test_stability(CSphmomentum & candidate, const vector & │ │ │ │ │ │ +border_vect) { │ │ │ │ │ │ +00588 │ │ │ │ │ │ +00589 │ │ │ │ │ │ +// this almost certainly has not been done... │ │ │ │ │ │ +00590 │ │ │ │ │ │ +//candidate.build_etaphi(); │ │ │ │ │ │ +00591 │ │ │ │ │ │ +00592 │ │ │ │ │ │ +bool stable = true; │ │ │ │ │ │ +for (unsigned i = 0; i < border_vect.size(); i++) { │ │ │ │ │ │ +00593 │ │ │ │ │ │ +00594 │ │ │ │ │ │ +if (is_closer(&candidate, border_vect[i].mom,tan2R) ^ (border_vect[i].is_in)) { │ │ │ │ │ │ +00595 │ │ │ │ │ │ +stable = false; │ │ │ │ │ │ +00596 │ │ │ │ │ │ +break; // it’s unstable so there’s no point continuing │ │ │ │ │ │ +00597 │ │ │ │ │ │ +} │ │ │ │ │ │ +00598 │ │ │ │ │ │ +} │ │ │ │ │ │ +00599 │ │ │ │ │ │ +if (stable) hc->insert(&candidate); │ │ │ │ │ │ +00600 │ │ │ │ │ │ +00601 } │ │ │ │ │ │ +00602 │ │ │ │ │ │ +00603 /* │ │ │ │ │ │ +00604 * check if we are in a situation of cocircularity. │ │ │ │ │ │ +00605 * if it is the case, update and test in the corresponding way │ │ │ │ │ │ +00606 * return ’false’ if no cocircularity detected, ’true’ otherwise │ │ │ │ │ │ +00607 * Note that if cocircularity is detected, we need to │ │ │ │ │ │ +00608 * recall ’update’ from ’update’ !!! │ │ │ │ │ │ +00609 ***************************************************************/ │ │ │ │ │ │ +00610 bool CSphstable_cones::cocircular_check(){ │ │ │ │ │ │ +00611 │ │ │ │ │ │ +// check if many configurations have the same centre. │ │ │ │ │ │ +00612 │ │ │ │ │ │ +// if this is the case, branch on the algorithm for this │ │ │ │ │ │ +00613 │ │ │ │ │ │ +// special case. │ │ │ │ │ │ +00614 │ │ │ │ │ │ +// Note that those situation, being considered separately in │ │ │ │ │ │ +00615 │ │ │ │ │ │ +// test_cone_multiple, must only be considered here if all │ │ │ │ │ │ +00616 │ │ │ │ │ │ +// angles are on the same side (this avoid multiple counting) │ │ │ │ │ │ +00617 │ │ │ │ │ │ +00618 │ │ │ │ │ │ +if (centre->cocircular.empty()) return false; │ │ │ │ │ │ +00619 │ │ │ │ │ │ +// first get cone into status required at end... │ │ │ │ │ │ +00620 │ │ │ │ │ │ +00621 │ │ │ │ │ │ +if ((centre->side) && (cone.ref.not_empty())){ │ │ │ │ │ │ +00622 │ │ │ │ │ │ +// update cone │ │ │ │ │ │ +00623 │ │ │ │ │ │ +cone -= (*child); │ │ │ │ │ │ +00624 │ │ │ │ │ │ +// update info on particles inside │ │ │ │ │ │ +00625 │ │ │ │ │ │ +00626 │ │ │ │ │ │ +centre->is_inside->cone = false; │ │ │ │ │ │ +00627 │ │ │ │ │ │ +00628 │ │ │ │ │ │ +// update stability check quantities │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.27 protocones.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +00629 │ │ │ │ │ │ +00630 │ │ │ │ │ │ +00631 │ │ │ │ │ │ +00632 │ │ │ │ │ │ +00633 │ │ │ │ │ │ +00634 │ │ │ │ │ │ +00635 │ │ │ │ │ │ +00636 │ │ │ │ │ │ +00637 │ │ │ │ │ │ +00638 │ │ │ │ │ │ +00639 │ │ │ │ │ │ +00640 │ │ │ │ │ │ +00641 │ │ │ │ │ │ +00642 │ │ │ │ │ │ +00643 │ │ │ │ │ │ +00644 │ │ │ │ │ │ +00645 │ │ │ │ │ │ +00646 │ │ │ │ │ │ +00647 │ │ │ │ │ │ +00648 │ │ │ │ │ │ +00649 │ │ │ │ │ │ +00650 │ │ │ │ │ │ +00651 │ │ │ │ │ │ +00652 │ │ │ │ │ │ +00653 │ │ │ │ │ │ +00654 │ │ │ │ │ │ +00655 │ │ │ │ │ │ +00656 │ │ │ │ │ │ +00657 │ │ │ │ │ │ +00658 │ │ │ │ │ │ +00659 │ │ │ │ │ │ +00660 │ │ │ │ │ │ +00661 │ │ │ │ │ │ +00662 │ │ │ │ │ │ +00663 │ │ │ │ │ │ +00664 │ │ │ │ │ │ +00665 │ │ │ │ │ │ +00666 │ │ │ │ │ │ +00667 │ │ │ │ │ │ + │ │ │ │ │ │ +235 │ │ │ │ │ │ + │ │ │ │ │ │ +dpt += fabs(child->px)+fabs(child->py)+fabs(child->pz); //child->perp2(); │ │ │ │ │ │ +} │ │ │ │ │ │ + │ │ │ │ │ │ +// now establish the list of unique children in the list │ │ │ │ │ │ +// first make sure parent and child are in! │ │ │ │ │ │ +list removed_from_cone; │ │ │ │ │ │ +list put_in_border; │ │ │ │ │ │ +list border_list; │ │ │ │ │ │ +CSphmomentum cone_removal; │ │ │ │ │ │ +CSphmomentum border = *parent; │ │ │ │ │ │ +border_list.push_back(parent); │ │ │ │ │ │ +// make sure child appears in the border region │ │ │ │ │ │ +centre->cocircular.push_back(centre); │ │ │ │ │ │ +// now establish the full contents of the cone minus the cocircular │ │ │ │ │ │ +// region and of the cocircular region itself │ │ │ │ │ │ +for(list::iterator it = centre->cocircular.begin(); │ │ │ │ │ │ +it != centre->cocircular.end(); it++) { │ │ │ │ │ │ +if ((*it)->is_inside->cone) { │ │ │ │ │ │ +cone_removal │ │ │ │ │ │ ++= *((*it)->v); │ │ │ │ │ │ +(*it)->is_inside->cone = false; │ │ │ │ │ │ +removed_from_cone.push_back((*it)->is_inside); │ │ │ │ │ │ +} │ │ │ │ │ │ + │ │ │ │ │ │ +// if a point appears twice (i.e. with + and - sign) in the list of │ │ │ │ │ │ +// points on the border, we take care not to include it twice. │ │ │ │ │ │ +// Note that this situation may appear when a point is at a distance │ │ │ │ │ │ +// close to 2R from the parent │ │ │ │ │ │ +if (!(*it)->is_inside->cocirc) { │ │ │ │ │ │ +border += *((*it)->v); │ │ │ │ │ │ +(*it)->is_inside->cocirc = true; │ │ │ │ │ │ +put_in_border.push_back((*it)->is_inside); │ │ │ │ │ │ +border_list.push_back((*it)->v); │ │ │ │ │ │ +//cout « " adding particle " « (*it)->v->_theta « ", " « (*it)->v->_phi « " to the border list" │ │ │ │ │ │ +« endl; │ │ │ │ │ │ +00668 │ │ │ │ │ │ +} │ │ │ │ │ │ +00669 │ │ │ │ │ │ +} │ │ │ │ │ │ +00670 │ │ │ │ │ │ +00671 │ │ │ │ │ │ +// figure out whether this pairing has been observed before │ │ │ │ │ │ +00672 │ │ │ │ │ │ +00673 │ │ │ │ │ │ +CSphmomentum borderless_cone = cone; │ │ │ │ │ │ +00674 │ │ │ │ │ │ +borderless_cone -= cone_removal; │ │ │ │ │ │ +bool consider = true; │ │ │ │ │ │ +00675 │ │ │ │ │ │ +00676 │ │ │ │ │ │ +for (unsigned int i=0;i(borderless_cone.ref, │ │ │ │ │ │ +00686 │ │ │ │ │ │ +border.ref)); │ │ │ │ │ │ +00687 │ │ │ │ │ │ +00688 │ │ │ │ │ │ +// first figure out whether our cone momentum is good │ │ │ │ │ │ +00689 │ │ │ │ │ │ +double local_dpt = fabs(cone_removal.px) + fabs(cone_removal.py); │ │ │ │ │ │ +00690 │ │ │ │ │ │ +double total_dpt = dpt + local_dpt; │ │ │ │ │ │ +00691 │ │ │ │ │ │ +00692 │ │ │ │ │ │ +recompute_cone_contents_if_needed(borderless_cone, total_dpt); │ │ │ │ │ │ +if (total_dpt == 0) { │ │ │ │ │ │ +00693 │ │ │ │ │ │ +00694 │ │ │ │ │ │ +// a recomputation has taken place -- so take advantage of this │ │ │ │ │ │ +00695 │ │ │ │ │ │ +// and update the member cone momentum │ │ │ │ │ │ +00696 │ │ │ │ │ │ +cone = borderless_cone + cone_removal; │ │ │ │ │ │ +00697 │ │ │ │ │ │ +dpt = local_dpt; │ │ │ │ │ │ +00698 │ │ │ │ │ │ +} │ │ │ │ │ │ +00699 │ │ │ │ │ │ +00700 │ │ │ │ │ │ +test_cone_cocircular(borderless_cone, border_list); │ │ │ │ │ │ +00701 │ │ │ │ │ │ +} │ │ │ │ │ │ +00702 │ │ │ │ │ │ +00703 │ │ │ │ │ │ +// relabel things that were in the cone but got removed │ │ │ │ │ │ +00704 │ │ │ │ │ │ +00705 │ │ │ │ │ │ +for(list::iterator is_in = removed_from_cone.begin(); │ │ │ │ │ │ +00706 │ │ │ │ │ │ +is_in != removed_from_cone.end(); is_in++) { │ │ │ │ │ │ +00707 │ │ │ │ │ │ +(*is_in)->cone = true; │ │ │ │ │ │ +00708 │ │ │ │ │ │ +} │ │ │ │ │ │ +00709 │ │ │ │ │ │ +00710 │ │ │ │ │ │ +// relabel things that got put into the border │ │ │ │ │ │ +00711 │ │ │ │ │ │ +for(list::iterator is_in = put_in_border.begin(); │ │ │ │ │ │ +00712 │ │ │ │ │ │ +is_in != put_in_border.end(); is_in++) { │ │ │ │ │ │ +00713 │ │ │ │ │ │ +(*is_in)->cocirc = false; │ │ │ │ │ │ +00714 │ │ │ │ │ │ +} │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 236 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +00715 │ │ │ │ │ │ +// we’re done with everything -- return true to signal to user that we’ve │ │ │ │ │ │ +00716 │ │ │ │ │ │ +00717 │ │ │ │ │ │ +// been through the co-circularity rigmarole │ │ │ │ │ │ +00718 │ │ │ │ │ │ +return true; │ │ │ │ │ │ +00719 } │ │ │ │ │ │ +00720 │ │ │ │ │ │ +00721 │ │ │ │ │ │ +00723 // RECOMPUTATION OF CONE CONTENTS │ │ │ │ │ │ +// │ │ │ │ │ │ +00724 // - compute_cone_contents() │ │ │ │ │ │ +// │ │ │ │ │ │ +00725 // - recompute_cone_contents() │ │ │ │ │ │ +// │ │ │ │ │ │ +00726 // - recompute_cone_contents_if_needed() │ │ │ │ │ │ +// │ │ │ │ │ │ +00728 │ │ │ │ │ │ +00737 void CSphstable_cones::compute_cone_contents() { │ │ │ │ │ │ +00738 │ │ │ │ │ │ +siscone::circulator::iterator > │ │ │ │ │ │ +00739 │ │ │ │ │ │ +start(vicinity.begin()+first_cone, vicinity.begin(), vicinity.end()); │ │ │ │ │ │ +00740 │ │ │ │ │ │ +00741 │ │ │ │ │ │ +siscone::circulator::iterator > here(start); │ │ │ │ │ │ +00742 │ │ │ │ │ │ +// note that in the following algorithm, the cone contents never includes │ │ │ │ │ │ +00743 │ │ │ │ │ │ +00744 │ │ │ │ │ │ +// the child. Indeed, if it has positive sign, then it will be set as │ │ │ │ │ │ +00745 │ │ │ │ │ │ +// outside at the last step in the loop. If it has negative sign, then the │ │ │ │ │ │ +00746 │ │ │ │ │ │ +// loop will at some point go to the corresponding situation with positive │ │ │ │ │ │ +00747 │ │ │ │ │ │ +// sign and set the inclusion status to 0. │ │ │ │ │ │ +00748 │ │ │ │ │ │ +00749 │ │ │ │ │ │ +do { │ │ │ │ │ │ +// as we leave this position a particle enters if its side is │ │ │ │ │ │ +00750 │ │ │ │ │ │ +00751 │ │ │ │ │ │ +// negative (i.e. the centre is the one at -ve angle wrt to the │ │ │ │ │ │ +00752 │ │ │ │ │ │ +// parent-child line │ │ │ │ │ │ +00753 │ │ │ │ │ │ +if (!(*here())->side) ((*here())->is_inside->cone) = 1; │ │ │ │ │ │ +00754 │ │ │ │ │ │ +// move on to the next position │ │ │ │ │ │ +00755 │ │ │ │ │ │ +00756 │ │ │ │ │ │ +++here; │ │ │ │ │ │ +00757 │ │ │ │ │ │ +// as we arrive at this position a particle leaves if its side is positive │ │ │ │ │ │ +00758 │ │ │ │ │ │ +00759 │ │ │ │ │ │ +if ((*here())->side) ((*here())->is_inside->cone) = 0; │ │ │ │ │ │ +00760 │ │ │ │ │ │ +} while (here != start); │ │ │ │ │ │ +00761 │ │ │ │ │ │ +// once we’ve reached the start the ’is_inside’ information should be │ │ │ │ │ │ +00762 │ │ │ │ │ │ +00763 │ │ │ │ │ │ +// 100% complete, so we can use it to calculate the cone contents │ │ │ │ │ │ +00764 │ │ │ │ │ │ +// and then exit │ │ │ │ │ │ +00765 │ │ │ │ │ │ +recompute_cone_contents(); │ │ │ │ │ │ +00766 │ │ │ │ │ │ +return; │ │ │ │ │ │ +00767 │ │ │ │ │ │ +00768 } │ │ │ │ │ │ +00769 │ │ │ │ │ │ +00770 │ │ │ │ │ │ +00771 /* │ │ │ │ │ │ +00772 * compute the cone momentum from particle list. │ │ │ │ │ │ +00773 * in this version, we use the ’pincluded’ information │ │ │ │ │ │ +00774 * from the CSphvicinity class │ │ │ │ │ │ +00775 */ │ │ │ │ │ │ +00776 void CSphstable_cones::recompute_cone_contents(){ │ │ │ │ │ │ +00777 │ │ │ │ │ │ +unsigned int i; │ │ │ │ │ │ +00778 │ │ │ │ │ │ +// set momentum to 0 │ │ │ │ │ │ +00779 │ │ │ │ │ │ +00780 │ │ │ │ │ │ +cone = CSphmomentum(); │ │ │ │ │ │ +00781 │ │ │ │ │ │ +// Important note: we can browse only the particles │ │ │ │ │ │ +00782 │ │ │ │ │ │ +00783 │ │ │ │ │ │ +// in vicinity since all particles in the cone are │ │ │ │ │ │ +00784 │ │ │ │ │ │ +// withing a distance 2R w.r.t. parent hence in vicinity. │ │ │ │ │ │ +00785 │ │ │ │ │ │ +// Among those, we only add the particles for which ’is_inside’ is true ! │ │ │ │ │ │ +00786 │ │ │ │ │ │ +// This methos rather than a direct comparison avoids rounding errors │ │ │ │ │ │ +00787 │ │ │ │ │ │ +for (i=0;iside) && (vicinity[i]->is_inside->cone)) │ │ │ │ │ │ +00790 │ │ │ │ │ │ +cone += *vicinity[i]->v; │ │ │ │ │ │ +00791 │ │ │ │ │ │ +} │ │ │ │ │ │ +00792 │ │ │ │ │ │ +00793 │ │ │ │ │ │ +// set check variables back to 0 │ │ │ │ │ │ +00794 │ │ │ │ │ │ +dpt = 0.0; │ │ │ │ │ │ +00795 } │ │ │ │ │ │ +00796 │ │ │ │ │ │ +00797 │ │ │ │ │ │ +00798 /* │ │ │ │ │ │ +00799 * if we have gone beyond the acceptable threshold of change, compute │ │ │ │ │ │ +00800 * the cone momentum from particle list. in this version, we use the │ │ │ │ │ │ +00801 * ’pincluded’ information from the CSphvicinity class, but we don’t │ │ │ │ │ │ +00802 * change the member cone, only the locally supplied one │ │ │ │ │ │ +00803 */ │ │ │ │ │ │ +00804 void CSphstable_cones::recompute_cone_contents_if_needed(CSphmomentum & this_cone, │ │ │ │ │ │ +00805 │ │ │ │ │ │ +double & this_dpt){ │ │ │ │ │ │ +00806 │ │ │ │ │ │ +if (this_dpt > PT_TSHOLD*(fabs(this_cone.px)+fabs(this_cone.py))) { │ │ │ │ │ │ +00807 │ │ │ │ │ │ +00808 │ │ │ │ │ │ +if (cone.ref.is_empty()) { │ │ │ │ │ │ +00809 │ │ │ │ │ │ +this_cone = CSphmomentum(); │ │ │ │ │ │ +00810 │ │ │ │ │ │ +} else { │ │ │ │ │ │ +00811 │ │ │ │ │ │ +// set momentum to 0 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.28 protocones.h │ │ │ │ │ │ + │ │ │ │ │ │ +00812 │ │ │ │ │ │ +this_cone = CSphmomentum(); │ │ │ │ │ │ +00813 │ │ │ │ │ │ +// Important note: we can browse only the particles │ │ │ │ │ │ +00814 │ │ │ │ │ │ +00815 │ │ │ │ │ │ +// in vicinity since all particles in the this_cone are │ │ │ │ │ │ +00816 │ │ │ │ │ │ +// withing a distance 2R w.r.t. parent hence in vicinity. │ │ │ │ │ │ +00817 │ │ │ │ │ │ +// Among those, we only add the particles for which ’is_inside’ is true ! │ │ │ │ │ │ +00818 │ │ │ │ │ │ +// This methos rather than a direct comparison avoids rounding errors │ │ │ │ │ │ +00819 │ │ │ │ │ │ +for (unsigned int i=0;iside) && (vicinity[i]->is_inside->cone)) │ │ │ │ │ │ +00822 │ │ │ │ │ │ +this_cone += *vicinity[i]->v; │ │ │ │ │ │ +00823 │ │ │ │ │ │ +} │ │ │ │ │ │ +00824 │ │ │ │ │ │ +00825 │ │ │ │ │ │ +} │ │ │ │ │ │ +00826 │ │ │ │ │ │ +// set check variables back to 0 │ │ │ │ │ │ +00827 │ │ │ │ │ │ +this_dpt = 0.0; │ │ │ │ │ │ +00828 │ │ │ │ │ │ +} │ │ │ │ │ │ +00829 │ │ │ │ │ │ +00830 } │ │ │ │ │ │ +00831 │ │ │ │ │ │ +00832 │ │ │ │ │ │ +00834 // VARIOUS TOOLS │ │ │ │ │ │ +// │ │ │ │ │ │ +00835 // - circle_intersect() │ │ │ │ │ │ +// │ │ │ │ │ │ +00836 // - is_inside() │ │ │ │ │ │ +// │ │ │ │ │ │ +00837 // - abs_dangle() │ │ │ │ │ │ +// │ │ │ │ │ │ +00839 │ │ │ │ │ │ +00840 │ │ │ │ │ │ +00841 /* │ │ │ │ │ │ +00842 * circle intersection. │ │ │ │ │ │ +00843 * computes the intersection with a circle of given centre and radius. │ │ │ │ │ │ +00844 * The output takes the form of a checkxor of the intersection’s particles │ │ │ │ │ │ +circle centre x coordinate │ │ │ │ │ │ +00845 * - cx │ │ │ │ │ │ +00846 * - cy │ │ │ │ │ │ +circle centre y coordinate │ │ │ │ │ │ +00847 * return the checkxor for the intersection │ │ │ │ │ │ +00848 ******************************************************************/ │ │ │ │ │ │ +00849 siscone::Creference CSphstable_cones::circle_intersect(CSph3vector &cone_centre){ │ │ │ │ │ │ +00850 │ │ │ │ │ │ +siscone::Creference intersection; │ │ │ │ │ │ +int i; │ │ │ │ │ │ +00851 │ │ │ │ │ │ +00852 │ │ │ │ │ │ +for (i=0;i │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +237 │ │ │ │ │ │ + │ │ │ │ │ │ + 238 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +00034 #include │ │ │ │ │ │ +00035 #include │ │ │ │ │ │ +00036 #include "hash.h" │ │ │ │ │ │ +00037 │ │ │ │ │ │ +00038 #include "defines.h" │ │ │ │ │ │ +00039 │ │ │ │ │ │ +00040 namespace siscone{ │ │ │ │ │ │ +00041 │ │ │ │ │ │ +00053 class Cborder_store{ │ │ │ │ │ │ +00054 public: │ │ │ │ │ │ +00056 │ │ │ │ │ │ +Cborder_store(Cmomentum * momentum, double centre_eta, double centre_phi) : │ │ │ │ │ │ +00057 │ │ │ │ │ │ +mom(momentum), is_in(false) { │ │ │ │ │ │ +00058 │ │ │ │ │ │ +angle = atan2(mom->phi - centre_phi, mom->eta - centre_eta); │ │ │ │ │ │ +00059 │ │ │ │ │ │ +} │ │ │ │ │ │ +00060 │ │ │ │ │ │ +00061 │ │ │ │ │ │ +Cmomentum * mom; │ │ │ │ │ │ +double angle; │ │ │ │ │ │ +00062 │ │ │ │ │ │ +00063 │ │ │ │ │ │ +bool │ │ │ │ │ │ +is_in; │ │ │ │ │ │ +00064 }; │ │ │ │ │ │ +00065 │ │ │ │ │ │ +00066 │ │ │ │ │ │ +00069 inline bool operator<(const Cborder_store & a, const Cborder_store & b) { │ │ │ │ │ │ +00070 │ │ │ │ │ │ return a.angle < b.angle; │ │ │ │ │ │ 00071 } │ │ │ │ │ │ 00072 │ │ │ │ │ │ 00073 │ │ │ │ │ │ 00082 class Cstable_cones : public Cvicinity{ │ │ │ │ │ │ 00083 public: │ │ │ │ │ │ 00085 │ │ │ │ │ │ @@ -15595,19 +19817,19 @@ │ │ │ │ │ │ 00086 │ │ │ │ │ │ 00088 │ │ │ │ │ │ Cstable_cones(std::vector &_particle_list); │ │ │ │ │ │ 00089 │ │ │ │ │ │ 00091 │ │ │ │ │ │ ~Cstable_cones(); │ │ │ │ │ │ 00092 │ │ │ │ │ │ -00097 │ │ │ │ │ │ void init(std::vector &_particle_list); │ │ │ │ │ │ +00097 │ │ │ │ │ │ 00098 │ │ │ │ │ │ -int get_stable_cones(double _radius); │ │ │ │ │ │ 00106 │ │ │ │ │ │ +int get_stable_cones(double _radius); │ │ │ │ │ │ 00107 │ │ │ │ │ │ 00109 │ │ │ │ │ │ std::vector protocones; │ │ │ │ │ │ 00110 │ │ │ │ │ │ 00112 │ │ │ │ │ │ hash_cones *hc; │ │ │ │ │ │ 00113 │ │ │ │ │ │ @@ -15676,16 +19898,23 @@ │ │ │ │ │ │ 00196 │ │ │ │ │ │ void compute_cone_contents(); │ │ │ │ │ │ 00203 │ │ │ │ │ │ 00204 │ │ │ │ │ │ void recompute_cone_contents(); │ │ │ │ │ │ 00210 │ │ │ │ │ │ 00211 │ │ │ │ │ │ -/* │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.29 protocones.h │ │ │ │ │ │ + │ │ │ │ │ │ +239 │ │ │ │ │ │ + │ │ │ │ │ │ 00212 │ │ │ │ │ │ +/* │ │ │ │ │ │ 00213 │ │ │ │ │ │ * if we have gone beyond the acceptable threshold of change, compute │ │ │ │ │ │ 00214 │ │ │ │ │ │ * the cone momentum from particle list. in this version, we use the │ │ │ │ │ │ 00215 │ │ │ │ │ │ * ’pincluded’ information from the Cvicinity class, but we don’t │ │ │ │ │ │ 00216 │ │ │ │ │ │ @@ -15694,27 +19923,18 @@ │ │ │ │ │ │ */ │ │ │ │ │ │ 00218 │ │ │ │ │ │ void recompute_cone_contents_if_needed(Cmomentum & this_cone, double & this_dpt); │ │ │ │ │ │ 00219 │ │ │ │ │ │ int proceed_with_stability(); │ │ │ │ │ │ 00225 │ │ │ │ │ │ 00226 │ │ │ │ │ │ -/* │ │ │ │ │ │ 00227 │ │ │ │ │ │ +/* │ │ │ │ │ │ 00228 │ │ │ │ │ │ * circle intersection. │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -209 │ │ │ │ │ │ - │ │ │ │ │ │ - 210 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00229 │ │ │ │ │ │ * computes the intersection with a circle of given centre and radius. │ │ │ │ │ │ 00230 │ │ │ │ │ │ * The output takes the form of a checkxor of the intersection’s particles │ │ │ │ │ │ circle centre x coordinate │ │ │ │ │ │ 00231 │ │ │ │ │ │ * - cx │ │ │ │ │ │ @@ -15756,15 +19976,15 @@ │ │ │ │ │ │ 00266 * \return the absolute value of the difference between the angles │ │ │ │ │ │ 00267 *****************************************************************/ │ │ │ │ │ │ 00268 inline double abs_dangle(double &angle1, double &angle2); │ │ │ │ │ │ 00269 │ │ │ │ │ │ 00270 } │ │ │ │ │ │ 00271 #endif │ │ │ │ │ │ │ │ │ │ │ │ -5.23 protocones.h │ │ │ │ │ │ +5.29 protocones.h │ │ │ │ │ │ 00001 // -*- C++ -*00003 // File: protocones.h │ │ │ │ │ │ // │ │ │ │ │ │ 00004 // Description: header file for stable cones determination (Cstable_cones) │ │ │ │ │ │ // │ │ │ │ │ │ 00005 // This file is part of the SISCone project. │ │ │ │ │ │ // │ │ │ │ │ │ 00006 // WARNING: this is not the main SISCone trunk but │ │ │ │ │ │ @@ -15773,15 +19993,14 @@ │ │ │ │ │ │ an adaptation to spherical coordinates │ │ │ │ │ │ // │ │ │ │ │ │ 00008 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ // │ │ │ │ │ │ 00009 // │ │ │ │ │ │ // │ │ │ │ │ │ 00010 // Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez │ │ │ │ │ │ -// │ │ │ │ │ │ 00011 // │ │ │ │ │ │ // │ │ │ │ │ │ 00012 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ // │ │ │ │ │ │ 00013 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ // │ │ │ │ │ │ 00014 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ @@ -15818,14 +20037,23 @@ │ │ │ │ │ │ 00033 #include "momentum.h" │ │ │ │ │ │ 00034 #include "vicinity.h" │ │ │ │ │ │ 00035 #include │ │ │ │ │ │ 00036 #include │ │ │ │ │ │ 00037 #include │ │ │ │ │ │ 00038 #include "hash.h" │ │ │ │ │ │ 00039 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ + 240 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00040 #include │ │ │ │ │ │ 00041 │ │ │ │ │ │ 00042 namespace siscone_spherical{ │ │ │ │ │ │ 00043 │ │ │ │ │ │ 00055 class CSphborder_store{ │ │ │ │ │ │ 00056 public: │ │ │ │ │ │ 00058 │ │ │ │ │ │ @@ -15834,19 +20062,14 @@ │ │ │ │ │ │ 00059 │ │ │ │ │ │ mom(momentum), is_in(false) { │ │ │ │ │ │ 00060 │ │ │ │ │ │ CSph3vector diff = (*momentum) - centre; │ │ │ │ │ │ 00061 │ │ │ │ │ │ angle = atan2(dot_product3(diff, angl_dir2), dot_product3(diff, angl_dir1)); │ │ │ │ │ │ 00062 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.23 protocones.h │ │ │ │ │ │ - │ │ │ │ │ │ 00063 │ │ │ │ │ │ std::cout « " adding point " « momentum->_theta « ", " « momentum->_phi │ │ │ │ │ │ 00064 │ │ │ │ │ │ « " at an angle of " « angle « std::endl; │ │ │ │ │ │ 00065 #endif │ │ │ │ │ │ 00066 │ │ │ │ │ │ } │ │ │ │ │ │ @@ -15913,16 +20136,16 @@ │ │ │ │ │ │ 00141 │ │ │ │ │ │ 00143 │ │ │ │ │ │ CSphmomentum *child; │ │ │ │ │ │ 00144 │ │ │ │ │ │ 00146 │ │ │ │ │ │ CSphvicinity_elm *centre; │ │ │ │ │ │ 00147 │ │ │ │ │ │ -00149 │ │ │ │ │ │ unsigned int centre_idx; │ │ │ │ │ │ +00149 │ │ │ │ │ │ 00150 │ │ │ │ │ │ unsigned int first_cone; │ │ │ │ │ │ 00152 │ │ │ │ │ │ 00153 │ │ │ │ │ │ 00159 │ │ │ │ │ │ int init_cone(); │ │ │ │ │ │ 00160 │ │ │ │ │ │ @@ -15939,29 +20162,34 @@ │ │ │ │ │ │ 00178 │ │ │ │ │ │ * indicate which members are cocircular... │ │ │ │ │ │ 00179 │ │ │ │ │ │ */ │ │ │ │ │ │ 00180 │ │ │ │ │ │ void prepare_cocircular_lists(); │ │ │ │ │ │ 00181 │ │ │ │ │ │ -00189 │ │ │ │ │ │ bool cocircular_check(); │ │ │ │ │ │ +00189 │ │ │ │ │ │ 00190 │ │ │ │ │ │ -void test_cone_cocircular(CSphmomentum & borderless_cone, │ │ │ │ │ │ 00195 │ │ │ │ │ │ +void test_cone_cocircular(CSphmomentum & borderless_cone, │ │ │ │ │ │ 00196 │ │ │ │ │ │ std::list & border_list); │ │ │ │ │ │ 00197 │ │ │ │ │ │ void test_stability(CSphmomentum & candidate, │ │ │ │ │ │ 00204 │ │ │ │ │ │ -00205 │ │ │ │ │ │ const std::vector & border_vect); │ │ │ │ │ │ +00205 │ │ │ │ │ │ 00206 │ │ │ │ │ │ -void compute_cone_contents(); │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.30 quadtree.cpp │ │ │ │ │ │ + │ │ │ │ │ │ 00213 │ │ │ │ │ │ +void compute_cone_contents(); │ │ │ │ │ │ 00214 │ │ │ │ │ │ void recompute_cone_contents(); │ │ │ │ │ │ 00220 │ │ │ │ │ │ 00221 │ │ │ │ │ │ /* │ │ │ │ │ │ 00222 │ │ │ │ │ │ 00223 │ │ │ │ │ │ @@ -15973,25 +20201,16 @@ │ │ │ │ │ │ 00226 │ │ │ │ │ │ * change the member cone, only the locally supplied one │ │ │ │ │ │ 00227 │ │ │ │ │ │ */ │ │ │ │ │ │ 00228 │ │ │ │ │ │ void recompute_cone_contents_if_needed(CSphmomentum & this_cone, double & this_dpt); │ │ │ │ │ │ 00229 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -211 │ │ │ │ │ │ - │ │ │ │ │ │ - 212 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00235 │ │ │ │ │ │ int proceed_with_stability(); │ │ │ │ │ │ +00235 │ │ │ │ │ │ 00236 │ │ │ │ │ │ /* │ │ │ │ │ │ 00237 │ │ │ │ │ │ 00238 │ │ │ │ │ │ * circle intersection. │ │ │ │ │ │ 00239 │ │ │ │ │ │ * computes the intersection with a circle of given centre and radius. │ │ │ │ │ │ @@ -16015,27 +20234,27 @@ │ │ │ │ │ │ 00249 │ │ │ │ │ │ 00251 │ │ │ │ │ │ std::vector child_list; │ │ │ │ │ │ 00252 │ │ │ │ │ │ 00255 │ │ │ │ │ │ std::vector< std::pair > multiple_centre_done; │ │ │ │ │ │ 00256 │ │ │ │ │ │ -// information for updating cone contents to avoid rounding errors │ │ │ │ │ │ 00257 │ │ │ │ │ │ +// information for updating cone contents to avoid rounding errors │ │ │ │ │ │ 00258 │ │ │ │ │ │ double dpt; │ │ │ │ │ │ 00259 }; │ │ │ │ │ │ 00260 │ │ │ │ │ │ 00261 } │ │ │ │ │ │ 00262 #endif │ │ │ │ │ │ │ │ │ │ │ │ -5.24 quadtree.cpp │ │ │ │ │ │ +5.30 quadtree.cpp │ │ │ │ │ │ 00001 │ │ │ │ │ │ -00002 // File: quadtree.cpp │ │ │ │ │ │ // │ │ │ │ │ │ +00002 // File: quadtree.cpp │ │ │ │ │ │ 00003 // Description: source file for quadtree management (Cquadtree class) │ │ │ │ │ │ // │ │ │ │ │ │ 00004 // This file is part of the SISCone project. │ │ │ │ │ │ // │ │ │ │ │ │ 00005 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ // │ │ │ │ │ │ 00006 // │ │ │ │ │ │ @@ -16093,14 +20312,23 @@ │ │ │ │ │ │ 00039 * This class implements the traditional two-dimensional quadtree. * │ │ │ │ │ │ 00040 * The elements at each node are of ’Cmomentum’ type. │ │ │ │ │ │ * │ │ │ │ │ │ 00041 *******************************************************************/ │ │ │ │ │ │ 00042 │ │ │ │ │ │ 00043 // default ctor │ │ │ │ │ │ 00044 //-------------00045 Cquadtree::Cquadtree(){ │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +241 │ │ │ │ │ │ + │ │ │ │ │ │ + 242 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00046 │ │ │ │ │ │ v = NULL; │ │ │ │ │ │ 00047 │ │ │ │ │ │ 00048 │ │ │ │ │ │ children[0][0] = children[0][1] = children[1][0] = children[1][1] = NULL; │ │ │ │ │ │ 00049 │ │ │ │ │ │ has_child = false; │ │ │ │ │ │ @@ -16108,19 +20336,14 @@ │ │ │ │ │ │ 00051 │ │ │ │ │ │ 00052 │ │ │ │ │ │ 00053 // ctor with initialisation (see init for details) │ │ │ │ │ │ 00054 //-------------------------00055 Cquadtree::Cquadtree(double _x, double _y, double _half_size_x, double _half_size_y){ │ │ │ │ │ │ 00056 │ │ │ │ │ │ v = NULL; │ │ │ │ │ │ 00057 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.24 quadtree.cpp │ │ │ │ │ │ - │ │ │ │ │ │ 00058 │ │ │ │ │ │ children[0][0] = children[0][1] = children[1][0] = children[1][1] = NULL; │ │ │ │ │ │ 00059 │ │ │ │ │ │ has_child = false; │ │ │ │ │ │ 00060 │ │ │ │ │ │ 00061 │ │ │ │ │ │ init(_x, _y, _half_size_x, _half_size_y); │ │ │ │ │ │ @@ -16216,38 +20439,43 @@ │ │ │ │ │ │ adequate child │ │ │ │ │ │ 00122 │ │ │ │ │ │ // NOTE: we assume in the whole procedure that the particle is │ │ │ │ │ │ 00123 │ │ │ │ │ │ // │ │ │ │ │ │ indeed inside the cell ! │ │ │ │ │ │ 00124 │ │ │ │ │ │ -00125 │ │ │ │ │ │ // step 1: the case of empty cells │ │ │ │ │ │ +00125 │ │ │ │ │ │ 00126 │ │ │ │ │ │ if (v==NULL){ │ │ │ │ │ │ 00127 │ │ │ │ │ │ v = v_add; │ │ │ │ │ │ return 0; │ │ │ │ │ │ 00128 │ │ │ │ │ │ 00129 │ │ │ │ │ │ } │ │ │ │ │ │ 00130 │ │ │ │ │ │ 00131 │ │ │ │ │ │ // step 2: additional work if 1! particle already present │ │ │ │ │ │ 00132 │ │ │ │ │ │ // │ │ │ │ │ │ we use the fact that only 1-particle systems have no child │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.30 quadtree.cpp │ │ │ │ │ │ + │ │ │ │ │ │ 00133 │ │ │ │ │ │ if (!has_child){ │ │ │ │ │ │ -00134 │ │ │ │ │ │ double new_half_size_x = 0.5*half_size_x; │ │ │ │ │ │ -double new_half_size_y = 0.5*half_size_y; │ │ │ │ │ │ +00134 │ │ │ │ │ │ 00135 │ │ │ │ │ │ -00136 │ │ │ │ │ │ +double new_half_size_y = 0.5*half_size_y; │ │ │ │ │ │ // create children │ │ │ │ │ │ +00136 │ │ │ │ │ │ 00137 │ │ │ │ │ │ children[0][0] = new Cquadtree(centre_x-new_half_size_x, centre_y-new_half_size_y, │ │ │ │ │ │ 00138 │ │ │ │ │ │ new_half_size_x, new_half_size_y); │ │ │ │ │ │ 00139 │ │ │ │ │ │ children[0][1] = new Cquadtree(centre_x-new_half_size_x, centre_y+new_half_size_y, │ │ │ │ │ │ 00140 │ │ │ │ │ │ @@ -16256,23 +20484,14 @@ │ │ │ │ │ │ children[1][0] = new Cquadtree(centre_x+new_half_size_x, centre_y-new_half_size_y, │ │ │ │ │ │ 00142 │ │ │ │ │ │ new_half_size_x, new_half_size_y); │ │ │ │ │ │ 00143 │ │ │ │ │ │ children[1][1] = new Cquadtree(centre_x+new_half_size_x, centre_y+new_half_size_y, │ │ │ │ │ │ 00144 │ │ │ │ │ │ new_half_size_x, new_half_size_y); │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -213 │ │ │ │ │ │ - │ │ │ │ │ │ - 214 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00145 │ │ │ │ │ │ 00146 │ │ │ │ │ │ has_child = true; │ │ │ │ │ │ 00147 │ │ │ │ │ │ // forward to child │ │ │ │ │ │ 00148 │ │ │ │ │ │ 00149 │ │ │ │ │ │ @@ -16285,16 +20504,16 @@ │ │ │ │ │ │ // copy physical params │ │ │ │ │ │ 00153 │ │ │ │ │ │ 00154 │ │ │ │ │ │ v = new Cmomentum(*v); │ │ │ │ │ │ 00155 │ │ │ │ │ │ } │ │ │ │ │ │ 00156 │ │ │ │ │ │ -00157 │ │ │ │ │ │ // step 3: add new particle │ │ │ │ │ │ +00157 │ │ │ │ │ │ 00158 │ │ │ │ │ │ // Note: v_add being a single particle, eta and phi are correct │ │ │ │ │ │ 00159 │ │ │ │ │ │ children[v_add->eta>centre_x][v_add->phi>centre_y]->add(v_add); │ │ │ │ │ │ 00160 │ │ │ │ │ │ *v+=*v_add; │ │ │ │ │ │ 00161 │ │ │ │ │ │ @@ -16308,16 +20527,16 @@ │ │ │ │ │ │ 00168 * computes the intersection with a circle of given centre and radius. │ │ │ │ │ │ 00169 * The output takes the form of a quadtree with all squares included │ │ │ │ │ │ 00170 * in the circle. │ │ │ │ │ │ circle centre x coordinate │ │ │ │ │ │ 00171 * - cx │ │ │ │ │ │ 00172 * - cy │ │ │ │ │ │ circle centre y coordinate │ │ │ │ │ │ -00173 * - cR2 │ │ │ │ │ │ circle radius SQUARED │ │ │ │ │ │ +00173 * - cR2 │ │ │ │ │ │ 00174 * return the checksum for the intersection │ │ │ │ │ │ 00175 ******************************************************************/ │ │ │ │ │ │ 00176 Creference Cquadtree::circle_intersect(double cx, double cy, double cR2){ │ │ │ │ │ │ // Description of the method: │ │ │ │ │ │ 00177 │ │ │ │ │ │ 00178 │ │ │ │ │ │ // -------------------------00179 │ │ │ │ │ │ @@ -16333,16 +20552,16 @@ │ │ │ │ │ │ // 4. check if the square is inside the circle. │ │ │ │ │ │ 00184 │ │ │ │ │ │ // │ │ │ │ │ │ If yes, add it to qt and return. │ │ │ │ │ │ 00185 │ │ │ │ │ │ // 5. check intersections with children. │ │ │ │ │ │ 00186 │ │ │ │ │ │ -// step 1: if there is no particle inside te square, no reason to go further │ │ │ │ │ │ 00187 │ │ │ │ │ │ +// step 1: if there is no particle inside te square, no reason to go further │ │ │ │ │ │ 00188 │ │ │ │ │ │ if (v==NULL) │ │ │ │ │ │ return Creference(); │ │ │ │ │ │ 00189 │ │ │ │ │ │ 00190 │ │ │ │ │ │ double dx, dy; │ │ │ │ │ │ 00191 │ │ │ │ │ │ @@ -16367,21 +20586,21 @@ │ │ │ │ │ │ 00201 │ │ │ │ │ │ dy -= 2.0*M_PI; │ │ │ │ │ │ 00202 │ │ │ │ │ │ // test distance │ │ │ │ │ │ 00203 │ │ │ │ │ │ 00204 │ │ │ │ │ │ if (dx*dx+dy*dyref; │ │ │ │ │ │ +00205 │ │ │ │ │ │ 00206 │ │ │ │ │ │ } │ │ │ │ │ │ 00207 │ │ │ │ │ │ -return Creference(); │ │ │ │ │ │ 00208 │ │ │ │ │ │ +return Creference(); │ │ │ │ │ │ 00209 │ │ │ │ │ │ } │ │ │ │ │ │ 00210 │ │ │ │ │ │ 00211 │ │ │ │ │ │ // step 3: check if there is an intersection │ │ │ │ │ │ 00212 │ │ │ │ │ │ //double ryp, rym; │ │ │ │ │ │ @@ -16393,43 +20612,45 @@ │ │ │ │ │ │ 00216 │ │ │ │ │ │ dx_c = fabs(cx-centre_x); │ │ │ │ │ │ 00217 │ │ │ │ │ │ dy_c = fabs(cy-centre_y); │ │ │ │ │ │ if (dy_c>M_PI) dy_c = 2.0*M_PI-dy_c; │ │ │ │ │ │ 00218 │ │ │ │ │ │ 00219 │ │ │ │ │ │ -// compute (minimal) the distance (pay attention to the periodicity in phi). │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +243 │ │ │ │ │ │ + │ │ │ │ │ │ + 244 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00220 │ │ │ │ │ │ +// compute (minimal) the distance (pay attention to the periodicity in phi). │ │ │ │ │ │ 00221 │ │ │ │ │ │ dx = dx_c-half_size_x; │ │ │ │ │ │ -if (dx<0) dx=0; │ │ │ │ │ │ 00222 │ │ │ │ │ │ +if (dx<0) dx=0; │ │ │ │ │ │ 00223 │ │ │ │ │ │ dy = dy_c-half_size_y; │ │ │ │ │ │ if (dy<0) dy=0; │ │ │ │ │ │ 00224 │ │ │ │ │ │ 00225 │ │ │ │ │ │ -00226 │ │ │ │ │ │ // check the distance │ │ │ │ │ │ +00226 │ │ │ │ │ │ 00227 │ │ │ │ │ │ if (dx*dx+dy*dy>=cR2){ │ │ │ │ │ │ -00228 │ │ │ │ │ │ // no intersection │ │ │ │ │ │ +00228 │ │ │ │ │ │ 00229 │ │ │ │ │ │ return Creference(); │ │ │ │ │ │ 00230 │ │ │ │ │ │ } │ │ │ │ │ │ 00231 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.25 quadtree.h │ │ │ │ │ │ - │ │ │ │ │ │ -215 │ │ │ │ │ │ - │ │ │ │ │ │ 00232 │ │ │ │ │ │ // step 4: check if included │ │ │ │ │ │ 00233 │ │ │ │ │ │ 00234 │ │ │ │ │ │ // compute the (maximal) distance │ │ │ │ │ │ 00235 │ │ │ │ │ │ dx = dx_c+half_size_x; │ │ │ │ │ │ @@ -16443,16 +20664,16 @@ │ │ │ │ │ │ 00240 │ │ │ │ │ │ if (dx*dx+dy*dyref; │ │ │ │ │ │ 00242 │ │ │ │ │ │ } │ │ │ │ │ │ 00243 │ │ │ │ │ │ -00244 │ │ │ │ │ │ // step 5: the square is not fully in. Recurse to children │ │ │ │ │ │ +00244 │ │ │ │ │ │ 00245 │ │ │ │ │ │ return children[0][0]->circle_intersect(cx, cy, cR2) │ │ │ │ │ │ 00246 │ │ │ │ │ │ + children[0][1]->circle_intersect(cx, cy, cR2) │ │ │ │ │ │ 00247 │ │ │ │ │ │ + children[1][0]->circle_intersect(cx, cy, cR2) │ │ │ │ │ │ 00248 │ │ │ │ │ │ @@ -16508,18 +20729,18 @@ │ │ │ │ │ │ 00287 int Cquadtree::save_leaves(FILE *flux){ │ │ │ │ │ │ 00288 │ │ │ │ │ │ if (flux==NULL) │ │ │ │ │ │ 00289 │ │ │ │ │ │ return 1; │ │ │ │ │ │ 00290 │ │ │ │ │ │ 00291 │ │ │ │ │ │ -00292 │ │ │ │ │ │ if (has_child){ │ │ │ │ │ │ -if (children[0][0]!=NULL) children[0][0]->save_leaves(flux); │ │ │ │ │ │ +00292 │ │ │ │ │ │ 00293 │ │ │ │ │ │ +if (children[0][0]!=NULL) children[0][0]->save_leaves(flux); │ │ │ │ │ │ 00294 │ │ │ │ │ │ if (children[0][1]!=NULL) children[0][1]->save_leaves(flux); │ │ │ │ │ │ if (children[1][0]!=NULL) children[1][0]->save_leaves(flux); │ │ │ │ │ │ 00295 │ │ │ │ │ │ 00296 │ │ │ │ │ │ if (children[1][1]!=NULL) children[1][1]->save_leaves(flux); │ │ │ │ │ │ 00297 │ │ │ │ │ │ @@ -16531,35 +20752,31 @@ │ │ │ │ │ │ 00300 │ │ │ │ │ │ 00301 │ │ │ │ │ │ return 0; │ │ │ │ │ │ 00302 } │ │ │ │ │ │ 00303 │ │ │ │ │ │ 00304 } │ │ │ │ │ │ │ │ │ │ │ │ -5.25 quadtree.h │ │ │ │ │ │ -00001 // -*- C++ -*00003 // File: quadtree.h │ │ │ │ │ │ -00004 // Description: header file for quadtree management (Cquadtree class) │ │ │ │ │ │ -00005 // This file is part of the SISCone project. │ │ │ │ │ │ -00006 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ -00007 // │ │ │ │ │ │ -00008 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ - │ │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ + 5.31 quadtree.h │ │ │ │ │ │ + │ │ │ │ │ │ +5.31 quadtree.h │ │ │ │ │ │ +00001 // -*- C++ -*00003 // File: quadtree.h │ │ │ │ │ │ // │ │ │ │ │ │ +00004 // Description: header file for quadtree management (Cquadtree class) │ │ │ │ │ │ // │ │ │ │ │ │ +00005 // This file is part of the SISCone project. │ │ │ │ │ │ // │ │ │ │ │ │ +00006 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ // │ │ │ │ │ │ +00007 // │ │ │ │ │ │ // │ │ │ │ │ │ +00008 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ // │ │ │ │ │ │ - │ │ │ │ │ │ - 216 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00009 // │ │ │ │ │ │ // │ │ │ │ │ │ 00010 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ // │ │ │ │ │ │ 00011 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ // │ │ │ │ │ │ 00012 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ @@ -16608,22 +20825,22 @@ │ │ │ │ │ │ 00050 │ │ │ │ │ │ 00054 │ │ │ │ │ │ ~Cquadtree(); │ │ │ │ │ │ 00055 │ │ │ │ │ │ int init(double _x, double _y, double _half_size_x, double _half_size_y); │ │ │ │ │ │ 00067 │ │ │ │ │ │ 00068 │ │ │ │ │ │ -00076 │ │ │ │ │ │ int add(Cmomentum *v_add); │ │ │ │ │ │ +00076 │ │ │ │ │ │ 00077 │ │ │ │ │ │ 00088 │ │ │ │ │ │ Creference circle_intersect(double cx, double cy, double cR2); │ │ │ │ │ │ 00089 │ │ │ │ │ │ -int save(FILE *flux); │ │ │ │ │ │ 00099 │ │ │ │ │ │ +int save(FILE *flux); │ │ │ │ │ │ 00100 │ │ │ │ │ │ int save_leaves(FILE *flux); │ │ │ │ │ │ 00110 │ │ │ │ │ │ 00111 │ │ │ │ │ │ double centre_x; │ │ │ │ │ │ 00112 │ │ │ │ │ │ 00113 │ │ │ │ │ │ @@ -16641,61 +20858,65 @@ │ │ │ │ │ │ 00120 │ │ │ │ │ │ bool has_child; │ │ │ │ │ │ 00121 }; │ │ │ │ │ │ 00122 │ │ │ │ │ │ 00123 } │ │ │ │ │ │ 00124 #endif │ │ │ │ │ │ │ │ │ │ │ │ -5.26 ranlux.cpp │ │ │ │ │ │ +5.32 ranlux.cpp │ │ │ │ │ │ 00001 // file: ranlux.xpp │ │ │ │ │ │ 00002 #include "ranlux.h" │ │ │ │ │ │ 00003 #include │ │ │ │ │ │ 00004 #include │ │ │ │ │ │ 00005 │ │ │ │ │ │ 00006 /* This is a lagged fibonacci generator with skipping developed by Luescher. │ │ │ │ │ │ 00007 │ │ │ │ │ │ The sequence is a series of 24-bit integers, x_n, │ │ │ │ │ │ 00008 │ │ │ │ │ │ -00009 │ │ │ │ │ │ x_n = d_n + b_n │ │ │ │ │ │ +00009 │ │ │ │ │ │ 00010 │ │ │ │ │ │ -00011 │ │ │ │ │ │ where d_n = x_{n-10} - x_{n-24} - c_{n-1}, b_n = 0 if d_n >= 0 and │ │ │ │ │ │ +00011 │ │ │ │ │ │ 00012 │ │ │ │ │ │ b_n = 2^24 if d_n < 0, c_n = 0 if d_n >= 0 and c_n = 1 if d_n < 0, │ │ │ │ │ │ 00013 │ │ │ │ │ │ where after 24 samples a group of p integers are "skipped", to │ │ │ │ │ │ 00014 │ │ │ │ │ │ reduce correlations. By default p = 199, but can be increased to │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +245 │ │ │ │ │ │ + │ │ │ │ │ │ + 246 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00015 │ │ │ │ │ │ 365. │ │ │ │ │ │ 00016 │ │ │ │ │ │ -The period of the generator is around 10^171. │ │ │ │ │ │ 00017 │ │ │ │ │ │ +The period of the generator is around 10^171. │ │ │ │ │ │ 00018 │ │ │ │ │ │ -From: M. Luescher, "A portable high-quality random number generator │ │ │ │ │ │ 00019 │ │ │ │ │ │ +From: M. Luescher, "A portable high-quality random number generator │ │ │ │ │ │ 00020 │ │ │ │ │ │ for lattice field theory calculations", Computer Physics │ │ │ │ │ │ 00021 │ │ │ │ │ │ Communications, 79 (1994) 100-110. │ │ │ │ │ │ 00022 │ │ │ │ │ │ Available on the net as hep-lat/9309020 at http://xxx.lanl.gov/ │ │ │ │ │ │ 00023 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.26 ranlux.cpp │ │ │ │ │ │ - │ │ │ │ │ │ 00024 │ │ │ │ │ │ -See also, │ │ │ │ │ │ 00025 │ │ │ │ │ │ +See also, │ │ │ │ │ │ 00026 │ │ │ │ │ │ -F. James, "RANLUX: A Fortran implementation of the high-quality │ │ │ │ │ │ 00027 │ │ │ │ │ │ +F. James, "RANLUX: A Fortran implementation of the high-quality │ │ │ │ │ │ 00028 │ │ │ │ │ │ pseudo-random number generator of Luscher", Computer Physics │ │ │ │ │ │ 00029 │ │ │ │ │ │ Communications, 79 (1994) 111-114 │ │ │ │ │ │ 00030 │ │ │ │ │ │ 00031 │ │ │ │ │ │ Kenneth G. Hamilton, F. James, "Acceleration of RANLUX", Computer │ │ │ │ │ │ @@ -16721,54 +20942,54 @@ │ │ │ │ │ │ 00047 │ │ │ │ │ │ 00048 │ │ │ │ │ │ unsigned int j; │ │ │ │ │ │ unsigned int n; │ │ │ │ │ │ 00049 │ │ │ │ │ │ 00050 │ │ │ │ │ │ unsigned int skip; │ │ │ │ │ │ -unsigned int carry; │ │ │ │ │ │ 00051 │ │ │ │ │ │ -00052 │ │ │ │ │ │ +unsigned int carry; │ │ │ │ │ │ unsigned long int u[24]; │ │ │ │ │ │ +00052 │ │ │ │ │ │ 00053 } ranlux_state_t; │ │ │ │ │ │ 00054 │ │ │ │ │ │ 00055 │ │ │ │ │ │ 00056 // internal generator state │ │ │ │ │ │ 00057 //-------------------------00058 ranlux_state_t local_ranlux_state; │ │ │ │ │ │ 00059 │ │ │ │ │ │ 00060 │ │ │ │ │ │ 00061 // incrementation of the generator state │ │ │ │ │ │ 00062 //--------------------------------------00063 static inline unsigned long int increment_state(){ │ │ │ │ │ │ -00064 │ │ │ │ │ │ unsigned int i = local_ranlux_state.i; │ │ │ │ │ │ +00064 │ │ │ │ │ │ 00065 │ │ │ │ │ │ unsigned int j = local_ranlux_state.j; │ │ │ │ │ │ long int delta = local_ranlux_state.u[j] - local_ranlux_state.u[i] │ │ │ │ │ │ 00066 │ │ │ │ │ │ 00067 │ │ │ │ │ │ - local_ranlux_state.carry; │ │ │ │ │ │ 00068 │ │ │ │ │ │ -if (delta & mask_hi){ │ │ │ │ │ │ 00069 │ │ │ │ │ │ +if (delta & mask_hi){ │ │ │ │ │ │ 00070 │ │ │ │ │ │ local_ranlux_state.carry = 1; │ │ │ │ │ │ 00071 │ │ │ │ │ │ delta &= mask_lo; │ │ │ │ │ │ 00072 │ │ │ │ │ │ } else { │ │ │ │ │ │ 00073 │ │ │ │ │ │ local_ranlux_state.carry = 0; │ │ │ │ │ │ 00074 │ │ │ │ │ │ } │ │ │ │ │ │ 00075 │ │ │ │ │ │ 00076 │ │ │ │ │ │ local_ranlux_state.u[i] = delta; │ │ │ │ │ │ 00077 │ │ │ │ │ │ -if (i==0) │ │ │ │ │ │ 00078 │ │ │ │ │ │ +if (i==0) │ │ │ │ │ │ 00079 │ │ │ │ │ │ i = 23; │ │ │ │ │ │ else │ │ │ │ │ │ 00080 │ │ │ │ │ │ 00081 │ │ │ │ │ │ i--; │ │ │ │ │ │ 00082 │ │ │ │ │ │ @@ -16792,42 +21013,40 @@ │ │ │ │ │ │ 00093 } │ │ │ │ │ │ 00094 │ │ │ │ │ │ 00095 │ │ │ │ │ │ 00096 // set generator state │ │ │ │ │ │ 00097 //--------------------00098 static void ranlux_set(unsigned long int s){ │ │ │ │ │ │ int i; │ │ │ │ │ │ 00099 │ │ │ │ │ │ -00100 │ │ │ │ │ │ long int seed; │ │ │ │ │ │ +00100 │ │ │ │ │ │ 00101 │ │ │ │ │ │ -if (s==0) │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.33 siscone/ranlux.h File Reference │ │ │ │ │ │ + │ │ │ │ │ │ +247 │ │ │ │ │ │ + │ │ │ │ │ │ 00102 │ │ │ │ │ │ +if (s==0) │ │ │ │ │ │ /* default seed is 314159265 */ │ │ │ │ │ │ 00103 │ │ │ │ │ │ s = 314159265; │ │ │ │ │ │ 00104 │ │ │ │ │ │ 00105 │ │ │ │ │ │ seed = s; │ │ │ │ │ │ 00106 │ │ │ │ │ │ 00107 │ │ │ │ │ │ /* This is the initialization algorithm of F. James, widely in use │ │ │ │ │ │ 00108 │ │ │ │ │ │ for RANLUX. */ │ │ │ │ │ │ 00109 │ │ │ │ │ │ -00110 │ │ │ │ │ │ for (i=0;i<24;i++){ │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -217 │ │ │ │ │ │ - │ │ │ │ │ │ - 218 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ +00110 │ │ │ │ │ │ 00111 │ │ │ │ │ │ unsigned long int k = seed/53668; │ │ │ │ │ │ 00112 │ │ │ │ │ │ seed = 40014*(seed-k*53668)-k*12211; │ │ │ │ │ │ if (seed<0){ │ │ │ │ │ │ 00113 │ │ │ │ │ │ 00114 │ │ │ │ │ │ @@ -16844,16 +21063,16 @@ │ │ │ │ │ │ 00120 │ │ │ │ │ │ local_ranlux_state.j = 9; │ │ │ │ │ │ 00121 │ │ │ │ │ │ local_ranlux_state.n = 0; │ │ │ │ │ │ 00122 │ │ │ │ │ │ local_ranlux_state.skip = 389-24; // 389 => best decorrelation │ │ │ │ │ │ 00123 │ │ │ │ │ │ -if (local_ranlux_state.u[23]&mask_hi){ │ │ │ │ │ │ 00124 │ │ │ │ │ │ +if (local_ranlux_state.u[23]&mask_hi){ │ │ │ │ │ │ 00125 │ │ │ │ │ │ local_ranlux_state.carry = 1; │ │ │ │ │ │ 00126 │ │ │ │ │ │ } else { │ │ │ │ │ │ 00127 │ │ │ │ │ │ local_ranlux_state.carry = 0; │ │ │ │ │ │ 00128 │ │ │ │ │ │ @@ -16868,18 +21087,18 @@ │ │ │ │ │ │ 00136 │ │ │ │ │ │ ranlux_set(0); │ │ │ │ │ │ 00137 } │ │ │ │ │ │ 00138 │ │ │ │ │ │ 00139 │ │ │ │ │ │ 00140 // get random number │ │ │ │ │ │ 00141 //------------------00142 unsigned long int ranlux_get(){ │ │ │ │ │ │ -const unsigned int skip = local_ranlux_state.skip; │ │ │ │ │ │ 00143 │ │ │ │ │ │ -00144 │ │ │ │ │ │ +const unsigned int skip = local_ranlux_state.skip; │ │ │ │ │ │ unsigned long int r = increment_state(); │ │ │ │ │ │ +00144 │ │ │ │ │ │ 00145 │ │ │ │ │ │ 00146 │ │ │ │ │ │ local_ranlux_state.n++; │ │ │ │ │ │ 00147 │ │ │ │ │ │ if (local_ranlux_state.n == 24){ │ │ │ │ │ │ 00148 │ │ │ │ │ │ 00149 │ │ │ │ │ │ @@ -16897,16 +21116,16 @@ │ │ │ │ │ │ 00155 │ │ │ │ │ │ 00156 } │ │ │ │ │ │ 00157 │ │ │ │ │ │ 00158 // print generator state │ │ │ │ │ │ 00159 //----------------------00160 void ranlux_print_state(){ │ │ │ │ │ │ 00161 │ │ │ │ │ │ size_t i; │ │ │ │ │ │ -unsigned char *p = (unsigned char *) (&local_ranlux_state); │ │ │ │ │ │ 00162 │ │ │ │ │ │ +unsigned char *p = (unsigned char *) (&local_ranlux_state); │ │ │ │ │ │ 00163 │ │ │ │ │ │ const size_t n = sizeof (ranlux_state_t); │ │ │ │ │ │ 00164 │ │ │ │ │ │ for (i=0;i= 0 and │ │ │ │ │ │ +00011 │ │ │ │ │ │ 00012 │ │ │ │ │ │ b_n = 2^24 if d_n < 0, c_n = 0 if d_n >= 0 and c_n = 1 if d_n < 0, │ │ │ │ │ │ 00013 │ │ │ │ │ │ where after 24 samples a group of p integers are "skipped", to │ │ │ │ │ │ 00014 │ │ │ │ │ │ reduce correlations. By default p = 199, but can be increased to │ │ │ │ │ │ 00015 │ │ │ │ │ │ 365. │ │ │ │ │ │ 00016 │ │ │ │ │ │ -The period of the generator is around 10^171. │ │ │ │ │ │ 00017 │ │ │ │ │ │ +The period of the generator is around 10^171. │ │ │ │ │ │ 00018 │ │ │ │ │ │ -From: M. Luescher, "A portable high-quality random number generator │ │ │ │ │ │ 00019 │ │ │ │ │ │ +From: M. Luescher, "A portable high-quality random number generator │ │ │ │ │ │ 00020 │ │ │ │ │ │ for lattice field theory calculations", Computer Physics │ │ │ │ │ │ 00021 │ │ │ │ │ │ Communications, 79 (1994) 100-110. │ │ │ │ │ │ 00022 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -219 │ │ │ │ │ │ - │ │ │ │ │ │ - 220 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00023 │ │ │ │ │ │ Available on the net as hep-lat/9309020 at http://xxx.lanl.gov/ │ │ │ │ │ │ +00023 │ │ │ │ │ │ 00024 │ │ │ │ │ │ -00025 │ │ │ │ │ │ See also, │ │ │ │ │ │ +00025 │ │ │ │ │ │ 00026 │ │ │ │ │ │ 00027 │ │ │ │ │ │ F. James, "RANLUX: A Fortran implementation of the high-quality │ │ │ │ │ │ 00028 │ │ │ │ │ │ pseudo-random number generator of Luscher", Computer Physics │ │ │ │ │ │ 00029 │ │ │ │ │ │ Communications, 79 (1994) 111-114 │ │ │ │ │ │ 00030 │ │ │ │ │ │ -Kenneth G. Hamilton, F. James, "Acceleration of RANLUX", Computer │ │ │ │ │ │ 00031 │ │ │ │ │ │ +Kenneth G. Hamilton, F. James, "Acceleration of RANLUX", Computer │ │ │ │ │ │ 00032 │ │ │ │ │ │ Physics Communications, 101 (1997) 241-248 │ │ │ │ │ │ 00033 │ │ │ │ │ │ -Kenneth G. Hamilton, "Assembler RANLUX for PCs", Computer Physics │ │ │ │ │ │ 00034 │ │ │ │ │ │ +Kenneth G. Hamilton, "Assembler RANLUX for PCs", Computer Physics │ │ │ │ │ │ 00035 │ │ │ │ │ │ Communications, 101 (1997) 249-253 */ │ │ │ │ │ │ 00036 │ │ │ │ │ │ 00037 namespace siscone{ │ │ │ │ │ │ 00038 │ │ │ │ │ │ 00040 void ranlux_init(); │ │ │ │ │ │ 00041 │ │ │ │ │ │ 00043 unsigned long int ranlux_get(); │ │ │ │ │ │ 00044 │ │ │ │ │ │ 00046 void ranlux_print_state(); │ │ │ │ │ │ 00047 │ │ │ │ │ │ 00048 } │ │ │ │ │ │ 00049 #endif │ │ │ │ │ │ │ │ │ │ │ │ -5.29 reference.cpp │ │ │ │ │ │ +5.35 reference.cpp │ │ │ │ │ │ 00001 │ │ │ │ │ │ 00002 // File: reference.cpp │ │ │ │ │ │ // │ │ │ │ │ │ 00003 // Description: source file for checkxor management (Creference class) │ │ │ │ │ │ // │ │ │ │ │ │ 00004 // This file is part of the SISCone project. │ │ │ │ │ │ // │ │ │ │ │ │ @@ -17092,14 +21308,23 @@ │ │ │ │ │ │ 00024 // $Date:: 2011-10-05 23:27:09 +0200 (Wed, 05 Oct 2011) │ │ │ │ │ │ $// │ │ │ │ │ │ 00026 │ │ │ │ │ │ 00027 #include "reference.h" │ │ │ │ │ │ 00028 #include "ranlux.h" │ │ │ │ │ │ 00029 #include │ │ │ │ │ │ 00030 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +249 │ │ │ │ │ │ + │ │ │ │ │ │ + 250 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00031 namespace siscone{ │ │ │ │ │ │ 00032 │ │ │ │ │ │ 00033 /******************************************************* │ │ │ │ │ │ 00034 * Creference implementation │ │ │ │ │ │ * │ │ │ │ │ │ 00035 * references used for checksums. │ │ │ │ │ │ * │ │ │ │ │ │ @@ -17127,32 +21352,25 @@ │ │ │ │ │ │ 00051 │ │ │ │ │ │ 00052 // create a random reference │ │ │ │ │ │ 00053 //--------------------------00054 void Creference::randomize(){ │ │ │ │ │ │ 00055 // ref[0] = reference_bit; │ │ │ │ │ │ 00056 // ref[1] = 0; │ │ │ │ │ │ 00057 // ref[2] = 0; │ │ │ │ │ │ 00058 // reference_bit «= 1; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.30 reference.h │ │ │ │ │ │ - │ │ │ │ │ │ -221 │ │ │ │ │ │ - │ │ │ │ │ │ 00059 │ │ │ │ │ │ -unsigned int r1 = ranlux_get(); │ │ │ │ │ │ 00060 │ │ │ │ │ │ +unsigned int r1 = ranlux_get(); │ │ │ │ │ │ 00061 │ │ │ │ │ │ unsigned int r2 = ranlux_get(); │ │ │ │ │ │ unsigned int r3 = ranlux_get(); │ │ │ │ │ │ 00062 │ │ │ │ │ │ 00063 │ │ │ │ │ │ unsigned int r4 = ranlux_get(); │ │ │ │ │ │ -00064 │ │ │ │ │ │ // since ranlux only produces 24 bits, take r4 and add 8 bits │ │ │ │ │ │ +00064 │ │ │ │ │ │ 00065 │ │ │ │ │ │ // from it to each of r1,r2, r3 to get 3*32 bits. │ │ │ │ │ │ 00066 │ │ │ │ │ │ ref[0] = r1+((r4 & 0x00ff0000) « 8); │ │ │ │ │ │ 00067 │ │ │ │ │ │ ref[1] = r2+((r4 & 0x0000ff00) « 16); │ │ │ │ │ │ 00068 │ │ │ │ │ │ @@ -17160,22 +21378,22 @@ │ │ │ │ │ │ 00069 │ │ │ │ │ │ if (is_empty()) randomize(); │ │ │ │ │ │ 00070 │ │ │ │ │ │ 00071 } │ │ │ │ │ │ 00072 │ │ │ │ │ │ 00073 // test emptyness │ │ │ │ │ │ 00074 //---------------00075 bool Creference::is_empty(){ │ │ │ │ │ │ -00076 │ │ │ │ │ │ return (ref[0]==0) && (ref[1]==0) && (ref[2]==0); │ │ │ │ │ │ +00076 │ │ │ │ │ │ 00077 } │ │ │ │ │ │ 00078 │ │ │ │ │ │ 00079 // test non-emptyness │ │ │ │ │ │ 00080 //-------------------00081 bool Creference::not_empty(){ │ │ │ │ │ │ -return (ref[0]!=0) || (ref[1]!=0) || (ref[2]!=0); │ │ │ │ │ │ 00082 │ │ │ │ │ │ +return (ref[0]!=0) || (ref[1]!=0) || (ref[2]!=0); │ │ │ │ │ │ 00083 } │ │ │ │ │ │ 00084 │ │ │ │ │ │ 00085 // assignment of reference │ │ │ │ │ │ 00086 //------------------------00087 Creference& Creference::operator = (const Creference &r){ │ │ │ │ │ │ 00088 │ │ │ │ │ │ ref[0] = r.ref[0]; │ │ │ │ │ │ 00089 │ │ │ │ │ │ @@ -17210,64 +21428,61 @@ │ │ │ │ │ │ 00111 //----------------------------00112 Creference& Creference::operator -= (const Creference &r){ │ │ │ │ │ │ 00113 │ │ │ │ │ │ ref[0] ^= r.ref[0]; │ │ │ │ │ │ 00114 │ │ │ │ │ │ ref[1] ^= r.ref[1]; │ │ │ │ │ │ 00115 │ │ │ │ │ │ ref[2] ^= r.ref[2]; │ │ │ │ │ │ -00116 │ │ │ │ │ │ return *this; │ │ │ │ │ │ +00116 │ │ │ │ │ │ 00117 } │ │ │ │ │ │ 00118 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.36 reference.h │ │ │ │ │ │ + │ │ │ │ │ │ 00119 } │ │ │ │ │ │ 00120 │ │ │ │ │ │ │ │ │ │ │ │ -5.30 reference.h │ │ │ │ │ │ +5.36 reference.h │ │ │ │ │ │ 00001 // -*- C++ -*00003 // File: reference.h │ │ │ │ │ │ -00004 // Description: header file for checkxor management (Creference class) │ │ │ │ │ │ -00005 // This file is part of the SISCone project. │ │ │ │ │ │ -00006 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ -00007 // │ │ │ │ │ │ -00008 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ -00009 // │ │ │ │ │ │ -00010 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ -00011 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ -00012 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ -00013 // (at your option) any later version. │ │ │ │ │ │ -00014 // │ │ │ │ │ │ -00015 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ -00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ -00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ -00018 // GNU General Public License for more details. │ │ │ │ │ │ -00019 // │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ // │ │ │ │ │ │ +00004 // Description: header file for checkxor management (Creference class) │ │ │ │ │ │ // │ │ │ │ │ │ +00005 // This file is part of the SISCone project. │ │ │ │ │ │ // │ │ │ │ │ │ +00006 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ // │ │ │ │ │ │ +00007 // │ │ │ │ │ │ // │ │ │ │ │ │ +00008 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ // │ │ │ │ │ │ +00009 // │ │ │ │ │ │ // │ │ │ │ │ │ +00010 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ // │ │ │ │ │ │ +00011 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ // │ │ │ │ │ │ +00012 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ // │ │ │ │ │ │ +00013 // (at your option) any later version. │ │ │ │ │ │ // │ │ │ │ │ │ +00014 // │ │ │ │ │ │ // │ │ │ │ │ │ +00015 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ // │ │ │ │ │ │ +00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ // │ │ │ │ │ │ +00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ // │ │ │ │ │ │ +00018 // GNU General Public License for more details. │ │ │ │ │ │ // │ │ │ │ │ │ +00019 // │ │ │ │ │ │ // │ │ │ │ │ │ - │ │ │ │ │ │ - 222 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00020 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ // │ │ │ │ │ │ 00021 // along with this program; if not, write to the Free Software │ │ │ │ │ │ // │ │ │ │ │ │ 00022 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ 00023 // │ │ │ │ │ │ // │ │ │ │ │ │ @@ -17323,66 +21538,70 @@ │ │ │ │ │ │ 00085 bool operator < (const Creference &r1, const Creference &r2); │ │ │ │ │ │ 00086 │ │ │ │ │ │ 00087 │ │ │ │ │ │ 00088 //=============== inline material ================ │ │ │ │ │ │ 00089 │ │ │ │ │ │ 00090 // equality test for two references │ │ │ │ │ │ 00091 //---------------------------------00092 inline bool operator == (const Creference &r1, const Creference &r2){ │ │ │ │ │ │ -return (r1.ref[0]==r2.ref[0]) && (r1.ref[1]==r2.ref[1]) && (r1.ref[2]==r2.ref[2]); │ │ │ │ │ │ 00093 │ │ │ │ │ │ +return (r1.ref[0]==r2.ref[0]) && (r1.ref[1]==r2.ref[1]) && (r1.ref[2]==r2.ref[2]); │ │ │ │ │ │ 00094 } │ │ │ │ │ │ 00095 │ │ │ │ │ │ 00096 // difference test for two references │ │ │ │ │ │ 00097 //---------------------------------00098 inline bool operator != (const Creference &r1, const Creference &r2){ │ │ │ │ │ │ -00099 │ │ │ │ │ │ return (r1.ref[0]!=r2.ref[0]) || (r1.ref[1]!=r2.ref[1]) || (r1.ref[2]!=r2.ref[2]); │ │ │ │ │ │ +00099 │ │ │ │ │ │ 00100 } │ │ │ │ │ │ 00101 │ │ │ │ │ │ 00102 // difference test for two references │ │ │ │ │ │ -00103 //---------------------------------00104 inline bool operator < (const Creference &r1, const Creference &r2){ │ │ │ │ │ │ +00103 //---------------------------------- │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +251 │ │ │ │ │ │ + │ │ │ │ │ │ + 252 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +00104 inline bool operator < (const Creference &r1, const Creference &r2){ │ │ │ │ │ │ return (r1.ref[0] &_particles, double _radius, │ │ │ │ │ │ -00157 │ │ │ │ │ │ int _n_pass_max, double _ptmin, │ │ │ │ │ │ +00157 │ │ │ │ │ │ 00158 │ │ │ │ │ │ Esplit_merge_scale _ordering_scale){ │ │ │ │ │ │ 00159 │ │ │ │ │ │ _initialise_if_needed(); │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +253 │ │ │ │ │ │ + │ │ │ │ │ │ + 254 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00160 │ │ │ │ │ │ -00161 │ │ │ │ │ │ // run some general safety tests (NB: f will be checked in split-merge) │ │ │ │ │ │ +00161 │ │ │ │ │ │ 00162 │ │ │ │ │ │ if (_radius <= 0.0 || _radius >= 0.5*M_PI) { │ │ │ │ │ │ 00163 │ │ │ │ │ │ ostringstream message; │ │ │ │ │ │ 00164 │ │ │ │ │ │ message « "Illegal value for cone radius, R = " « _radius │ │ │ │ │ │ 00165 │ │ │ │ │ │ « " (legal values are 0flags()); │ │ │ │ │ │ 00250 │ │ │ │ │ │ 00251 │ │ │ │ │ │ +00252 │ │ │ │ │ │ + │ │ │ │ │ │ +255 │ │ │ │ │ │ + │ │ │ │ │ │ +// print the banner │ │ │ │ │ │ +if (_banner_ostr != 0){ │ │ │ │ │ │ +ios::fmtflags flags_to_restore(_banner_ostr->flags()); │ │ │ │ │ │ + │ │ │ │ │ │ (*_banner_ostr) « "#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" « endl; │ │ │ │ │ │ +(*_banner_ostr) « "# │ │ │ │ │ │ SISCone │ │ │ │ │ │ version " « setw(28) « left « siscone_version() │ │ │ │ │ │ -00252 │ │ │ │ │ │ -(*_banner_ostr) « "# │ │ │ │ │ │ « "o" « endl; │ │ │ │ │ │ 00253 │ │ │ │ │ │ (*_banner_ostr) « "# │ │ │ │ │ │ http://projects.hepforge.org/siscone │ │ │ │ │ │ o" « endl; │ │ │ │ │ │ o" « endl; │ │ │ │ │ │ 00254 │ │ │ │ │ │ (*_banner_ostr) « "# │ │ │ │ │ │ 00255 │ │ │ │ │ │ (*_banner_ostr) « "# This is SISCone: the Seedless Infrared Safe Cone Jet Algorithm │ │ │ │ │ │ o" « endl; │ │ │ │ │ │ -o" « endl; │ │ │ │ │ │ 00256 │ │ │ │ │ │ (*_banner_ostr) « "# SISCone was written by Gavin Salam and Gregory Soyez │ │ │ │ │ │ +o" « endl; │ │ │ │ │ │ 00257 │ │ │ │ │ │ (*_banner_ostr) « "# It is released under the terms of the GNU General Public License o" « endl; │ │ │ │ │ │ -o" « endl; │ │ │ │ │ │ 00258 │ │ │ │ │ │ (*_banner_ostr) « "# │ │ │ │ │ │ +o" « endl; │ │ │ │ │ │ +o" « endl; │ │ │ │ │ │ 00259 │ │ │ │ │ │ (*_banner_ostr) « "# A description of the algorithm is available in the publication │ │ │ │ │ │ -o" « endl; │ │ │ │ │ │ 00260 │ │ │ │ │ │ (*_banner_ostr) « "# JHEP 05 (2007) 086 [arXiv:0704.0292 (hep-ph)]. │ │ │ │ │ │ o" « endl; │ │ │ │ │ │ o" « endl; │ │ │ │ │ │ 00261 │ │ │ │ │ │ (*_banner_ostr) « "# Please cite it if you use SISCone. │ │ │ │ │ │ 00262 │ │ │ │ │ │ @@ -17814,23 +22040,15 @@ │ │ │ │ │ │ _banner_ostr->flags(flags_to_restore); │ │ │ │ │ │ 00267 │ │ │ │ │ │ } │ │ │ │ │ │ 00268 } │ │ │ │ │ │ 00269 │ │ │ │ │ │ 00270 // finally, a bunch of functions to access to │ │ │ │ │ │ 00271 // basic information (package name, version) │ │ │ │ │ │ -00272 //--------------------------------------------- │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 226 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00273 │ │ │ │ │ │ +00272 //--------------------------------------------00273 │ │ │ │ │ │ 00274 /* │ │ │ │ │ │ 00275 * return SISCone package name. │ │ │ │ │ │ 00276 * This is nothing but "SISCone", it is a replacement to the │ │ │ │ │ │ 00277 * SISCONE_PACKAGE_NAME string defined in config.h and which is not │ │ │ │ │ │ 00278 * guaranteed to be public. │ │ │ │ │ │ 00279 * return the SISCone name as a string │ │ │ │ │ │ 00280 */ │ │ │ │ │ │ @@ -17842,21 +22060,21 @@ │ │ │ │ │ │ 00285 /* │ │ │ │ │ │ 00286 * return SISCone version number. │ │ │ │ │ │ 00287 * return a string of the form "X.Y.Z" with possible additional tag │ │ │ │ │ │ 00288 * │ │ │ │ │ │ (alpha, beta, devel) to mention stability status │ │ │ │ │ │ 00289 */ │ │ │ │ │ │ 00290 string siscone_version(){ │ │ │ │ │ │ -return SISCONE_VERSION; │ │ │ │ │ │ 00291 │ │ │ │ │ │ +return SISCONE_VERSION; │ │ │ │ │ │ 00292 } │ │ │ │ │ │ 00293 │ │ │ │ │ │ 00294 } │ │ │ │ │ │ │ │ │ │ │ │ -5.32 siscone.cpp │ │ │ │ │ │ +5.38 siscone.cpp │ │ │ │ │ │ 00001 │ │ │ │ │ │ // │ │ │ │ │ │ 00002 // File: siscone.cpp │ │ │ │ │ │ 00003 // Description: source file for the main SISCone class │ │ │ │ │ │ // │ │ │ │ │ │ 00004 // This file is part of the SISCone project. │ │ │ │ │ │ // │ │ │ │ │ │ @@ -17905,14 +22123,21 @@ │ │ │ │ │ │ 00026 // $Date:: 2016-05-19 16:52:05 +0200 (Thu, 19 May 2016) │ │ │ │ │ │ $// │ │ │ │ │ │ 00028 │ │ │ │ │ │ 00029 #include │ │ │ │ │ │ 00030 #include │ │ │ │ │ │ 00031 #include │ │ │ │ │ │ 00032 #include │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 256 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00033 #include "momentum.h" │ │ │ │ │ │ 00034 #include "siscone.h" │ │ │ │ │ │ 00035 #include │ │ │ │ │ │ 00036 #include │ │ │ │ │ │ 00037 #include │ │ │ │ │ │ 00038 │ │ │ │ │ │ 00039 namespace siscone_spherical{ │ │ │ │ │ │ @@ -17935,52 +22160,47 @@ │ │ │ │ │ │ 00052 //-------------00053 CSphsiscone::CSphsiscone(){ │ │ │ │ │ │ 00054 │ │ │ │ │ │ rerun_allowed = false; │ │ │ │ │ │ 00055 } │ │ │ │ │ │ 00056 │ │ │ │ │ │ 00057 // default dtor │ │ │ │ │ │ 00058 //-------------00059 CSphsiscone::~CSphsiscone(){ │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.32 siscone.cpp │ │ │ │ │ │ - │ │ │ │ │ │ 00060 │ │ │ │ │ │ rerun_allowed = false; │ │ │ │ │ │ 00061 } │ │ │ │ │ │ 00062 │ │ │ │ │ │ 00063 bool CSphsiscone::init_done=false; │ │ │ │ │ │ 00064 std::ostream* CSphsiscone::_banner_ostr=&cout; │ │ │ │ │ │ 00065 │ │ │ │ │ │ 00066 /* │ │ │ │ │ │ 00067 * compute the jets from a given particle set doing multiple passes │ │ │ │ │ │ 00068 * such pass N looks for jets among all particles not put into jets │ │ │ │ │ │ 00069 * during previous passes. │ │ │ │ │ │ -list of particles │ │ │ │ │ │ 00070 * - _particles │ │ │ │ │ │ -00071 * - _radius │ │ │ │ │ │ +list of particles │ │ │ │ │ │ cone radius │ │ │ │ │ │ -shared energy threshold for splitting&merging │ │ │ │ │ │ +00071 * - _radius │ │ │ │ │ │ 00072 * - _f │ │ │ │ │ │ +shared energy threshold for splitting&merging │ │ │ │ │ │ 00073 * - _n_pass_max maximum number of runs │ │ │ │ │ │ minimum energy of the protojets │ │ │ │ │ │ 00074 * - _Emin │ │ │ │ │ │ 00075 * - _split_merge_scale │ │ │ │ │ │ the scale choice for the split-merge procedure │ │ │ │ │ │ -00076 * │ │ │ │ │ │ NOTE: using pt leads to IR unsafety for some events with momentum │ │ │ │ │ │ -conservation. So we strongly advise not to change the default │ │ │ │ │ │ +00076 * │ │ │ │ │ │ 00077 * │ │ │ │ │ │ -00078 * │ │ │ │ │ │ +conservation. So we strongly advise not to change the default │ │ │ │ │ │ value. │ │ │ │ │ │ +00078 * │ │ │ │ │ │ 00079 * return the number of jets found. │ │ │ │ │ │ 00080 **********************************************************************/ │ │ │ │ │ │ 00081 int CSphsiscone::compute_jets(vector &_particles, double _radius, double _f, │ │ │ │ │ │ -00082 │ │ │ │ │ │ int _n_pass_max, double _Emin, │ │ │ │ │ │ +00082 │ │ │ │ │ │ 00083 │ │ │ │ │ │ Esplit_merge_scale _split_merge_scale){ │ │ │ │ │ │ // make sure things are initialised │ │ │ │ │ │ 00084 │ │ │ │ │ │ 00085 │ │ │ │ │ │ _initialise_if_needed(); │ │ │ │ │ │ 00086 │ │ │ │ │ │ @@ -17990,16 +22210,16 @@ │ │ │ │ │ │ if (_radius <= 0.0 || _radius >= 0.5*M_PI) { │ │ │ │ │ │ 00089 │ │ │ │ │ │ ostringstream message; │ │ │ │ │ │ 00090 │ │ │ │ │ │ message « "Illegal value for cone radius, R = " « _radius │ │ │ │ │ │ 00091 │ │ │ │ │ │ « " (legal values are 0 &_particles, double _radius, │ │ │ │ │ │ -00157 │ │ │ │ │ │ int _n_pass_max, double _Emin, │ │ │ │ │ │ +00157 │ │ │ │ │ │ 00158 │ │ │ │ │ │ Esplit_merge_scale _ordering_scale){ │ │ │ │ │ │ // make sure things are initialised │ │ │ │ │ │ 00159 │ │ │ │ │ │ 00160 │ │ │ │ │ │ _initialise_if_needed(); │ │ │ │ │ │ 00161 │ │ │ │ │ │ @@ -18122,26 +22340,26 @@ │ │ │ │ │ │ if (_radius <= 0.0 || _radius >= 0.5*M_PI) { │ │ │ │ │ │ 00164 │ │ │ │ │ │ ostringstream message; │ │ │ │ │ │ 00165 │ │ │ │ │ │ message « "Illegal value for cone radius, R = " « _radius │ │ │ │ │ │ 00166 │ │ │ │ │ │ « " (legal values are 00) && (_n_pass_max!=0)); │ │ │ │ │ │ -00200 │ │ │ │ │ │ -// split & merge │ │ │ │ │ │ -00201 │ │ │ │ │ │ -00202 │ │ │ │ │ │ -return jets.size(); │ │ │ │ │ │ -00203 } │ │ │ │ │ │ -00204 /* │ │ │ │ │ │ -00205 * recompute the jets with a different overlap parameter. │ │ │ │ │ │ -00206 * we use the same particles and R as in the preceeding call. │ │ │ │ │ │ -shared energy threshold for splitting&merging │ │ │ │ │ │ -00207 * - _f │ │ │ │ │ │ -00208 * - _Emin │ │ │ │ │ │ -minimum Energy of the protojets │ │ │ │ │ │ -the scale choice for the split-merge procedure │ │ │ │ │ │ -00209 * - _split_merge_scale │ │ │ │ │ │ -00210 * │ │ │ │ │ │ -NOTE: using pt leads to IR unsafety for some events with momentum │ │ │ │ │ │ -conservation. So we strongly advise not to change the default │ │ │ │ │ │ -00211 * │ │ │ │ │ │ -00212 * │ │ │ │ │ │ -value. │ │ │ │ │ │ -00213 * return the number of jets found, -1 if recomputation not allowed. │ │ │ │ │ │ -00214 ********************************************************************/ │ │ │ │ │ │ -00215 int CSphsiscone::recompute_jets(double _f, double _Emin, │ │ │ │ │ │ -00216 │ │ │ │ │ │ -Esplit_merge_scale _split_merge_scale){ │ │ │ │ │ │ -if (!rerun_allowed) │ │ │ │ │ │ -00217 │ │ │ │ │ │ -00218 │ │ │ │ │ │ -return -1; │ │ │ │ │ │ -00219 │ │ │ │ │ │ -00220 │ │ │ │ │ │ -ptcomparison.split_merge_scale = _split_merge_scale; │ │ │ │ │ │ -00221 │ │ │ │ │ │ -// restore particle list │ │ │ │ │ │ -00222 │ │ │ │ │ │ -00223 │ │ │ │ │ │ -partial_clear(); │ │ │ │ │ │ -00224 │ │ │ │ │ │ -init_pleft(); │ │ │ │ │ │ -00225 │ │ │ │ │ │ -// initialise split/merge algorithm │ │ │ │ │ │ -00226 │ │ │ │ │ │ -00227 │ │ │ │ │ │ -unsigned int i; │ │ │ │ │ │ -00228 │ │ │ │ │ │ -for (i=0;iflags()); │ │ │ │ │ │ -00250 │ │ │ │ │ │ -00251 │ │ │ │ │ │ -(*_banner_ostr) « "#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" « endl; │ │ │ │ │ │ -SISCone │ │ │ │ │ │ -version " « setw(28) « left « siscone_version() │ │ │ │ │ │ -00252 │ │ │ │ │ │ -(*_banner_ostr) « "# │ │ │ │ │ │ -« "o" « endl; │ │ │ │ │ │ -http://projects.hepforge.org/siscone │ │ │ │ │ │ -o" « endl; │ │ │ │ │ │ -00253 │ │ │ │ │ │ -(*_banner_ostr) « "# │ │ │ │ │ │ -00254 │ │ │ │ │ │ -(*_banner_ostr) « "# │ │ │ │ │ │ -o" « endl; │ │ │ │ │ │ -00255 │ │ │ │ │ │ -(*_banner_ostr) « "# This is SISCone: the Seedless Infrared Safe Cone Jet Algorithm │ │ │ │ │ │ -o" « endl; │ │ │ │ │ │ -o" « endl; │ │ │ │ │ │ -00256 │ │ │ │ │ │ -(*_banner_ostr) « "# SISCone was written by Gavin Salam and Gregory Soyez │ │ │ │ │ │ -00257 │ │ │ │ │ │ -(*_banner_ostr) « "# It is released under the terms of the GNU General Public License o" « endl; │ │ │ │ │ │ -o" « endl; │ │ │ │ │ │ -00258 │ │ │ │ │ │ -(*_banner_ostr) « "# │ │ │ │ │ │ -00259 │ │ │ │ │ │ -(*_banner_ostr) « "# │ │ │ │ │ │ -!!! │ │ │ │ │ │ -WARNING │ │ │ │ │ │ -!!! │ │ │ │ │ │ -o" « endl; │ │ │ │ │ │ -This is the version of SISCone using spherical coordinates │ │ │ │ │ │ -o" « endl; │ │ │ │ │ │ -00260 │ │ │ │ │ │ -(*_banner_ostr) « "# │ │ │ │ │ │ -00261 │ │ │ │ │ │ -(*_banner_ostr) « "# │ │ │ │ │ │ -o" « endl; │ │ │ │ │ │ -00262 │ │ │ │ │ │ -(*_banner_ostr) « "# A description of the algorithm is available in the publication │ │ │ │ │ │ -o" « endl; │ │ │ │ │ │ -o" « endl; │ │ │ │ │ │ -00263 │ │ │ │ │ │ -(*_banner_ostr) « "# JHEP 05 (2007) 086 [arXiv:0704.0292 (hep-ph)]. │ │ │ │ │ │ -00264 │ │ │ │ │ │ -(*_banner_ostr) « "# Please cite it if you use SISCone. │ │ │ │ │ │ -o" « endl; │ │ │ │ │ │ -00265 │ │ │ │ │ │ -(*_banner_ostr) « "#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" « endl; │ │ │ │ │ │ -00266 │ │ │ │ │ │ -(*_banner_ostr) « endl; │ │ │ │ │ │ -00267 │ │ │ │ │ │ -00268 │ │ │ │ │ │ -_banner_ostr->flush(); │ │ │ │ │ │ -00269 │ │ │ │ │ │ -_banner_ostr->flags(flags_to_restore); │ │ │ │ │ │ -00270 │ │ │ │ │ │ -} │ │ │ │ │ │ -00271 } │ │ │ │ │ │ -00272 │ │ │ │ │ │ -00273 // finally, a bunch of functions to access to │ │ │ │ │ │ -00274 // basic information (package name, version) │ │ │ │ │ │ -00275 //--------------------------------------------00276 │ │ │ │ │ │ -00277 /* │ │ │ │ │ │ -00278 * return SISCone package name. │ │ │ │ │ │ -00279 * This is nothing but "SISCone", it is a replacement to the │ │ │ │ │ │ -00280 * SISCONE_PACKAGE_NAME string defined in config.h and which is not │ │ │ │ │ │ -00281 * guaranteed to be public. │ │ │ │ │ │ -00282 * return the SISCone name as a string │ │ │ │ │ │ -00283 */ │ │ │ │ │ │ -00284 string siscone_package_name(){ │ │ │ │ │ │ -00285 │ │ │ │ │ │ -return SISCONE_PACKAGE_NAME; │ │ │ │ │ │ -00286 } │ │ │ │ │ │ -00287 │ │ │ │ │ │ -00288 /* │ │ │ │ │ │ -00289 * return SISCone version number. │ │ │ │ │ │ -00290 * return a string of the form "X.Y.Z" with possible additional tag │ │ │ │ │ │ -00291 * │ │ │ │ │ │ -(alpha, beta, devel) to mention stability status │ │ │ │ │ │ -00292 */ │ │ │ │ │ │ -00293 string siscone_version(){ │ │ │ │ │ │ -return SISCONE_VERSION; │ │ │ │ │ │ -00294 │ │ │ │ │ │ -00295 } │ │ │ │ │ │ -00296 │ │ │ │ │ │ -00297 } │ │ │ │ │ │ - │ │ │ │ │ │ -5.33 siscone.h │ │ │ │ │ │ -00001 // -*- C++ -*00003 // File: siscone.h │ │ │ │ │ │ -00004 // Description: header file for the main SISCone class │ │ │ │ │ │ -00005 // This file is part of the SISCone project. │ │ │ │ │ │ -00006 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ -00007 // │ │ │ │ │ │ -00008 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ -00009 // │ │ │ │ │ │ -00010 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ -00011 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ -00012 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ -00013 // (at your option) any later version. │ │ │ │ │ │ -00014 // │ │ │ │ │ │ -00015 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ -00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ - │ │ │ │ │ │ - 230 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ -// │ │ │ │ │ │ -00018 // GNU General Public License for more details. │ │ │ │ │ │ -// │ │ │ │ │ │ -00019 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00020 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ -// │ │ │ │ │ │ -00021 // along with this program; if not, write to the Free Software │ │ │ │ │ │ -// │ │ │ │ │ │ -00022 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ -00023 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00024 // $Revision:: 401 │ │ │ │ │ │ -$// │ │ │ │ │ │ -00025 // $Date:: 2016-05-19 16:44:37 +0200 (Thu, 19 May 2016) │ │ │ │ │ │ -$// │ │ │ │ │ │ -00027 │ │ │ │ │ │ -00028 #ifndef __SISCONE_H__ │ │ │ │ │ │ -00029 #define __SISCONE_H__ │ │ │ │ │ │ -00030 │ │ │ │ │ │ -00031 #include "protocones.h" │ │ │ │ │ │ -00032 #include "split_merge.h" │ │ │ │ │ │ -00033 │ │ │ │ │ │ -00034 namespace siscone{ │ │ │ │ │ │ -00035 │ │ │ │ │ │ -00048 class Csiscone : public Cstable_cones, public Csplit_merge{ │ │ │ │ │ │ -00049 public: │ │ │ │ │ │ -00051 │ │ │ │ │ │ -Csiscone(); │ │ │ │ │ │ -00052 │ │ │ │ │ │ -00054 │ │ │ │ │ │ -~Csiscone(); │ │ │ │ │ │ -00055 │ │ │ │ │ │ -int compute_jets(std::vector &_particles, double _radius, double _f, │ │ │ │ │ │ -00076 │ │ │ │ │ │ -int _n_pass_max=0, double _ptmin=0.0, │ │ │ │ │ │ -00077 │ │ │ │ │ │ -00078 │ │ │ │ │ │ -Esplit_merge_scale _split_merge_scale=SM_pttilde); │ │ │ │ │ │ -00079 │ │ │ │ │ │ -00097 │ │ │ │ │ │ -int compute_jets_progressive_removal(std::vector &_particles, double _radius, │ │ │ │ │ │ -00098 │ │ │ │ │ │ -int _n_pass_max=0, double _ptmin=0.0, │ │ │ │ │ │ -00099 │ │ │ │ │ │ -Esplit_merge_scale _ordering_scale=SM_pttilde); │ │ │ │ │ │ -00100 │ │ │ │ │ │ -int recompute_jets(double _f, double _ptmin = 0.0, │ │ │ │ │ │ -00113 │ │ │ │ │ │ -00114 │ │ │ │ │ │ -Esplit_merge_scale _split_merge_scale=SM_pttilde); │ │ │ │ │ │ -00115 │ │ │ │ │ │ -00117 │ │ │ │ │ │ -std::vector > protocones_list; │ │ │ │ │ │ -00118 │ │ │ │ │ │ -00119 │ │ │ │ │ │ -// random number initialisation │ │ │ │ │ │ -00120 │ │ │ │ │ │ -static bool init_done; │ │ │ │ │ │ -00121 │ │ │ │ │ │ -00122 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ -00123 │ │ │ │ │ │ -int nb_hash_cones_total, nb_hash_occupied_total; │ │ │ │ │ │ -00124 #endif │ │ │ │ │ │ -00125 │ │ │ │ │ │ -static void set_banner_stream(std::ostream * ostr) {_banner_ostr = ostr;} │ │ │ │ │ │ -00137 │ │ │ │ │ │ -00138 │ │ │ │ │ │ -static std::ostream * banner_stream() {return _banner_ostr;} │ │ │ │ │ │ -00143 │ │ │ │ │ │ -00144 │ │ │ │ │ │ -00145 private: │ │ │ │ │ │ -bool rerun_allowed; │ │ │ │ │ │ -00146 │ │ │ │ │ │ -00147 │ │ │ │ │ │ -static std::ostream * _banner_ostr; │ │ │ │ │ │ -00148 │ │ │ │ │ │ -void _initialise_if_needed(); │ │ │ │ │ │ -00150 │ │ │ │ │ │ -00151 │ │ │ │ │ │ -00152 }; │ │ │ │ │ │ -00153 │ │ │ │ │ │ -00154 │ │ │ │ │ │ -00155 // finally, a bunch of functions to access to │ │ │ │ │ │ -00156 // basic information (package name, version) │ │ │ │ │ │ -00157 //--------------------------------------------00158 │ │ │ │ │ │ -00166 std::string siscone_package_name(); │ │ │ │ │ │ -00167 │ │ │ │ │ │ -00173 std::string siscone_version(); │ │ │ │ │ │ -00174 │ │ │ │ │ │ -00175 } │ │ │ │ │ │ -00176 #endif │ │ │ │ │ │ - │ │ │ │ │ │ -5.34 siscone.h │ │ │ │ │ │ -00001 // -*- C++ -*00003 // File: siscone.h │ │ │ │ │ │ -00004 // Description: header file for the main SISCone class │ │ │ │ │ │ -00005 // This file is part of the SISCone project. │ │ │ │ │ │ -00006 // WARNING: this is not the main SISCone trunk but │ │ │ │ │ │ -00007 // │ │ │ │ │ │ -an adaptation to spherical coordinates │ │ │ │ │ │ -00008 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ -00009 // │ │ │ │ │ │ -00010 // Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez │ │ │ │ │ │ -00011 // │ │ │ │ │ │ -00012 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ -00013 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ -00014 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ - │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.35 siscone_error.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -231 │ │ │ │ │ │ - │ │ │ │ │ │ -00015 // (at your option) any later version. │ │ │ │ │ │ -// │ │ │ │ │ │ -00016 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00017 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ -// │ │ │ │ │ │ -00018 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ -// │ │ │ │ │ │ -00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ -// │ │ │ │ │ │ -00020 // GNU General Public License for more details. │ │ │ │ │ │ -// │ │ │ │ │ │ -00021 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00022 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ -// │ │ │ │ │ │ -00023 // along with this program; if not, write to the Free Software │ │ │ │ │ │ -// │ │ │ │ │ │ -00024 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ -00025 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00026 // $Revision:: 401 │ │ │ │ │ │ -$// │ │ │ │ │ │ -00027 // $Date:: 2016-05-19 16:44:37 +0200 (Thu, 19 May 2016) │ │ │ │ │ │ -$// │ │ │ │ │ │ -00029 │ │ │ │ │ │ -00030 #ifndef __SPH_SISCONE_H__ │ │ │ │ │ │ -00031 #define __SPH_SISCONE_H__ │ │ │ │ │ │ -00032 │ │ │ │ │ │ -00033 #include "protocones.h" │ │ │ │ │ │ -00034 #include "split_merge.h" │ │ │ │ │ │ -00035 │ │ │ │ │ │ -00036 namespace siscone_spherical{ │ │ │ │ │ │ -00037 │ │ │ │ │ │ -00050 class CSphsiscone : public CSphstable_cones, public CSphsplit_merge{ │ │ │ │ │ │ -00051 public: │ │ │ │ │ │ -00053 │ │ │ │ │ │ -CSphsiscone(); │ │ │ │ │ │ -00054 │ │ │ │ │ │ -00056 │ │ │ │ │ │ -~CSphsiscone(); │ │ │ │ │ │ -00057 │ │ │ │ │ │ -00076 │ │ │ │ │ │ -int compute_jets(std::vector &_particles, double _radius, double _f, │ │ │ │ │ │ -00077 │ │ │ │ │ │ -int _n_pass_max=0, double _Emin=0.0, │ │ │ │ │ │ -00078 │ │ │ │ │ │ -Esplit_merge_scale _split_merge_scale=SM_Etilde); │ │ │ │ │ │ -00079 │ │ │ │ │ │ -int compute_jets_progressive_removal(std::vector &_particles, double _radius, │ │ │ │ │ │ -00094 │ │ │ │ │ │ -00095 │ │ │ │ │ │ -int _n_pass_max=0, double _Emin=0.0, │ │ │ │ │ │ -00096 │ │ │ │ │ │ -Esplit_merge_scale _ordering_scale=SM_Etilde); │ │ │ │ │ │ -00097 │ │ │ │ │ │ -00110 │ │ │ │ │ │ -int recompute_jets(double _f, double _Emin = 0.0, │ │ │ │ │ │ -00111 │ │ │ │ │ │ -Esplit_merge_scale _split_merge_scale=SM_Etilde); │ │ │ │ │ │ -00112 │ │ │ │ │ │ -00114 │ │ │ │ │ │ -std::vector > protocones_list; │ │ │ │ │ │ -00115 │ │ │ │ │ │ -// random number initialisation │ │ │ │ │ │ -00116 │ │ │ │ │ │ -00117 │ │ │ │ │ │ -static bool init_done; │ │ │ │ │ │ -00118 │ │ │ │ │ │ -00119 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ -00120 │ │ │ │ │ │ -int nb_hash_cones_total, nb_hash_occupied_total; │ │ │ │ │ │ -00121 #endif │ │ │ │ │ │ -00122 │ │ │ │ │ │ -00134 │ │ │ │ │ │ -static void set_banner_stream(std::ostream * ostr) {_banner_ostr = ostr;} │ │ │ │ │ │ -00135 │ │ │ │ │ │ -static std::ostream * banner_stream() {return _banner_ostr;} │ │ │ │ │ │ -00140 │ │ │ │ │ │ -00141 │ │ │ │ │ │ -00142 private: │ │ │ │ │ │ -bool rerun_allowed; │ │ │ │ │ │ -00143 │ │ │ │ │ │ -00144 │ │ │ │ │ │ -static std::ostream * _banner_ostr; │ │ │ │ │ │ -00145 │ │ │ │ │ │ -void _initialise_if_needed(); │ │ │ │ │ │ -00147 │ │ │ │ │ │ -00148 │ │ │ │ │ │ -00149 }; │ │ │ │ │ │ -00150 │ │ │ │ │ │ -00151 │ │ │ │ │ │ -00152 // finally, a bunch of functions to access to │ │ │ │ │ │ -00153 // basic information (package name, version) │ │ │ │ │ │ -00154 //--------------------------------------------00155 │ │ │ │ │ │ -00163 std::string siscone_package_name(); │ │ │ │ │ │ -00164 │ │ │ │ │ │ -00170 std::string siscone_version(); │ │ │ │ │ │ -00171 │ │ │ │ │ │ -00172 } │ │ │ │ │ │ -00173 #endif │ │ │ │ │ │ - │ │ │ │ │ │ -5.35 siscone_error.cpp │ │ │ │ │ │ -00001 │ │ │ │ │ │ -00002 // File: siscone_error.cpp │ │ │ │ │ │ -00003 // Description: source file for SISCone error messages (Csiscone_error) │ │ │ │ │ │ -00004 // This file is part of the SISCone project. │ │ │ │ │ │ -00005 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ -00006 // │ │ │ │ │ │ -00007 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ -00008 // │ │ │ │ │ │ -00009 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ - │ │ │ │ │ │ - 232 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00010 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ -// │ │ │ │ │ │ -00011 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ -// │ │ │ │ │ │ -00012 // (at your option) any later version. │ │ │ │ │ │ -// │ │ │ │ │ │ -00013 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00014 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ -// │ │ │ │ │ │ -00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ -// │ │ │ │ │ │ -00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ -// │ │ │ │ │ │ -00017 // GNU General Public License for more details. │ │ │ │ │ │ -// │ │ │ │ │ │ -00018 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00019 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ -// │ │ │ │ │ │ -00020 // along with this program; if not, write to the Free Software │ │ │ │ │ │ -// │ │ │ │ │ │ -00021 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ -00022 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00023 // $Revision:: 123 │ │ │ │ │ │ -$// │ │ │ │ │ │ -00024 // $Date:: 2007-03-01 02:52:16 +0100 (Thu, 01 Mar 2007) │ │ │ │ │ │ -$// │ │ │ │ │ │ -00026 │ │ │ │ │ │ -00027 #include "siscone_error.h" │ │ │ │ │ │ -00028 │ │ │ │ │ │ -00029 namespace siscone{ │ │ │ │ │ │ -00030 │ │ │ │ │ │ -00031 bool Csiscone_error::m_print_errors = true; │ │ │ │ │ │ -00032 │ │ │ │ │ │ -00033 } │ │ │ │ │ │ - │ │ │ │ │ │ -5.36 siscone_error.h │ │ │ │ │ │ -00001 // -*- C++ -*00003 // File: siscone_error.h │ │ │ │ │ │ -// │ │ │ │ │ │ -00004 // Description: header file for SISCone error messages (Csiscone_error) │ │ │ │ │ │ -// │ │ │ │ │ │ -00005 // This file is part of the SISCone project. │ │ │ │ │ │ -// │ │ │ │ │ │ -00006 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ -// │ │ │ │ │ │ -00007 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00008 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ -// │ │ │ │ │ │ -00009 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00010 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ -// │ │ │ │ │ │ -00011 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ -// │ │ │ │ │ │ -00012 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ -// │ │ │ │ │ │ -00013 // (at your option) any later version. │ │ │ │ │ │ -// │ │ │ │ │ │ -00014 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00015 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ -// │ │ │ │ │ │ -00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ -// │ │ │ │ │ │ -00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ -// │ │ │ │ │ │ -00018 // GNU General Public License for more details. │ │ │ │ │ │ -// │ │ │ │ │ │ -00019 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00020 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ -// │ │ │ │ │ │ -00021 // along with this program; if not, write to the Free Software │ │ │ │ │ │ -// │ │ │ │ │ │ -00022 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ -00023 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00024 // $Revision:: 327 │ │ │ │ │ │ -$// │ │ │ │ │ │ -00025 // $Date:: 2011-11-25 15:19:39 +0100 (Fri, 25 Nov 2011) │ │ │ │ │ │ -$// │ │ │ │ │ │ -00027 │ │ │ │ │ │ -00028 #ifndef __SISCONE_ERROR_H__ │ │ │ │ │ │ -00029 #define __SISCONE_ERROR_H__ │ │ │ │ │ │ -00030 │ │ │ │ │ │ -00031 #include │ │ │ │ │ │ -00032 #include │ │ │ │ │ │ -00033 │ │ │ │ │ │ -00034 namespace siscone{ │ │ │ │ │ │ -00035 │ │ │ │ │ │ -00038 class Csiscone_error { │ │ │ │ │ │ -00039 public: │ │ │ │ │ │ -00041 │ │ │ │ │ │ -Csiscone_error() {;}; │ │ │ │ │ │ -00042 │ │ │ │ │ │ -00045 │ │ │ │ │ │ -Csiscone_error(const std::string & message_in) { │ │ │ │ │ │ -00046 │ │ │ │ │ │ -m_message = message_in; │ │ │ │ │ │ -if (m_print_errors) std::cerr « "siscone::Csiscone_error: "« message_in « std::endl; │ │ │ │ │ │ -00047 │ │ │ │ │ │ -00048 │ │ │ │ │ │ -}; │ │ │ │ │ │ -00049 │ │ │ │ │ │ -00051 │ │ │ │ │ │ -std::string message() const {return m_message;}; │ │ │ │ │ │ -00052 │ │ │ │ │ │ -static void setm_print_errors(bool print_errors) { │ │ │ │ │ │ -00055 │ │ │ │ │ │ -00056 │ │ │ │ │ │ -m_print_errors = print_errors;}; │ │ │ │ │ │ -00057 │ │ │ │ │ │ -00058 private: │ │ │ │ │ │ -00059 │ │ │ │ │ │ -std::string m_message; │ │ │ │ │ │ -static bool m_print_errors; │ │ │ │ │ │ -00060 │ │ │ │ │ │ -00061 }; │ │ │ │ │ │ -00062 │ │ │ │ │ │ -00063 } │ │ │ │ │ │ -00064 #endif │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.37 hash.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -5.37 hash.cpp │ │ │ │ │ │ -00001 │ │ │ │ │ │ -// │ │ │ │ │ │ -00002 // File: hash.cpp │ │ │ │ │ │ -00003 // Description: source file for classes hash_element and hash_cones │ │ │ │ │ │ -// │ │ │ │ │ │ -00004 // This file is part of the SISCone project. │ │ │ │ │ │ -// │ │ │ │ │ │ -00005 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ -// │ │ │ │ │ │ -00006 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00007 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ -// │ │ │ │ │ │ -00008 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00009 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ -// │ │ │ │ │ │ -00010 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ -// │ │ │ │ │ │ -00011 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ -// │ │ │ │ │ │ -00012 // (at your option) any later version. │ │ │ │ │ │ -// │ │ │ │ │ │ -00013 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00014 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ -// │ │ │ │ │ │ -00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ -// │ │ │ │ │ │ -00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ -// │ │ │ │ │ │ -00017 // GNU General Public License for more details. │ │ │ │ │ │ -// │ │ │ │ │ │ -00018 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00019 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ -// │ │ │ │ │ │ -00020 // along with this program; if not, write to the Free Software │ │ │ │ │ │ -// │ │ │ │ │ │ -00021 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ -00022 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00023 // $Revision:: 225 │ │ │ │ │ │ -$// │ │ │ │ │ │ -00024 // $Date:: 2008-05-20 16:59:47 +0200 (Tue, 20 May 2008) │ │ │ │ │ │ -$// │ │ │ │ │ │ -00026 │ │ │ │ │ │ -00027 #include │ │ │ │ │ │ -00028 #include │ │ │ │ │ │ -00029 #include "hash.h" │ │ │ │ │ │ -00030 #include │ │ │ │ │ │ -00031 │ │ │ │ │ │ -00032 namespace siscone{ │ │ │ │ │ │ -00033 │ │ │ │ │ │ -00034 using namespace std; │ │ │ │ │ │ -00035 │ │ │ │ │ │ -00036 /************************************************************** │ │ │ │ │ │ -00037 * implementation of hash_cones │ │ │ │ │ │ -* │ │ │ │ │ │ -00038 * list of cones candidates. │ │ │ │ │ │ -* │ │ │ │ │ │ -00039 * We store in this class all the hash_elements and give │ │ │ │ │ │ -* │ │ │ │ │ │ -00040 * functions to manipulate them. │ │ │ │ │ │ -* │ │ │ │ │ │ -00041 **************************************************************/ │ │ │ │ │ │ -00042 │ │ │ │ │ │ -00043 // constructor with initialisation │ │ │ │ │ │ -00044 // - _Np number of particles │ │ │ │ │ │ -00045 // - _R2 cone radius (squared) │ │ │ │ │ │ -00046 //----------------------------------00047 hash_cones::hash_cones(int _Np, double _R2){ │ │ │ │ │ │ -00048 │ │ │ │ │ │ -int i; │ │ │ │ │ │ -00049 │ │ │ │ │ │ -00050 │ │ │ │ │ │ -n_cones = 0; │ │ │ │ │ │ -00051 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ -00052 │ │ │ │ │ │ -n_occupied_cells = 0; │ │ │ │ │ │ -00053 #endif │ │ │ │ │ │ -00054 │ │ │ │ │ │ -// determine hash size │ │ │ │ │ │ -00055 │ │ │ │ │ │ -00056 │ │ │ │ │ │ -// for a ymax=5 and R=0.7, we observed an occupancy around 1/8 N^2 ~ N2 R2/4 │ │ │ │ │ │ -00057 │ │ │ │ │ │ -//mask = 1 « (int) (2*log(double(_Np))/log(2.0)); │ │ │ │ │ │ -00058 │ │ │ │ │ │ -//if (mask<=1) mask=2; │ │ │ │ │ │ -00059 │ │ │ │ │ │ -int nbits = (int) (log(_Np*_R2*_Np/4.0)/log(2.0)); │ │ │ │ │ │ -00060 │ │ │ │ │ │ -if (nbits<1) nbits=1; │ │ │ │ │ │ -00061 │ │ │ │ │ │ -mask = 1 « nbits; │ │ │ │ │ │ -00062 │ │ │ │ │ │ -// create hash │ │ │ │ │ │ -00063 │ │ │ │ │ │ -00064 │ │ │ │ │ │ -hash_array = new hash_element*[mask]; │ │ │ │ │ │ -00065 │ │ │ │ │ │ -mask--; │ │ │ │ │ │ -00066 │ │ │ │ │ │ -00067 │ │ │ │ │ │ -// set the array to 0 │ │ │ │ │ │ -00068 │ │ │ │ │ │ -//? needed ? │ │ │ │ │ │ -00069 │ │ │ │ │ │ -for (i=0;inext; │ │ │ │ │ │ -delete elm; │ │ │ │ │ │ -00085 │ │ │ │ │ │ -00086 │ │ │ │ │ │ -} │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -233 │ │ │ │ │ │ - │ │ │ │ │ │ - 234 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00087 │ │ │ │ │ │ -} │ │ │ │ │ │ -00088 │ │ │ │ │ │ -delete[] hash_array; │ │ │ │ │ │ -00089 │ │ │ │ │ │ -00090 } │ │ │ │ │ │ -00091 │ │ │ │ │ │ -00092 │ │ │ │ │ │ -00093 /* │ │ │ │ │ │ -00094 * insert a new candidate into the hash. │ │ │ │ │ │ -00095 * - v │ │ │ │ │ │ -4-momentum of the cone to add │ │ │ │ │ │ -00096 * - parent parent particle defining the cone │ │ │ │ │ │ -child particle defining the cone │ │ │ │ │ │ -00097 * - child │ │ │ │ │ │ -00098 * - p_io │ │ │ │ │ │ -whether the parent has to belong to the cone or not │ │ │ │ │ │ -whether the child has to belong to the cone or not │ │ │ │ │ │ -00099 * - c_io │ │ │ │ │ │ -00100 * return 0 on success, 1 on error │ │ │ │ │ │ -00101 ***********************************************************************/ │ │ │ │ │ │ -00102 int hash_cones::insert(Cmomentum *v, Cmomentum *parent, Cmomentum *child, bool p_io, bool c_io){ │ │ │ │ │ │ -00103 │ │ │ │ │ │ -hash_element *elm; │ │ │ │ │ │ -00104 │ │ │ │ │ │ -int index = (v->ref.ref[0]) & mask; │ │ │ │ │ │ -00105 │ │ │ │ │ │ -// check the array cell corresponding to our reference │ │ │ │ │ │ -00106 │ │ │ │ │ │ -00107 │ │ │ │ │ │ -elm = hash_array[index]; │ │ │ │ │ │ -00108 │ │ │ │ │ │ -00109 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ -00110 │ │ │ │ │ │ -if (elm==NULL) │ │ │ │ │ │ -00111 │ │ │ │ │ │ -n_occupied_cells++; │ │ │ │ │ │ -00112 #endif │ │ │ │ │ │ -00113 │ │ │ │ │ │ -do{ │ │ │ │ │ │ -00114 │ │ │ │ │ │ -00115 │ │ │ │ │ │ -// if it is not present, add it │ │ │ │ │ │ -00116 │ │ │ │ │ │ -if (elm==NULL){ │ │ │ │ │ │ -// create element │ │ │ │ │ │ -00117 │ │ │ │ │ │ -00118 │ │ │ │ │ │ -elm = new hash_element; │ │ │ │ │ │ -00119 │ │ │ │ │ │ -// set its varibles │ │ │ │ │ │ -00120 │ │ │ │ │ │ -00121 │ │ │ │ │ │ -// Note: at this level, eta and phi have already been computed │ │ │ │ │ │ -00122 │ │ │ │ │ │ -// │ │ │ │ │ │ -through Cmomentum::build_etaphi. │ │ │ │ │ │ -00123 │ │ │ │ │ │ -elm->ref = v->ref; │ │ │ │ │ │ -00124 │ │ │ │ │ │ -//compute vectors centre │ │ │ │ │ │ -00125 │ │ │ │ │ │ -00126 │ │ │ │ │ │ -v->build_etaphi(); │ │ │ │ │ │ -00127 │ │ │ │ │ │ -elm->eta = v->eta; │ │ │ │ │ │ -00128 │ │ │ │ │ │ -elm->phi = v->phi; │ │ │ │ │ │ -00129 │ │ │ │ │ │ -// if at least one of the two is_inside tests gives a result != from the expected, │ │ │ │ │ │ -00130 │ │ │ │ │ │ -// the || will be true hence !(...) false as wanted │ │ │ │ │ │ -00131 │ │ │ │ │ │ -elm->is_stable = !((is_inside(v, parent)^p_io)||(is_inside(v, child)^c_io)); │ │ │ │ │ │ -00132 │ │ │ │ │ │ -//cout « "-- new status of " « v->ref[0] « ":" « elm->is_stable « endl; │ │ │ │ │ │ -00133 │ │ │ │ │ │ -00134 │ │ │ │ │ │ -// update hash │ │ │ │ │ │ -00135 │ │ │ │ │ │ -elm->next = hash_array[index]; │ │ │ │ │ │ -00136 │ │ │ │ │ │ -hash_array[index] = elm; │ │ │ │ │ │ -00137 │ │ │ │ │ │ -00138 │ │ │ │ │ │ -n_cones++; │ │ │ │ │ │ -return 0; │ │ │ │ │ │ -00139 │ │ │ │ │ │ -00140 │ │ │ │ │ │ -} │ │ │ │ │ │ -00141 │ │ │ │ │ │ -00142 │ │ │ │ │ │ -// if the cone is already there, simply update stability status │ │ │ │ │ │ -00143 │ │ │ │ │ │ -if (v->ref == elm->ref){ │ │ │ │ │ │ -00144 │ │ │ │ │ │ -// there is only an update to perform to see if the cone is still stable │ │ │ │ │ │ -00145 │ │ │ │ │ │ -if (elm->is_stable){ │ │ │ │ │ │ -00146 │ │ │ │ │ │ -v->build_etaphi(); │ │ │ │ │ │ -00147 │ │ │ │ │ │ -elm->is_stable = !((is_inside(v, parent)^p_io)||(is_inside(v, child)^c_io)); │ │ │ │ │ │ -00148 │ │ │ │ │ │ -//cout « " parent/child: " │ │ │ │ │ │ -00149 │ │ │ │ │ │ -// │ │ │ │ │ │ -« parent->ref[0] « ":" « is_inside(v, parent) « ":" « p_io « " " │ │ │ │ │ │ -00150 │ │ │ │ │ │ -// │ │ │ │ │ │ -« child->ref[0] « ":" « is_inside(v, child) « ":" « c_io « endl; │ │ │ │ │ │ -00151 │ │ │ │ │ │ -//cout « "-- rep status of " « v->ref[0] « ":" « elm->is_stable « endl; │ │ │ │ │ │ -00152 │ │ │ │ │ │ -//cout « v->eta « " " « v->phi « endl; │ │ │ │ │ │ -00153 │ │ │ │ │ │ -//cout « (child->eta) « " " « child->phi « endl; │ │ │ │ │ │ -00154 │ │ │ │ │ │ -} │ │ │ │ │ │ -return 0; │ │ │ │ │ │ -00155 │ │ │ │ │ │ -00156 │ │ │ │ │ │ -} │ │ │ │ │ │ -00157 │ │ │ │ │ │ -00158 │ │ │ │ │ │ -elm = elm->next; │ │ │ │ │ │ -00159 │ │ │ │ │ │ -} while (1); │ │ │ │ │ │ -00160 │ │ │ │ │ │ -00161 │ │ │ │ │ │ -return 1; │ │ │ │ │ │ -00162 } │ │ │ │ │ │ -00163 │ │ │ │ │ │ -00164 /* │ │ │ │ │ │ -00165 * insert a new candidate into the hash. │ │ │ │ │ │ -00166 * - v │ │ │ │ │ │ -4-momentum of te cone to add │ │ │ │ │ │ -00167 * Note, in this case, we assume stability. We also assume │ │ │ │ │ │ -00168 * that eta and phi are computed for v │ │ │ │ │ │ -00169 * return 0 on success, 1 on error │ │ │ │ │ │ -00170 ***********************************************************************/ │ │ │ │ │ │ -00171 int hash_cones::insert(Cmomentum *v){ │ │ │ │ │ │ -00172 │ │ │ │ │ │ -hash_element *elm; │ │ │ │ │ │ -00173 │ │ │ │ │ │ -int index = (v->ref.ref[0]) & mask; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.38 hash.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -235 │ │ │ │ │ │ - │ │ │ │ │ │ -00174 │ │ │ │ │ │ -//cout « "-- stable candidate: " « v->ref[0] « ":" « endl; │ │ │ │ │ │ -00175 │ │ │ │ │ │ -00176 │ │ │ │ │ │ -// check the array cell corresponding to our reference │ │ │ │ │ │ -00177 │ │ │ │ │ │ -elm = hash_array[index]; │ │ │ │ │ │ -00178 │ │ │ │ │ │ -do{ │ │ │ │ │ │ -00179 │ │ │ │ │ │ -// if it is not present, add it │ │ │ │ │ │ -00180 │ │ │ │ │ │ -if (elm==NULL){ │ │ │ │ │ │ -00181 │ │ │ │ │ │ -// create element │ │ │ │ │ │ -00182 │ │ │ │ │ │ -elm = new hash_element; │ │ │ │ │ │ -00183 │ │ │ │ │ │ -00184 │ │ │ │ │ │ -// set its varibles │ │ │ │ │ │ -00185 │ │ │ │ │ │ -// Note: at this level, eta and phi have already been computed │ │ │ │ │ │ -00186 │ │ │ │ │ │ -// │ │ │ │ │ │ -through Cmomentum::build_etaphi. │ │ │ │ │ │ -00187 │ │ │ │ │ │ -elm->ref = v->ref; │ │ │ │ │ │ -00188 │ │ │ │ │ │ -elm->eta = v->eta; │ │ │ │ │ │ -00189 │ │ │ │ │ │ -elm->phi = v->phi; │ │ │ │ │ │ -00190 │ │ │ │ │ │ -elm->is_stable = true; │ │ │ │ │ │ -00191 │ │ │ │ │ │ -// update hash │ │ │ │ │ │ -00192 │ │ │ │ │ │ -00193 │ │ │ │ │ │ -elm->next = hash_array[index]; │ │ │ │ │ │ -00194 │ │ │ │ │ │ -hash_array[index] = elm; │ │ │ │ │ │ -00195 │ │ │ │ │ │ -00196 │ │ │ │ │ │ -n_cones++; │ │ │ │ │ │ -return 0; │ │ │ │ │ │ -00197 │ │ │ │ │ │ -00198 │ │ │ │ │ │ -} │ │ │ │ │ │ -00199 │ │ │ │ │ │ -00200 │ │ │ │ │ │ -// if the cone is already there, we have nothing to do │ │ │ │ │ │ -00201 │ │ │ │ │ │ -if (v->ref == elm->ref){ │ │ │ │ │ │ -00202 │ │ │ │ │ │ -return 0; │ │ │ │ │ │ -00203 │ │ │ │ │ │ -} │ │ │ │ │ │ -00204 │ │ │ │ │ │ -00205 │ │ │ │ │ │ -elm = elm->next; │ │ │ │ │ │ -00206 │ │ │ │ │ │ -} while (1); │ │ │ │ │ │ -00207 │ │ │ │ │ │ -return 1; │ │ │ │ │ │ -00208 │ │ │ │ │ │ -00209 } │ │ │ │ │ │ -00210 │ │ │ │ │ │ -00211 /* │ │ │ │ │ │ -00212 * test if a particle is inside a cone of given centre. │ │ │ │ │ │ -00213 * check if the particle of coordinates ’v’ is inside the circle of radius R │ │ │ │ │ │ -00214 * centered at ’centre’. │ │ │ │ │ │ -centre of the circle │ │ │ │ │ │ -00215 * - centre │ │ │ │ │ │ -00216 * - v │ │ │ │ │ │ -particle to test │ │ │ │ │ │ -00217 * return true if inside, false if outside │ │ │ │ │ │ -00218 ******************************************************************************/ │ │ │ │ │ │ -00219 inline bool hash_cones::is_inside(Cmomentum *centre, Cmomentum *v){ │ │ │ │ │ │ -double dx, dy; │ │ │ │ │ │ -00220 │ │ │ │ │ │ -00221 │ │ │ │ │ │ -00222 │ │ │ │ │ │ -dx = centre->eta - v->eta; │ │ │ │ │ │ -00223 │ │ │ │ │ │ -dy = fabs(centre->phi - v->phi); │ │ │ │ │ │ -00224 │ │ │ │ │ │ -if (dy>M_PI) │ │ │ │ │ │ -00225 │ │ │ │ │ │ -dy -= 2.0*M_PI; │ │ │ │ │ │ -00226 │ │ │ │ │ │ -return dx*dx+dy*dy │ │ │ │ │ │ -00030 #include │ │ │ │ │ │ -00031 #include "hash.h" │ │ │ │ │ │ -00032 #include │ │ │ │ │ │ -00033 │ │ │ │ │ │ -00034 namespace siscone_spherical{ │ │ │ │ │ │ -00035 │ │ │ │ │ │ -00036 using namespace std; │ │ │ │ │ │ -00037 │ │ │ │ │ │ -00038 /************************************************************** │ │ │ │ │ │ -00039 * implementation of sph_hash_cones │ │ │ │ │ │ -* │ │ │ │ │ │ -00040 * list of cones candidates. │ │ │ │ │ │ -* │ │ │ │ │ │ -00041 * We store in this class all the sph_hash_element and give │ │ │ │ │ │ -* │ │ │ │ │ │ -00042 * functions to manipulate them. │ │ │ │ │ │ -* │ │ │ │ │ │ -00043 **************************************************************/ │ │ │ │ │ │ -00044 │ │ │ │ │ │ -00045 // constructor with initialisation │ │ │ │ │ │ -00046 // - _Np │ │ │ │ │ │ -number of particles │ │ │ │ │ │ -00047 // - _radius cone radius │ │ │ │ │ │ -00048 //----------------------------------00049 sph_hash_cones::sph_hash_cones(int _Np, double _radius){ │ │ │ │ │ │ -int i; │ │ │ │ │ │ -00050 │ │ │ │ │ │ -00051 │ │ │ │ │ │ -00052 │ │ │ │ │ │ -n_cones = 0; │ │ │ │ │ │ -00053 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ -00054 │ │ │ │ │ │ -n_occupied_cells = 0; │ │ │ │ │ │ -00055 #endif │ │ │ │ │ │ -00056 │ │ │ │ │ │ -// determine hash size │ │ │ │ │ │ -00057 │ │ │ │ │ │ -00058 │ │ │ │ │ │ -// for a ymax=5 and R=0.7, we observed an occupancy around 1/8 N^2 ~ N2 R2/4 │ │ │ │ │ │ -00059 │ │ │ │ │ │ -//mask = 1 « (int) (2*log(double(_Np))/log(2.0)); │ │ │ │ │ │ -00060 │ │ │ │ │ │ -//if (mask<=1) mask=2; │ │ │ │ │ │ -00061 │ │ │ │ │ │ -int nbits = (int) (log(_Np*_radius*_radius*_Np/4.0)/log(2.0)); │ │ │ │ │ │ -if (nbits<1) nbits=1; │ │ │ │ │ │ -00062 │ │ │ │ │ │ -00063 │ │ │ │ │ │ -mask = 1 « nbits; │ │ │ │ │ │ -00064 │ │ │ │ │ │ -00065 │ │ │ │ │ │ -// create hash │ │ │ │ │ │ -00066 │ │ │ │ │ │ -hash_array = new sph_hash_element*[mask]; │ │ │ │ │ │ -00067 │ │ │ │ │ │ -mask--; │ │ │ │ │ │ -00068 │ │ │ │ │ │ -// set the array to 0 │ │ │ │ │ │ -00069 │ │ │ │ │ │ -00070 │ │ │ │ │ │ -//? needed ? │ │ │ │ │ │ -00071 │ │ │ │ │ │ -for (i=0;inext; │ │ │ │ │ │ -delete elm; │ │ │ │ │ │ -00088 │ │ │ │ │ │ -00089 │ │ │ │ │ │ -} │ │ │ │ │ │ -00090 │ │ │ │ │ │ -} │ │ │ │ │ │ -00091 │ │ │ │ │ │ -00092 │ │ │ │ │ │ -delete[] hash_array; │ │ │ │ │ │ -00093 } │ │ │ │ │ │ -00094 │ │ │ │ │ │ -00095 │ │ │ │ │ │ -00096 /* │ │ │ │ │ │ -00097 * insert a new candidate into the hash. │ │ │ │ │ │ -00098 * - v │ │ │ │ │ │ -4-momentum of the cone to add │ │ │ │ │ │ -00099 * - parent parent particle defining the cone │ │ │ │ │ │ -00100 * - child │ │ │ │ │ │ -child particle defining the cone │ │ │ │ │ │ -whether the parent has to belong to the cone or not │ │ │ │ │ │ -00101 * - p_io │ │ │ │ │ │ -00102 * - c_io │ │ │ │ │ │ -whether the child has to belong to the cone or not │ │ │ │ │ │ -00103 * return 0 on success, 1 on error │ │ │ │ │ │ -00104 ***********************************************************************/ │ │ │ │ │ │ -00105 int sph_hash_cones::insert(CSphmomentum *v, CSphmomentum *parent, CSphmomentum *child, bool p_io, bool │ │ │ │ │ │ -c_io){ │ │ │ │ │ │ -00106 │ │ │ │ │ │ -sph_hash_element *elm; │ │ │ │ │ │ -int index = (v->ref.ref[0]) & mask; │ │ │ │ │ │ -00107 │ │ │ │ │ │ -00108 │ │ │ │ │ │ -// check the array cell corresponding to our reference │ │ │ │ │ │ -00109 │ │ │ │ │ │ -00110 │ │ │ │ │ │ -elm = hash_array[index]; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.38 hash.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -00111 │ │ │ │ │ │ -00112 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ -00113 │ │ │ │ │ │ -if (elm==NULL) │ │ │ │ │ │ -00114 │ │ │ │ │ │ -n_occupied_cells++; │ │ │ │ │ │ -00115 #endif │ │ │ │ │ │ -00116 │ │ │ │ │ │ -do{ │ │ │ │ │ │ -00117 │ │ │ │ │ │ -00118 │ │ │ │ │ │ -// if it is not present, add it │ │ │ │ │ │ -00119 │ │ │ │ │ │ -if (elm==NULL){ │ │ │ │ │ │ -00120 │ │ │ │ │ │ -// create element │ │ │ │ │ │ -00121 │ │ │ │ │ │ -elm = new sph_hash_element; │ │ │ │ │ │ -00122 │ │ │ │ │ │ -// set its varibles │ │ │ │ │ │ -00123 │ │ │ │ │ │ -00124 │ │ │ │ │ │ -// Note: at this level, eta and phi have already been computed │ │ │ │ │ │ -00125 │ │ │ │ │ │ -// │ │ │ │ │ │ -through CSphmomentum::build_thetaphi. │ │ │ │ │ │ -00126 │ │ │ │ │ │ -elm->centre = *v; │ │ │ │ │ │ -00127 │ │ │ │ │ │ -00128 │ │ │ │ │ │ -// if at least one of the two is_closer tests gives a result != from the expected, │ │ │ │ │ │ -00129 │ │ │ │ │ │ -// the || will be true hence !(...) false as wanted │ │ │ │ │ │ -00130 │ │ │ │ │ │ -elm->is_stable = !((is_closer(v, parent, tan2R)^p_io)||(is_closer(v, child, tan2R)^c_io)); │ │ │ │ │ │ -//cout « "-- new status of " « v->ref[0] « ":" « elm->is_stable « endl; │ │ │ │ │ │ -00131 │ │ │ │ │ │ -00132 │ │ │ │ │ │ -00133 │ │ │ │ │ │ -// update hash │ │ │ │ │ │ -00134 │ │ │ │ │ │ -elm->next = hash_array[index]; │ │ │ │ │ │ -00135 │ │ │ │ │ │ -hash_array[index] = elm; │ │ │ │ │ │ -00136 │ │ │ │ │ │ -00137 │ │ │ │ │ │ -n_cones++; │ │ │ │ │ │ -return 0; │ │ │ │ │ │ -00138 │ │ │ │ │ │ -00139 │ │ │ │ │ │ -} │ │ │ │ │ │ -00140 │ │ │ │ │ │ -00141 │ │ │ │ │ │ -// if the cone is already there, simply update stability status │ │ │ │ │ │ -00142 │ │ │ │ │ │ -if (v->ref == elm->centre.ref){ │ │ │ │ │ │ -// there is only an update to perform to see if the cone is still stable │ │ │ │ │ │ -00143 │ │ │ │ │ │ -00144 │ │ │ │ │ │ -if (elm->is_stable){ │ │ │ │ │ │ -00145 │ │ │ │ │ │ -elm->is_stable = !((is_closer(v, parent, tan2R)^p_io)||(is_closer(v, child, tan2R)^c_io)); │ │ │ │ │ │ -//cout « " parent/child: " │ │ │ │ │ │ -00146 │ │ │ │ │ │ -00147 │ │ │ │ │ │ -// │ │ │ │ │ │ -« parent->ref[0] « ":" « is_closer(v, parent) « ":" « p_io « " " │ │ │ │ │ │ -00148 │ │ │ │ │ │ -// │ │ │ │ │ │ -« child->ref[0] « ":" « is_closer(v, child) « ":" « c_io « endl; │ │ │ │ │ │ -00149 │ │ │ │ │ │ -//cout « "-- rep status of " « v->ref[0] « ":" « elm->is_stable « endl; │ │ │ │ │ │ -00150 │ │ │ │ │ │ -//cout « v->eta « " " « v->phi « endl; │ │ │ │ │ │ -00151 │ │ │ │ │ │ -//cout « (child->eta) « " " « child->phi « endl; │ │ │ │ │ │ -00152 │ │ │ │ │ │ -} │ │ │ │ │ │ -return 0; │ │ │ │ │ │ -00153 │ │ │ │ │ │ -00154 │ │ │ │ │ │ -} │ │ │ │ │ │ -00155 │ │ │ │ │ │ -00156 │ │ │ │ │ │ -elm = elm->next; │ │ │ │ │ │ -00157 │ │ │ │ │ │ -} while (1); │ │ │ │ │ │ -00158 │ │ │ │ │ │ -00159 │ │ │ │ │ │ -return 1; │ │ │ │ │ │ -00160 } │ │ │ │ │ │ -00161 │ │ │ │ │ │ -00162 /* │ │ │ │ │ │ -00163 * insert a new candidate into the hash. │ │ │ │ │ │ -00164 * - v │ │ │ │ │ │ -4-momentum of te cone to add │ │ │ │ │ │ -00165 * Note, in this case, we assume stability. We also assume │ │ │ │ │ │ -00166 * that eta and phi are computed for v │ │ │ │ │ │ -00167 * return 0 on success, 1 on error │ │ │ │ │ │ -00168 ***********************************************************************/ │ │ │ │ │ │ -00169 int sph_hash_cones::insert(CSphmomentum *v){ │ │ │ │ │ │ -00170 │ │ │ │ │ │ -sph_hash_element *elm; │ │ │ │ │ │ -00171 │ │ │ │ │ │ -int index = (v->ref.ref[0]) & mask; │ │ │ │ │ │ -//cout « "-- stable candidate: " « v->ref[0] « ":" « endl; │ │ │ │ │ │ -00172 │ │ │ │ │ │ -00173 │ │ │ │ │ │ -// check the array cell corresponding to our reference │ │ │ │ │ │ -00174 │ │ │ │ │ │ -00175 │ │ │ │ │ │ -elm = hash_array[index]; │ │ │ │ │ │ -do{ │ │ │ │ │ │ -00176 │ │ │ │ │ │ -00177 │ │ │ │ │ │ -// if it is not present, add it │ │ │ │ │ │ -00178 │ │ │ │ │ │ -if (elm==NULL){ │ │ │ │ │ │ -// create element │ │ │ │ │ │ -00179 │ │ │ │ │ │ -00180 │ │ │ │ │ │ -elm = new sph_hash_element; │ │ │ │ │ │ -00181 │ │ │ │ │ │ -// set its varibles │ │ │ │ │ │ -00182 │ │ │ │ │ │ -00183 │ │ │ │ │ │ -// Note: at this level, eta and phi have already been computed │ │ │ │ │ │ -00184 │ │ │ │ │ │ -// │ │ │ │ │ │ -through CSphmomentum::build_thetaphi. │ │ │ │ │ │ -00185 │ │ │ │ │ │ -elm->centre = *v; │ │ │ │ │ │ -00186 │ │ │ │ │ │ -elm->is_stable = true; │ │ │ │ │ │ -00187 │ │ │ │ │ │ -// update hash │ │ │ │ │ │ -00188 │ │ │ │ │ │ -00189 │ │ │ │ │ │ -elm->next = hash_array[index]; │ │ │ │ │ │ -00190 │ │ │ │ │ │ -hash_array[index] = elm; │ │ │ │ │ │ -00191 │ │ │ │ │ │ -00192 │ │ │ │ │ │ -n_cones++; │ │ │ │ │ │ -00193 │ │ │ │ │ │ -return 0; │ │ │ │ │ │ -00194 │ │ │ │ │ │ -} │ │ │ │ │ │ -00195 │ │ │ │ │ │ -00196 │ │ │ │ │ │ -// if the cone is already there, we have nothing to do │ │ │ │ │ │ -00197 │ │ │ │ │ │ -if (v->ref == elm->centre.ref){ │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -237 │ │ │ │ │ │ - │ │ │ │ │ │ - 238 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00198 │ │ │ │ │ │ -return 0; │ │ │ │ │ │ -00199 │ │ │ │ │ │ -} │ │ │ │ │ │ -00200 │ │ │ │ │ │ -00201 │ │ │ │ │ │ -elm = elm->next; │ │ │ │ │ │ -00202 │ │ │ │ │ │ -} while (1); │ │ │ │ │ │ -00203 │ │ │ │ │ │ -return 1; │ │ │ │ │ │ -00204 │ │ │ │ │ │ -00205 } │ │ │ │ │ │ -00206 │ │ │ │ │ │ -00207 } │ │ │ │ │ │ - │ │ │ │ │ │ -5.39 hash.h │ │ │ │ │ │ -00001 // -*- C++ -*00003 // File: hash.h │ │ │ │ │ │ -// │ │ │ │ │ │ -00004 // Description: header file for classes hash_element and hash_cones │ │ │ │ │ │ -// │ │ │ │ │ │ -00005 // This file is part of the SISCone project. │ │ │ │ │ │ -// │ │ │ │ │ │ -00006 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ -// │ │ │ │ │ │ -00007 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00008 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ -// │ │ │ │ │ │ -00009 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00010 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ -// │ │ │ │ │ │ -00011 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ -// │ │ │ │ │ │ -00012 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ -// │ │ │ │ │ │ -00013 // (at your option) any later version. │ │ │ │ │ │ -// │ │ │ │ │ │ -00014 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00015 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ -// │ │ │ │ │ │ -00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ -// │ │ │ │ │ │ -00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ -// │ │ │ │ │ │ -00018 // GNU General Public License for more details. │ │ │ │ │ │ -// │ │ │ │ │ │ -00019 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00020 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ -// │ │ │ │ │ │ -00021 // along with this program; if not, write to the Free Software │ │ │ │ │ │ -// │ │ │ │ │ │ -00022 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ -00023 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00024 // $Revision:: 224 │ │ │ │ │ │ -$// │ │ │ │ │ │ -00025 // $Date:: 2008-05-16 19:58:30 +0200 (Fri, 16 May 2008) │ │ │ │ │ │ -$// │ │ │ │ │ │ -00027 │ │ │ │ │ │ -00028 #ifndef __HASH_H__ │ │ │ │ │ │ -00029 #define __HASH_H__ │ │ │ │ │ │ -00030 │ │ │ │ │ │ -00031 #include "momentum.h" │ │ │ │ │ │ -00032 #include "reference.h" │ │ │ │ │ │ -00033 │ │ │ │ │ │ -00034 namespace siscone{ │ │ │ │ │ │ -00035 │ │ │ │ │ │ -00045 class hash_element{ │ │ │ │ │ │ -00046 public: │ │ │ │ │ │ -00047 │ │ │ │ │ │ -Creference ref; │ │ │ │ │ │ -double eta; │ │ │ │ │ │ -00048 │ │ │ │ │ │ -double phi; │ │ │ │ │ │ -00049 │ │ │ │ │ │ -00050 │ │ │ │ │ │ -bool is_stable; │ │ │ │ │ │ -00051 │ │ │ │ │ │ -00052 │ │ │ │ │ │ -hash_element *next; │ │ │ │ │ │ -00053 }; │ │ │ │ │ │ -00054 │ │ │ │ │ │ -00062 class hash_cones{ │ │ │ │ │ │ -00063 public: │ │ │ │ │ │ -00067 │ │ │ │ │ │ -hash_cones(int _Np, double _R2); │ │ │ │ │ │ -00068 │ │ │ │ │ │ -00070 │ │ │ │ │ │ -~hash_cones(); │ │ │ │ │ │ -00071 │ │ │ │ │ │ -00081 │ │ │ │ │ │ -int insert(Cmomentum *v, Cmomentum *parent, Cmomentum *child, bool p_io, bool c_io); │ │ │ │ │ │ -00082 │ │ │ │ │ │ -int insert(Cmomentum *v); │ │ │ │ │ │ -00090 │ │ │ │ │ │ -00091 │ │ │ │ │ │ -00093 │ │ │ │ │ │ -hash_element **hash_array; │ │ │ │ │ │ -00094 │ │ │ │ │ │ -int n_cones; │ │ │ │ │ │ -00096 │ │ │ │ │ │ -00097 │ │ │ │ │ │ -00099 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ -00100 │ │ │ │ │ │ -int n_occupied_cells; │ │ │ │ │ │ -00101 #endif │ │ │ │ │ │ -00102 │ │ │ │ │ │ -int mask; │ │ │ │ │ │ -00104 │ │ │ │ │ │ -00105 │ │ │ │ │ │ -double R2; │ │ │ │ │ │ -00108 │ │ │ │ │ │ -00109 │ │ │ │ │ │ -inline bool is_inside(Cmomentum *centre, Cmomentum *v); │ │ │ │ │ │ -00118 │ │ │ │ │ │ -00119 }; │ │ │ │ │ │ -00120 │ │ │ │ │ │ -00121 } │ │ │ │ │ │ -00122 #endif │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.40 hash.h │ │ │ │ │ │ - │ │ │ │ │ │ -239 │ │ │ │ │ │ - │ │ │ │ │ │ -5.40 hash.h │ │ │ │ │ │ -00001 // -*- C++ -*00003 // File: hash.h │ │ │ │ │ │ -// │ │ │ │ │ │ -00004 // Description: header file for classes hash_element and hash_cones │ │ │ │ │ │ -// │ │ │ │ │ │ -00005 // This file is part of the SISCone project. │ │ │ │ │ │ -// │ │ │ │ │ │ -00006 // WARNING: this is not the main SISCone trunk but │ │ │ │ │ │ -// │ │ │ │ │ │ -00007 // │ │ │ │ │ │ -an adaptation to spherical coordinates │ │ │ │ │ │ -// │ │ │ │ │ │ -00008 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ -// │ │ │ │ │ │ -00009 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00010 // Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez │ │ │ │ │ │ -// │ │ │ │ │ │ -00011 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00012 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ -// │ │ │ │ │ │ -00013 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ -// │ │ │ │ │ │ -00014 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ -// │ │ │ │ │ │ -00015 // (at your option) any later version. │ │ │ │ │ │ -// │ │ │ │ │ │ -00016 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00017 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ -// │ │ │ │ │ │ -00018 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ -// │ │ │ │ │ │ -00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ -// │ │ │ │ │ │ -00020 // GNU General Public License for more details. │ │ │ │ │ │ -// │ │ │ │ │ │ -00021 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00022 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ -// │ │ │ │ │ │ -00023 // along with this program; if not, write to the Free Software │ │ │ │ │ │ -// │ │ │ │ │ │ -00024 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ -00025 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00026 // $Revision:: 294 │ │ │ │ │ │ -$// │ │ │ │ │ │ -00027 // $Date:: 2009-05-01 17:15:04 +0200 (Fri, 01 May 2009) │ │ │ │ │ │ -$// │ │ │ │ │ │ -00029 │ │ │ │ │ │ -00030 #ifndef __SPH_HASH_H__ │ │ │ │ │ │ -00031 #define __SPH_HASH_H__ │ │ │ │ │ │ -00032 │ │ │ │ │ │ -00033 #include "momentum.h" │ │ │ │ │ │ -00034 │ │ │ │ │ │ -00035 namespace siscone_spherical{ │ │ │ │ │ │ -00036 │ │ │ │ │ │ -00046 class sph_hash_element{ │ │ │ │ │ │ -00047 public: │ │ │ │ │ │ -00048 │ │ │ │ │ │ -CSph3vector centre; │ │ │ │ │ │ -bool is_stable; │ │ │ │ │ │ -00049 │ │ │ │ │ │ -00050 │ │ │ │ │ │ -00051 │ │ │ │ │ │ -sph_hash_element *next; │ │ │ │ │ │ -00052 }; │ │ │ │ │ │ -00053 │ │ │ │ │ │ -00061 class sph_hash_cones{ │ │ │ │ │ │ -00062 public: │ │ │ │ │ │ -00065 │ │ │ │ │ │ -sph_hash_cones(int _Np, double _radius); │ │ │ │ │ │ -00066 │ │ │ │ │ │ -00068 │ │ │ │ │ │ -~sph_hash_cones(); │ │ │ │ │ │ -00069 │ │ │ │ │ │ -int insert(CSphmomentum *v, CSphmomentum *parent, CSphmomentum *child, bool p_io, bool c_io); │ │ │ │ │ │ -00079 │ │ │ │ │ │ -00080 │ │ │ │ │ │ -int insert(CSphmomentum *v); │ │ │ │ │ │ -00088 │ │ │ │ │ │ -00089 │ │ │ │ │ │ -00091 │ │ │ │ │ │ -sph_hash_element **hash_array; │ │ │ │ │ │ -00092 │ │ │ │ │ │ -00094 │ │ │ │ │ │ -int n_cones; │ │ │ │ │ │ -00095 │ │ │ │ │ │ -00097 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ -00098 │ │ │ │ │ │ -int n_occupied_cells; │ │ │ │ │ │ -00099 #endif │ │ │ │ │ │ -00100 │ │ │ │ │ │ -int mask; │ │ │ │ │ │ -00102 │ │ │ │ │ │ -00103 │ │ │ │ │ │ -double R2; │ │ │ │ │ │ -00106 │ │ │ │ │ │ -00107 │ │ │ │ │ │ -double tan2R; │ │ │ │ │ │ -00109 │ │ │ │ │ │ -00110 }; │ │ │ │ │ │ -00111 │ │ │ │ │ │ -00112 } │ │ │ │ │ │ -00113 #endif │ │ │ │ │ │ - │ │ │ │ │ │ -5.41 momentum.cpp │ │ │ │ │ │ -00001 │ │ │ │ │ │ -00002 // File: momentum.cpp │ │ │ │ │ │ -00003 // Description: source file for 4-momentum class Cmomentum │ │ │ │ │ │ -00004 // This file is part of the SISCone project. │ │ │ │ │ │ -00005 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ -00006 // │ │ │ │ │ │ -00007 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ -00008 // │ │ │ │ │ │ -00009 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ - │ │ │ │ │ │ - 240 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00010 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ -// │ │ │ │ │ │ -00011 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ -// │ │ │ │ │ │ -00012 // (at your option) any later version. │ │ │ │ │ │ -// │ │ │ │ │ │ -00013 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00014 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ -// │ │ │ │ │ │ -00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ -// │ │ │ │ │ │ -00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ -// │ │ │ │ │ │ -00017 // GNU General Public License for more details. │ │ │ │ │ │ -// │ │ │ │ │ │ -00018 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00019 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ -// │ │ │ │ │ │ -00020 // along with this program; if not, write to the Free Software │ │ │ │ │ │ -// │ │ │ │ │ │ -00021 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ -00022 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00023 // $Revision:: 123 │ │ │ │ │ │ -$// │ │ │ │ │ │ -00024 // $Date:: 2007-03-01 02:52:16 +0100 (Thu, 01 Mar 2007) │ │ │ │ │ │ -$// │ │ │ │ │ │ -00026 │ │ │ │ │ │ -00027 #include "momentum.h" │ │ │ │ │ │ -00028 #include │ │ │ │ │ │ -00029 #include │ │ │ │ │ │ -00030 │ │ │ │ │ │ -00031 namespace siscone{ │ │ │ │ │ │ -00032 │ │ │ │ │ │ -00033 /************************************************************************* │ │ │ │ │ │ -00034 * class Cmomentum │ │ │ │ │ │ -* │ │ │ │ │ │ -00035 * This class contains the information for particle or group of │ │ │ │ │ │ -* │ │ │ │ │ │ -00036 * particles management. │ │ │ │ │ │ -* │ │ │ │ │ │ -00037 * It includes all Lorentz properties as well as tools for summing them. * │ │ │ │ │ │ -00038 *************************************************************************/ │ │ │ │ │ │ -00039 │ │ │ │ │ │ -00040 // default ctor │ │ │ │ │ │ -00041 //-------------00042 Cmomentum::Cmomentum(){ │ │ │ │ │ │ -00043 │ │ │ │ │ │ -eta = 0.0; │ │ │ │ │ │ -00044 │ │ │ │ │ │ -phi = 0.0; │ │ │ │ │ │ -00045 │ │ │ │ │ │ -px = py = pz = E = 0.0; │ │ │ │ │ │ -00046 │ │ │ │ │ │ -ref = Creference(); │ │ │ │ │ │ -00047 │ │ │ │ │ │ -index = -1; │ │ │ │ │ │ -00048 } │ │ │ │ │ │ -00049 │ │ │ │ │ │ -00050 // ctor with initialisation │ │ │ │ │ │ -00051 //-------------------------00052 Cmomentum::Cmomentum(double _px, double _py, double _pz, double _E){ │ │ │ │ │ │ -00053 │ │ │ │ │ │ -px = _px; │ │ │ │ │ │ -00054 │ │ │ │ │ │ -py = _py; │ │ │ │ │ │ -00055 │ │ │ │ │ │ -pz = _pz; │ │ │ │ │ │ -00056 │ │ │ │ │ │ -E = _E; │ │ │ │ │ │ -00057 │ │ │ │ │ │ -// compute eta and phi │ │ │ │ │ │ -00058 │ │ │ │ │ │ -00059 │ │ │ │ │ │ -build_etaphi(); │ │ │ │ │ │ -00060 │ │ │ │ │ │ -ref = Creference(); │ │ │ │ │ │ -00061 } │ │ │ │ │ │ -00062 │ │ │ │ │ │ -00063 // ctor with detailed initialisation │ │ │ │ │ │ -00064 //----------------------------------00065 Cmomentum::Cmomentum(double _eta, double _phi, Creference _ref){ │ │ │ │ │ │ -00066 │ │ │ │ │ │ -eta = _eta; │ │ │ │ │ │ -00067 │ │ │ │ │ │ -phi = _phi; │ │ │ │ │ │ -00068 │ │ │ │ │ │ -00069 │ │ │ │ │ │ -ref = _ref; │ │ │ │ │ │ -00070 } │ │ │ │ │ │ -00071 │ │ │ │ │ │ -00072 // default dtor │ │ │ │ │ │ -00073 //-------------00074 Cmomentum::~Cmomentum(){ │ │ │ │ │ │ -00075 │ │ │ │ │ │ -00076 } │ │ │ │ │ │ -00077 │ │ │ │ │ │ -00078 // assignment of vectors │ │ │ │ │ │ -00079 //----------------------00080 Cmomentum& Cmomentum::operator = (const Cmomentum &v){ │ │ │ │ │ │ -00081 │ │ │ │ │ │ -px = v.px; │ │ │ │ │ │ -00082 │ │ │ │ │ │ -py = v.py; │ │ │ │ │ │ -00083 │ │ │ │ │ │ -pz = v.pz; │ │ │ │ │ │ -00084 │ │ │ │ │ │ -E = v.E; │ │ │ │ │ │ -00085 │ │ │ │ │ │ -00086 │ │ │ │ │ │ -eta = v.eta; │ │ │ │ │ │ -00087 │ │ │ │ │ │ -phi = v.phi; │ │ │ │ │ │ -00088 │ │ │ │ │ │ -00089 │ │ │ │ │ │ -ref = v.ref; │ │ │ │ │ │ -00090 │ │ │ │ │ │ -return *this; │ │ │ │ │ │ -00091 } │ │ │ │ │ │ -00092 │ │ │ │ │ │ -00093 // addition of vectors │ │ │ │ │ │ -00094 // !!! WARNING !!! no updating of eta and phi !!! │ │ │ │ │ │ -00095 //-----------------------------------------------00096 const Cmomentum Cmomentum::operator + (const Cmomentum &v){ │ │ │ │ │ │ -00097 │ │ │ │ │ │ -Cmomentum tmp = *this; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.42 momentum.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -241 │ │ │ │ │ │ - │ │ │ │ │ │ -00098 │ │ │ │ │ │ -return tmp+=v; │ │ │ │ │ │ -00099 } │ │ │ │ │ │ -00100 │ │ │ │ │ │ -00101 // incrementation of vectors │ │ │ │ │ │ -00102 // !!! WARNING !!! no updating of eta and phi !!! │ │ │ │ │ │ -00103 //-----------------------------------------------00104 Cmomentum& Cmomentum::operator += (const Cmomentum &v){ │ │ │ │ │ │ -00105 │ │ │ │ │ │ -px+=v.px; │ │ │ │ │ │ -00106 │ │ │ │ │ │ -py+=v.py; │ │ │ │ │ │ -00107 │ │ │ │ │ │ -pz+=v.pz; │ │ │ │ │ │ -00108 │ │ │ │ │ │ -E +=v.E; │ │ │ │ │ │ -00109 │ │ │ │ │ │ -00110 │ │ │ │ │ │ -ref+=v.ref; │ │ │ │ │ │ -00111 │ │ │ │ │ │ -00112 │ │ │ │ │ │ -return *this; │ │ │ │ │ │ -00113 } │ │ │ │ │ │ -00114 │ │ │ │ │ │ -00115 // incrementation of vectors │ │ │ │ │ │ -00116 // !!! WARNING !!! no updating of eta and phi !!! │ │ │ │ │ │ -00117 //-----------------------------------------------00118 Cmomentum& Cmomentum::operator -= (const Cmomentum &v){ │ │ │ │ │ │ -00119 │ │ │ │ │ │ -px-=v.px; │ │ │ │ │ │ -00120 │ │ │ │ │ │ -py-=v.py; │ │ │ │ │ │ -00121 │ │ │ │ │ │ -pz-=v.pz; │ │ │ │ │ │ -00122 │ │ │ │ │ │ -E -=v.E; │ │ │ │ │ │ -00123 │ │ │ │ │ │ -00124 │ │ │ │ │ │ -ref-=v.ref; │ │ │ │ │ │ -return *this; │ │ │ │ │ │ -00125 │ │ │ │ │ │ -00126 } │ │ │ │ │ │ -00127 │ │ │ │ │ │ -00128 // build eta-phi from 4-momentum info │ │ │ │ │ │ -00129 // !!! │ │ │ │ │ │ -WARNING │ │ │ │ │ │ -!!! │ │ │ │ │ │ -00130 // !!! computing eta and phi is time-consuming !!! │ │ │ │ │ │ -00131 // !!! use this whenever you need eta or phi │ │ │ │ │ │ -!!! │ │ │ │ │ │ -00132 // !!! automatically called for single-particle !!! │ │ │ │ │ │ -00133 //-------------------------------------------------00134 void Cmomentum::build_etaphi(){ │ │ │ │ │ │ -// note: the factor n (ref.nb) cancels in all expressions !! │ │ │ │ │ │ -00135 │ │ │ │ │ │ -00136 │ │ │ │ │ │ -eta = 0.5*log((E+pz)/(E-pz)); │ │ │ │ │ │ -00137 │ │ │ │ │ │ -phi = atan2(py,px); │ │ │ │ │ │ -00138 } │ │ │ │ │ │ -00139 │ │ │ │ │ │ -00140 │ │ │ │ │ │ -00141 // ordering of two vectors │ │ │ │ │ │ -00142 // the default ordering is w.r.t. their references │ │ │ │ │ │ -00143 //------------------------------------------------00144 bool operator < (const Cmomentum &v1, const Cmomentum &v2){ │ │ │ │ │ │ -00145 │ │ │ │ │ │ -return v1.ref < v2.ref; │ │ │ │ │ │ -00146 } │ │ │ │ │ │ -00147 │ │ │ │ │ │ -00148 // ordering of vectors in eta (e.g. used in collinear tests) │ │ │ │ │ │ -00149 //----------------------------------------------------------00150 bool momentum_eta_less(const Cmomentum &v1, const Cmomentum &v2){ │ │ │ │ │ │ -return v1.eta < v2.eta; │ │ │ │ │ │ -00151 │ │ │ │ │ │ -00152 } │ │ │ │ │ │ -00153 │ │ │ │ │ │ -00154 // ordering of vectors in pt │ │ │ │ │ │ -00155 //--------------------------00156 bool momentum_pt_less(const Cmomentum &v1, const Cmomentum &v2){ │ │ │ │ │ │ -00157 │ │ │ │ │ │ -return v1.perp2() < v2.perp2(); │ │ │ │ │ │ -00158 } │ │ │ │ │ │ -00159 │ │ │ │ │ │ -00160 } │ │ │ │ │ │ -00161 │ │ │ │ │ │ - │ │ │ │ │ │ -5.42 momentum.cpp │ │ │ │ │ │ -00001 │ │ │ │ │ │ -00002 // File: momentum.cpp │ │ │ │ │ │ -00003 // Description: source file for 4-momentum class Cmomentum │ │ │ │ │ │ -00004 // This file is part of the SISCone project. │ │ │ │ │ │ -00005 // WARNING: this is not the main SISCone trunk but │ │ │ │ │ │ -00006 // │ │ │ │ │ │ -an adaptation to spherical coordinates │ │ │ │ │ │ -00007 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ -00008 // │ │ │ │ │ │ -00009 // Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez │ │ │ │ │ │ -00010 // │ │ │ │ │ │ -00011 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ -00012 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ -00013 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ -00014 // (at your option) any later version. │ │ │ │ │ │ -00015 // │ │ │ │ │ │ -00016 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ - │ │ │ │ │ │ - 242 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ -// │ │ │ │ │ │ -00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ -// │ │ │ │ │ │ -00019 // GNU General Public License for more details. │ │ │ │ │ │ -// │ │ │ │ │ │ -00020 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00021 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ -// │ │ │ │ │ │ -00022 // along with this program; if not, write to the Free Software │ │ │ │ │ │ -// │ │ │ │ │ │ -00023 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ -00024 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00025 // $Revision:: 255 │ │ │ │ │ │ -$// │ │ │ │ │ │ -00026 // $Date:: 2008-07-12 17:40:35 +0200 (Sat, 12 Jul 2008) │ │ │ │ │ │ -$// │ │ │ │ │ │ -00028 │ │ │ │ │ │ -00029 #include "momentum.h" │ │ │ │ │ │ -00030 #include │ │ │ │ │ │ -00031 #include │ │ │ │ │ │ -00032 │ │ │ │ │ │ -00033 namespace siscone_spherical{ │ │ │ │ │ │ -00034 │ │ │ │ │ │ -00035 /************************************************************************* │ │ │ │ │ │ -00036 * class CSph3vector │ │ │ │ │ │ -* │ │ │ │ │ │ -00037 * This class contains the information for particle or group of │ │ │ │ │ │ -* │ │ │ │ │ │ -00038 * particles management. │ │ │ │ │ │ -* │ │ │ │ │ │ -00039 *************************************************************************/ │ │ │ │ │ │ -00040 │ │ │ │ │ │ -00041 // default ctor │ │ │ │ │ │ -00042 //-------------00043 CSph3vector::CSph3vector(){ │ │ │ │ │ │ -00044 │ │ │ │ │ │ -_theta = _phi = _norm = 0.0; │ │ │ │ │ │ -00045 │ │ │ │ │ │ -px = py = pz = 0.0; │ │ │ │ │ │ -00046 │ │ │ │ │ │ -ref = siscone::Creference(); │ │ │ │ │ │ -00047 } │ │ │ │ │ │ -00048 │ │ │ │ │ │ -00049 // ctor with initialisation │ │ │ │ │ │ -00050 //-------------------------00051 CSph3vector::CSph3vector(double _px, double _py, double _pz){ │ │ │ │ │ │ -00052 │ │ │ │ │ │ -px = _px; │ │ │ │ │ │ -00053 │ │ │ │ │ │ -py = _py; │ │ │ │ │ │ -00054 │ │ │ │ │ │ -pz = _pz; │ │ │ │ │ │ -00055 │ │ │ │ │ │ -// compute the norm │ │ │ │ │ │ -00056 │ │ │ │ │ │ -00057 │ │ │ │ │ │ -build_norm(); │ │ │ │ │ │ -00058 │ │ │ │ │ │ -00059 │ │ │ │ │ │ -ref = siscone::Creference(); │ │ │ │ │ │ -00060 } │ │ │ │ │ │ -00061 │ │ │ │ │ │ -00062 // default dtor │ │ │ │ │ │ -00063 //-------------00064 CSph3vector::~CSph3vector(){ │ │ │ │ │ │ -00065 │ │ │ │ │ │ -00066 } │ │ │ │ │ │ -00067 │ │ │ │ │ │ -00068 │ │ │ │ │ │ -00069 // assignment of vectors │ │ │ │ │ │ -00070 //----------------------00071 CSph3vector& CSph3vector::operator = (const CSph3vector &v){ │ │ │ │ │ │ -00072 │ │ │ │ │ │ -px = v.px; │ │ │ │ │ │ -00073 │ │ │ │ │ │ -py = v.py; │ │ │ │ │ │ -00074 │ │ │ │ │ │ -pz = v.pz; │ │ │ │ │ │ -00075 │ │ │ │ │ │ -00076 │ │ │ │ │ │ -_norm = v._norm; │ │ │ │ │ │ -00077 │ │ │ │ │ │ -_theta = v._theta; │ │ │ │ │ │ -00078 │ │ │ │ │ │ -_phi │ │ │ │ │ │ -= v._phi; │ │ │ │ │ │ -00079 │ │ │ │ │ │ -00080 │ │ │ │ │ │ -ref = v.ref; │ │ │ │ │ │ -00081 │ │ │ │ │ │ -return *this; │ │ │ │ │ │ -00082 } │ │ │ │ │ │ -00083 │ │ │ │ │ │ -00084 // addition of vectors │ │ │ │ │ │ -00085 //-----------------------------------------------00086 const CSph3vector CSph3vector::operator + (const CSph3vector &v){ │ │ │ │ │ │ -00087 │ │ │ │ │ │ -CSph3vector tmp = *this; │ │ │ │ │ │ -00088 │ │ │ │ │ │ -return tmp+=v; │ │ │ │ │ │ -00089 } │ │ │ │ │ │ -00090 │ │ │ │ │ │ -00091 // subtraction of vectors │ │ │ │ │ │ -00092 //-----------------------------------------------00093 const CSph3vector CSph3vector::operator - (const CSph3vector &v){ │ │ │ │ │ │ -00094 │ │ │ │ │ │ -CSph3vector tmp = *this; │ │ │ │ │ │ -00095 │ │ │ │ │ │ -return tmp-=v; │ │ │ │ │ │ -00096 } │ │ │ │ │ │ -00097 │ │ │ │ │ │ -00098 // division by constant │ │ │ │ │ │ -00099 //-----------------------------------------------00100 const CSph3vector CSph3vector::operator / (const double &r){ │ │ │ │ │ │ -00101 │ │ │ │ │ │ -CSph3vector tmp = *this; │ │ │ │ │ │ -return tmp/=r; │ │ │ │ │ │ -00102 │ │ │ │ │ │ -00103 } │ │ │ │ │ │ -00104 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.42 momentum.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -00105 // incrementation │ │ │ │ │ │ -00106 //-----------------------------------------------00107 CSph3vector& CSph3vector::operator += (const CSph3vector &v){ │ │ │ │ │ │ -00108 │ │ │ │ │ │ -px+=v.px; │ │ │ │ │ │ -00109 │ │ │ │ │ │ -py+=v.py; │ │ │ │ │ │ -00110 │ │ │ │ │ │ -pz+=v.pz; │ │ │ │ │ │ -00111 │ │ │ │ │ │ -00112 │ │ │ │ │ │ -return *this; │ │ │ │ │ │ -00113 } │ │ │ │ │ │ -00114 │ │ │ │ │ │ -00115 // decrementation │ │ │ │ │ │ -00116 //-----------------------------------------------00117 CSph3vector& CSph3vector::operator -= (const CSph3vector &v){ │ │ │ │ │ │ -00118 │ │ │ │ │ │ -px-=v.px; │ │ │ │ │ │ -00119 │ │ │ │ │ │ -py-=v.py; │ │ │ │ │ │ -00120 │ │ │ │ │ │ -pz-=v.pz; │ │ │ │ │ │ -00121 │ │ │ │ │ │ -00122 │ │ │ │ │ │ -return *this; │ │ │ │ │ │ -00123 } │ │ │ │ │ │ -00124 │ │ │ │ │ │ -00125 // multiplication by a constant │ │ │ │ │ │ -00126 //-----------------------------------------------00127 CSph3vector& CSph3vector::operator *= (const double &r){ │ │ │ │ │ │ -00128 │ │ │ │ │ │ -px*=r; │ │ │ │ │ │ -00129 │ │ │ │ │ │ -py*=r; │ │ │ │ │ │ -00130 │ │ │ │ │ │ -pz*=r; │ │ │ │ │ │ -00131 │ │ │ │ │ │ -return *this; │ │ │ │ │ │ -00132 │ │ │ │ │ │ -00133 } │ │ │ │ │ │ -00134 │ │ │ │ │ │ -00135 // division by a constant │ │ │ │ │ │ -00136 //-----------------------------------------------00137 CSph3vector& CSph3vector::operator /= (const double &r){ │ │ │ │ │ │ -00138 │ │ │ │ │ │ -px/=r; │ │ │ │ │ │ -00139 │ │ │ │ │ │ -py/=r; │ │ │ │ │ │ -00140 │ │ │ │ │ │ -pz/=r; │ │ │ │ │ │ -00141 │ │ │ │ │ │ -00142 │ │ │ │ │ │ -_norm/=r; │ │ │ │ │ │ -00143 │ │ │ │ │ │ -return *this; │ │ │ │ │ │ -00144 │ │ │ │ │ │ -00145 } │ │ │ │ │ │ -00146 │ │ │ │ │ │ -00147 // build norm from 3-momentum info │ │ │ │ │ │ -00148 void CSph3vector::build_norm(){ │ │ │ │ │ │ -00149 │ │ │ │ │ │ -_norm = norm(); │ │ │ │ │ │ -00150 } │ │ │ │ │ │ -00151 │ │ │ │ │ │ -00152 // build norm from 3-momentum info │ │ │ │ │ │ -00153 void CSph3vector::build_thetaphi(){ │ │ │ │ │ │ -00154 │ │ │ │ │ │ -_theta = theta(); │ │ │ │ │ │ -00155 │ │ │ │ │ │ -_phi = phi(); │ │ │ │ │ │ -00156 } │ │ │ │ │ │ -00157 │ │ │ │ │ │ -00158 │ │ │ │ │ │ -00159 // for this direction, compute the two reference directions │ │ │ │ │ │ -00160 // used to measure angles │ │ │ │ │ │ -00161 void CSph3vector::get_angular_directions(CSph3vector &angular_dir1, CSph3vector &angular_dir2){ │ │ │ │ │ │ -00162 │ │ │ │ │ │ -if (px < py){ │ │ │ │ │ │ -if (pz < px){ │ │ │ │ │ │ -00163 │ │ │ │ │ │ -00164 │ │ │ │ │ │ -// z smallest │ │ │ │ │ │ -00165 │ │ │ │ │ │ -angular_dir1 = CSph3vector(-py, px, 0.0); │ │ │ │ │ │ -00166 │ │ │ │ │ │ -} else { │ │ │ │ │ │ -00167 │ │ │ │ │ │ -// x smallest │ │ │ │ │ │ -00168 │ │ │ │ │ │ -angular_dir1 = CSph3vector(0.0, -pz, py); │ │ │ │ │ │ -00169 │ │ │ │ │ │ -} │ │ │ │ │ │ -00170 │ │ │ │ │ │ -} else { │ │ │ │ │ │ -00171 │ │ │ │ │ │ -if (pz < py){ │ │ │ │ │ │ -00172 │ │ │ │ │ │ -// z smallest │ │ │ │ │ │ -00173 │ │ │ │ │ │ -angular_dir1 = CSph3vector(-py, px, 0.0); │ │ │ │ │ │ -00174 │ │ │ │ │ │ -} else { │ │ │ │ │ │ -// y smallest │ │ │ │ │ │ -00175 │ │ │ │ │ │ -00176 │ │ │ │ │ │ -angular_dir1 = CSph3vector(-pz, 0.0, px); │ │ │ │ │ │ -00177 │ │ │ │ │ │ -} │ │ │ │ │ │ -00178 │ │ │ │ │ │ -} │ │ │ │ │ │ -00179 │ │ │ │ │ │ -angular_dir2 = cross_product3(*this, angular_dir1); │ │ │ │ │ │ -00180 │ │ │ │ │ │ -// We’ll simply take x & y so the reflection symmetry is not broken │ │ │ │ │ │ -00181 │ │ │ │ │ │ -//angular_dir1 = CSph3vector(0.0, -pz, py); │ │ │ │ │ │ -00182 │ │ │ │ │ │ -//angular_dir2 = CSph3vector(-pz, 0.0, -px); │ │ │ │ │ │ -00183 } │ │ │ │ │ │ -00184 │ │ │ │ │ │ -00185 /************************************************************************* │ │ │ │ │ │ -00186 * class CSphmomentum │ │ │ │ │ │ -* │ │ │ │ │ │ -00187 * This class contains the information for particle or group of │ │ │ │ │ │ -* │ │ │ │ │ │ -00188 * particles management. │ │ │ │ │ │ -* │ │ │ │ │ │ -00189 * It includes all Lorentz properties as well as tools for summing them. * │ │ │ │ │ │ -00190 *************************************************************************/ │ │ │ │ │ │ -00191 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -243 │ │ │ │ │ │ - │ │ │ │ │ │ - 244 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00192 // default ctor │ │ │ │ │ │ -00193 //-------------00194 CSphmomentum::CSphmomentum(){ │ │ │ │ │ │ -00195 │ │ │ │ │ │ -E=0.0; │ │ │ │ │ │ -00196 │ │ │ │ │ │ -index = -1; │ │ │ │ │ │ -00197 } │ │ │ │ │ │ -00198 │ │ │ │ │ │ -00199 // ctor with initialisation │ │ │ │ │ │ -00200 //-------------------------00201 CSphmomentum::CSphmomentum(double _px, double _py, double _pz, double _E) │ │ │ │ │ │ -00202 │ │ │ │ │ │ -: CSph3vector(_px, _py, _pz) { │ │ │ │ │ │ -00203 │ │ │ │ │ │ -E = _E; │ │ │ │ │ │ -00204 │ │ │ │ │ │ -// compute the angles │ │ │ │ │ │ -00205 │ │ │ │ │ │ -00206 │ │ │ │ │ │ -build_thetaphi(); │ │ │ │ │ │ -00207 } │ │ │ │ │ │ -00208 │ │ │ │ │ │ -00209 // ctor with initialisation │ │ │ │ │ │ -00210 //-------------------------00211 CSphmomentum::CSphmomentum(CSph3vector &_v, double _E) │ │ │ │ │ │ -00212 │ │ │ │ │ │ -: CSph3vector(_v.px, _v.py, _v.pz) { │ │ │ │ │ │ -00213 │ │ │ │ │ │ -E = _E; │ │ │ │ │ │ -00214 } │ │ │ │ │ │ -00215 │ │ │ │ │ │ -00216 // default dtor │ │ │ │ │ │ -00217 //-------------00218 CSphmomentum::~CSphmomentum(){ │ │ │ │ │ │ -00219 │ │ │ │ │ │ -00220 } │ │ │ │ │ │ -00221 │ │ │ │ │ │ -00222 // assignment of vectors │ │ │ │ │ │ -00223 //----------------------00224 CSphmomentum& CSphmomentum::operator = (const CSphmomentum &v){ │ │ │ │ │ │ -00225 │ │ │ │ │ │ -px = v.px; │ │ │ │ │ │ -00226 │ │ │ │ │ │ -py = v.py; │ │ │ │ │ │ -00227 │ │ │ │ │ │ -pz = v.pz; │ │ │ │ │ │ -00228 │ │ │ │ │ │ -E = v.E; │ │ │ │ │ │ -00229 │ │ │ │ │ │ -00230 │ │ │ │ │ │ -_norm = v._norm; │ │ │ │ │ │ -00231 │ │ │ │ │ │ -_theta = v._theta; │ │ │ │ │ │ -00232 │ │ │ │ │ │ -_phi │ │ │ │ │ │ -= v._phi; │ │ │ │ │ │ -00233 │ │ │ │ │ │ -00234 │ │ │ │ │ │ -ref = v.ref; │ │ │ │ │ │ -return *this; │ │ │ │ │ │ -00235 │ │ │ │ │ │ -00236 } │ │ │ │ │ │ -00237 │ │ │ │ │ │ -00238 // addition of vectors │ │ │ │ │ │ -00239 // !!! WARNING !!! no updating of eta and phi !!! │ │ │ │ │ │ -00240 //-----------------------------------------------00241 const CSphmomentum CSphmomentum::operator + (const CSphmomentum &v){ │ │ │ │ │ │ -00242 │ │ │ │ │ │ -CSphmomentum tmp = *this; │ │ │ │ │ │ -00243 │ │ │ │ │ │ -return tmp+=v; │ │ │ │ │ │ -00244 } │ │ │ │ │ │ -00245 │ │ │ │ │ │ -00246 // incrementation of vectors │ │ │ │ │ │ -00247 // !!! WARNING !!! no updating of eta and phi !!! │ │ │ │ │ │ -00248 //-----------------------------------------------00249 CSphmomentum& CSphmomentum::operator += (const CSphmomentum &v){ │ │ │ │ │ │ -00250 │ │ │ │ │ │ -px+=v.px; │ │ │ │ │ │ -00251 │ │ │ │ │ │ -py+=v.py; │ │ │ │ │ │ -00252 │ │ │ │ │ │ -pz+=v.pz; │ │ │ │ │ │ -00253 │ │ │ │ │ │ -E +=v.E; │ │ │ │ │ │ -00254 │ │ │ │ │ │ -00255 │ │ │ │ │ │ -ref+=v.ref; │ │ │ │ │ │ -00256 │ │ │ │ │ │ -00257 │ │ │ │ │ │ -return *this; │ │ │ │ │ │ -00258 } │ │ │ │ │ │ -00259 │ │ │ │ │ │ -00260 // decrementation of vectors │ │ │ │ │ │ -00261 // !!! WARNING !!! no updating of eta and phi !!! │ │ │ │ │ │ -00262 //-----------------------------------------------00263 CSphmomentum& CSphmomentum::operator -= (const CSphmomentum &v){ │ │ │ │ │ │ -00264 │ │ │ │ │ │ -px-=v.px; │ │ │ │ │ │ -00265 │ │ │ │ │ │ -py-=v.py; │ │ │ │ │ │ -00266 │ │ │ │ │ │ -pz-=v.pz; │ │ │ │ │ │ -00267 │ │ │ │ │ │ -E -=v.E; │ │ │ │ │ │ -00268 │ │ │ │ │ │ -00269 │ │ │ │ │ │ -ref-=v.ref; │ │ │ │ │ │ -00270 │ │ │ │ │ │ -return *this; │ │ │ │ │ │ -00271 } │ │ │ │ │ │ -00272 │ │ │ │ │ │ -00273 │ │ │ │ │ │ -00274 // ordering of two vectors │ │ │ │ │ │ -00275 // the default ordering is w.r.t. their references │ │ │ │ │ │ -00276 //------------------------------------------------00277 bool operator < (const CSphmomentum &v1, const CSphmomentum &v2){ │ │ │ │ │ │ -00278 │ │ │ │ │ │ -return v1.ref < v2.ref; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.43 protocones.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -00279 } │ │ │ │ │ │ -00280 │ │ │ │ │ │ -00281 // ordering of vectors in eta (e.g. used in collinear tests) │ │ │ │ │ │ -00282 //----------------------------------------------------------00283 bool momentum_theta_less(const CSphmomentum &v1, const CSphmomentum &v2){ │ │ │ │ │ │ -00284 │ │ │ │ │ │ -return v1._theta < v2._theta; │ │ │ │ │ │ -00285 } │ │ │ │ │ │ -00286 │ │ │ │ │ │ -00287 // ordering of vectors in pt │ │ │ │ │ │ -00288 //--------------------------00289 bool momentum_pt_less(const CSphmomentum &v1, const CSphmomentum &v2){ │ │ │ │ │ │ -return v1.perp2() < v2.perp2(); │ │ │ │ │ │ -00290 │ │ │ │ │ │ -00291 } │ │ │ │ │ │ -00292 │ │ │ │ │ │ -00293 } │ │ │ │ │ │ -00294 │ │ │ │ │ │ - │ │ │ │ │ │ -5.43 protocones.cpp │ │ │ │ │ │ -00001 │ │ │ │ │ │ -00002 // File: protocones.cpp │ │ │ │ │ │ -// │ │ │ │ │ │ -00003 // Description: source file for stable cones determination (Cstable_cones) │ │ │ │ │ │ -// │ │ │ │ │ │ -00004 // This file is part of the SISCone project. │ │ │ │ │ │ -// │ │ │ │ │ │ -00005 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ -// │ │ │ │ │ │ -00006 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00007 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ -// │ │ │ │ │ │ -00008 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00009 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ -// │ │ │ │ │ │ -00010 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ -// │ │ │ │ │ │ -00011 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ -// │ │ │ │ │ │ -00012 // (at your option) any later version. │ │ │ │ │ │ -// │ │ │ │ │ │ -00013 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00014 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ -// │ │ │ │ │ │ -00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ -// │ │ │ │ │ │ -00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ -// │ │ │ │ │ │ -00017 // GNU General Public License for more details. │ │ │ │ │ │ -// │ │ │ │ │ │ -00018 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00019 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ -// │ │ │ │ │ │ -00020 // along with this program; if not, write to the Free Software │ │ │ │ │ │ -// │ │ │ │ │ │ -00021 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ -00022 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00023 // $Revision:: 322 │ │ │ │ │ │ -$// │ │ │ │ │ │ -00024 // $Date:: 2011-11-15 10:12:36 +0100 (Tue, 15 Nov 2011) │ │ │ │ │ │ -$// │ │ │ │ │ │ -00026 │ │ │ │ │ │ -00027 /******************************************************* │ │ │ │ │ │ -00028 * Introductory note: │ │ │ │ │ │ -* │ │ │ │ │ │ -00029 * Since this file has many member functions, we have * │ │ │ │ │ │ -00030 * structured them in categories: │ │ │ │ │ │ -* │ │ │ │ │ │ -00031 * INITIALISATION FUNCTIONS │ │ │ │ │ │ -* │ │ │ │ │ │ -00032 * - ctor() │ │ │ │ │ │ -* │ │ │ │ │ │ -00033 * - ctor(particle_list) │ │ │ │ │ │ -* │ │ │ │ │ │ -00034 * - dtor() │ │ │ │ │ │ -* │ │ │ │ │ │ -00035 * - init(particle_list) │ │ │ │ │ │ -* │ │ │ │ │ │ -00036 * ALGORITHM MAIN ENTRY │ │ │ │ │ │ -* │ │ │ │ │ │ -00037 * - get_stable_cone(radius) │ │ │ │ │ │ -* │ │ │ │ │ │ -00038 * ALGORITHM MAIN STEPS │ │ │ │ │ │ -* │ │ │ │ │ │ -00039 * - init_cone() │ │ │ │ │ │ -* │ │ │ │ │ │ -00040 * - test_cone() │ │ │ │ │ │ -* │ │ │ │ │ │ -00041 * - update_cone() │ │ │ │ │ │ -* │ │ │ │ │ │ -00042 * - proceed_with_stability() │ │ │ │ │ │ -* │ │ │ │ │ │ -00043 * ALGORITHM MAIN STEPS FOR COCIRCULAR SITUATIONS │ │ │ │ │ │ -* │ │ │ │ │ │ -00044 * - cocircular_pt_less(v1, v2) │ │ │ │ │ │ -* │ │ │ │ │ │ -00045 * - prepare_cocircular_list() │ │ │ │ │ │ -* │ │ │ │ │ │ -00046 * - test_cone_cocircular() │ │ │ │ │ │ -* │ │ │ │ │ │ -00047 * - test_stability(candidate, border_list) │ │ │ │ │ │ -* │ │ │ │ │ │ -00048 * - updat_cone_cocircular() │ │ │ │ │ │ -* │ │ │ │ │ │ -00049 * RECOMPUTATION OF CONE CONTENTS │ │ │ │ │ │ -* │ │ │ │ │ │ -00050 * - compute_cone_contents() │ │ │ │ │ │ -* │ │ │ │ │ │ -00051 * - recompute_cone_contents() │ │ │ │ │ │ -* │ │ │ │ │ │ -00052 * - recompute_cone_contents_if_needed() │ │ │ │ │ │ -* │ │ │ │ │ │ -00053 * VARIOUS TOOLS │ │ │ │ │ │ -* │ │ │ │ │ │ -00054 * - circle_intersect() │ │ │ │ │ │ -* │ │ │ │ │ │ -00055 * - is_inside() │ │ │ │ │ │ -* │ │ │ │ │ │ -00056 * - abs_dangle() │ │ │ │ │ │ -* │ │ │ │ │ │ -00057 *******************************************************/ │ │ │ │ │ │ -00058 │ │ │ │ │ │ -00059 #include "protocones.h" │ │ │ │ │ │ -00060 #include "siscone_error.h" │ │ │ │ │ │ -00061 #include "defines.h" │ │ │ │ │ │ -00062 #include │ │ │ │ │ │ -00063 #include │ │ │ │ │ │ -00064 #include "circulator.h" │ │ │ │ │ │ -00065 #include │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -245 │ │ │ │ │ │ - │ │ │ │ │ │ - 246 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00066 │ │ │ │ │ │ -00067 namespace siscone{ │ │ │ │ │ │ -00068 │ │ │ │ │ │ -00069 using namespace std; │ │ │ │ │ │ -00070 │ │ │ │ │ │ -00071 /********************************************************************** │ │ │ │ │ │ -00072 * Cstable_cones implementation │ │ │ │ │ │ -* │ │ │ │ │ │ -00073 * Computes the list of stable comes from a particle list. │ │ │ │ │ │ -* │ │ │ │ │ │ -00074 * This class does the first fundamental task of te cone algorithm: │ │ │ │ │ │ -* │ │ │ │ │ │ -00075 * it is used to compute the list of stable cones given a list │ │ │ │ │ │ -* │ │ │ │ │ │ -00076 * of particles. │ │ │ │ │ │ -* │ │ │ │ │ │ -00077 **********************************************************************/ │ │ │ │ │ │ -00078 │ │ │ │ │ │ -// │ │ │ │ │ │ -00080 // INITIALISATION FUNCTIONS │ │ │ │ │ │ -00081 // - ctor() │ │ │ │ │ │ -// │ │ │ │ │ │ -00082 // - ctor(particle_list) │ │ │ │ │ │ -// │ │ │ │ │ │ -00083 // - dtor() │ │ │ │ │ │ -// │ │ │ │ │ │ -00084 // - init(particle_list) │ │ │ │ │ │ -// │ │ │ │ │ │ -00086 │ │ │ │ │ │ -00087 // default ctor │ │ │ │ │ │ -00088 //-------------00089 Cstable_cones::Cstable_cones(){ │ │ │ │ │ │ -00090 │ │ │ │ │ │ -nb_tot = 0; │ │ │ │ │ │ -00091 │ │ │ │ │ │ -hc = NULL; │ │ │ │ │ │ -00092 } │ │ │ │ │ │ -00093 │ │ │ │ │ │ -00094 // ctor with initialisation │ │ │ │ │ │ -00095 //-------------------------00096 Cstable_cones::Cstable_cones(vector &_particle_list) │ │ │ │ │ │ -00097 │ │ │ │ │ │ -: Cvicinity(_particle_list){ │ │ │ │ │ │ -00098 │ │ │ │ │ │ -00099 │ │ │ │ │ │ -nb_tot = 0; │ │ │ │ │ │ -00100 │ │ │ │ │ │ -hc = NULL; │ │ │ │ │ │ -00101 } │ │ │ │ │ │ -00102 │ │ │ │ │ │ -00103 // default dtor │ │ │ │ │ │ -00104 //-------------00105 Cstable_cones::~Cstable_cones(){ │ │ │ │ │ │ -00106 │ │ │ │ │ │ -if (hc!=NULL) delete hc; │ │ │ │ │ │ -00107 } │ │ │ │ │ │ -00108 │ │ │ │ │ │ -00109 /* │ │ │ │ │ │ -00110 * initialisation │ │ │ │ │ │ -00111 * - _particle_list list of particles │ │ │ │ │ │ -00112 * - _n │ │ │ │ │ │ -number of particles │ │ │ │ │ │ -00113 *********************************************************************/ │ │ │ │ │ │ -00114 void Cstable_cones::init(vector &_particle_list){ │ │ │ │ │ │ -00115 │ │ │ │ │ │ -// check already allocated mem │ │ │ │ │ │ -00116 │ │ │ │ │ │ -if (hc!=NULL){ │ │ │ │ │ │ -delete hc; │ │ │ │ │ │ -00117 │ │ │ │ │ │ -00118 │ │ │ │ │ │ -} │ │ │ │ │ │ -if (protocones.size()!=0) │ │ │ │ │ │ -00119 │ │ │ │ │ │ -00120 │ │ │ │ │ │ -protocones.clear(); │ │ │ │ │ │ -00121 │ │ │ │ │ │ -00122 │ │ │ │ │ │ -multiple_centre_done.clear(); │ │ │ │ │ │ -00123 │ │ │ │ │ │ -00124 │ │ │ │ │ │ -// initialisation │ │ │ │ │ │ -00125 │ │ │ │ │ │ -set_particle_list(_particle_list); │ │ │ │ │ │ -00126 } │ │ │ │ │ │ -00127 │ │ │ │ │ │ -00128 │ │ │ │ │ │ -00130 // ALGORITHM MAIN ENTRY │ │ │ │ │ │ -// │ │ │ │ │ │ -00131 // - get_stable_cone(radius) │ │ │ │ │ │ -// │ │ │ │ │ │ -00133 │ │ │ │ │ │ -00134 /* │ │ │ │ │ │ -00135 * compute stable cones. │ │ │ │ │ │ -00136 * This function really does the job i.e. computes │ │ │ │ │ │ -00137 * the list of stable cones (in a seedless way) │ │ │ │ │ │ -00138 * - _radius: radius of the cones │ │ │ │ │ │ -00139 * The number of stable cones found is returned │ │ │ │ │ │ -00140 *********************************************************************/ │ │ │ │ │ │ -00141 int Cstable_cones::get_stable_cones(double _radius){ │ │ │ │ │ │ -int p_idx; │ │ │ │ │ │ -00142 │ │ │ │ │ │ -00143 │ │ │ │ │ │ -00144 │ │ │ │ │ │ -// check if everything is correctly initialised │ │ │ │ │ │ -00145 │ │ │ │ │ │ -if (n_part==0){ │ │ │ │ │ │ -00146 │ │ │ │ │ │ -return 0; │ │ │ │ │ │ -00147 │ │ │ │ │ │ -} │ │ │ │ │ │ -00148 │ │ │ │ │ │ -00149 │ │ │ │ │ │ -R = _radius; │ │ │ │ │ │ -00150 │ │ │ │ │ │ -R2 = R*R; │ │ │ │ │ │ -00151 │ │ │ │ │ │ -// allow hash for cones candidates │ │ │ │ │ │ -00152 │ │ │ │ │ │ -00153 │ │ │ │ │ │ -hc = new hash_cones(n_part, R2); │ │ │ │ │ │ -00154 │ │ │ │ │ │ -// browse all particles │ │ │ │ │ │ -00155 │ │ │ │ │ │ -00156 │ │ │ │ │ │ -for (p_idx=0;p_idxv; │ │ │ │ │ │ -00216 │ │ │ │ │ │ -centre_idx = first_cone; │ │ │ │ │ │ -00217 │ │ │ │ │ │ -// build the initial cone (nodist: avoids calculating distances -00218 │ │ │ │ │ │ -00219 │ │ │ │ │ │ -// just deduces contents by circulating around all in/out operations) │ │ │ │ │ │ -00220 │ │ │ │ │ │ -// this function also sets the list of included particles │ │ │ │ │ │ -00221 │ │ │ │ │ │ -compute_cone_contents(); │ │ │ │ │ │ -00222 │ │ │ │ │ │ -return 0; │ │ │ │ │ │ -00223 │ │ │ │ │ │ -00224 } │ │ │ │ │ │ -00225 │ │ │ │ │ │ -00226 │ │ │ │ │ │ -00227 /* │ │ │ │ │ │ -00228 * test cones. │ │ │ │ │ │ -00229 * We check if the cone(s) built with the present parent and child │ │ │ │ │ │ -00230 * are stable │ │ │ │ │ │ -00231 * return 0 on success 1 on error │ │ │ │ │ │ -00232 *********************************************************************/ │ │ │ │ │ │ -00233 int Cstable_cones::test_cone(){ │ │ │ │ │ │ -00234 │ │ │ │ │ │ -Creference weighted_cone_ref; │ │ │ │ │ │ -00235 │ │ │ │ │ │ -// depending on the side we are taking the child particle, │ │ │ │ │ │ -00236 │ │ │ │ │ │ -00237 │ │ │ │ │ │ -// we test different configuration. │ │ │ │ │ │ -00238 │ │ │ │ │ │ -// Each time, two configurations are tested in such a way that │ │ │ │ │ │ -00239 │ │ │ │ │ │ -// all 4 possible cases (parent or child in or out the cone) │ │ │ │ │ │ -00240 │ │ │ │ │ │ -// are tested when taking the pair of particle parent+child │ │ │ │ │ │ -00241 │ │ │ │ │ │ -// and child+parent. │ │ │ │ │ │ -00242 │ │ │ │ │ │ -// here are the tests entering the first series: │ │ │ │ │ │ -00243 │ │ │ │ │ │ -00244 │ │ │ │ │ │ -// 1. check if the cone is already inserted │ │ │ │ │ │ -00245 │ │ │ │ │ │ -// 2. check cone stability for the parent and child particles │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -247 │ │ │ │ │ │ - │ │ │ │ │ │ - 248 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00246 │ │ │ │ │ │ -if (centre->side){ │ │ │ │ │ │ -00247 │ │ │ │ │ │ -00248 │ │ │ │ │ │ -// test when both particles are not in the cone │ │ │ │ │ │ -00249 │ │ │ │ │ │ -// or when both are in. │ │ │ │ │ │ -00250 │ │ │ │ │ │ -// Note: for the totally exclusive case, test emptyness before │ │ │ │ │ │ -00251 │ │ │ │ │ │ -cone_candidate = cone; │ │ │ │ │ │ -if (cone.ref.not_empty()){ │ │ │ │ │ │ -00252 │ │ │ │ │ │ -00253 │ │ │ │ │ │ -hc->insert(&cone_candidate, parent, child, false, false); │ │ │ │ │ │ -00254 │ │ │ │ │ │ -} │ │ │ │ │ │ -00255 │ │ │ │ │ │ -00256 │ │ │ │ │ │ -cone_candidate = cone; │ │ │ │ │ │ -00257 │ │ │ │ │ │ -cone_candidate+= *parent + *child; │ │ │ │ │ │ -00258 │ │ │ │ │ │ -hc->insert(&cone_candidate, parent, child, true, true); │ │ │ │ │ │ -00259 │ │ │ │ │ │ -} else { │ │ │ │ │ │ -00260 │ │ │ │ │ │ -// test when 1! of the particles is in the cone │ │ │ │ │ │ -00261 │ │ │ │ │ │ -cone_candidate = cone + *parent; │ │ │ │ │ │ -00262 │ │ │ │ │ │ -hc->insert(&cone_candidate, parent, child, true, false); │ │ │ │ │ │ -00263 │ │ │ │ │ │ -00264 │ │ │ │ │ │ -cone_candidate = cone + *child; │ │ │ │ │ │ -00265 │ │ │ │ │ │ -hc->insert(&cone_candidate, parent, child, false, true); │ │ │ │ │ │ -00266 │ │ │ │ │ │ -} │ │ │ │ │ │ -00267 │ │ │ │ │ │ -00268 │ │ │ │ │ │ -nb_tot+=2; │ │ │ │ │ │ -00269 │ │ │ │ │ │ -return 0; │ │ │ │ │ │ -00270 │ │ │ │ │ │ -00271 } │ │ │ │ │ │ -00272 │ │ │ │ │ │ -00273 │ │ │ │ │ │ -00274 /* │ │ │ │ │ │ -00275 * update the cone │ │ │ │ │ │ -00276 * go to the next child for that parent and update ’cone’ appropriately │ │ │ │ │ │ -00277 * return 0 if update candidate found, 1 otherwise │ │ │ │ │ │ -00278 ***********************************************************************/ │ │ │ │ │ │ -00279 int Cstable_cones::update_cone(){ │ │ │ │ │ │ -// get the next child and centre │ │ │ │ │ │ -00280 │ │ │ │ │ │ -00281 │ │ │ │ │ │ -centre_idx++; │ │ │ │ │ │ -00282 │ │ │ │ │ │ -if (centre_idx==vicinity_size) │ │ │ │ │ │ -00283 │ │ │ │ │ │ -centre_idx=0; │ │ │ │ │ │ -if (centre_idx==first_cone) │ │ │ │ │ │ -00284 │ │ │ │ │ │ -return 1; │ │ │ │ │ │ -00285 │ │ │ │ │ │ -00286 │ │ │ │ │ │ -00287 │ │ │ │ │ │ -// update the cone w.r.t. the old child │ │ │ │ │ │ -00288 │ │ │ │ │ │ -// only required if the old child is entering inside in which │ │ │ │ │ │ -00289 │ │ │ │ │ │ -// case we need to add it. We also know that the child is │ │ │ │ │ │ -00290 │ │ │ │ │ │ -// inside iff its side is -. │ │ │ │ │ │ -00291 │ │ │ │ │ │ -if (!centre->side){ │ │ │ │ │ │ -// update cone │ │ │ │ │ │ -00292 │ │ │ │ │ │ -00293 │ │ │ │ │ │ -cone += (*child); │ │ │ │ │ │ -00294 │ │ │ │ │ │ -// update info on particles inside │ │ │ │ │ │ -00295 │ │ │ │ │ │ -00296 │ │ │ │ │ │ -centre->is_inside->cone = true; │ │ │ │ │ │ -00297 │ │ │ │ │ │ -// update stability check quantities │ │ │ │ │ │ -00298 │ │ │ │ │ │ -00299 │ │ │ │ │ │ -dpt += fabs(child->px)+fabs(child->py); │ │ │ │ │ │ -00300 │ │ │ │ │ │ -} │ │ │ │ │ │ -00301 │ │ │ │ │ │ -00302 │ │ │ │ │ │ -// update centre and child to correspond to the new position │ │ │ │ │ │ -00303 │ │ │ │ │ │ -centre = vicinity[centre_idx]; │ │ │ │ │ │ -00304 │ │ │ │ │ │ -child = centre->v; │ │ │ │ │ │ -00305 │ │ │ │ │ │ -00306 │ │ │ │ │ │ -// check cocircularity │ │ │ │ │ │ -00307 │ │ │ │ │ │ -// note that if cocirculaity is detected (i.e. if we receive 1 │ │ │ │ │ │ -00308 │ │ │ │ │ │ -// in the next test), we need to recall ’update_cone’ directly │ │ │ │ │ │ -00309 │ │ │ │ │ │ -// since tests and remaining part of te update has been performed │ │ │ │ │ │ -00310 │ │ │ │ │ │ -//if (cocircular_check()) │ │ │ │ │ │ -00311 │ │ │ │ │ │ -if (cocircular_check()) │ │ │ │ │ │ -00312 │ │ │ │ │ │ -return update_cone(); │ │ │ │ │ │ -00313 │ │ │ │ │ │ -00314 │ │ │ │ │ │ -00315 │ │ │ │ │ │ -// update the cone w.r.t. the new child │ │ │ │ │ │ -00316 │ │ │ │ │ │ -// only required if the new child was already inside in which │ │ │ │ │ │ -00317 │ │ │ │ │ │ -// case we need to remove it. We also know that the child is │ │ │ │ │ │ -00318 │ │ │ │ │ │ -// inside iff its side is +. │ │ │ │ │ │ -00319 │ │ │ │ │ │ -if ((centre->side) && (cone.ref.not_empty())){ │ │ │ │ │ │ -00320 │ │ │ │ │ │ -// update cone │ │ │ │ │ │ -00321 │ │ │ │ │ │ -cone -= (*child); │ │ │ │ │ │ -00322 │ │ │ │ │ │ -// update info on particles inside │ │ │ │ │ │ -00323 │ │ │ │ │ │ -00324 │ │ │ │ │ │ -centre->is_inside->cone = false; │ │ │ │ │ │ -00325 │ │ │ │ │ │ -// update stability check quantities │ │ │ │ │ │ -00326 │ │ │ │ │ │ -00327 │ │ │ │ │ │ -dpt += fabs(child->px)+fabs(child->py); //child->perp2(); │ │ │ │ │ │ -00328 │ │ │ │ │ │ -} │ │ │ │ │ │ -00329 │ │ │ │ │ │ -00330 │ │ │ │ │ │ -// check that the addition and subtraction of vectors does │ │ │ │ │ │ -00331 │ │ │ │ │ │ -// not lead to too much rounding error │ │ │ │ │ │ -00332 │ │ │ │ │ │ -// for that, we compute the sum of pt modifications and of |pt| │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.43 protocones.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -00333 │ │ │ │ │ │ -// since last recomputation and once the ratio overpasses a threshold │ │ │ │ │ │ -00334 │ │ │ │ │ │ -// we recompute vicinity. │ │ │ │ │ │ -00335 │ │ │ │ │ │ -if ((dpt>PT_TSHOLD*(fabs(cone.px)+fabs(cone.py))) && (cone.ref.not_empty())){ │ │ │ │ │ │ -00336 │ │ │ │ │ │ -recompute_cone_contents(); │ │ │ │ │ │ -00337 │ │ │ │ │ │ -} │ │ │ │ │ │ -00338 │ │ │ │ │ │ -if (cone.ref.is_empty()){ │ │ │ │ │ │ -00339 │ │ │ │ │ │ -cone = Cmomentum(); │ │ │ │ │ │ -00340 │ │ │ │ │ │ -dpt=0.0; │ │ │ │ │ │ -00341 │ │ │ │ │ │ -} │ │ │ │ │ │ -00342 │ │ │ │ │ │ -00343 │ │ │ │ │ │ -return 0; │ │ │ │ │ │ -00344 } │ │ │ │ │ │ -00345 │ │ │ │ │ │ -00346 │ │ │ │ │ │ -00347 /* │ │ │ │ │ │ -00348 * compute stability of all enumerated candidates. │ │ │ │ │ │ -00349 * For all candidate cones which are stable w.r.t. their border particles, │ │ │ │ │ │ -00350 * pass the last test: stability with quadtree intersection │ │ │ │ │ │ -00351 ************************************************************************/ │ │ │ │ │ │ -00352 int Cstable_cones::proceed_with_stability(){ │ │ │ │ │ │ -int i; // ,n; │ │ │ │ │ │ -00353 │ │ │ │ │ │ -00354 │ │ │ │ │ │ -hash_element *elm; │ │ │ │ │ │ -00355 │ │ │ │ │ │ -//n=0; │ │ │ │ │ │ -00356 │ │ │ │ │ │ -00357 │ │ │ │ │ │ -for (i=0;i<=hc->mask;i++){ │ │ │ │ │ │ -// test ith cell of the hash array │ │ │ │ │ │ -00358 │ │ │ │ │ │ -00359 │ │ │ │ │ │ -elm = hc->hash_array[i]; │ │ │ │ │ │ -00360 │ │ │ │ │ │ -// browse elements therein │ │ │ │ │ │ -00361 │ │ │ │ │ │ -00362 │ │ │ │ │ │ -while (elm!=NULL){ │ │ │ │ │ │ -// test stability │ │ │ │ │ │ -00363 │ │ │ │ │ │ -00364 │ │ │ │ │ │ -if (elm->is_stable){ │ │ │ │ │ │ -// stability is not ensured by all pairs of "edges" already browsed │ │ │ │ │ │ -00365 │ │ │ │ │ │ -00366 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ -00367 │ │ │ │ │ │ -// => testing stability with quadtree intersection │ │ │ │ │ │ -00368 │ │ │ │ │ │ -if (quadtree->circle_intersect(elm->eta, elm->phi, R2)==elm->ref){ │ │ │ │ │ │ -00369 #else │ │ │ │ │ │ -00370 │ │ │ │ │ │ -// => testing stability with the particle-list intersection │ │ │ │ │ │ -00371 │ │ │ │ │ │ -if (circle_intersect(elm->eta, elm->phi)==elm->ref){ │ │ │ │ │ │ -00372 #endif │ │ │ │ │ │ -00373 │ │ │ │ │ │ -// add it to the list of protocones │ │ │ │ │ │ -00374 │ │ │ │ │ │ -// note that in its present form, we do not allocate the │ │ │ │ │ │ -00375 │ │ │ │ │ │ -// 4-vector components of the momentum. There’s no need to │ │ │ │ │ │ -00376 │ │ │ │ │ │ -// do it here as it will be recomputed in │ │ │ │ │ │ -00377 │ │ │ │ │ │ -// │ │ │ │ │ │ -Csplit_merge::add_protocones │ │ │ │ │ │ -00378 │ │ │ │ │ │ -protocones.push_back(Cmomentum(elm->eta, elm->phi, elm->ref)); │ │ │ │ │ │ -00379 │ │ │ │ │ │ -} │ │ │ │ │ │ -00380 │ │ │ │ │ │ -} │ │ │ │ │ │ -00381 │ │ │ │ │ │ -// jump to the next one │ │ │ │ │ │ -00382 │ │ │ │ │ │ -00383 │ │ │ │ │ │ -elm = elm->next; │ │ │ │ │ │ -00384 │ │ │ │ │ │ -} │ │ │ │ │ │ -00385 │ │ │ │ │ │ -} │ │ │ │ │ │ -00386 │ │ │ │ │ │ -// free hash │ │ │ │ │ │ -00387 │ │ │ │ │ │ -00388 │ │ │ │ │ │ -// we do that at this level because hash eats rather a lot of memory │ │ │ │ │ │ -00389 │ │ │ │ │ │ -// we want to free it before running the split/merge algorithm │ │ │ │ │ │ -00390 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ -00391 │ │ │ │ │ │ -nb_hash_cones = hc->n_cones; │ │ │ │ │ │ -00392 │ │ │ │ │ │ -nb_hash_occupied = hc->n_occupied_cells; │ │ │ │ │ │ -00393 #endif │ │ │ │ │ │ -00394 │ │ │ │ │ │ -00395 │ │ │ │ │ │ -delete hc; │ │ │ │ │ │ -00396 │ │ │ │ │ │ -hc=NULL; │ │ │ │ │ │ -00397 │ │ │ │ │ │ -return protocones.size(); │ │ │ │ │ │ -00398 │ │ │ │ │ │ -00399 } │ │ │ │ │ │ -00400 │ │ │ │ │ │ -00401 │ │ │ │ │ │ -00403 // ALGORITHM MAIN STEPS FOR COCIRCULAR SITUATIONS │ │ │ │ │ │ -// │ │ │ │ │ │ -00404 // - cocircular_pt_less(v1, v2) │ │ │ │ │ │ -// │ │ │ │ │ │ -00405 // - prepare_cocircular_list() │ │ │ │ │ │ -// │ │ │ │ │ │ -00406 // - test_cone_cocircular() │ │ │ │ │ │ -// │ │ │ │ │ │ -00407 // - test_stability(candidate, border_vect) │ │ │ │ │ │ -// │ │ │ │ │ │ -00408 // - updat_cone_cocircular() │ │ │ │ │ │ -// │ │ │ │ │ │ -00410 │ │ │ │ │ │ -00412 bool cocircular_pt_less(Cmomentum *v1, Cmomentum *v2){ │ │ │ │ │ │ -return v1->perp2() < v2->perp2(); │ │ │ │ │ │ -00413 │ │ │ │ │ │ -00414 } │ │ │ │ │ │ -00415 │ │ │ │ │ │ -00416 /* │ │ │ │ │ │ -00417 * run through the vicinity of the current parent and for each child │ │ │ │ │ │ -00418 * establish which other members are cocircular... Note that the list │ │ │ │ │ │ -00419 * associated with each child contains references to vicinity │ │ │ │ │ │ -00420 * elements: thus two vicinity elements each associated with one given │ │ │ │ │ │ -00421 * particle may appear in a list -- this needs to be watched out for │ │ │ │ │ │ -00422 * later on... │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -249 │ │ │ │ │ │ - │ │ │ │ │ │ - 250 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00423 **********************************************************************/ │ │ │ │ │ │ -00424 void Cstable_cones::prepare_cocircular_lists() { │ │ │ │ │ │ -00425 │ │ │ │ │ │ -circulator::iterator > here(vicinity.begin(), │ │ │ │ │ │ -00426 │ │ │ │ │ │ -vicinity.begin(), │ │ │ │ │ │ -00427 │ │ │ │ │ │ -vicinity.end()); │ │ │ │ │ │ -00428 │ │ │ │ │ │ -00429 │ │ │ │ │ │ -circulator::iterator > search(here); │ │ │ │ │ │ -00430 │ │ │ │ │ │ -do { │ │ │ │ │ │ -00431 │ │ │ │ │ │ -00432 │ │ │ │ │ │ -Cvicinity_elm* here_pntr = *here(); │ │ │ │ │ │ -00433 │ │ │ │ │ │ -search.set_position(here); │ │ │ │ │ │ -00434 │ │ │ │ │ │ -00435 │ │ │ │ │ │ -// search forwards for things that should have "here" included in │ │ │ │ │ │ -00436 │ │ │ │ │ │ -// their cocircularity list │ │ │ │ │ │ -00437 │ │ │ │ │ │ -while (true) { │ │ │ │ │ │ -00438 │ │ │ │ │ │ -++search; │ │ │ │ │ │ -if ( abs_dphi((*search())->angle, here_pntr->angle) < │ │ │ │ │ │ -00439 │ │ │ │ │ │ -00440 │ │ │ │ │ │ -here_pntr->cocircular_range │ │ │ │ │ │ -00441 │ │ │ │ │ │ -&& search() != here()) { │ │ │ │ │ │ -00442 │ │ │ │ │ │ -(*search())->cocircular.push_back(here_pntr); │ │ │ │ │ │ -00443 │ │ │ │ │ │ -} else { │ │ │ │ │ │ -00444 │ │ │ │ │ │ -break; │ │ │ │ │ │ -00445 │ │ │ │ │ │ -} │ │ │ │ │ │ -00446 │ │ │ │ │ │ -} │ │ │ │ │ │ -00447 │ │ │ │ │ │ -// search backwards │ │ │ │ │ │ -00448 │ │ │ │ │ │ -00449 │ │ │ │ │ │ -search.set_position(here); │ │ │ │ │ │ -while (true) { │ │ │ │ │ │ -00450 │ │ │ │ │ │ -00451 │ │ │ │ │ │ ---search; │ │ │ │ │ │ -00452 │ │ │ │ │ │ -if ( abs_dphi((*search())->angle, here_pntr->angle) < │ │ │ │ │ │ -00453 │ │ │ │ │ │ -here_pntr->cocircular_range │ │ │ │ │ │ -00454 │ │ │ │ │ │ -&& search() != here()) { │ │ │ │ │ │ -00455 │ │ │ │ │ │ -(*search())->cocircular.push_back(here_pntr); │ │ │ │ │ │ -00456 │ │ │ │ │ │ -} else { │ │ │ │ │ │ -break; │ │ │ │ │ │ -00457 │ │ │ │ │ │ -00458 │ │ │ │ │ │ -} │ │ │ │ │ │ -00459 │ │ │ │ │ │ -} │ │ │ │ │ │ -00460 │ │ │ │ │ │ -00461 │ │ │ │ │ │ -++here; │ │ │ │ │ │ -00462 │ │ │ │ │ │ -} while (here() != vicinity.begin()); │ │ │ │ │ │ -00463 │ │ │ │ │ │ -00464 } │ │ │ │ │ │ -00465 │ │ │ │ │ │ -00466 /* │ │ │ │ │ │ -00467 * Testing cocircular configurations in p^3 time, │ │ │ │ │ │ -00468 * rather than 2^p time; we will test all contiguous subsets of points │ │ │ │ │ │ -00469 * on the border --- note that this is till probably overkill, since │ │ │ │ │ │ -00470 * in principle we only have to test situations where up to a │ │ │ │ │ │ -00471 * half-circle is filled (but going to a full circle is simpler) │ │ │ │ │ │ -00472 ******************************************************************/ │ │ │ │ │ │ -00473 void Cstable_cones::test_cone_cocircular(Cmomentum & borderless_cone, │ │ │ │ │ │ -00474 │ │ │ │ │ │ -list & border_list) { │ │ │ │ │ │ -00475 │ │ │ │ │ │ -vector border_vect; │ │ │ │ │ │ -00476 │ │ │ │ │ │ -00477 │ │ │ │ │ │ -border_vect.reserve(border_list.size()); │ │ │ │ │ │ -00478 │ │ │ │ │ │ -for (list::iterator it = border_list.begin(); │ │ │ │ │ │ -00479 │ │ │ │ │ │ -it != border_list.end(); it++) { │ │ │ │ │ │ -00480 │ │ │ │ │ │ -border_vect.push_back(Cborder_store(*it, centre->eta, centre->phi)); │ │ │ │ │ │ -00481 │ │ │ │ │ │ -} │ │ │ │ │ │ -00482 │ │ │ │ │ │ -00483 │ │ │ │ │ │ -// get them into order of angle │ │ │ │ │ │ -00484 │ │ │ │ │ │ -sort(border_vect.begin(), border_vect.end()); │ │ │ │ │ │ -00485 │ │ │ │ │ │ -// set up some circulators, since these will help us go around the │ │ │ │ │ │ -00486 │ │ │ │ │ │ -00487 │ │ │ │ │ │ -// circle easily │ │ │ │ │ │ -00488 │ │ │ │ │ │ -circulator::iterator > │ │ │ │ │ │ -00489 │ │ │ │ │ │ -start(border_vect.begin(), border_vect.begin(),border_vect.end()); │ │ │ │ │ │ -00490 │ │ │ │ │ │ -circulator::iterator > mid(start), end(start); │ │ │ │ │ │ -00491 │ │ │ │ │ │ -00492 │ │ │ │ │ │ -// test the borderless cone │ │ │ │ │ │ -00493 │ │ │ │ │ │ -Cmomentum candidate = borderless_cone; │ │ │ │ │ │ -00494 │ │ │ │ │ │ -candidate.build_etaphi(); │ │ │ │ │ │ -if (candidate.ref.not_empty()) │ │ │ │ │ │ -00495 │ │ │ │ │ │ -00496 │ │ │ │ │ │ -test_stability(candidate, border_vect); │ │ │ │ │ │ -00497 │ │ │ │ │ │ -00498 │ │ │ │ │ │ -do { │ │ │ │ │ │ -00499 │ │ │ │ │ │ -// reset status wrt inclusion in the cone │ │ │ │ │ │ -00500 │ │ │ │ │ │ -mid = start; │ │ │ │ │ │ -00501 │ │ │ │ │ │ -do { │ │ │ │ │ │ -00502 │ │ │ │ │ │ -mid()->is_in = false; │ │ │ │ │ │ -00503 │ │ │ │ │ │ -} while (++mid != start); │ │ │ │ │ │ -00504 │ │ │ │ │ │ -// now run over all inclusion possibilities with this starting point │ │ │ │ │ │ -00505 │ │ │ │ │ │ -00506 │ │ │ │ │ │ -candidate = borderless_cone; │ │ │ │ │ │ -while (++mid != start) { │ │ │ │ │ │ -00507 │ │ │ │ │ │ -// will begin with start+1 and go up to start-1 │ │ │ │ │ │ -00508 │ │ │ │ │ │ -00509 │ │ │ │ │ │ -mid()->is_in = true; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.43 protocones.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -251 │ │ │ │ │ │ - │ │ │ │ │ │ -00510 │ │ │ │ │ │ -candidate += *(mid()->mom); │ │ │ │ │ │ -00511 │ │ │ │ │ │ -test_stability(candidate, border_vect); │ │ │ │ │ │ -00512 │ │ │ │ │ │ -} │ │ │ │ │ │ -00513 │ │ │ │ │ │ -00514 │ │ │ │ │ │ -} while (++start != end); │ │ │ │ │ │ -00515 │ │ │ │ │ │ -// mid corresponds to momentum that we need to include to get the │ │ │ │ │ │ -00516 │ │ │ │ │ │ -00517 │ │ │ │ │ │ -// full cone │ │ │ │ │ │ -00518 │ │ │ │ │ │ -mid()->is_in = true; │ │ │ │ │ │ -00519 │ │ │ │ │ │ -candidate += *(mid()->mom); │ │ │ │ │ │ -00520 │ │ │ │ │ │ -test_stability(candidate, border_vect); │ │ │ │ │ │ -00521 } │ │ │ │ │ │ -00522 │ │ │ │ │ │ -00523 │ │ │ │ │ │ -00530 void Cstable_cones::test_stability(Cmomentum & candidate, const vector & border_vect) { │ │ │ │ │ │ -00531 │ │ │ │ │ │ -// this almost certainly has not been done... │ │ │ │ │ │ -00532 │ │ │ │ │ │ -00533 │ │ │ │ │ │ -candidate.build_etaphi(); │ │ │ │ │ │ -00534 │ │ │ │ │ │ -bool stable = true; │ │ │ │ │ │ -00535 │ │ │ │ │ │ -for (unsigned i = 0; i < border_vect.size(); i++) { │ │ │ │ │ │ -00536 │ │ │ │ │ │ -00537 │ │ │ │ │ │ -if (is_inside(&candidate, border_vect[i].mom) ^ (border_vect[i].is_in)) { │ │ │ │ │ │ -00538 │ │ │ │ │ │ -stable = false; │ │ │ │ │ │ -break; // it’s unstable so there’s no point continuing │ │ │ │ │ │ -00539 │ │ │ │ │ │ -00540 │ │ │ │ │ │ -} │ │ │ │ │ │ -00541 │ │ │ │ │ │ -} │ │ │ │ │ │ -00542 │ │ │ │ │ │ -if (stable) hc->insert(&candidate); │ │ │ │ │ │ -00543 │ │ │ │ │ │ -00544 } │ │ │ │ │ │ -00545 │ │ │ │ │ │ -00546 /* │ │ │ │ │ │ -00547 * check if we are in a situation of cocircularity. │ │ │ │ │ │ -00548 * if it is the case, update and test in the corresponding way │ │ │ │ │ │ -00549 * return ’false’ if no cocircularity detected, ’true’ otherwise │ │ │ │ │ │ -00550 * Note that if cocircularity is detected, we need to │ │ │ │ │ │ -00551 * recall ’update’ from ’update’ !!! │ │ │ │ │ │ -00552 ***************************************************************/ │ │ │ │ │ │ -00553 bool Cstable_cones::cocircular_check(){ │ │ │ │ │ │ -00554 │ │ │ │ │ │ -// check if many configurations have the same centre. │ │ │ │ │ │ -00555 │ │ │ │ │ │ -// if this is the case, branch on the algorithm for this │ │ │ │ │ │ -00556 │ │ │ │ │ │ -// special case. │ │ │ │ │ │ -00557 │ │ │ │ │ │ -// Note that those situation, being considered separately in │ │ │ │ │ │ -00558 │ │ │ │ │ │ -// test_cone_multiple, must only be considered here if all │ │ │ │ │ │ -00559 │ │ │ │ │ │ -// angles are on the same side (this avoid multiple counting) │ │ │ │ │ │ -00560 │ │ │ │ │ │ -00561 │ │ │ │ │ │ -if (centre->cocircular.empty()) return false; │ │ │ │ │ │ -00562 │ │ │ │ │ │ -// first get cone into status required at end... │ │ │ │ │ │ -00563 │ │ │ │ │ │ -00564 │ │ │ │ │ │ -if ((centre->side) && (cone.ref.not_empty())){ │ │ │ │ │ │ -// update cone │ │ │ │ │ │ -00565 │ │ │ │ │ │ -00566 │ │ │ │ │ │ -cone -= (*child); │ │ │ │ │ │ -00567 │ │ │ │ │ │ -// update info on particles inside │ │ │ │ │ │ -00568 │ │ │ │ │ │ -00569 │ │ │ │ │ │ -centre->is_inside->cone = false; │ │ │ │ │ │ -00570 │ │ │ │ │ │ -00571 │ │ │ │ │ │ -// update stability check quantities │ │ │ │ │ │ -00572 │ │ │ │ │ │ -dpt += fabs(child->px)+fabs(child->py); //child->perp2(); │ │ │ │ │ │ -00573 │ │ │ │ │ │ -} │ │ │ │ │ │ -00574 │ │ │ │ │ │ -00575 │ │ │ │ │ │ -00576 │ │ │ │ │ │ -// now establish the list of unique children in the list │ │ │ │ │ │ -00577 │ │ │ │ │ │ -// first make sure parent and child are in! │ │ │ │ │ │ -00578 │ │ │ │ │ │ -00579 │ │ │ │ │ │ -list removed_from_cone; │ │ │ │ │ │ -00580 │ │ │ │ │ │ -list put_in_border; │ │ │ │ │ │ -00581 │ │ │ │ │ │ -list border_list; │ │ │ │ │ │ -00582 │ │ │ │ │ │ -00583 │ │ │ │ │ │ -Cmomentum cone_removal; │ │ │ │ │ │ -00584 │ │ │ │ │ │ -Cmomentum border = *parent; │ │ │ │ │ │ -00585 │ │ │ │ │ │ -border_list.push_back(parent); │ │ │ │ │ │ -00586 │ │ │ │ │ │ -// make sure child appears in the border region │ │ │ │ │ │ -00587 │ │ │ │ │ │ -00588 │ │ │ │ │ │ -centre->cocircular.push_back(centre); │ │ │ │ │ │ -00589 │ │ │ │ │ │ -00590 │ │ │ │ │ │ -// now establish the full contents of the cone minus the cocircular │ │ │ │ │ │ -00591 │ │ │ │ │ │ -// region and of the cocircular region itself │ │ │ │ │ │ -00592 │ │ │ │ │ │ -for(list::iterator it = centre->cocircular.begin(); │ │ │ │ │ │ -00593 │ │ │ │ │ │ -it != centre->cocircular.end(); it++) { │ │ │ │ │ │ -00594 │ │ │ │ │ │ -if ((*it)->is_inside->cone) { │ │ │ │ │ │ -00595 │ │ │ │ │ │ -00596 │ │ │ │ │ │ -cone_removal │ │ │ │ │ │ -+= *((*it)->v); │ │ │ │ │ │ -00597 │ │ │ │ │ │ -(*it)->is_inside->cone = false; │ │ │ │ │ │ -00598 │ │ │ │ │ │ -removed_from_cone.push_back((*it)->is_inside); │ │ │ │ │ │ -00599 │ │ │ │ │ │ -} │ │ │ │ │ │ -00600 │ │ │ │ │ │ -// if a point appears twice (i.e. with + and - sign) in the list of │ │ │ │ │ │ -00601 │ │ │ │ │ │ -00602 │ │ │ │ │ │ -// points on the border, we take care not to include it twice. │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 252 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00603 │ │ │ │ │ │ -// Note that this situation may appear when a point is at a distance │ │ │ │ │ │ -00604 │ │ │ │ │ │ -// close to 2R from the parent │ │ │ │ │ │ -00605 │ │ │ │ │ │ -if (!(*it)->is_inside->cocirc) { │ │ │ │ │ │ -00606 │ │ │ │ │ │ -border += *((*it)->v); │ │ │ │ │ │ -00607 │ │ │ │ │ │ -(*it)->is_inside->cocirc = true; │ │ │ │ │ │ -00608 │ │ │ │ │ │ -put_in_border.push_back((*it)->is_inside); │ │ │ │ │ │ -00609 │ │ │ │ │ │ -border_list.push_back((*it)->v); │ │ │ │ │ │ -00610 │ │ │ │ │ │ -} │ │ │ │ │ │ -00611 │ │ │ │ │ │ -} │ │ │ │ │ │ -00612 │ │ │ │ │ │ -00613 │ │ │ │ │ │ -// figure out whether this pairing has been observed before │ │ │ │ │ │ -00614 │ │ │ │ │ │ -00615 │ │ │ │ │ │ -Cmomentum borderless_cone = cone; │ │ │ │ │ │ -00616 │ │ │ │ │ │ -borderless_cone -= cone_removal; │ │ │ │ │ │ -bool consider = true; │ │ │ │ │ │ -00617 │ │ │ │ │ │ -for (unsigned int i=0;i(borderless_cone.ref, │ │ │ │ │ │ -00628 │ │ │ │ │ │ -border.ref)); │ │ │ │ │ │ -00629 │ │ │ │ │ │ -// first figure out whether our cone momentum is good │ │ │ │ │ │ -00630 │ │ │ │ │ │ -00631 │ │ │ │ │ │ -double local_dpt = fabs(cone_removal.px) + fabs(cone_removal.py); │ │ │ │ │ │ -00632 │ │ │ │ │ │ -double total_dpt = dpt + local_dpt; │ │ │ │ │ │ -00633 │ │ │ │ │ │ -00634 │ │ │ │ │ │ -recompute_cone_contents_if_needed(borderless_cone, total_dpt); │ │ │ │ │ │ -if (total_dpt == 0) { │ │ │ │ │ │ -00635 │ │ │ │ │ │ -00636 │ │ │ │ │ │ -// a recomputation has taken place -- so take advantage of this │ │ │ │ │ │ -00637 │ │ │ │ │ │ -// and update the member cone momentum │ │ │ │ │ │ -00638 │ │ │ │ │ │ -cone = borderless_cone + cone_removal; │ │ │ │ │ │ -00639 │ │ │ │ │ │ -dpt = local_dpt; │ │ │ │ │ │ -00640 │ │ │ │ │ │ -} │ │ │ │ │ │ -00641 │ │ │ │ │ │ -00642 │ │ │ │ │ │ -test_cone_cocircular(borderless_cone, border_list); │ │ │ │ │ │ -00643 │ │ │ │ │ │ -} │ │ │ │ │ │ -00644 │ │ │ │ │ │ -00645 │ │ │ │ │ │ -// relabel things that were in the cone but got removed │ │ │ │ │ │ -00646 │ │ │ │ │ │ -00647 │ │ │ │ │ │ -for(list::iterator is_in = removed_from_cone.begin(); │ │ │ │ │ │ -00648 │ │ │ │ │ │ -is_in != removed_from_cone.end(); is_in++) { │ │ │ │ │ │ -00649 │ │ │ │ │ │ -(*is_in)->cone = true; │ │ │ │ │ │ -00650 │ │ │ │ │ │ -} │ │ │ │ │ │ -00651 │ │ │ │ │ │ -00652 │ │ │ │ │ │ -// relabel things that got put into the border │ │ │ │ │ │ -00653 │ │ │ │ │ │ -for(list::iterator is_in = put_in_border.begin(); │ │ │ │ │ │ -00654 │ │ │ │ │ │ -is_in != put_in_border.end(); is_in++) { │ │ │ │ │ │ -00655 │ │ │ │ │ │ -(*is_in)->cocirc = false; │ │ │ │ │ │ -00656 │ │ │ │ │ │ -} │ │ │ │ │ │ -00657 │ │ │ │ │ │ -00658 │ │ │ │ │ │ -// we’re done with everything -- return true to signal to user that we’ve │ │ │ │ │ │ -00659 │ │ │ │ │ │ -// been through the co-circularity rigmarole │ │ │ │ │ │ -00660 │ │ │ │ │ │ -return true; │ │ │ │ │ │ -00661 } │ │ │ │ │ │ -00662 │ │ │ │ │ │ -00663 │ │ │ │ │ │ -00665 // RECOMPUTATION OF CONE CONTENTS │ │ │ │ │ │ -// │ │ │ │ │ │ -00666 // - compute_cone_contents() │ │ │ │ │ │ -// │ │ │ │ │ │ -00667 // - recompute_cone_contents() │ │ │ │ │ │ -// │ │ │ │ │ │ -00668 // - recompute_cone_contents_if_needed() │ │ │ │ │ │ -// │ │ │ │ │ │ -00670 │ │ │ │ │ │ -00679 void Cstable_cones::compute_cone_contents() { │ │ │ │ │ │ -00680 │ │ │ │ │ │ -circulator::iterator > │ │ │ │ │ │ -00681 │ │ │ │ │ │ -start(vicinity.begin()+first_cone, vicinity.begin(), vicinity.end()); │ │ │ │ │ │ -00682 │ │ │ │ │ │ -00683 │ │ │ │ │ │ -circulator::iterator > here(start); │ │ │ │ │ │ -00684 │ │ │ │ │ │ -// note that in the following algorithm, the cone contents never includes │ │ │ │ │ │ -00685 │ │ │ │ │ │ -00686 │ │ │ │ │ │ -// the child. Indeed, if it has positive sign, then it will be set as │ │ │ │ │ │ -00687 │ │ │ │ │ │ -// outside at the last step in the loop. If it has negative sign, then the │ │ │ │ │ │ -00688 │ │ │ │ │ │ -// loop will at some point go to the corresponding situation with positive │ │ │ │ │ │ -00689 │ │ │ │ │ │ -// sign and set the inclusion status to 0. │ │ │ │ │ │ -00690 │ │ │ │ │ │ -00691 │ │ │ │ │ │ -do { │ │ │ │ │ │ -// as we leave this position a particle enters if its side is │ │ │ │ │ │ -00692 │ │ │ │ │ │ -00693 │ │ │ │ │ │ -// negative (i.e. the centre is the one at -ve angle wrt to the │ │ │ │ │ │ -00694 │ │ │ │ │ │ -// parent-child line │ │ │ │ │ │ -00695 │ │ │ │ │ │ -if (!(*here())->side) ((*here())->is_inside->cone) = 1; │ │ │ │ │ │ -00696 │ │ │ │ │ │ -00697 │ │ │ │ │ │ -// move on to the next position │ │ │ │ │ │ -00698 │ │ │ │ │ │ -++here; │ │ │ │ │ │ -00699 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.43 protocones.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -00700 │ │ │ │ │ │ -// as we arrive at this position a particle leaves if its side is positive │ │ │ │ │ │ -00701 │ │ │ │ │ │ -if ((*here())->side) ((*here())->is_inside->cone) = 0; │ │ │ │ │ │ -00702 │ │ │ │ │ │ -} while (here != start); │ │ │ │ │ │ -00703 │ │ │ │ │ │ -// once we’ve reached the start the ’is_inside’ information should be │ │ │ │ │ │ -00704 │ │ │ │ │ │ -00705 │ │ │ │ │ │ -// 100% complete, so we can use it to calculate the cone contents │ │ │ │ │ │ -00706 │ │ │ │ │ │ -// and then exit │ │ │ │ │ │ -00707 │ │ │ │ │ │ -recompute_cone_contents(); │ │ │ │ │ │ -return; │ │ │ │ │ │ -00708 │ │ │ │ │ │ -00709 │ │ │ │ │ │ -00710 } │ │ │ │ │ │ -00711 │ │ │ │ │ │ -00712 │ │ │ │ │ │ -00713 /* │ │ │ │ │ │ -00714 * compute the cone momentum from particle list. │ │ │ │ │ │ -00715 * in this version, we use the ’pincluded’ information │ │ │ │ │ │ -00716 * from the Cvicinity class │ │ │ │ │ │ -00717 */ │ │ │ │ │ │ -00718 void Cstable_cones::recompute_cone_contents(){ │ │ │ │ │ │ -00719 │ │ │ │ │ │ -unsigned int i; │ │ │ │ │ │ -00720 │ │ │ │ │ │ -// set momentum to 0 │ │ │ │ │ │ -00721 │ │ │ │ │ │ -00722 │ │ │ │ │ │ -cone = Cmomentum(); │ │ │ │ │ │ -00723 │ │ │ │ │ │ -// Important note: we can browse only the particles │ │ │ │ │ │ -00724 │ │ │ │ │ │ -00725 │ │ │ │ │ │ -// in vicinity since all particles in the cone are │ │ │ │ │ │ -00726 │ │ │ │ │ │ -// withing a distance 2R w.r.t. parent hence in vicinity. │ │ │ │ │ │ -00727 │ │ │ │ │ │ -// Among those, we only add the particles for which ’is_inside’ is true ! │ │ │ │ │ │ -00728 │ │ │ │ │ │ -// This methos rather than a direct comparison avoids rounding errors │ │ │ │ │ │ -00729 │ │ │ │ │ │ -for (i=0;iside) && (vicinity[i]->is_inside->cone)) │ │ │ │ │ │ -00732 │ │ │ │ │ │ -cone += *vicinity[i]->v; │ │ │ │ │ │ -00733 │ │ │ │ │ │ -} │ │ │ │ │ │ -00734 │ │ │ │ │ │ -// set check variables back to 0 │ │ │ │ │ │ -00735 │ │ │ │ │ │ -00736 │ │ │ │ │ │ -dpt = 0.0; │ │ │ │ │ │ -00737 } │ │ │ │ │ │ -00738 │ │ │ │ │ │ -00739 │ │ │ │ │ │ -00740 /* │ │ │ │ │ │ -00741 * if we have gone beyond the acceptable threshold of change, compute │ │ │ │ │ │ -00742 * the cone momentum from particle list. in this version, we use the │ │ │ │ │ │ -00743 * ’pincluded’ information from the Cvicinity class, but we don’t │ │ │ │ │ │ -00744 * change the member cone, only the locally supplied one │ │ │ │ │ │ -00745 */ │ │ │ │ │ │ -00746 void Cstable_cones::recompute_cone_contents_if_needed(Cmomentum & this_cone, │ │ │ │ │ │ -00747 │ │ │ │ │ │ -double & this_dpt){ │ │ │ │ │ │ -00748 │ │ │ │ │ │ -if (this_dpt > PT_TSHOLD*(fabs(this_cone.px)+fabs(this_cone.py))) { │ │ │ │ │ │ -00749 │ │ │ │ │ │ -00750 │ │ │ │ │ │ -if (cone.ref.is_empty()) { │ │ │ │ │ │ -00751 │ │ │ │ │ │ -this_cone = Cmomentum(); │ │ │ │ │ │ -00752 │ │ │ │ │ │ -} else { │ │ │ │ │ │ -// set momentum to 0 │ │ │ │ │ │ -00753 │ │ │ │ │ │ -00754 │ │ │ │ │ │ -this_cone = Cmomentum(); │ │ │ │ │ │ -00755 │ │ │ │ │ │ -// Important note: we can browse only the particles │ │ │ │ │ │ -00756 │ │ │ │ │ │ -00757 │ │ │ │ │ │ -// in vicinity since all particles in the this_cone are │ │ │ │ │ │ -00758 │ │ │ │ │ │ -// withing a distance 2R w.r.t. parent hence in vicinity. │ │ │ │ │ │ -00759 │ │ │ │ │ │ -// Among those, we only add the particles for which ’is_inside’ is true ! │ │ │ │ │ │ -00760 │ │ │ │ │ │ -// This methos rather than a direct comparison avoids rounding errors │ │ │ │ │ │ -00761 │ │ │ │ │ │ -for (unsigned int i=0;iside) && (vicinity[i]->is_inside->cone)) │ │ │ │ │ │ -00764 │ │ │ │ │ │ -this_cone += *vicinity[i]->v; │ │ │ │ │ │ -00765 │ │ │ │ │ │ -} │ │ │ │ │ │ -00766 │ │ │ │ │ │ -00767 │ │ │ │ │ │ -} │ │ │ │ │ │ -00768 │ │ │ │ │ │ -// set check variables back to 0 │ │ │ │ │ │ -00769 │ │ │ │ │ │ -this_dpt = 0.0; │ │ │ │ │ │ -00770 │ │ │ │ │ │ -} │ │ │ │ │ │ -00771 │ │ │ │ │ │ -00772 } │ │ │ │ │ │ -00773 │ │ │ │ │ │ -00774 │ │ │ │ │ │ -00776 // VARIOUS TOOLS │ │ │ │ │ │ -// │ │ │ │ │ │ -00777 // - circle_intersect() │ │ │ │ │ │ -// │ │ │ │ │ │ -00778 // - is_inside() │ │ │ │ │ │ -// │ │ │ │ │ │ -00779 // - abs_dangle() │ │ │ │ │ │ -// │ │ │ │ │ │ -00781 │ │ │ │ │ │ -00782 │ │ │ │ │ │ -00783 /* │ │ │ │ │ │ -00784 * circle intersection. │ │ │ │ │ │ -00785 * computes the intersection with a circle of given centre and radius. │ │ │ │ │ │ -00786 * The output takes the form of a checkxor of the intersection’s particles │ │ │ │ │ │ -00787 * - cx │ │ │ │ │ │ -circle centre x coordinate │ │ │ │ │ │ -circle centre y coordinate │ │ │ │ │ │ -00788 * - cy │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -253 │ │ │ │ │ │ - │ │ │ │ │ │ - 254 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00789 * return the checkxor for the intersection │ │ │ │ │ │ -00790 ******************************************************************/ │ │ │ │ │ │ -00791 Creference Cstable_cones::circle_intersect(double cx, double cy){ │ │ │ │ │ │ -00792 │ │ │ │ │ │ -Creference intersection; │ │ │ │ │ │ -int i; │ │ │ │ │ │ -00793 │ │ │ │ │ │ -00794 │ │ │ │ │ │ -double dx, dy; │ │ │ │ │ │ -00795 │ │ │ │ │ │ -for (i=0;iM_PI) │ │ │ │ │ │ -00803 │ │ │ │ │ │ -dy -= twopi; │ │ │ │ │ │ -00804 │ │ │ │ │ │ -00805 │ │ │ │ │ │ -// really check if the distance is less than VR │ │ │ │ │ │ -00806 │ │ │ │ │ │ -if (dx*dx+dy*dyeta - v->eta; │ │ │ │ │ │ -00825 │ │ │ │ │ │ -dy = fabs(centre_in->phi - v->phi); │ │ │ │ │ │ -if (dy>M_PI) │ │ │ │ │ │ -00826 │ │ │ │ │ │ -00827 │ │ │ │ │ │ -dy -= twopi; │ │ │ │ │ │ -00828 │ │ │ │ │ │ -00829 │ │ │ │ │ │ -return dx*dx+dy*dyM_PI) │ │ │ │ │ │ -00844 │ │ │ │ │ │ -dphi = dphi-twopi; │ │ │ │ │ │ -00845 │ │ │ │ │ │ -00846 │ │ │ │ │ │ -return dphi; │ │ │ │ │ │ -00847 } │ │ │ │ │ │ -00848 │ │ │ │ │ │ -00849 } │ │ │ │ │ │ - │ │ │ │ │ │ -5.44 protocones.cpp │ │ │ │ │ │ -00001 │ │ │ │ │ │ -00002 // File: protocones.cpp │ │ │ │ │ │ -00003 // Description: source file for stable cones determination (Cstable_cones) │ │ │ │ │ │ -00004 // This file is part of the SISCone project. │ │ │ │ │ │ -00005 // WARNING: this is not the main SISCone trunk but │ │ │ │ │ │ -00006 // │ │ │ │ │ │ -an adaptation to spherical coordinates │ │ │ │ │ │ -00007 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ -00008 // │ │ │ │ │ │ -00009 // Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez │ │ │ │ │ │ -00010 // │ │ │ │ │ │ -00011 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ -00012 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ -00013 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ -00014 // (at your option) any later version. │ │ │ │ │ │ -00015 // │ │ │ │ │ │ -00016 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ -00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ -00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ -00019 // GNU General Public License for more details. │ │ │ │ │ │ - │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.44 protocones.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -00020 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00021 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ -// │ │ │ │ │ │ -00022 // along with this program; if not, write to the Free Software │ │ │ │ │ │ -// │ │ │ │ │ │ -00023 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ -00024 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00025 // $Revision:: 311 │ │ │ │ │ │ -$// │ │ │ │ │ │ -00026 // $Date:: 2011-10-05 23:27:09 +0200 (Wed, 05 Oct 2011) │ │ │ │ │ │ -$// │ │ │ │ │ │ -00028 │ │ │ │ │ │ -00029 /******************************************************* │ │ │ │ │ │ -00030 * Introductory note: │ │ │ │ │ │ -* │ │ │ │ │ │ -00031 * Since this file has many member functions, we have * │ │ │ │ │ │ -00032 * structured them in categories: │ │ │ │ │ │ -* │ │ │ │ │ │ -00033 * INITIALISATION FUNCTIONS │ │ │ │ │ │ -* │ │ │ │ │ │ -00034 * - ctor() │ │ │ │ │ │ -* │ │ │ │ │ │ -00035 * - ctor(particle_list) │ │ │ │ │ │ -* │ │ │ │ │ │ -00036 * - dtor() │ │ │ │ │ │ -* │ │ │ │ │ │ -00037 * - init(particle_list) │ │ │ │ │ │ -* │ │ │ │ │ │ -00038 * ALGORITHM MAIN ENTRY │ │ │ │ │ │ -* │ │ │ │ │ │ -00039 * - get_stable_cone(radius) │ │ │ │ │ │ -* │ │ │ │ │ │ -00040 * ALGORITHM MAIN STEPS │ │ │ │ │ │ -* │ │ │ │ │ │ -00041 * - init_cone() │ │ │ │ │ │ -* │ │ │ │ │ │ -00042 * - test_cone() │ │ │ │ │ │ -* │ │ │ │ │ │ -00043 * - update_cone() │ │ │ │ │ │ -* │ │ │ │ │ │ -00044 * - proceed_with_stability() │ │ │ │ │ │ -* │ │ │ │ │ │ -00045 * ALGORITHM MAIN STEPS FOR COCIRCULAR SITUATIONS │ │ │ │ │ │ -* │ │ │ │ │ │ -00046 * - cocircular_pt_less(v1, v2) │ │ │ │ │ │ -* │ │ │ │ │ │ -00047 * - prepare_cocircular_list() │ │ │ │ │ │ -* │ │ │ │ │ │ -00048 * - test_cone_cocircular() │ │ │ │ │ │ -* │ │ │ │ │ │ -00049 * - test_stability(candidate, border_list) │ │ │ │ │ │ -* │ │ │ │ │ │ -00050 * - updat_cone_cocircular() │ │ │ │ │ │ -* │ │ │ │ │ │ -00051 * RECOMPUTATION OF CONE CONTENTS │ │ │ │ │ │ -* │ │ │ │ │ │ -00052 * - compute_cone_contents() │ │ │ │ │ │ -* │ │ │ │ │ │ -00053 * - recompute_cone_contents() │ │ │ │ │ │ -* │ │ │ │ │ │ -00054 * - recompute_cone_contents_if_needed() │ │ │ │ │ │ -* │ │ │ │ │ │ -00055 * VARIOUS TOOLS │ │ │ │ │ │ -* │ │ │ │ │ │ -00056 * - circle_intersect() │ │ │ │ │ │ -* │ │ │ │ │ │ -00057 * - is_inside() │ │ │ │ │ │ -* │ │ │ │ │ │ -00058 * - abs_dangle() │ │ │ │ │ │ -* │ │ │ │ │ │ -00059 *******************************************************/ │ │ │ │ │ │ -00060 │ │ │ │ │ │ -00061 #include │ │ │ │ │ │ -00062 #include │ │ │ │ │ │ -00063 #include │ │ │ │ │ │ -00064 #include "protocones.h" │ │ │ │ │ │ -00065 #include │ │ │ │ │ │ -00066 #include │ │ │ │ │ │ -00067 #include │ │ │ │ │ │ -00068 │ │ │ │ │ │ -00069 namespace siscone_spherical{ │ │ │ │ │ │ -00070 │ │ │ │ │ │ -00071 using namespace std; │ │ │ │ │ │ -00072 │ │ │ │ │ │ -00073 /********************************************************************** │ │ │ │ │ │ -00074 * CSphstable_cones implementation │ │ │ │ │ │ -* │ │ │ │ │ │ -00075 * Computes the list of stable comes from a particle list. │ │ │ │ │ │ -* │ │ │ │ │ │ -00076 * This class does the first fundamental task of te cone algorithm: │ │ │ │ │ │ -* │ │ │ │ │ │ -00077 * it is used to compute the list of stable cones given a list │ │ │ │ │ │ -* │ │ │ │ │ │ -00078 * of particles. │ │ │ │ │ │ -* │ │ │ │ │ │ -00079 **********************************************************************/ │ │ │ │ │ │ -00080 │ │ │ │ │ │ -00082 // INITIALISATION FUNCTIONS │ │ │ │ │ │ -// │ │ │ │ │ │ -00083 // - ctor() │ │ │ │ │ │ -// │ │ │ │ │ │ -00084 // - ctor(particle_list) │ │ │ │ │ │ -// │ │ │ │ │ │ -00085 // - dtor() │ │ │ │ │ │ -// │ │ │ │ │ │ -00086 // - init(particle_list) │ │ │ │ │ │ -// │ │ │ │ │ │ -00088 │ │ │ │ │ │ -00089 // default ctor │ │ │ │ │ │ -00090 //-------------00091 CSphstable_cones::CSphstable_cones(){ │ │ │ │ │ │ -00092 │ │ │ │ │ │ -nb_tot = 0; │ │ │ │ │ │ -00093 │ │ │ │ │ │ -hc = NULL; │ │ │ │ │ │ -00094 } │ │ │ │ │ │ -00095 │ │ │ │ │ │ -00096 // ctor with initialisation │ │ │ │ │ │ -00097 //-------------------------00098 CSphstable_cones::CSphstable_cones(vector &_particle_list) │ │ │ │ │ │ -00099 │ │ │ │ │ │ -: CSphvicinity(_particle_list){ │ │ │ │ │ │ -00100 │ │ │ │ │ │ -00101 │ │ │ │ │ │ -nb_tot = 0; │ │ │ │ │ │ -00102 │ │ │ │ │ │ -hc = NULL; │ │ │ │ │ │ -00103 } │ │ │ │ │ │ -00104 │ │ │ │ │ │ -00105 // default dtor │ │ │ │ │ │ -00106 //-------------00107 CSphstable_cones::~CSphstable_cones(){ │ │ │ │ │ │ -if (hc!=NULL) delete hc; │ │ │ │ │ │ -00108 │ │ │ │ │ │ -00109 } │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -255 │ │ │ │ │ │ - │ │ │ │ │ │ - 256 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00110 │ │ │ │ │ │ -00111 /* │ │ │ │ │ │ -00112 * initialisation │ │ │ │ │ │ -00113 * - _particle_list list of particles │ │ │ │ │ │ -00114 * - _n │ │ │ │ │ │ -number of particles │ │ │ │ │ │ -00115 *********************************************************************/ │ │ │ │ │ │ -00116 void CSphstable_cones::init(vector &_particle_list){ │ │ │ │ │ │ -00117 │ │ │ │ │ │ -// check already allocated mem │ │ │ │ │ │ -00118 │ │ │ │ │ │ -if (hc!=NULL){ │ │ │ │ │ │ -00119 │ │ │ │ │ │ -delete hc; │ │ │ │ │ │ -00120 │ │ │ │ │ │ -} │ │ │ │ │ │ -if (protocones.size()!=0) │ │ │ │ │ │ -00121 │ │ │ │ │ │ -00122 │ │ │ │ │ │ -protocones.clear(); │ │ │ │ │ │ -00123 │ │ │ │ │ │ -00124 │ │ │ │ │ │ -multiple_centre_done.clear(); │ │ │ │ │ │ -00125 │ │ │ │ │ │ -00126 │ │ │ │ │ │ -// initialisation │ │ │ │ │ │ -00127 │ │ │ │ │ │ -set_particle_list(_particle_list); │ │ │ │ │ │ -00128 } │ │ │ │ │ │ -00129 │ │ │ │ │ │ -00130 │ │ │ │ │ │ -// │ │ │ │ │ │ -00132 // ALGORITHM MAIN ENTRY │ │ │ │ │ │ -00133 // - get_stable_cone(radius) │ │ │ │ │ │ -// │ │ │ │ │ │ -00135 │ │ │ │ │ │ -00136 /* │ │ │ │ │ │ -00137 * compute stable cones. │ │ │ │ │ │ -00138 * This function really does the job i.e. computes │ │ │ │ │ │ -00139 * the list of stable cones (in a seedless way) │ │ │ │ │ │ -00140 * - _radius: radius of the cones │ │ │ │ │ │ -00141 * The number of stable cones found is returned │ │ │ │ │ │ -00142 *********************************************************************/ │ │ │ │ │ │ -00143 int CSphstable_cones::get_stable_cones(double _radius){ │ │ │ │ │ │ -int p_idx; │ │ │ │ │ │ -00144 │ │ │ │ │ │ -00145 │ │ │ │ │ │ -// check if everything is correctly initialised │ │ │ │ │ │ -00146 │ │ │ │ │ │ -00147 │ │ │ │ │ │ -if (n_part==0){ │ │ │ │ │ │ -00148 │ │ │ │ │ │ -return 0; │ │ │ │ │ │ -00149 │ │ │ │ │ │ -} │ │ │ │ │ │ -00150 │ │ │ │ │ │ -00151 │ │ │ │ │ │ -R = _radius; │ │ │ │ │ │ -00152 │ │ │ │ │ │ -R2 = R*R; │ │ │ │ │ │ -00153 │ │ │ │ │ │ -tan2R = tan(R); │ │ │ │ │ │ -00154 │ │ │ │ │ │ -tan2R *= tan2R; │ │ │ │ │ │ -00155 │ │ │ │ │ │ -00156 │ │ │ │ │ │ -// allow hash for cones candidates │ │ │ │ │ │ -00157 │ │ │ │ │ │ -hc = new sph_hash_cones(n_part, R); │ │ │ │ │ │ -00158 │ │ │ │ │ │ -// browse all particles │ │ │ │ │ │ -00159 │ │ │ │ │ │ -00160 │ │ │ │ │ │ -for (p_idx=0;p_idx_phi « ", " « parent->_theta « endl; │ │ │ │ │ │ -00177 #endif │ │ │ │ │ │ -00178 │ │ │ │ │ │ -00179 │ │ │ │ │ │ -// step 1: initialise with the first cone candidate │ │ │ │ │ │ -00180 │ │ │ │ │ │ -init_cone(); │ │ │ │ │ │ -00181 │ │ │ │ │ │ -do{ │ │ │ │ │ │ -00182 │ │ │ │ │ │ -00183 │ │ │ │ │ │ -// step 2: test cone stability for that pair (P,C) │ │ │ │ │ │ -00184 │ │ │ │ │ │ -test_cone(); │ │ │ │ │ │ -00185 │ │ │ │ │ │ -00186 │ │ │ │ │ │ -// step 3: go to the next cone child candidate C │ │ │ │ │ │ -00187 │ │ │ │ │ │ -} while (!update_cone()); │ │ │ │ │ │ -00188 │ │ │ │ │ │ -} │ │ │ │ │ │ -00189 │ │ │ │ │ │ -00190 │ │ │ │ │ │ -return proceed_with_stability(); │ │ │ │ │ │ -00191 } │ │ │ │ │ │ +CSphstable_cones::init(p_uncol_hard); │ │ │ │ │ │ +00191 │ │ │ │ │ │ +// get stable cones (stored in ’protocones’) │ │ │ │ │ │ 00192 │ │ │ │ │ │ 00193 │ │ │ │ │ │ -00195 // ALGORITHM MAIN STEPS │ │ │ │ │ │ -// │ │ │ │ │ │ -00196 // - init_cone() │ │ │ │ │ │ -// │ │ │ │ │ │ -00197 // - test_cone() │ │ │ │ │ │ -// │ │ │ │ │ │ -00198 // - update_cone() │ │ │ │ │ │ -// │ │ │ │ │ │ -00199 // - proceed_with_stability() │ │ │ │ │ │ -// │ │ │ │ │ │ +unclustered_left = get_stable_cones(_radius); │ │ │ │ │ │ +00194 │ │ │ │ │ │ +00195 │ │ │ │ │ │ +// add the hardest stable cone to the list of jets │ │ │ │ │ │ +00196 │ │ │ │ │ │ +if (add_hardest_protocone_to_jets(&protocones, R2, _Emin)) break; │ │ │ │ │ │ +00197 │ │ │ │ │ │ +00198 │ │ │ │ │ │ +_n_pass_max--; │ │ │ │ │ │ +00199 │ │ │ │ │ │ +} while ((unclustered_left) && (n_left>0) && (_n_pass_max!=0)); │ │ │ │ │ │ +00200 │ │ │ │ │ │ +00201 │ │ │ │ │ │ +// split & merge │ │ │ │ │ │ +00202 │ │ │ │ │ │ +return jets.size(); │ │ │ │ │ │ +00203 } │ │ │ │ │ │ +00204 /* │ │ │ │ │ │ +00205 * recompute the jets with a different overlap parameter. │ │ │ │ │ │ +00206 * we use the same particles and R as in the preceeding call. │ │ │ │ │ │ │ │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 5.44 protocones.cpp │ │ │ │ │ │ + 258 │ │ │ │ │ │ │ │ │ │ │ │ -00201 │ │ │ │ │ │ -00202 /* │ │ │ │ │ │ -00203 * initialise the cone. │ │ │ │ │ │ -00204 * We take the first particle in the angular ordering to compute │ │ │ │ │ │ -00205 * this one │ │ │ │ │ │ -00206 * return 0 on success, 1 on error │ │ │ │ │ │ -00207 *********************************************************************/ │ │ │ │ │ │ -00208 int CSphstable_cones::init_cone(){ │ │ │ │ │ │ -// The previous version of the algorithm was starting the │ │ │ │ │ │ -00209 │ │ │ │ │ │ -00210 │ │ │ │ │ │ -// loop around vicinity elements with the "most isolated" child. │ │ │ │ │ │ -00211 │ │ │ │ │ │ -// given the nodist method to calculate the cone contents, we no │ │ │ │ │ │ -00212 │ │ │ │ │ │ -// longer need to worry about which cone comes first... │ │ │ │ │ │ -00213 │ │ │ │ │ │ -first_cone=0; │ │ │ │ │ │ -00214 │ │ │ │ │ │ -// now make sure we have lists of the cocircular particles │ │ │ │ │ │ -00215 │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +shared energy threshold for splitting&merging │ │ │ │ │ │ +00207 * - _f │ │ │ │ │ │ +00208 * - _Emin │ │ │ │ │ │ +minimum Energy of the protojets │ │ │ │ │ │ +the scale choice for the split-merge procedure │ │ │ │ │ │ +00209 * - _split_merge_scale │ │ │ │ │ │ +00210 * │ │ │ │ │ │ +NOTE: using pt leads to IR unsafety for some events with momentum │ │ │ │ │ │ +00211 * │ │ │ │ │ │ +conservation. So we strongly advise not to change the default │ │ │ │ │ │ +value. │ │ │ │ │ │ +00212 * │ │ │ │ │ │ +00213 * return the number of jets found, -1 if recomputation not allowed. │ │ │ │ │ │ +00214 ********************************************************************/ │ │ │ │ │ │ +00215 int CSphsiscone::recompute_jets(double _f, double _Emin, │ │ │ │ │ │ 00216 │ │ │ │ │ │ -prepare_cocircular_lists(); │ │ │ │ │ │ +Esplit_merge_scale _split_merge_scale){ │ │ │ │ │ │ 00217 │ │ │ │ │ │ +if (!rerun_allowed) │ │ │ │ │ │ +return -1; │ │ │ │ │ │ 00218 │ │ │ │ │ │ -//TODO? deal with a configuration with only degeneracies ? │ │ │ │ │ │ 00219 │ │ │ │ │ │ -// The only possibility seems a regular hexagon with a parent point │ │ │ │ │ │ 00220 │ │ │ │ │ │ -// in the centre. And this situation is by itself unclear. │ │ │ │ │ │ +ptcomparison.split_merge_scale = _split_merge_scale; │ │ │ │ │ │ 00221 │ │ │ │ │ │ -// Hence, we do nothing here ! │ │ │ │ │ │ +// restore particle list │ │ │ │ │ │ 00222 │ │ │ │ │ │ 00223 │ │ │ │ │ │ -// init set child C │ │ │ │ │ │ +partial_clear(); │ │ │ │ │ │ 00224 │ │ │ │ │ │ -centre = vicinity[first_cone]; │ │ │ │ │ │ +init_pleft(); │ │ │ │ │ │ 00225 │ │ │ │ │ │ -child = centre->v; │ │ │ │ │ │ 00226 │ │ │ │ │ │ -centre_idx = first_cone; │ │ │ │ │ │ +// initialise split/merge algorithm │ │ │ │ │ │ 00227 │ │ │ │ │ │ -// build the initial cone (nodist: avoids calculating distances -00228 │ │ │ │ │ │ +unsigned int i; │ │ │ │ │ │ +00228 │ │ │ │ │ │ +for (i=0;iflags()); │ │ │ │ │ │ 00250 │ │ │ │ │ │ -// are tested when taking the pair of particle parent+child │ │ │ │ │ │ 00251 │ │ │ │ │ │ -// and child+parent. │ │ │ │ │ │ +(*_banner_ostr) « "#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" « endl; │ │ │ │ │ │ 00252 │ │ │ │ │ │ +(*_banner_ostr) « "# │ │ │ │ │ │ +SISCone │ │ │ │ │ │ +version " « setw(28) « left « siscone_version() │ │ │ │ │ │ +« "o" « endl; │ │ │ │ │ │ 00253 │ │ │ │ │ │ -// here are the tests entering the first series: │ │ │ │ │ │ +(*_banner_ostr) « "# │ │ │ │ │ │ +http://projects.hepforge.org/siscone │ │ │ │ │ │ +o" « endl; │ │ │ │ │ │ 00254 │ │ │ │ │ │ -// 1. check if the cone is already inserted │ │ │ │ │ │ +(*_banner_ostr) « "# │ │ │ │ │ │ +o" « endl; │ │ │ │ │ │ +o" « endl; │ │ │ │ │ │ 00255 │ │ │ │ │ │ -// 2. check cone stability for the parent and child particles │ │ │ │ │ │ +(*_banner_ostr) « "# This is SISCone: the Seedless Infrared Safe Cone Jet Algorithm │ │ │ │ │ │ 00256 │ │ │ │ │ │ -//UPDATED(see below): if (centre->side){ │ │ │ │ │ │ +(*_banner_ostr) « "# SISCone was written by Gavin Salam and Gregory Soyez │ │ │ │ │ │ +o" « endl; │ │ │ │ │ │ 00257 │ │ │ │ │ │ +(*_banner_ostr) « "# It is released under the terms of the GNU General Public License o" « endl; │ │ │ │ │ │ 00258 │ │ │ │ │ │ -//UPDATED(see below): │ │ │ │ │ │ -// test when both particles are not in the cone │ │ │ │ │ │ +(*_banner_ostr) « "# │ │ │ │ │ │ +o" « endl; │ │ │ │ │ │ +!!! │ │ │ │ │ │ +WARNING │ │ │ │ │ │ +!!! │ │ │ │ │ │ +o" « endl; │ │ │ │ │ │ 00259 │ │ │ │ │ │ -//UPDATED(see below): │ │ │ │ │ │ -// or when both are in. │ │ │ │ │ │ +(*_banner_ostr) « "# │ │ │ │ │ │ 00260 │ │ │ │ │ │ -//UPDATED(see below): │ │ │ │ │ │ -// Note: for the totally exclusive case, test emptyness before │ │ │ │ │ │ +(*_banner_ostr) « "# │ │ │ │ │ │ +This is the version of SISCone using spherical coordinates │ │ │ │ │ │ +o" « endl; │ │ │ │ │ │ 00261 │ │ │ │ │ │ -//UPDATED(see below): │ │ │ │ │ │ -cone_candidate = cone; │ │ │ │ │ │ +(*_banner_ostr) « "# │ │ │ │ │ │ +o" « endl; │ │ │ │ │ │ +o" « endl; │ │ │ │ │ │ 00262 │ │ │ │ │ │ -//UPDATED(see below): │ │ │ │ │ │ -if (cone.ref.not_empty()){ │ │ │ │ │ │ +(*_banner_ostr) « "# A description of the algorithm is available in the publication │ │ │ │ │ │ 00263 │ │ │ │ │ │ -//UPDATED(see below): │ │ │ │ │ │ -hc->insert(&cone_candidate, parent, child, false, false); │ │ │ │ │ │ +(*_banner_ostr) « "# JHEP 05 (2007) 086 [arXiv:0704.0292 (hep-ph)]. │ │ │ │ │ │ +o" « endl; │ │ │ │ │ │ +o" « endl; │ │ │ │ │ │ 00264 │ │ │ │ │ │ -//UPDATED(see below): │ │ │ │ │ │ -} │ │ │ │ │ │ +(*_banner_ostr) « "# Please cite it if you use SISCone. │ │ │ │ │ │ 00265 │ │ │ │ │ │ -//UPDATED(see below): │ │ │ │ │ │ +(*_banner_ostr) « "#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" « endl; │ │ │ │ │ │ 00266 │ │ │ │ │ │ -//UPDATED(see below): │ │ │ │ │ │ -cone_candidate = cone; │ │ │ │ │ │ +(*_banner_ostr) « endl; │ │ │ │ │ │ 00267 │ │ │ │ │ │ -//UPDATED(see below): │ │ │ │ │ │ -cone_candidate+= *parent + *child; │ │ │ │ │ │ 00268 │ │ │ │ │ │ -//UPDATED(see below): │ │ │ │ │ │ -hc->insert(&cone_candidate, parent, child, true, true); │ │ │ │ │ │ +_banner_ostr->flush(); │ │ │ │ │ │ 00269 │ │ │ │ │ │ -//UPDATED(see below): } else { │ │ │ │ │ │ +_banner_ostr->flags(flags_to_restore); │ │ │ │ │ │ 00270 │ │ │ │ │ │ -//UPDATED(see below): │ │ │ │ │ │ -// test when 1! of the particles is in the cone │ │ │ │ │ │ -00271 │ │ │ │ │ │ -//UPDATED(see below): │ │ │ │ │ │ -cone_candidate = cone + *parent; │ │ │ │ │ │ +} │ │ │ │ │ │ +00271 } │ │ │ │ │ │ 00272 │ │ │ │ │ │ -//UPDATED(see below): │ │ │ │ │ │ -hc->insert(&cone_candidate, parent, child, true, false); │ │ │ │ │ │ -00273 │ │ │ │ │ │ -//UPDATED(see below): │ │ │ │ │ │ -00274 │ │ │ │ │ │ -//UPDATED(see below): │ │ │ │ │ │ -cone_candidate = cone + *child; │ │ │ │ │ │ -00275 │ │ │ │ │ │ -//UPDATED(see below): │ │ │ │ │ │ -hc->insert(&cone_candidate, parent, child, false, true); │ │ │ │ │ │ -00276 │ │ │ │ │ │ -//UPDATED(see below): } │ │ │ │ │ │ -00277 │ │ │ │ │ │ -//UPDATED(see below): │ │ │ │ │ │ -00278 │ │ │ │ │ │ -//UPDATED(see below): nb_tot+=2; │ │ │ │ │ │ -00279 │ │ │ │ │ │ -// instead of testing 2 inclusion/exclusion states for every pair, we test the 4 of them │ │ │ │ │ │ -00280 │ │ │ │ │ │ -00281 │ │ │ │ │ │ -// when the parent has an energy bigger than the child │ │ │ │ │ │ -00282 │ │ │ │ │ │ -if (parent->E >= child->E){ │ │ │ │ │ │ -// test when both particles are not in the cone │ │ │ │ │ │ -00283 │ │ │ │ │ │ -00284 │ │ │ │ │ │ -// Note: for the totally exclusive case, test emptiness before │ │ │ │ │ │ +00273 // finally, a bunch of functions to access to │ │ │ │ │ │ +00274 // basic information (package name, version) │ │ │ │ │ │ +00275 //--------------------------------------------00276 │ │ │ │ │ │ +00277 /* │ │ │ │ │ │ +00278 * return SISCone package name. │ │ │ │ │ │ +00279 * This is nothing but "SISCone", it is a replacement to the │ │ │ │ │ │ +00280 * SISCONE_PACKAGE_NAME string defined in config.h and which is not │ │ │ │ │ │ +00281 * guaranteed to be public. │ │ │ │ │ │ +00282 * return the SISCone name as a string │ │ │ │ │ │ +00283 */ │ │ │ │ │ │ +00284 string siscone_package_name(){ │ │ │ │ │ │ +return SISCONE_PACKAGE_NAME; │ │ │ │ │ │ 00285 │ │ │ │ │ │ -cone_candidate = cone; │ │ │ │ │ │ -if (cone.ref.not_empty()){ │ │ │ │ │ │ -00286 │ │ │ │ │ │ +00286 } │ │ │ │ │ │ 00287 │ │ │ │ │ │ -hc->insert(&cone_candidate, parent, child, false, false); │ │ │ │ │ │ +00288 /* │ │ │ │ │ │ +00289 * return SISCone version number. │ │ │ │ │ │ +00290 * return a string of the form "X.Y.Z" with possible additional tag │ │ │ │ │ │ +00291 * │ │ │ │ │ │ +(alpha, beta, devel) to mention stability status │ │ │ │ │ │ +00292 */ │ │ │ │ │ │ │ │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -257 │ │ │ │ │ │ - │ │ │ │ │ │ - 258 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ + 5.39 siscone.h │ │ │ │ │ │ │ │ │ │ │ │ -00288 │ │ │ │ │ │ -} │ │ │ │ │ │ -00289 │ │ │ │ │ │ -// test when 1! of the particles is in the cone │ │ │ │ │ │ -00290 │ │ │ │ │ │ -00291 │ │ │ │ │ │ -cone_candidate += *parent; │ │ │ │ │ │ -00292 │ │ │ │ │ │ -hc->insert(&cone_candidate, parent, child, true, false); │ │ │ │ │ │ -00293 │ │ │ │ │ │ +00293 string siscone_version(){ │ │ │ │ │ │ +return SISCONE_VERSION; │ │ │ │ │ │ 00294 │ │ │ │ │ │ -cone_candidate = cone; │ │ │ │ │ │ -00295 │ │ │ │ │ │ -cone_candidate += *child; │ │ │ │ │ │ +00295 } │ │ │ │ │ │ 00296 │ │ │ │ │ │ -hc->insert(&cone_candidate, parent, child, false, true); │ │ │ │ │ │ -00297 │ │ │ │ │ │ -00298 │ │ │ │ │ │ -// test when both are in. │ │ │ │ │ │ -00299 │ │ │ │ │ │ -cone_candidate += *parent; │ │ │ │ │ │ -00300 │ │ │ │ │ │ -hc->insert(&cone_candidate, parent, child, true, true); │ │ │ │ │ │ -00301 │ │ │ │ │ │ -00302 │ │ │ │ │ │ -nb_tot += 4; │ │ │ │ │ │ -00303 │ │ │ │ │ │ -} │ │ │ │ │ │ -00304 │ │ │ │ │ │ -00305 │ │ │ │ │ │ -return 0; │ │ │ │ │ │ -00306 │ │ │ │ │ │ -00307 } │ │ │ │ │ │ -00308 │ │ │ │ │ │ -00309 │ │ │ │ │ │ -00310 /* │ │ │ │ │ │ -00311 * update the cone │ │ │ │ │ │ -00312 * go to the next child for that parent and update ’cone’ appropriately │ │ │ │ │ │ -00313 * return 0 if update candidate found, 1 otherwise │ │ │ │ │ │ -00314 ***********************************************************************/ │ │ │ │ │ │ -00315 int CSphstable_cones::update_cone(){ │ │ │ │ │ │ -00316 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ -00317 │ │ │ │ │ │ -cout « "call ’circles_plot.gp’ ’" « centre->centre.px « "’ ’" │ │ │ │ │ │ -00318 │ │ │ │ │ │ -« centre->centre.py « "’ ’" « centre->centre.pz « "’" « endl │ │ │ │ │ │ -00319 │ │ │ │ │ │ -« "pause -1 ’(" « centre->angle « " " « (centre->side ? ’+’ : ’-’) « ")"; │ │ │ │ │ │ -00320 #endif │ │ │ │ │ │ -00321 │ │ │ │ │ │ -// get the next child and centre │ │ │ │ │ │ -00322 │ │ │ │ │ │ -00323 │ │ │ │ │ │ -centre_idx++; │ │ │ │ │ │ -00324 │ │ │ │ │ │ -if (centre_idx==vicinity_size) │ │ │ │ │ │ -00325 │ │ │ │ │ │ -centre_idx=0; │ │ │ │ │ │ -if (centre_idx==first_cone) │ │ │ │ │ │ -00326 │ │ │ │ │ │ -return 1; │ │ │ │ │ │ -00327 │ │ │ │ │ │ -00328 │ │ │ │ │ │ -00329 │ │ │ │ │ │ -// update the cone w.r.t. the old child │ │ │ │ │ │ -00330 │ │ │ │ │ │ -// only required if the old child is entering inside in which │ │ │ │ │ │ -00331 │ │ │ │ │ │ -// case we need to add it. We also know that the child is │ │ │ │ │ │ -00332 │ │ │ │ │ │ -// inside iff its side is -. │ │ │ │ │ │ -00333 │ │ │ │ │ │ -if (!centre->side){ │ │ │ │ │ │ -00334 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ -00335 │ │ │ │ │ │ -cout « " old_enter"; │ │ │ │ │ │ -00336 #endif │ │ │ │ │ │ -00337 │ │ │ │ │ │ -// update cone │ │ │ │ │ │ -00338 │ │ │ │ │ │ -cone += (*child); │ │ │ │ │ │ -00339 │ │ │ │ │ │ -// update info on particles inside │ │ │ │ │ │ -00340 │ │ │ │ │ │ -00341 │ │ │ │ │ │ -centre->is_inside->cone = true; │ │ │ │ │ │ -00342 │ │ │ │ │ │ -00343 │ │ │ │ │ │ -// update stability check quantities │ │ │ │ │ │ -00344 │ │ │ │ │ │ -dpt += fabs(child->px)+fabs(child->py)+fabs(child->pz); │ │ │ │ │ │ -00345 │ │ │ │ │ │ -} │ │ │ │ │ │ -00346 │ │ │ │ │ │ -00347 │ │ │ │ │ │ -// update centre and child to correspond to the new position │ │ │ │ │ │ -00348 │ │ │ │ │ │ -centre = vicinity[centre_idx]; │ │ │ │ │ │ -00349 │ │ │ │ │ │ -child = centre->v; │ │ │ │ │ │ -00350 │ │ │ │ │ │ -// check cocircularity │ │ │ │ │ │ -00351 │ │ │ │ │ │ -00352 │ │ │ │ │ │ -// note that if cocirculaity is detected (i.e. if we receive 1 │ │ │ │ │ │ -00353 │ │ │ │ │ │ -// in the next test), we need to recall ’update_cone’ directly │ │ │ │ │ │ -00354 │ │ │ │ │ │ -// since tests and remaining part of te update has been performed │ │ │ │ │ │ -00355 │ │ │ │ │ │ -//if (cocircular_check()) │ │ │ │ │ │ -00356 │ │ │ │ │ │ -if (cocircular_check()){ │ │ │ │ │ │ -00357 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ -00358 │ │ │ │ │ │ -cout « " Co-circular case detected" « endl; │ │ │ │ │ │ -00359 #endif │ │ │ │ │ │ -00360 │ │ │ │ │ │ -return update_cone(); │ │ │ │ │ │ -00361 │ │ │ │ │ │ -} │ │ │ │ │ │ -00362 │ │ │ │ │ │ -00363 │ │ │ │ │ │ -// update the cone w.r.t. the new child │ │ │ │ │ │ -00364 │ │ │ │ │ │ -// only required if the new child was already inside in which │ │ │ │ │ │ -00365 │ │ │ │ │ │ -// case we need to remove it. We also know that the child is │ │ │ │ │ │ -00366 │ │ │ │ │ │ -// inside iff its side is +. │ │ │ │ │ │ -00367 │ │ │ │ │ │ -if ((centre->side) && (cone.ref.not_empty())){ │ │ │ │ │ │ -00368 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ -00369 │ │ │ │ │ │ -cout « " new exit"; │ │ │ │ │ │ -00370 #endif │ │ │ │ │ │ -00371 │ │ │ │ │ │ -// update cone │ │ │ │ │ │ -00372 │ │ │ │ │ │ -00373 │ │ │ │ │ │ -cone -= (*child); │ │ │ │ │ │ -00374 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.44 protocones.cpp │ │ │ │ │ │ +00297 } │ │ │ │ │ │ │ │ │ │ │ │ -00375 │ │ │ │ │ │ -// update info on particles inside │ │ │ │ │ │ -00376 │ │ │ │ │ │ -centre->is_inside->cone = false; │ │ │ │ │ │ -00377 │ │ │ │ │ │ -// update stability check quantities │ │ │ │ │ │ -00378 │ │ │ │ │ │ -00379 │ │ │ │ │ │ -dpt += fabs(child->px)+fabs(child->py)+fabs(child->pz); //child->perp2(); │ │ │ │ │ │ -00380 │ │ │ │ │ │ -} │ │ │ │ │ │ -00381 │ │ │ │ │ │ -// check that the addition and subtraction of vectors does │ │ │ │ │ │ -00382 │ │ │ │ │ │ -00383 │ │ │ │ │ │ -// not lead to too much rounding error │ │ │ │ │ │ -00384 │ │ │ │ │ │ -// for that, we compute the sum of pt modifications and of |pt| │ │ │ │ │ │ -00385 │ │ │ │ │ │ -// since last recomputation and once the ratio overpasses a threshold │ │ │ │ │ │ -00386 │ │ │ │ │ │ -// we recompute vicinity. │ │ │ │ │ │ -00387 │ │ │ │ │ │ -if ((dpt>PT_TSHOLD*(fabs(cone.px)+fabs(cone.py)+fabs(cone.pz))) && (cone.ref.not_empty())){ │ │ │ │ │ │ -00388 │ │ │ │ │ │ -recompute_cone_contents(); │ │ │ │ │ │ -00389 │ │ │ │ │ │ -} │ │ │ │ │ │ -if (cone.ref.is_empty()){ │ │ │ │ │ │ -00390 │ │ │ │ │ │ -00391 │ │ │ │ │ │ -cone = CSphmomentum(); │ │ │ │ │ │ -00392 │ │ │ │ │ │ -dpt=0.0; │ │ │ │ │ │ -00393 │ │ │ │ │ │ -} │ │ │ │ │ │ -00394 │ │ │ │ │ │ -00395 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ -00396 │ │ │ │ │ │ -cout « "’" « endl; │ │ │ │ │ │ -00397 #endif │ │ │ │ │ │ -00398 │ │ │ │ │ │ -00399 │ │ │ │ │ │ -return 0; │ │ │ │ │ │ -00400 } │ │ │ │ │ │ -00401 │ │ │ │ │ │ -00402 │ │ │ │ │ │ -00403 /* │ │ │ │ │ │ -00404 * compute stability of all enumerated candidates. │ │ │ │ │ │ -00405 * For all candidate cones which are stable w.r.t. their border particles, │ │ │ │ │ │ -00406 * pass the last test: stability with quadtree intersection │ │ │ │ │ │ -00407 ************************************************************************/ │ │ │ │ │ │ -00408 int CSphstable_cones::proceed_with_stability(){ │ │ │ │ │ │ -int i; │ │ │ │ │ │ -00409 │ │ │ │ │ │ -00410 │ │ │ │ │ │ -sph_hash_element *elm; │ │ │ │ │ │ -00411 │ │ │ │ │ │ -00412 │ │ │ │ │ │ -for (i=0;i<=hc->mask;i++){ │ │ │ │ │ │ -00413 │ │ │ │ │ │ -// test ith cell of the hash array │ │ │ │ │ │ -00414 │ │ │ │ │ │ -elm = hc->hash_array[i]; │ │ │ │ │ │ -00415 │ │ │ │ │ │ -00416 │ │ │ │ │ │ -// browse elements therein │ │ │ │ │ │ -00417 │ │ │ │ │ │ -while (elm!=NULL){ │ │ │ │ │ │ -00418 │ │ │ │ │ │ -// test stability │ │ │ │ │ │ -00419 │ │ │ │ │ │ -if (elm->is_stable){ │ │ │ │ │ │ -00420 │ │ │ │ │ │ -// stability is not ensured by all pairs of "edges" already browsed │ │ │ │ │ │ -00421 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ -00422 │ │ │ │ │ │ -// => testing stability with quadtree intersection │ │ │ │ │ │ -00423 │ │ │ │ │ │ -if (quadtree->circle_intersect(elm->eta, elm->phi, R2)==elm->ref) │ │ │ │ │ │ -00424 #else │ │ │ │ │ │ -00425 │ │ │ │ │ │ -// => testing stability with the particle-list intersection │ │ │ │ │ │ -00426 │ │ │ │ │ │ -if (circle_intersect(elm->centre)==elm->centre.ref) │ │ │ │ │ │ -00427 #endif │ │ │ │ │ │ -00428 │ │ │ │ │ │ -protocones.push_back(CSphmomentum(elm->centre,1.0)); │ │ │ │ │ │ -00429 │ │ │ │ │ │ -} │ │ │ │ │ │ -00430 │ │ │ │ │ │ -00431 │ │ │ │ │ │ -// jump to the next one │ │ │ │ │ │ -00432 │ │ │ │ │ │ -elm = elm->next; │ │ │ │ │ │ -00433 │ │ │ │ │ │ -} │ │ │ │ │ │ -00434 │ │ │ │ │ │ -} │ │ │ │ │ │ -00435 │ │ │ │ │ │ -00436 │ │ │ │ │ │ -// free hash │ │ │ │ │ │ -00437 │ │ │ │ │ │ -// we do that at this level because hash eats rather a lot of memory │ │ │ │ │ │ -00438 │ │ │ │ │ │ -// we want to free it before running the split/merge algorithm │ │ │ │ │ │ -00439 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ -00440 │ │ │ │ │ │ -nb_hash_cones = hc->n_cones; │ │ │ │ │ │ -00441 │ │ │ │ │ │ -nb_hash_occupied = hc->n_occupied_cells; │ │ │ │ │ │ -00442 #endif │ │ │ │ │ │ -00443 │ │ │ │ │ │ -00444 │ │ │ │ │ │ -delete hc; │ │ │ │ │ │ -00445 │ │ │ │ │ │ -hc=NULL; │ │ │ │ │ │ -00446 │ │ │ │ │ │ -return protocones.size(); │ │ │ │ │ │ -00447 │ │ │ │ │ │ -00448 } │ │ │ │ │ │ -00449 │ │ │ │ │ │ -00450 │ │ │ │ │ │ -00452 // ALGORITHM MAIN STEPS FOR COCIRCULAR SITUATIONS │ │ │ │ │ │ +5.39 siscone.h │ │ │ │ │ │ +00001 // -*- C++ -*00003 // File: siscone.h │ │ │ │ │ │ // │ │ │ │ │ │ -00453 // - cocircular_pt_less(v1, v2) │ │ │ │ │ │ +00004 // Description: header file for the main SISCone class │ │ │ │ │ │ // │ │ │ │ │ │ -00454 // - prepare_cocircular_list() │ │ │ │ │ │ +00005 // This file is part of the SISCone project. │ │ │ │ │ │ // │ │ │ │ │ │ -00455 // - test_cone_cocircular() │ │ │ │ │ │ +00006 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ // │ │ │ │ │ │ -00456 // - test_stability(candidate, border_vect) │ │ │ │ │ │ +00007 // │ │ │ │ │ │ // │ │ │ │ │ │ -00457 // - updat_cone_cocircular() │ │ │ │ │ │ +00008 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ // │ │ │ │ │ │ -00459 │ │ │ │ │ │ -00461 //NEVER USED │ │ │ │ │ │ -00462 //bool cocircular_pt_less(CSphmomentum *v1, CSphmomentum *v2){ │ │ │ │ │ │ -00463 // return v1->perp2() < v2->perp2(); │ │ │ │ │ │ -00464 //} │ │ │ │ │ │ +00009 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00010 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ +// │ │ │ │ │ │ +00011 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ +// │ │ │ │ │ │ +00012 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ +// │ │ │ │ │ │ +00013 // (at your option) any later version. │ │ │ │ │ │ +// │ │ │ │ │ │ +00014 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00015 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ +// │ │ │ │ │ │ +00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ +// │ │ │ │ │ │ +00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ +// │ │ │ │ │ │ +00018 // GNU General Public License for more details. │ │ │ │ │ │ +// │ │ │ │ │ │ +00019 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00020 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ +// │ │ │ │ │ │ +00021 // along with this program; if not, write to the Free Software │ │ │ │ │ │ +// │ │ │ │ │ │ +00022 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ +00023 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00024 // $Revision:: 401 │ │ │ │ │ │ +$// │ │ │ │ │ │ +00025 // $Date:: 2016-05-19 16:44:37 +0200 (Thu, 19 May 2016) │ │ │ │ │ │ +$// │ │ │ │ │ │ +00027 │ │ │ │ │ │ +00028 #ifndef __SISCONE_H__ │ │ │ │ │ │ +00029 #define __SISCONE_H__ │ │ │ │ │ │ +00030 │ │ │ │ │ │ +00031 #include "protocones.h" │ │ │ │ │ │ +00032 #include "split_merge.h" │ │ │ │ │ │ +00033 │ │ │ │ │ │ +00034 namespace siscone{ │ │ │ │ │ │ +00035 │ │ │ │ │ │ +00048 class Csiscone : public Cstable_cones, public Csplit_merge{ │ │ │ │ │ │ +00049 public: │ │ │ │ │ │ +00051 │ │ │ │ │ │ +Csiscone(); │ │ │ │ │ │ +00052 │ │ │ │ │ │ +00054 │ │ │ │ │ │ +~Csiscone(); │ │ │ │ │ │ +00055 │ │ │ │ │ │ +00076 │ │ │ │ │ │ +int compute_jets(std::vector &_particles, double _radius, double _f, │ │ │ │ │ │ +int _n_pass_max=0, double _ptmin=0.0, │ │ │ │ │ │ +00077 │ │ │ │ │ │ +00078 │ │ │ │ │ │ +Esplit_merge_scale _split_merge_scale=SM_pttilde); │ │ │ │ │ │ +00079 │ │ │ │ │ │ +00097 │ │ │ │ │ │ +int compute_jets_progressive_removal(std::vector &_particles, double _radius, │ │ │ │ │ │ +int _n_pass_max=0, double _ptmin=0.0, │ │ │ │ │ │ +00098 │ │ │ │ │ │ +00099 │ │ │ │ │ │ +Esplit_merge_scale _ordering_scale=SM_pttilde); │ │ │ │ │ │ +00100 │ │ │ │ │ │ +00113 │ │ │ │ │ │ +int recompute_jets(double _f, double _ptmin = 0.0, │ │ │ │ │ │ +00114 │ │ │ │ │ │ +Esplit_merge_scale _split_merge_scale=SM_pttilde); │ │ │ │ │ │ +00115 │ │ │ │ │ │ +00117 │ │ │ │ │ │ +std::vector > protocones_list; │ │ │ │ │ │ +00118 │ │ │ │ │ │ +00119 │ │ │ │ │ │ +// random number initialisation │ │ │ │ │ │ +00120 │ │ │ │ │ │ +static bool init_done; │ │ │ │ │ │ +00121 │ │ │ │ │ │ +00122 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ +00123 │ │ │ │ │ │ +int nb_hash_cones_total, nb_hash_occupied_total; │ │ │ │ │ │ +00124 #endif │ │ │ │ │ │ +00125 │ │ │ │ │ │ +00137 │ │ │ │ │ │ +static void set_banner_stream(std::ostream * ostr) {_banner_ostr = ostr;} │ │ │ │ │ │ +00138 │ │ │ │ │ │ +static std::ostream * banner_stream() {return _banner_ostr;} │ │ │ │ │ │ +00143 │ │ │ │ │ │ +00144 │ │ │ │ │ │ +00145 private: │ │ │ │ │ │ +00146 │ │ │ │ │ │ +bool rerun_allowed; │ │ │ │ │ │ +00147 │ │ │ │ │ │ +static std::ostream * _banner_ostr; │ │ │ │ │ │ +00148 │ │ │ │ │ │ +void _initialise_if_needed(); │ │ │ │ │ │ +00150 │ │ │ │ │ │ +00151 │ │ │ │ │ │ +00152 }; │ │ │ │ │ │ +00153 │ │ │ │ │ │ +00154 │ │ │ │ │ │ +00155 // finally, a bunch of functions to access to │ │ │ │ │ │ +00156 // basic information (package name, version) │ │ │ │ │ │ +00157 //--------------------------------------------- │ │ │ │ │ │ │ │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ 259 │ │ │ │ │ │ │ │ │ │ │ │ 260 │ │ │ │ │ │ │ │ │ │ │ │ File Documentation │ │ │ │ │ │ │ │ │ │ │ │ -00465 │ │ │ │ │ │ -00466 /* │ │ │ │ │ │ -00467 * run through the vicinity of the current parent and for each child │ │ │ │ │ │ -00468 * establish which other members are cocircular... Note that the list │ │ │ │ │ │ -00469 * associated with each child contains references to vicinity │ │ │ │ │ │ -00470 * elements: thus two vicinity elements each associated with one given │ │ │ │ │ │ -00471 * particle may appear in a list -- this needs to be watched out for │ │ │ │ │ │ -00472 * later on... │ │ │ │ │ │ -00473 **********************************************************************/ │ │ │ │ │ │ -00474 void CSphstable_cones::prepare_cocircular_lists() { │ │ │ │ │ │ -00475 │ │ │ │ │ │ -siscone::circulator::iterator > here(vicinity.begin(), │ │ │ │ │ │ -00476 │ │ │ │ │ │ -vicinity.begin(), │ │ │ │ │ │ -00477 │ │ │ │ │ │ -vicinity.end()); │ │ │ │ │ │ -00478 │ │ │ │ │ │ -00479 │ │ │ │ │ │ -siscone::circulator::iterator > search(here); │ │ │ │ │ │ -00480 │ │ │ │ │ │ -do { │ │ │ │ │ │ -00481 │ │ │ │ │ │ -00482 │ │ │ │ │ │ -CSphvicinity_elm* here_pntr = *here(); │ │ │ │ │ │ -00483 │ │ │ │ │ │ -search.set_position(here); │ │ │ │ │ │ -00484 │ │ │ │ │ │ -// search forwards for things that should have "here" included in │ │ │ │ │ │ -00485 │ │ │ │ │ │ -00486 │ │ │ │ │ │ -// their cocircularity list │ │ │ │ │ │ -00487 │ │ │ │ │ │ -while (true) { │ │ │ │ │ │ -00488 │ │ │ │ │ │ -++search; │ │ │ │ │ │ -if ( siscone::abs_dphi((*search())->angle, here_pntr->angle) < │ │ │ │ │ │ -00489 │ │ │ │ │ │ -00490 │ │ │ │ │ │ -here_pntr->cocircular_range │ │ │ │ │ │ -00491 │ │ │ │ │ │ -&& search() != here()) { │ │ │ │ │ │ -00492 │ │ │ │ │ │ -(*search())->cocircular.push_back(here_pntr); │ │ │ │ │ │ -00493 │ │ │ │ │ │ -} else { │ │ │ │ │ │ -00494 │ │ │ │ │ │ -break; │ │ │ │ │ │ -00495 │ │ │ │ │ │ -} │ │ │ │ │ │ -00496 │ │ │ │ │ │ -} │ │ │ │ │ │ -00497 │ │ │ │ │ │ -// search backwards │ │ │ │ │ │ -00498 │ │ │ │ │ │ -00499 │ │ │ │ │ │ -search.set_position(here); │ │ │ │ │ │ -00500 │ │ │ │ │ │ -while (true) { │ │ │ │ │ │ -00501 │ │ │ │ │ │ ---search; │ │ │ │ │ │ -if ( siscone::abs_dphi((*search())->angle, here_pntr->angle) < │ │ │ │ │ │ -00502 │ │ │ │ │ │ -00503 │ │ │ │ │ │ -here_pntr->cocircular_range │ │ │ │ │ │ -00504 │ │ │ │ │ │ -&& search() != here()) { │ │ │ │ │ │ -00505 │ │ │ │ │ │ -(*search())->cocircular.push_back(here_pntr); │ │ │ │ │ │ -00506 │ │ │ │ │ │ -} else { │ │ │ │ │ │ -break; │ │ │ │ │ │ -00507 │ │ │ │ │ │ -00508 │ │ │ │ │ │ -} │ │ │ │ │ │ -00509 │ │ │ │ │ │ -} │ │ │ │ │ │ -00510 │ │ │ │ │ │ -00511 │ │ │ │ │ │ -++here; │ │ │ │ │ │ -00512 │ │ │ │ │ │ -} while (here() != vicinity.begin()); │ │ │ │ │ │ -00513 } │ │ │ │ │ │ -00514 │ │ │ │ │ │ -00515 /* │ │ │ │ │ │ -00516 * Testing cocircular configurations in p^3 time, │ │ │ │ │ │ -00517 * rather than 2^p time; we will test all contiguous subsets of points │ │ │ │ │ │ -00518 * on the border --- note that this is till probably overkill, since │ │ │ │ │ │ -00519 * in principle we only have to test situations where up to a │ │ │ │ │ │ -00520 * half-circle is filled (but going to a full circle is simpler) │ │ │ │ │ │ -00521 ******************************************************************/ │ │ │ │ │ │ -00522 void CSphstable_cones::test_cone_cocircular(CSphmomentum & borderless_cone, │ │ │ │ │ │ -00523 │ │ │ │ │ │ -list & border_list) { │ │ │ │ │ │ -// in spherical coordinates, we don’t have a universal x-y axis system │ │ │ │ │ │ -00524 │ │ │ │ │ │ -00525 │ │ │ │ │ │ -// to measure the angles. So we first determine one minimising │ │ │ │ │ │ -00526 │ │ │ │ │ │ -// the uncertainties │ │ │ │ │ │ -00527 │ │ │ │ │ │ -CSph3vector angl_dir1, angl_dir2; │ │ │ │ │ │ -00528 │ │ │ │ │ │ -centre->centre.get_angular_directions(angl_dir1, angl_dir2); │ │ │ │ │ │ -00529 │ │ │ │ │ │ -angl_dir1/=angl_dir1._norm; │ │ │ │ │ │ -00530 │ │ │ │ │ │ -angl_dir2/=angl_dir2._norm; │ │ │ │ │ │ -00531 │ │ │ │ │ │ -00532 │ │ │ │ │ │ -// now we have te reference axis, create the CSphborder_store structure │ │ │ │ │ │ -00533 │ │ │ │ │ │ -vector border_vect; │ │ │ │ │ │ -00534 │ │ │ │ │ │ -border_vect.reserve(border_list.size()); │ │ │ │ │ │ -for (list::iterator it = border_list.begin(); │ │ │ │ │ │ -00535 │ │ │ │ │ │ -00536 │ │ │ │ │ │ -it != border_list.end(); it++) { │ │ │ │ │ │ -00537 │ │ │ │ │ │ -border_vect.push_back(CSphborder_store(*it, centre->centre, angl_dir1, angl_dir2)); │ │ │ │ │ │ -00538 │ │ │ │ │ │ -} │ │ │ │ │ │ -00539 │ │ │ │ │ │ -// get them into order of angle │ │ │ │ │ │ -00540 │ │ │ │ │ │ -00541 │ │ │ │ │ │ -sort(border_vect.begin(), border_vect.end()); │ │ │ │ │ │ -00542 │ │ │ │ │ │ -// set up some circulators, since these will help us go around the │ │ │ │ │ │ -00543 │ │ │ │ │ │ -00544 │ │ │ │ │ │ -// circle easily │ │ │ │ │ │ -00545 │ │ │ │ │ │ -siscone::circulator::iterator > │ │ │ │ │ │ -00546 │ │ │ │ │ │ -start(border_vect.begin(), border_vect.begin(),border_vect.end()); │ │ │ │ │ │ -00547 │ │ │ │ │ │ -siscone::circulator::iterator > mid(start), end(start); │ │ │ │ │ │ -00548 │ │ │ │ │ │ -// test the borderless cone │ │ │ │ │ │ -00549 │ │ │ │ │ │ -00550 │ │ │ │ │ │ -CSphmomentum candidate = borderless_cone; │ │ │ │ │ │ -00551 │ │ │ │ │ │ -//candidate.build_etaphi(); │ │ │ │ │ │ +00158 │ │ │ │ │ │ +00166 std::string siscone_package_name(); │ │ │ │ │ │ +00167 │ │ │ │ │ │ +00173 std::string siscone_version(); │ │ │ │ │ │ +00174 │ │ │ │ │ │ +00175 } │ │ │ │ │ │ +00176 #endif │ │ │ │ │ │ + │ │ │ │ │ │ +5.40 siscone.h │ │ │ │ │ │ +00001 // -*- C++ -*00003 // File: siscone.h │ │ │ │ │ │ +// │ │ │ │ │ │ +00004 // Description: header file for the main SISCone class │ │ │ │ │ │ +// │ │ │ │ │ │ +00005 // This file is part of the SISCone project. │ │ │ │ │ │ +// │ │ │ │ │ │ +00006 // WARNING: this is not the main SISCone trunk but │ │ │ │ │ │ +// │ │ │ │ │ │ +00007 // │ │ │ │ │ │ +an adaptation to spherical coordinates │ │ │ │ │ │ +// │ │ │ │ │ │ +00008 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ +// │ │ │ │ │ │ +00009 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00010 // Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez │ │ │ │ │ │ +// │ │ │ │ │ │ +00011 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00012 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ +// │ │ │ │ │ │ +00013 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ +// │ │ │ │ │ │ +00014 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ +// │ │ │ │ │ │ +00015 // (at your option) any later version. │ │ │ │ │ │ +// │ │ │ │ │ │ +00016 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00017 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ +// │ │ │ │ │ │ +00018 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ +// │ │ │ │ │ │ +00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ +// │ │ │ │ │ │ +00020 // GNU General Public License for more details. │ │ │ │ │ │ +// │ │ │ │ │ │ +00021 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00022 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ +// │ │ │ │ │ │ +00023 // along with this program; if not, write to the Free Software │ │ │ │ │ │ +// │ │ │ │ │ │ +00024 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ +00025 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00026 // $Revision:: 401 │ │ │ │ │ │ +$// │ │ │ │ │ │ +00027 // $Date:: 2016-05-19 16:44:37 +0200 (Thu, 19 May 2016) │ │ │ │ │ │ +$// │ │ │ │ │ │ +00029 │ │ │ │ │ │ +00030 #ifndef __SPH_SISCONE_H__ │ │ │ │ │ │ +00031 #define __SPH_SISCONE_H__ │ │ │ │ │ │ +00032 │ │ │ │ │ │ +00033 #include "protocones.h" │ │ │ │ │ │ +00034 #include "split_merge.h" │ │ │ │ │ │ +00035 │ │ │ │ │ │ +00036 namespace siscone_spherical{ │ │ │ │ │ │ +00037 │ │ │ │ │ │ +00050 class CSphsiscone : public CSphstable_cones, public CSphsplit_merge{ │ │ │ │ │ │ +00051 public: │ │ │ │ │ │ +00053 │ │ │ │ │ │ +CSphsiscone(); │ │ │ │ │ │ +00054 │ │ │ │ │ │ +00056 │ │ │ │ │ │ +~CSphsiscone(); │ │ │ │ │ │ +00057 │ │ │ │ │ │ +00076 │ │ │ │ │ │ +int compute_jets(std::vector &_particles, double _radius, double _f, │ │ │ │ │ │ +int _n_pass_max=0, double _Emin=0.0, │ │ │ │ │ │ +00077 │ │ │ │ │ │ +00078 │ │ │ │ │ │ +Esplit_merge_scale _split_merge_scale=SM_Etilde); │ │ │ │ │ │ +00079 │ │ │ │ │ │ +00094 │ │ │ │ │ │ +int compute_jets_progressive_removal(std::vector &_particles, double _radius, │ │ │ │ │ │ +00095 │ │ │ │ │ │ +int _n_pass_max=0, double _Emin=0.0, │ │ │ │ │ │ +00096 │ │ │ │ │ │ +Esplit_merge_scale _ordering_scale=SM_Etilde); │ │ │ │ │ │ +00097 │ │ │ │ │ │ +int recompute_jets(double _f, double _Emin = 0.0, │ │ │ │ │ │ +00110 │ │ │ │ │ │ +00111 │ │ │ │ │ │ +Esplit_merge_scale _split_merge_scale=SM_Etilde); │ │ │ │ │ │ +00112 │ │ │ │ │ │ +00114 │ │ │ │ │ │ +std::vector > protocones_list; │ │ │ │ │ │ +00115 │ │ │ │ │ │ +00116 │ │ │ │ │ │ +// random number initialisation │ │ │ │ │ │ +00117 │ │ │ │ │ │ +static bool init_done; │ │ │ │ │ │ +00118 │ │ │ │ │ │ +00119 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ +00120 │ │ │ │ │ │ +int nb_hash_cones_total, nb_hash_occupied_total; │ │ │ │ │ │ +00121 #endif │ │ │ │ │ │ +00122 │ │ │ │ │ │ +static void set_banner_stream(std::ostream * ostr) {_banner_ostr = ostr;} │ │ │ │ │ │ +00134 │ │ │ │ │ │ +00135 │ │ │ │ │ │ +00140 │ │ │ │ │ │ +static std::ostream * banner_stream() {return _banner_ostr;} │ │ │ │ │ │ +00141 │ │ │ │ │ │ +00142 private: │ │ │ │ │ │ +bool rerun_allowed; │ │ │ │ │ │ +00143 │ │ │ │ │ │ +00144 │ │ │ │ │ │ +static std::ostream * _banner_ostr; │ │ │ │ │ │ +00145 │ │ │ │ │ │ +void _initialise_if_needed(); │ │ │ │ │ │ +00147 │ │ │ │ │ │ +00148 │ │ │ │ │ │ +00149 }; │ │ │ │ │ │ +00150 │ │ │ │ │ │ │ │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 5.44 protocones.cpp │ │ │ │ │ │ + 5.41 siscone_error.cpp │ │ │ │ │ │ │ │ │ │ │ │ -00552 │ │ │ │ │ │ -if (candidate.ref.not_empty()) │ │ │ │ │ │ -00553 │ │ │ │ │ │ -test_stability(candidate, border_vect); │ │ │ │ │ │ -00554 │ │ │ │ │ │ -do { │ │ │ │ │ │ -00555 │ │ │ │ │ │ -00556 │ │ │ │ │ │ -// reset status wrt inclusion in the cone │ │ │ │ │ │ -00557 │ │ │ │ │ │ -mid = start; │ │ │ │ │ │ -do { │ │ │ │ │ │ -00558 │ │ │ │ │ │ -00559 │ │ │ │ │ │ -mid()->is_in = false; │ │ │ │ │ │ -00560 │ │ │ │ │ │ -} while (++mid != start); │ │ │ │ │ │ -00561 │ │ │ │ │ │ -00562 │ │ │ │ │ │ -// now run over all inclusion possibilities with this starting point │ │ │ │ │ │ -00563 │ │ │ │ │ │ -candidate = borderless_cone; │ │ │ │ │ │ -00564 │ │ │ │ │ │ -while (++mid != start) { │ │ │ │ │ │ -// will begin with start+1 and go up to start-1 │ │ │ │ │ │ -00565 │ │ │ │ │ │ -00566 │ │ │ │ │ │ -mid()->is_in = true; │ │ │ │ │ │ -00567 │ │ │ │ │ │ -candidate += *(mid()->mom); │ │ │ │ │ │ -00568 │ │ │ │ │ │ -test_stability(candidate, border_vect); │ │ │ │ │ │ -00569 │ │ │ │ │ │ -} │ │ │ │ │ │ -00570 │ │ │ │ │ │ -00571 │ │ │ │ │ │ -} while (++start != end); │ │ │ │ │ │ -00572 │ │ │ │ │ │ -// mid corresponds to momentum that we need to include to get the │ │ │ │ │ │ -00573 │ │ │ │ │ │ -00574 │ │ │ │ │ │ -// full cone │ │ │ │ │ │ -00575 │ │ │ │ │ │ -mid()->is_in = true; │ │ │ │ │ │ -00576 │ │ │ │ │ │ -candidate += *(mid()->mom); │ │ │ │ │ │ -00577 │ │ │ │ │ │ -test_stability(candidate, border_vect); │ │ │ │ │ │ -00578 } │ │ │ │ │ │ -00579 │ │ │ │ │ │ -00580 │ │ │ │ │ │ -00587 void CSphstable_cones::test_stability(CSphmomentum & candidate, const vector & │ │ │ │ │ │ -border_vect) { │ │ │ │ │ │ -00588 │ │ │ │ │ │ -// this almost certainly has not been done... │ │ │ │ │ │ -00589 │ │ │ │ │ │ -00590 │ │ │ │ │ │ -//candidate.build_etaphi(); │ │ │ │ │ │ -00591 │ │ │ │ │ │ -00592 │ │ │ │ │ │ -bool stable = true; │ │ │ │ │ │ -00593 │ │ │ │ │ │ -for (unsigned i = 0; i < border_vect.size(); i++) { │ │ │ │ │ │ -if (is_closer(&candidate, border_vect[i].mom,tan2R) ^ (border_vect[i].is_in)) { │ │ │ │ │ │ -00594 │ │ │ │ │ │ -00595 │ │ │ │ │ │ -stable = false; │ │ │ │ │ │ -break; // it’s unstable so there’s no point continuing │ │ │ │ │ │ -00596 │ │ │ │ │ │ -00597 │ │ │ │ │ │ -} │ │ │ │ │ │ -00598 │ │ │ │ │ │ -} │ │ │ │ │ │ -00599 │ │ │ │ │ │ -00600 │ │ │ │ │ │ -if (stable) hc->insert(&candidate); │ │ │ │ │ │ -00601 } │ │ │ │ │ │ -00602 │ │ │ │ │ │ -00603 /* │ │ │ │ │ │ -00604 * check if we are in a situation of cocircularity. │ │ │ │ │ │ -00605 * if it is the case, update and test in the corresponding way │ │ │ │ │ │ -00606 * return ’false’ if no cocircularity detected, ’true’ otherwise │ │ │ │ │ │ -00607 * Note that if cocircularity is detected, we need to │ │ │ │ │ │ -00608 * recall ’update’ from ’update’ !!! │ │ │ │ │ │ -00609 ***************************************************************/ │ │ │ │ │ │ -00610 bool CSphstable_cones::cocircular_check(){ │ │ │ │ │ │ -00611 │ │ │ │ │ │ -// check if many configurations have the same centre. │ │ │ │ │ │ -00612 │ │ │ │ │ │ -// if this is the case, branch on the algorithm for this │ │ │ │ │ │ -00613 │ │ │ │ │ │ -// special case. │ │ │ │ │ │ -00614 │ │ │ │ │ │ -// Note that those situation, being considered separately in │ │ │ │ │ │ -00615 │ │ │ │ │ │ -// test_cone_multiple, must only be considered here if all │ │ │ │ │ │ -00616 │ │ │ │ │ │ -// angles are on the same side (this avoid multiple counting) │ │ │ │ │ │ -00617 │ │ │ │ │ │ -if (centre->cocircular.empty()) return false; │ │ │ │ │ │ -00618 │ │ │ │ │ │ -00619 │ │ │ │ │ │ -// first get cone into status required at end... │ │ │ │ │ │ -00620 │ │ │ │ │ │ -00621 │ │ │ │ │ │ -if ((centre->side) && (cone.ref.not_empty())){ │ │ │ │ │ │ -// update cone │ │ │ │ │ │ -00622 │ │ │ │ │ │ -00623 │ │ │ │ │ │ -cone -= (*child); │ │ │ │ │ │ -00624 │ │ │ │ │ │ -// update info on particles inside │ │ │ │ │ │ -00625 │ │ │ │ │ │ -00626 │ │ │ │ │ │ -centre->is_inside->cone = false; │ │ │ │ │ │ -00627 │ │ │ │ │ │ -// update stability check quantities │ │ │ │ │ │ -00628 │ │ │ │ │ │ -00629 │ │ │ │ │ │ -dpt += fabs(child->px)+fabs(child->py)+fabs(child->pz); //child->perp2(); │ │ │ │ │ │ -00630 │ │ │ │ │ │ -} │ │ │ │ │ │ -00631 │ │ │ │ │ │ -00632 │ │ │ │ │ │ -00633 │ │ │ │ │ │ -// now establish the list of unique children in the list │ │ │ │ │ │ -00634 │ │ │ │ │ │ -// first make sure parent and child are in! │ │ │ │ │ │ -00635 │ │ │ │ │ │ -00636 │ │ │ │ │ │ -list removed_from_cone; │ │ │ │ │ │ -00637 │ │ │ │ │ │ -list put_in_border; │ │ │ │ │ │ -00638 │ │ │ │ │ │ -list border_list; │ │ │ │ │ │ -00639 │ │ │ │ │ │ -00640 │ │ │ │ │ │ -CSphmomentum cone_removal; │ │ │ │ │ │ -00641 │ │ │ │ │ │ -CSphmomentum border = *parent; │ │ │ │ │ │ -00642 │ │ │ │ │ │ -border_list.push_back(parent); │ │ │ │ │ │ -00643 │ │ │ │ │ │ +00151 │ │ │ │ │ │ +00152 // finally, a bunch of functions to access to │ │ │ │ │ │ +00153 // basic information (package name, version) │ │ │ │ │ │ +00154 //--------------------------------------------00155 │ │ │ │ │ │ +00163 std::string siscone_package_name(); │ │ │ │ │ │ +00164 │ │ │ │ │ │ +00170 std::string siscone_version(); │ │ │ │ │ │ +00171 │ │ │ │ │ │ +00172 } │ │ │ │ │ │ +00173 #endif │ │ │ │ │ │ + │ │ │ │ │ │ +5.41 siscone_error.cpp │ │ │ │ │ │ +00001 │ │ │ │ │ │ +// │ │ │ │ │ │ +00002 // File: siscone_error.cpp │ │ │ │ │ │ +00003 // Description: source file for SISCone error messages (Csiscone_error) │ │ │ │ │ │ +// │ │ │ │ │ │ +00004 // This file is part of the SISCone project. │ │ │ │ │ │ +// │ │ │ │ │ │ +00005 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ +// │ │ │ │ │ │ +00006 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00007 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ +// │ │ │ │ │ │ +00008 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00009 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ +// │ │ │ │ │ │ +00010 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ +// │ │ │ │ │ │ +00011 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ +// │ │ │ │ │ │ +00012 // (at your option) any later version. │ │ │ │ │ │ +// │ │ │ │ │ │ +00013 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00014 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ +// │ │ │ │ │ │ +00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ +// │ │ │ │ │ │ +00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ +// │ │ │ │ │ │ +00017 // GNU General Public License for more details. │ │ │ │ │ │ +// │ │ │ │ │ │ +00018 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00019 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ +// │ │ │ │ │ │ +00020 // along with this program; if not, write to the Free Software │ │ │ │ │ │ +// │ │ │ │ │ │ +00021 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ +00022 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00023 // $Revision:: 123 │ │ │ │ │ │ +$// │ │ │ │ │ │ +00024 // $Date:: 2007-03-01 02:52:16 +0100 (Thu, 01 Mar 2007) │ │ │ │ │ │ +$// │ │ │ │ │ │ +00026 │ │ │ │ │ │ +00027 #include "siscone_error.h" │ │ │ │ │ │ +00028 │ │ │ │ │ │ +00029 namespace siscone{ │ │ │ │ │ │ +00030 │ │ │ │ │ │ +00031 bool Csiscone_error::m_print_errors = true; │ │ │ │ │ │ +00032 │ │ │ │ │ │ +00033 } │ │ │ │ │ │ + │ │ │ │ │ │ +5.42 siscone_error.h │ │ │ │ │ │ +00001 // -*- C++ -*00003 // File: siscone_error.h │ │ │ │ │ │ +// │ │ │ │ │ │ +00004 // Description: header file for SISCone error messages (Csiscone_error) │ │ │ │ │ │ +// │ │ │ │ │ │ +00005 // This file is part of the SISCone project. │ │ │ │ │ │ +// │ │ │ │ │ │ +00006 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ +// │ │ │ │ │ │ +00007 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00008 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ +// │ │ │ │ │ │ +00009 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00010 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ +// │ │ │ │ │ │ +00011 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ +// │ │ │ │ │ │ +00012 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ +// │ │ │ │ │ │ +00013 // (at your option) any later version. │ │ │ │ │ │ +// │ │ │ │ │ │ +00014 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00015 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ +// │ │ │ │ │ │ +00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ +// │ │ │ │ │ │ +00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ +// │ │ │ │ │ │ +00018 // GNU General Public License for more details. │ │ │ │ │ │ +// │ │ │ │ │ │ +00019 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00020 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ +// │ │ │ │ │ │ +00021 // along with this program; if not, write to the Free Software │ │ │ │ │ │ +// │ │ │ │ │ │ +00022 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ +00023 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00024 // $Revision:: 327 │ │ │ │ │ │ +$// │ │ │ │ │ │ +00025 // $Date:: 2011-11-25 15:19:39 +0100 (Fri, 25 Nov 2011) │ │ │ │ │ │ +$// │ │ │ │ │ │ +00027 │ │ │ │ │ │ +00028 #ifndef __SISCONE_ERROR_H__ │ │ │ │ │ │ +00029 #define __SISCONE_ERROR_H__ │ │ │ │ │ │ +00030 │ │ │ │ │ │ +00031 #include │ │ │ │ │ │ +00032 #include │ │ │ │ │ │ │ │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ 261 │ │ │ │ │ │ │ │ │ │ │ │ 262 │ │ │ │ │ │ │ │ │ │ │ │ -00644 │ │ │ │ │ │ -00645 │ │ │ │ │ │ -00646 │ │ │ │ │ │ -00647 │ │ │ │ │ │ -00648 │ │ │ │ │ │ -00649 │ │ │ │ │ │ -00650 │ │ │ │ │ │ -00651 │ │ │ │ │ │ -00652 │ │ │ │ │ │ -00653 │ │ │ │ │ │ -00654 │ │ │ │ │ │ -00655 │ │ │ │ │ │ -00656 │ │ │ │ │ │ -00657 │ │ │ │ │ │ -00658 │ │ │ │ │ │ -00659 │ │ │ │ │ │ -00660 │ │ │ │ │ │ -00661 │ │ │ │ │ │ -00662 │ │ │ │ │ │ -00663 │ │ │ │ │ │ -00664 │ │ │ │ │ │ -00665 │ │ │ │ │ │ -00666 │ │ │ │ │ │ -00667 │ │ │ │ │ │ - │ │ │ │ │ │ File Documentation │ │ │ │ │ │ │ │ │ │ │ │ -// make sure child appears in the border region │ │ │ │ │ │ -centre->cocircular.push_back(centre); │ │ │ │ │ │ -// now establish the full contents of the cone minus the cocircular │ │ │ │ │ │ -// region and of the cocircular region itself │ │ │ │ │ │ -for(list::iterator it = centre->cocircular.begin(); │ │ │ │ │ │ -it != centre->cocircular.end(); it++) { │ │ │ │ │ │ -if ((*it)->is_inside->cone) { │ │ │ │ │ │ -cone_removal │ │ │ │ │ │ -+= *((*it)->v); │ │ │ │ │ │ -(*it)->is_inside->cone = false; │ │ │ │ │ │ -removed_from_cone.push_back((*it)->is_inside); │ │ │ │ │ │ -} │ │ │ │ │ │ +00033 │ │ │ │ │ │ +00034 namespace siscone{ │ │ │ │ │ │ +00035 │ │ │ │ │ │ +00038 class Csiscone_error { │ │ │ │ │ │ +00039 public: │ │ │ │ │ │ +00041 │ │ │ │ │ │ +Csiscone_error() {;}; │ │ │ │ │ │ +00042 │ │ │ │ │ │ +00045 │ │ │ │ │ │ +Csiscone_error(const std::string & message_in) { │ │ │ │ │ │ +00046 │ │ │ │ │ │ +m_message = message_in; │ │ │ │ │ │ +if (m_print_errors) std::cerr « "siscone::Csiscone_error: "« message_in « std::endl; │ │ │ │ │ │ +00047 │ │ │ │ │ │ +00048 │ │ │ │ │ │ +}; │ │ │ │ │ │ +00049 │ │ │ │ │ │ +00051 │ │ │ │ │ │ +std::string message() const {return m_message;}; │ │ │ │ │ │ +00052 │ │ │ │ │ │ +static void setm_print_errors(bool print_errors) { │ │ │ │ │ │ +00055 │ │ │ │ │ │ +00056 │ │ │ │ │ │ +m_print_errors = print_errors;}; │ │ │ │ │ │ +00057 │ │ │ │ │ │ +00058 private: │ │ │ │ │ │ +00059 │ │ │ │ │ │ +std::string m_message; │ │ │ │ │ │ +static bool m_print_errors; │ │ │ │ │ │ +00060 │ │ │ │ │ │ +00061 }; │ │ │ │ │ │ +00062 │ │ │ │ │ │ +00063 } │ │ │ │ │ │ +00064 #endif │ │ │ │ │ │ │ │ │ │ │ │ -// if a point appears twice (i.e. with + and - sign) in the list of │ │ │ │ │ │ -// points on the border, we take care not to include it twice. │ │ │ │ │ │ -// Note that this situation may appear when a point is at a distance │ │ │ │ │ │ -// close to 2R from the parent │ │ │ │ │ │ -if (!(*it)->is_inside->cocirc) { │ │ │ │ │ │ -border += *((*it)->v); │ │ │ │ │ │ -(*it)->is_inside->cocirc = true; │ │ │ │ │ │ -put_in_border.push_back((*it)->is_inside); │ │ │ │ │ │ -border_list.push_back((*it)->v); │ │ │ │ │ │ -//cout « " adding particle " « (*it)->v->_theta « ", " « (*it)->v->_phi « " to the border list" │ │ │ │ │ │ -« endl; │ │ │ │ │ │ -00668 │ │ │ │ │ │ -} │ │ │ │ │ │ -00669 │ │ │ │ │ │ -} │ │ │ │ │ │ -00670 │ │ │ │ │ │ -00671 │ │ │ │ │ │ -00672 │ │ │ │ │ │ -// figure out whether this pairing has been observed before │ │ │ │ │ │ -00673 │ │ │ │ │ │ -CSphmomentum borderless_cone = cone; │ │ │ │ │ │ -00674 │ │ │ │ │ │ -borderless_cone -= cone_removal; │ │ │ │ │ │ -bool consider = true; │ │ │ │ │ │ -00675 │ │ │ │ │ │ -00676 │ │ │ │ │ │ -for (unsigned int i=0;i(borderless_cone.ref, │ │ │ │ │ │ -00686 │ │ │ │ │ │ -border.ref)); │ │ │ │ │ │ -00687 │ │ │ │ │ │ -// first figure out whether our cone momentum is good │ │ │ │ │ │ -00688 │ │ │ │ │ │ -00689 │ │ │ │ │ │ -double local_dpt = fabs(cone_removal.px) + fabs(cone_removal.py); │ │ │ │ │ │ -00690 │ │ │ │ │ │ -double total_dpt = dpt + local_dpt; │ │ │ │ │ │ -00691 │ │ │ │ │ │ -00692 │ │ │ │ │ │ -recompute_cone_contents_if_needed(borderless_cone, total_dpt); │ │ │ │ │ │ -00693 │ │ │ │ │ │ -if (total_dpt == 0) { │ │ │ │ │ │ -// a recomputation has taken place -- so take advantage of this │ │ │ │ │ │ -00694 │ │ │ │ │ │ -00695 │ │ │ │ │ │ -// and update the member cone momentum │ │ │ │ │ │ -00696 │ │ │ │ │ │ -cone = borderless_cone + cone_removal; │ │ │ │ │ │ -00697 │ │ │ │ │ │ -dpt = local_dpt; │ │ │ │ │ │ -00698 │ │ │ │ │ │ -} │ │ │ │ │ │ -00699 │ │ │ │ │ │ -00700 │ │ │ │ │ │ -test_cone_cocircular(borderless_cone, border_list); │ │ │ │ │ │ -00701 │ │ │ │ │ │ -} │ │ │ │ │ │ -00702 │ │ │ │ │ │ -00703 │ │ │ │ │ │ -00704 │ │ │ │ │ │ -// relabel things that were in the cone but got removed │ │ │ │ │ │ -00705 │ │ │ │ │ │ -for(list::iterator is_in = removed_from_cone.begin(); │ │ │ │ │ │ -00706 │ │ │ │ │ │ -is_in != removed_from_cone.end(); is_in++) { │ │ │ │ │ │ -00707 │ │ │ │ │ │ -(*is_in)->cone = true; │ │ │ │ │ │ -00708 │ │ │ │ │ │ -} │ │ │ │ │ │ -00709 │ │ │ │ │ │ -00710 │ │ │ │ │ │ -// relabel things that got put into the border │ │ │ │ │ │ -00711 │ │ │ │ │ │ -for(list::iterator is_in = put_in_border.begin(); │ │ │ │ │ │ -00712 │ │ │ │ │ │ -is_in != put_in_border.end(); is_in++) { │ │ │ │ │ │ -00713 │ │ │ │ │ │ -(*is_in)->cocirc = false; │ │ │ │ │ │ -00714 │ │ │ │ │ │ -} │ │ │ │ │ │ -00715 │ │ │ │ │ │ -00716 │ │ │ │ │ │ -// we’re done with everything -- return true to signal to user that we’ve │ │ │ │ │ │ -00717 │ │ │ │ │ │ -// been through the co-circularity rigmarole │ │ │ │ │ │ -00718 │ │ │ │ │ │ -return true; │ │ │ │ │ │ -00719 } │ │ │ │ │ │ -00720 │ │ │ │ │ │ -00721 │ │ │ │ │ │ +5.43 geom_2d.h │ │ │ │ │ │ +00001 // -*- C++ -*00003 // File: geom_2d.h │ │ │ │ │ │ // │ │ │ │ │ │ -00723 // RECOMPUTATION OF CONE CONTENTS │ │ │ │ │ │ -00724 // - compute_cone_contents() │ │ │ │ │ │ +00004 // Description: header file for two-dimensional geometry tools │ │ │ │ │ │ // │ │ │ │ │ │ -00725 // - recompute_cone_contents() │ │ │ │ │ │ +00005 // This file is part of the SISCone project. │ │ │ │ │ │ // │ │ │ │ │ │ -00726 // - recompute_cone_contents_if_needed() │ │ │ │ │ │ +00006 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ // │ │ │ │ │ │ -00728 │ │ │ │ │ │ -00737 void CSphstable_cones::compute_cone_contents() { │ │ │ │ │ │ -00738 │ │ │ │ │ │ -siscone::circulator::iterator > │ │ │ │ │ │ -00739 │ │ │ │ │ │ -start(vicinity.begin()+first_cone, vicinity.begin(), vicinity.end()); │ │ │ │ │ │ +00007 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00008 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ +// │ │ │ │ │ │ +00009 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00010 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ +// │ │ │ │ │ │ +00011 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ +// │ │ │ │ │ │ +00012 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ +// │ │ │ │ │ │ +00013 // (at your option) any later version. │ │ │ │ │ │ +// │ │ │ │ │ │ +00014 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00015 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ +// │ │ │ │ │ │ +00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ +// │ │ │ │ │ │ +00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ +// │ │ │ │ │ │ +00018 // GNU General Public License for more details. │ │ │ │ │ │ +// │ │ │ │ │ │ +00019 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00020 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ +// │ │ │ │ │ │ +00021 // along with this program; if not, write to the Free Software │ │ │ │ │ │ +// │ │ │ │ │ │ +00022 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ +00023 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00024 // $Revision:: 422 │ │ │ │ │ │ +$// │ │ │ │ │ │ +00025 // $Date:: 2020-04-22 11:51:09 +0200 (Wed, 22 Apr 2020) │ │ │ │ │ │ +$// │ │ │ │ │ │ +00027 │ │ │ │ │ │ +00028 #ifndef __GEOM_2D_H__ │ │ │ │ │ │ +00029 #define __GEOM_2D_H__ │ │ │ │ │ │ +00030 │ │ │ │ │ │ +00031 #include │ │ │ │ │ │ +00032 #include │ │ │ │ │ │ +00033 #include "defines.h" │ │ │ │ │ │ +00034 │ │ │ │ │ │ +00035 #ifndef M_PI │ │ │ │ │ │ +00036 #define M_PI 3.141592653589793238462643383279502884197 │ │ │ │ │ │ +00037 #endif │ │ │ │ │ │ +00038 │ │ │ │ │ │ +00039 namespace siscone{ │ │ │ │ │ │ +00040 │ │ │ │ │ │ +00043 inline double phi_in_range(double phi) { │ │ │ │ │ │ +if │ │ │ │ │ │ +(phi <= -M_PI) phi += twopi; │ │ │ │ │ │ +00044 │ │ │ │ │ │ +00045 │ │ │ │ │ │ +else if (phi > │ │ │ │ │ │ +M_PI) phi -= twopi; │ │ │ │ │ │ +00046 │ │ │ │ │ │ +return phi; │ │ │ │ │ │ +00047 } │ │ │ │ │ │ +00048 │ │ │ │ │ │ +00052 inline double dphi(double phi1, double phi2) { │ │ │ │ │ │ +00053 │ │ │ │ │ │ +return phi_in_range(phi1-phi2); │ │ │ │ │ │ +00054 } │ │ │ │ │ │ +00055 │ │ │ │ │ │ +00056 │ │ │ │ │ │ +00060 inline double abs_dphi(double phi1, double phi2) { │ │ │ │ │ │ +00061 │ │ │ │ │ │ +double delta = fabs(phi1-phi2); │ │ │ │ │ │ +return delta > M_PI ? twopi-delta : delta; │ │ │ │ │ │ +00062 │ │ │ │ │ │ +00063 } │ │ │ │ │ │ +00064 │ │ │ │ │ │ +00066 inline double pow2(double x) {return x*x;} │ │ │ │ │ │ +00067 │ │ │ │ │ │ │ │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 5.44 protocones.cpp │ │ │ │ │ │ + 5.44 geom_2d.h │ │ │ │ │ │ │ │ │ │ │ │ -00740 │ │ │ │ │ │ -00741 │ │ │ │ │ │ -siscone::circulator::iterator > here(start); │ │ │ │ │ │ -00742 │ │ │ │ │ │ -// note that in the following algorithm, the cone contents never includes │ │ │ │ │ │ -00743 │ │ │ │ │ │ -00744 │ │ │ │ │ │ -// the child. Indeed, if it has positive sign, then it will be set as │ │ │ │ │ │ -00745 │ │ │ │ │ │ -// outside at the last step in the loop. If it has negative sign, then the │ │ │ │ │ │ -00746 │ │ │ │ │ │ -// loop will at some point go to the corresponding situation with positive │ │ │ │ │ │ -00747 │ │ │ │ │ │ -// sign and set the inclusion status to 0. │ │ │ │ │ │ -00748 │ │ │ │ │ │ -00749 │ │ │ │ │ │ -do { │ │ │ │ │ │ -00750 │ │ │ │ │ │ -// as we leave this position a particle enters if its side is │ │ │ │ │ │ -00751 │ │ │ │ │ │ -// negative (i.e. the centre is the one at -ve angle wrt to the │ │ │ │ │ │ -00752 │ │ │ │ │ │ -// parent-child line │ │ │ │ │ │ -00753 │ │ │ │ │ │ -if (!(*here())->side) ((*here())->is_inside->cone) = 1; │ │ │ │ │ │ -00754 │ │ │ │ │ │ -// move on to the next position │ │ │ │ │ │ -00755 │ │ │ │ │ │ -00756 │ │ │ │ │ │ -++here; │ │ │ │ │ │ -00757 │ │ │ │ │ │ -// as we arrive at this position a particle leaves if its side is positive │ │ │ │ │ │ -00758 │ │ │ │ │ │ -00759 │ │ │ │ │ │ -if ((*here())->side) ((*here())->is_inside->cone) = 0; │ │ │ │ │ │ -00760 │ │ │ │ │ │ -} while (here != start); │ │ │ │ │ │ -00761 │ │ │ │ │ │ -00762 │ │ │ │ │ │ -// once we’ve reached the start the ’is_inside’ information should be │ │ │ │ │ │ -00763 │ │ │ │ │ │ -// 100% complete, so we can use it to calculate the cone contents │ │ │ │ │ │ -00764 │ │ │ │ │ │ -// and then exit │ │ │ │ │ │ -00765 │ │ │ │ │ │ -recompute_cone_contents(); │ │ │ │ │ │ -00766 │ │ │ │ │ │ -return; │ │ │ │ │ │ -00767 │ │ │ │ │ │ -00768 } │ │ │ │ │ │ -00769 │ │ │ │ │ │ -00770 │ │ │ │ │ │ -00771 /* │ │ │ │ │ │ -00772 * compute the cone momentum from particle list. │ │ │ │ │ │ -00773 * in this version, we use the ’pincluded’ information │ │ │ │ │ │ -00774 * from the CSphvicinity class │ │ │ │ │ │ -00775 */ │ │ │ │ │ │ -00776 void CSphstable_cones::recompute_cone_contents(){ │ │ │ │ │ │ -unsigned int i; │ │ │ │ │ │ -00777 │ │ │ │ │ │ -00778 │ │ │ │ │ │ -// set momentum to 0 │ │ │ │ │ │ -00779 │ │ │ │ │ │ -00780 │ │ │ │ │ │ -cone = CSphmomentum(); │ │ │ │ │ │ -00781 │ │ │ │ │ │ -// Important note: we can browse only the particles │ │ │ │ │ │ -00782 │ │ │ │ │ │ -00783 │ │ │ │ │ │ -// in vicinity since all particles in the cone are │ │ │ │ │ │ -00784 │ │ │ │ │ │ -// withing a distance 2R w.r.t. parent hence in vicinity. │ │ │ │ │ │ -00785 │ │ │ │ │ │ -// Among those, we only add the particles for which ’is_inside’ is true ! │ │ │ │ │ │ -00786 │ │ │ │ │ │ -// This methos rather than a direct comparison avoids rounding errors │ │ │ │ │ │ -00787 │ │ │ │ │ │ -for (i=0;iside) && (vicinity[i]->is_inside->cone)) │ │ │ │ │ │ -00790 │ │ │ │ │ │ -cone += *vicinity[i]->v; │ │ │ │ │ │ -00791 │ │ │ │ │ │ -} │ │ │ │ │ │ -00792 │ │ │ │ │ │ -// set check variables back to 0 │ │ │ │ │ │ -00793 │ │ │ │ │ │ -00794 │ │ │ │ │ │ -dpt = 0.0; │ │ │ │ │ │ -00795 } │ │ │ │ │ │ -00796 │ │ │ │ │ │ -00797 │ │ │ │ │ │ -00798 /* │ │ │ │ │ │ -00799 * if we have gone beyond the acceptable threshold of change, compute │ │ │ │ │ │ -00800 * the cone momentum from particle list. in this version, we use the │ │ │ │ │ │ -00801 * ’pincluded’ information from the CSphvicinity class, but we don’t │ │ │ │ │ │ -00802 * change the member cone, only the locally supplied one │ │ │ │ │ │ -00803 */ │ │ │ │ │ │ -00804 void CSphstable_cones::recompute_cone_contents_if_needed(CSphmomentum & this_cone, │ │ │ │ │ │ -double & this_dpt){ │ │ │ │ │ │ -00805 │ │ │ │ │ │ -00806 │ │ │ │ │ │ -00807 │ │ │ │ │ │ -if (this_dpt > PT_TSHOLD*(fabs(this_cone.px)+fabs(this_cone.py))) { │ │ │ │ │ │ -if (cone.ref.is_empty()) { │ │ │ │ │ │ -00808 │ │ │ │ │ │ -00809 │ │ │ │ │ │ -this_cone = CSphmomentum(); │ │ │ │ │ │ -00810 │ │ │ │ │ │ -} else { │ │ │ │ │ │ -00811 │ │ │ │ │ │ -// set momentum to 0 │ │ │ │ │ │ -00812 │ │ │ │ │ │ -this_cone = CSphmomentum(); │ │ │ │ │ │ -00813 │ │ │ │ │ │ -00814 │ │ │ │ │ │ -// Important note: we can browse only the particles │ │ │ │ │ │ -00815 │ │ │ │ │ │ -// in vicinity since all particles in the this_cone are │ │ │ │ │ │ -00816 │ │ │ │ │ │ -// withing a distance 2R w.r.t. parent hence in vicinity. │ │ │ │ │ │ -00817 │ │ │ │ │ │ -// Among those, we only add the particles for which ’is_inside’ is true ! │ │ │ │ │ │ -00818 │ │ │ │ │ │ -// This methos rather than a direct comparison avoids rounding errors │ │ │ │ │ │ -00819 │ │ │ │ │ │ -for (unsigned int i=0;iside) && (vicinity[i]->is_inside->cone)) │ │ │ │ │ │ -00822 │ │ │ │ │ │ -this_cone += *vicinity[i]->v; │ │ │ │ │ │ -00823 │ │ │ │ │ │ +263 │ │ │ │ │ │ + │ │ │ │ │ │ +00068 │ │ │ │ │ │ +00073 class Ctwovect { │ │ │ │ │ │ +00074 public: │ │ │ │ │ │ +00076 │ │ │ │ │ │ +Ctwovect() : x(0.0), y(0.0) {} │ │ │ │ │ │ +00077 │ │ │ │ │ │ +00081 │ │ │ │ │ │ +Ctwovect(double _x, double _y) : x(_x), y(_y) {} │ │ │ │ │ │ +00082 │ │ │ │ │ │ +double x, y; │ │ │ │ │ │ +00084 │ │ │ │ │ │ +00085 │ │ │ │ │ │ +inline double mod2() const {return pow2(x)+pow2(y);} │ │ │ │ │ │ +00087 │ │ │ │ │ │ +00088 │ │ │ │ │ │ +inline double modulus() const {return sqrt(mod2());} │ │ │ │ │ │ +00090 │ │ │ │ │ │ +00091 }; │ │ │ │ │ │ +00092 │ │ │ │ │ │ +00093 │ │ │ │ │ │ +00098 inline double dot_product(const Ctwovect & a, const Ctwovect & b) { │ │ │ │ │ │ +00099 │ │ │ │ │ │ +return a.x*b.x + a.y*b.y; │ │ │ │ │ │ +00100 } │ │ │ │ │ │ +00101 │ │ │ │ │ │ +00102 │ │ │ │ │ │ +00107 inline double cross_product(const Ctwovect & a, const Ctwovect & b) { │ │ │ │ │ │ +00108 │ │ │ │ │ │ +return a.x*b.y - a.y*b.x; │ │ │ │ │ │ +00109 } │ │ │ │ │ │ +00110 │ │ │ │ │ │ +00111 │ │ │ │ │ │ +00120 class Ceta_phi_range{ │ │ │ │ │ │ +00121 public: │ │ │ │ │ │ +00123 │ │ │ │ │ │ +Ceta_phi_range(); │ │ │ │ │ │ +00124 │ │ │ │ │ │ +00130 │ │ │ │ │ │ +Ceta_phi_range(double c_eta, double c_phi, double R); │ │ │ │ │ │ +00131 │ │ │ │ │ │ +00134 │ │ │ │ │ │ +Ceta_phi_range& operator = (const Ceta_phi_range &r); │ │ │ │ │ │ +00135 │ │ │ │ │ │ +int add_particle(const double eta, const double phi); │ │ │ │ │ │ +00140 │ │ │ │ │ │ +00141 │ │ │ │ │ │ +unsigned int eta_range; │ │ │ │ │ │ +00143 │ │ │ │ │ │ +00144 │ │ │ │ │ │ +unsigned int phi_range; │ │ │ │ │ │ +00146 │ │ │ │ │ │ +00147 │ │ │ │ │ │ +// extremal value for eta │ │ │ │ │ │ +00148 │ │ │ │ │ │ +00149 │ │ │ │ │ │ +static double eta_min; │ │ │ │ │ │ +00150 │ │ │ │ │ │ +static double eta_max; │ │ │ │ │ │ +00151 │ │ │ │ │ │ +00152 private: │ │ │ │ │ │ +inline unsigned int get_eta_cell(double eta){ │ │ │ │ │ │ +00154 │ │ │ │ │ │ +00155 │ │ │ │ │ │ +return (unsigned int) (1u « ((int) (32*((eta-eta_min)/(eta_max-eta_min))))); │ │ │ │ │ │ +00156 │ │ │ │ │ │ } │ │ │ │ │ │ -00824 │ │ │ │ │ │ -00825 │ │ │ │ │ │ +00157 │ │ │ │ │ │ +00159 │ │ │ │ │ │ +inline unsigned int get_phi_cell(double phi){ │ │ │ │ │ │ +return (unsigned int) (1u « ((int) (32*phi/twopi+16)%32)); │ │ │ │ │ │ +00160 │ │ │ │ │ │ +00161 │ │ │ │ │ │ } │ │ │ │ │ │ -// set check variables back to 0 │ │ │ │ │ │ -00826 │ │ │ │ │ │ +00162 }; │ │ │ │ │ │ +00163 │ │ │ │ │ │ +00168 bool is_range_overlap(const Ceta_phi_range &r1, const Ceta_phi_range &r2); │ │ │ │ │ │ +00169 │ │ │ │ │ │ +00175 const Ceta_phi_range range_union(const Ceta_phi_range &r1, const Ceta_phi_range &r2); │ │ │ │ │ │ +00176 │ │ │ │ │ │ +00177 } │ │ │ │ │ │ +00178 │ │ │ │ │ │ +00179 #endif │ │ │ │ │ │ + │ │ │ │ │ │ +5.44 geom_2d.h │ │ │ │ │ │ +00001 // -*- C++ -*00003 // File: geom_2d.h │ │ │ │ │ │ +00004 // Description: header file for two-dimensional geometry tools │ │ │ │ │ │ +00005 // This file is part of the SISCone project. │ │ │ │ │ │ +00006 // WARNING: this is not the main SISCone trunk but │ │ │ │ │ │ +00007 // │ │ │ │ │ │ +an adaptation to spherical coordinates │ │ │ │ │ │ +00008 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ +00009 // │ │ │ │ │ │ +00010 // Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez │ │ │ │ │ │ +00011 // │ │ │ │ │ │ +00012 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ +00013 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ +00014 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ +00015 // (at your option) any later version. │ │ │ │ │ │ +00016 // │ │ │ │ │ │ +00017 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ +00018 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ +00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ +00020 // GNU General Public License for more details. │ │ │ │ │ │ +00021 // │ │ │ │ │ │ │ │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -263 │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ │ │ │ │ │ │ 264 │ │ │ │ │ │ │ │ │ │ │ │ File Documentation │ │ │ │ │ │ │ │ │ │ │ │ -00827 │ │ │ │ │ │ -this_dpt = 0.0; │ │ │ │ │ │ -00828 │ │ │ │ │ │ -} │ │ │ │ │ │ -00829 │ │ │ │ │ │ -00830 } │ │ │ │ │ │ -00831 │ │ │ │ │ │ -00832 │ │ │ │ │ │ -// │ │ │ │ │ │ -00834 // VARIOUS TOOLS │ │ │ │ │ │ -00835 // - circle_intersect() │ │ │ │ │ │ +00022 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ // │ │ │ │ │ │ -00836 // - is_inside() │ │ │ │ │ │ +00023 // along with this program; if not, write to the Free Software │ │ │ │ │ │ // │ │ │ │ │ │ -00837 // - abs_dangle() │ │ │ │ │ │ +00024 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ +00025 // │ │ │ │ │ │ // │ │ │ │ │ │ -00839 │ │ │ │ │ │ -00840 │ │ │ │ │ │ -00841 /* │ │ │ │ │ │ -00842 * circle intersection. │ │ │ │ │ │ -00843 * computes the intersection with a circle of given centre and radius. │ │ │ │ │ │ -00844 * The output takes the form of a checkxor of the intersection’s particles │ │ │ │ │ │ -00845 * - cx │ │ │ │ │ │ -circle centre x coordinate │ │ │ │ │ │ -circle centre y coordinate │ │ │ │ │ │ -00846 * - cy │ │ │ │ │ │ -00847 * return the checkxor for the intersection │ │ │ │ │ │ -00848 ******************************************************************/ │ │ │ │ │ │ -00849 siscone::Creference CSphstable_cones::circle_intersect(CSph3vector &cone_centre){ │ │ │ │ │ │ -00850 │ │ │ │ │ │ -siscone::Creference intersection; │ │ │ │ │ │ -00851 │ │ │ │ │ │ -int i; │ │ │ │ │ │ -00852 │ │ │ │ │ │ -for (i=0;i │ │ │ │ │ │ +00034 #include │ │ │ │ │ │ +00035 #include │ │ │ │ │ │ +00036 #include │ │ │ │ │ │ +00037 │ │ │ │ │ │ +00038 #ifndef M_PI │ │ │ │ │ │ +00039 #define M_PI 3.141592653589793238462643383279502884197 │ │ │ │ │ │ +00040 #endif │ │ │ │ │ │ +00041 │ │ │ │ │ │ +00042 namespace siscone_spherical{ │ │ │ │ │ │ +00043 │ │ │ │ │ │ +00052 class CSphtheta_phi_range{ │ │ │ │ │ │ +00053 public: │ │ │ │ │ │ +00055 │ │ │ │ │ │ +CSphtheta_phi_range(); │ │ │ │ │ │ +00056 │ │ │ │ │ │ +00062 │ │ │ │ │ │ +CSphtheta_phi_range(double c_theta, double c_phi, double R); │ │ │ │ │ │ +00063 │ │ │ │ │ │ +00066 │ │ │ │ │ │ +CSphtheta_phi_range& operator = (const CSphtheta_phi_range &r); │ │ │ │ │ │ +00067 │ │ │ │ │ │ +00072 │ │ │ │ │ │ +int add_particle(const double theta, const double phi); │ │ │ │ │ │ +00073 │ │ │ │ │ │ +unsigned int theta_range; │ │ │ │ │ │ +00075 │ │ │ │ │ │ +00076 │ │ │ │ │ │ +unsigned int phi_range; │ │ │ │ │ │ +00078 │ │ │ │ │ │ +00079 │ │ │ │ │ │ +static double theta_min; │ │ │ │ │ │ +00081 │ │ │ │ │ │ +00082 │ │ │ │ │ │ +static double theta_max; │ │ │ │ │ │ +00083 │ │ │ │ │ │ +00084 private: │ │ │ │ │ │ +inline unsigned int get_theta_cell(double theta){ │ │ │ │ │ │ +00086 │ │ │ │ │ │ +00087 │ │ │ │ │ │ +if (theta>=theta_max) return 1u«31; │ │ │ │ │ │ +00088 │ │ │ │ │ │ +return (unsigned int) (1u « ((int) (32*((theta-theta_min)/(theta_max-theta_min))))); │ │ │ │ │ │ +00089 │ │ │ │ │ │ } │ │ │ │ │ │ -00858 │ │ │ │ │ │ -return intersection; │ │ │ │ │ │ -00859 │ │ │ │ │ │ -00860 } │ │ │ │ │ │ -00861 │ │ │ │ │ │ -00862 } │ │ │ │ │ │ +00090 │ │ │ │ │ │ +inline unsigned int get_phi_cell(double phi){ │ │ │ │ │ │ +00092 │ │ │ │ │ │ +00093 │ │ │ │ │ │ +return (unsigned int) (1u « ((int) (32*phi/twopi+16)%32)); │ │ │ │ │ │ +00094 │ │ │ │ │ │ +} │ │ │ │ │ │ +00095 }; │ │ │ │ │ │ +00096 │ │ │ │ │ │ +00101 bool is_range_overlap(const CSphtheta_phi_range &r1, const CSphtheta_phi_range &r2); │ │ │ │ │ │ +00102 │ │ │ │ │ │ +00108 const CSphtheta_phi_range range_union(const CSphtheta_phi_range &r1, const CSphtheta_phi_range &r2); │ │ │ │ │ │ +00109 │ │ │ │ │ │ +00110 } │ │ │ │ │ │ +00111 │ │ │ │ │ │ +00112 #endif │ │ │ │ │ │ │ │ │ │ │ │ 5.45 split_merge.cpp │ │ │ │ │ │ 00001 │ │ │ │ │ │ // │ │ │ │ │ │ 00002 // File: split_merge.cpp │ │ │ │ │ │ 00003 // Description: source file for splitting/merging (contains the CJet class) // │ │ │ │ │ │ 00004 // This file is part of the SISCone project. │ │ │ │ │ │ @@ -23354,14 +23345,19 @@ │ │ │ │ │ │ 00021 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ // │ │ │ │ │ │ 00022 // along with this program; if not, write to the Free Software │ │ │ │ │ │ // │ │ │ │ │ │ 00023 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ 00024 // │ │ │ │ │ │ // │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.45 split_merge.cpp │ │ │ │ │ │ + │ │ │ │ │ │ 00025 // $Revision:: 390 │ │ │ │ │ │ $// │ │ │ │ │ │ 00026 // $Date:: 2016-03-03 11:06:52 +0100 (Thu, 03 Mar 2016) │ │ │ │ │ │ $// │ │ │ │ │ │ 00028 │ │ │ │ │ │ 00029 #include │ │ │ │ │ │ 00030 #include "split_merge.h" │ │ │ │ │ │ @@ -23382,19 +23378,14 @@ │ │ │ │ │ │ 00044 * class CSphjet implementation │ │ │ │ │ │ * │ │ │ │ │ │ 00045 * real Jet information. │ │ │ │ │ │ * │ │ │ │ │ │ 00046 * This class contains information for one single jet. * │ │ │ │ │ │ 00047 * That is, first, its momentum carrying information │ │ │ │ │ │ * │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.45 split_merge.cpp │ │ │ │ │ │ - │ │ │ │ │ │ 00048 * about its centre and pT, and second, its particle │ │ │ │ │ │ * │ │ │ │ │ │ 00049 * contents │ │ │ │ │ │ * │ │ │ │ │ │ 00050 ********************************************************/ │ │ │ │ │ │ 00051 // default ctor │ │ │ │ │ │ 00052 //-------------00053 CSphjet::CSphjet(){ │ │ │ │ │ │ @@ -23415,16 +23406,16 @@ │ │ │ │ │ │ 00062 // default dtor │ │ │ │ │ │ 00063 //-------------00064 CSphjet::~CSphjet(){ │ │ │ │ │ │ 00065 │ │ │ │ │ │ 00066 } │ │ │ │ │ │ 00067 │ │ │ │ │ │ 00068 // ordering of jets in E (e.g. used in final jets ordering) │ │ │ │ │ │ 00069 //---------------------------------------------------------00070 bool jets_E_less(const CSphjet &j1, const CSphjet &j2){ │ │ │ │ │ │ -return j1.v.E > j2.v.E; │ │ │ │ │ │ 00071 │ │ │ │ │ │ +return j1.v.E > j2.v.E; │ │ │ │ │ │ 00072 } │ │ │ │ │ │ 00073 │ │ │ │ │ │ 00074 │ │ │ │ │ │ 00075 /******************************************************** │ │ │ │ │ │ 00076 * CSphsplit_merge_ptcomparison implementation │ │ │ │ │ │ * │ │ │ │ │ │ 00077 * This deals with the ordering of the jets candidates * │ │ │ │ │ │ @@ -23442,16 +23433,16 @@ │ │ │ │ │ │ 00089 // │ │ │ │ │ │ 00090 // NB: there is a potential issue in momentum-conserving events, │ │ │ │ │ │ 00091 // whereby the harder of two jets becomes ill-defined when a soft │ │ │ │ │ │ 00092 // particle is emitted --- this may have a knock-on effect on │ │ │ │ │ │ 00093 // subsequent split-merge steps in cases with sufficiently large R │ │ │ │ │ │ 00094 // (but we don’t know what the limit is...) │ │ │ │ │ │ 00095 //-----------------------------------------------------------------00096 bool CSphsplit_merge_ptcomparison::operator ()(const CSphjet &jet1, const CSphjet &jet2) const{ │ │ │ │ │ │ -double q1, q2; │ │ │ │ │ │ 00097 │ │ │ │ │ │ +double q1, q2; │ │ │ │ │ │ 00098 │ │ │ │ │ │ // compute the value for comparison for both jets │ │ │ │ │ │ 00099 │ │ │ │ │ │ 00100 │ │ │ │ │ │ // This depends on the choice of variable (mt is the default) │ │ │ │ │ │ 00101 │ │ │ │ │ │ q1 = jet1.sm_var2; │ │ │ │ │ │ @@ -23469,64 +23460,64 @@ │ │ │ │ │ │ // close in the ordering variable. │ │ │ │ │ │ 00109 #ifdef EPSILON_SPLITMERGE │ │ │ │ │ │ 00110 │ │ │ │ │ │ if ( (fabs(q1-q2) < EPSILON_SPLITMERGE*max(q1,q2)) && │ │ │ │ │ │ 00111 │ │ │ │ │ │ (jet1.v.ref != jet2.v.ref) ) { │ │ │ │ │ │ 00112 #ifdef DEBUG_SPLIT_MERGE │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +265 │ │ │ │ │ │ + │ │ │ │ │ │ + 266 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00113 │ │ │ │ │ │ cout « "Using high-precision ordering tests" « endl; │ │ │ │ │ │ 00114 #endif │ │ │ │ │ │ 00115 │ │ │ │ │ │ // get the momentum of the difference │ │ │ │ │ │ 00116 │ │ │ │ │ │ CSphmomentum difference; │ │ │ │ │ │ 00117 │ │ │ │ │ │ double E_tilde_difference; │ │ │ │ │ │ 00118 │ │ │ │ │ │ get_difference(jet1,jet2,&difference,&E_tilde_difference); │ │ │ │ │ │ 00119 │ │ │ │ │ │ -// use the following relation: pt1^2 - pt2^2 = (pt1+pt2)*(pt1-pt2) │ │ │ │ │ │ 00120 │ │ │ │ │ │ +// use the following relation: pt1^2 - pt2^2 = (pt1+pt2)*(pt1-pt2) │ │ │ │ │ │ 00121 │ │ │ │ │ │ double qdiff; │ │ │ │ │ │ 00122 │ │ │ │ │ │ CSphmomentum sum = jet1.v ; │ │ │ │ │ │ 00123 │ │ │ │ │ │ sum += jet2.v; │ │ │ │ │ │ 00124 │ │ │ │ │ │ double E_tilde_sum = jet1.E_tilde + jet2.E_tilde; │ │ │ │ │ │ 00125 │ │ │ │ │ │ // depending on the choice of ordering variable, set the result │ │ │ │ │ │ 00126 │ │ │ │ │ │ 00127 │ │ │ │ │ │ switch (split_merge_scale){ │ │ │ │ │ │ -00128 │ │ │ │ │ │ case SM_Etilde: │ │ │ │ │ │ +00128 │ │ │ │ │ │ 00129 │ │ │ │ │ │ qdiff = E_tilde_sum*E_tilde_difference; │ │ │ │ │ │ -break; │ │ │ │ │ │ 00130 │ │ │ │ │ │ -00131 │ │ │ │ │ │ +break; │ │ │ │ │ │ case SM_E: │ │ │ │ │ │ +00131 │ │ │ │ │ │ 00132 │ │ │ │ │ │ qdiff = sum.E*difference.E; │ │ │ │ │ │ break; │ │ │ │ │ │ 00133 │ │ │ │ │ │ 00134 │ │ │ │ │ │ default: │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -265 │ │ │ │ │ │ - │ │ │ │ │ │ - 266 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00135 │ │ │ │ │ │ throw siscone::Csiscone_error("Unsupported split-merge scale choice: " │ │ │ │ │ │ 00136 │ │ │ │ │ │ + SM_scale_name()); │ │ │ │ │ │ 00137 │ │ │ │ │ │ } │ │ │ │ │ │ 00138 │ │ │ │ │ │ @@ -23537,28 +23528,28 @@ │ │ │ │ │ │ 00141 │ │ │ │ │ │ 00142 │ │ │ │ │ │ return res; │ │ │ │ │ │ 00143 } │ │ │ │ │ │ 00144 │ │ │ │ │ │ 00145 │ │ │ │ │ │ 00148 std::string split_merge_scale_name(Esplit_merge_scale sms) { │ │ │ │ │ │ -00149 │ │ │ │ │ │ switch(sms) { │ │ │ │ │ │ -case SM_E: │ │ │ │ │ │ +00149 │ │ │ │ │ │ 00150 │ │ │ │ │ │ +case SM_E: │ │ │ │ │ │ 00151 │ │ │ │ │ │ return "E (IR unsafe for pairs of identical decayed heavy particles)"; │ │ │ │ │ │ case SM_Etilde: │ │ │ │ │ │ 00152 │ │ │ │ │ │ 00153 │ │ │ │ │ │ return "Etilde (sum of E.[1+sin^2(theta_{i,jet})])"; │ │ │ │ │ │ -00154 │ │ │ │ │ │ default: │ │ │ │ │ │ -return "[SM scale without a name]"; │ │ │ │ │ │ +00154 │ │ │ │ │ │ 00155 │ │ │ │ │ │ +return "[SM scale without a name]"; │ │ │ │ │ │ 00156 │ │ │ │ │ │ } │ │ │ │ │ │ 00157 } │ │ │ │ │ │ 00158 │ │ │ │ │ │ 00159 │ │ │ │ │ │ 00160 // get the difference between 2 jets │ │ │ │ │ │ 00161 // - j1 │ │ │ │ │ │ @@ -23569,16 +23560,16 @@ │ │ │ │ │ │ jet1-jet2 │ │ │ │ │ │ 00164 // - pt_tilde │ │ │ │ │ │ jet1-jet2 pt_tilde │ │ │ │ │ │ 00165 // return true if overlapping, false if disjoint │ │ │ │ │ │ 00166 //----------------------------------------------00167 void CSphsplit_merge_ptcomparison::get_difference(const CSphjet &j1, const CSphjet &j2, │ │ │ │ │ │ 00168 │ │ │ │ │ │ CSphmomentum *v, double *E_tilde) const { │ │ │ │ │ │ -int i1,i2; │ │ │ │ │ │ 00169 │ │ │ │ │ │ +int i1,i2; │ │ │ │ │ │ 00170 │ │ │ │ │ │ // initialise │ │ │ │ │ │ 00171 │ │ │ │ │ │ 00172 │ │ │ │ │ │ i1=i2=0; │ │ │ │ │ │ 00173 │ │ │ │ │ │ *v = CSphmomentum(); │ │ │ │ │ │ @@ -23594,51 +23585,56 @@ │ │ │ │ │ │ 00179 │ │ │ │ │ │ CSph3vector jet2_axis = j2.v; │ │ │ │ │ │ //jet2_axis /= j2.v._norm; │ │ │ │ │ │ 00180 │ │ │ │ │ │ 00181 │ │ │ │ │ │ jet2_axis /= j2.v.E; │ │ │ │ │ │ 00182 │ │ │ │ │ │ -// compute overlap │ │ │ │ │ │ 00183 │ │ │ │ │ │ +// compute overlap │ │ │ │ │ │ 00184 │ │ │ │ │ │ // at the same time, we store union in indices │ │ │ │ │ │ 00185 │ │ │ │ │ │ // note tat for Etilde, we’ll add the direct energy contributino at the end │ │ │ │ │ │ 00186 │ │ │ │ │ │ do{ │ │ │ │ │ │ -00187 │ │ │ │ │ │ if (j1.contents[i1]==j2.contents[i2]) { │ │ │ │ │ │ -const CSphmomentum & p = (*particles)[j1.contents[i1]]; │ │ │ │ │ │ +00187 │ │ │ │ │ │ 00188 │ │ │ │ │ │ +const CSphmomentum & p = (*particles)[j1.contents[i1]]; │ │ │ │ │ │ 00189 │ │ │ │ │ │ (*E_tilde) += │ │ │ │ │ │ p.E*((norm2_cross_product3(p,jet1_axis)-norm2_cross_product3(p,jet2_axis))/(*particles_norm2)[j1.contents[i1]]); │ │ │ │ │ │ 00190 │ │ │ │ │ │ i1++; │ │ │ │ │ │ 00191 │ │ │ │ │ │ i2++; │ │ │ │ │ │ 00192 │ │ │ │ │ │ } else if (j1.contents[i1]j2.contents[i2]){ │ │ │ │ │ │ -00198 │ │ │ │ │ │ const CSphmomentum &p = (*particles)[j2.contents[i2]]; │ │ │ │ │ │ +00198 │ │ │ │ │ │ 00199 │ │ │ │ │ │ (*v) -= p; │ │ │ │ │ │ 00200 │ │ │ │ │ │ (*E_tilde) -= p.E*norm2_cross_product3(p,jet2_axis)/(*particles_norm2)[j2.contents[i2]]; │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.45 split_merge.cpp │ │ │ │ │ │ + │ │ │ │ │ │ 00201 │ │ │ │ │ │ i2++; │ │ │ │ │ │ 00202 │ │ │ │ │ │ } else { │ │ │ │ │ │ 00203 │ │ │ │ │ │ throw siscone::Csiscone_error("get_non_overlap reached part it should never have seen..."); │ │ │ │ │ │ 00204 │ │ │ │ │ │ @@ -23646,46 +23642,41 @@ │ │ │ │ │ │ 00205 │ │ │ │ │ │ } while ((i1E; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.45 split_merge.cpp │ │ │ │ │ │ - │ │ │ │ │ │ 00223 } │ │ │ │ │ │ 00224 │ │ │ │ │ │ 00225 │ │ │ │ │ │ 00226 /******************************************************** │ │ │ │ │ │ 00227 * class CSphsplit_merge implementation │ │ │ │ │ │ * │ │ │ │ │ │ 00228 * Class used to split and merge jets. │ │ │ │ │ │ @@ -23744,16 +23735,16 @@ │ │ │ │ │ │ 00267 // - protocones list of protocones (initial jet candidates) │ │ │ │ │ │ 00268 // - R2 │ │ │ │ │ │ cone radius (squared) │ │ │ │ │ │ 00269 // - Emin │ │ │ │ │ │ minimal energy allowed for jets │ │ │ │ │ │ 00270 //------------------------------------------------------------00271 int CSphsplit_merge::init(vector & /*_particles*/, vector *protocones, │ │ │ │ │ │ double R2, double Emin){ │ │ │ │ │ │ -00272 │ │ │ │ │ │ // browse protocones │ │ │ │ │ │ +00272 │ │ │ │ │ │ 00273 │ │ │ │ │ │ return add_protocones(protocones, R2, Emin); │ │ │ │ │ │ 00274 } │ │ │ │ │ │ 00275 │ │ │ │ │ │ 00276 │ │ │ │ │ │ 00277 // initialisation function for particle list │ │ │ │ │ │ 00278 // - _particles list of particles │ │ │ │ │ │ @@ -23765,58 +23756,58 @@ │ │ │ │ │ │ // compute the list of particles │ │ │ │ │ │ 00284 │ │ │ │ │ │ // here, we do not need to throw away particles │ │ │ │ │ │ 00285 │ │ │ │ │ │ // with infinite rapidity (colinear with the beam) │ │ │ │ │ │ 00286 │ │ │ │ │ │ particles = _particles; │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +267 │ │ │ │ │ │ + │ │ │ │ │ │ + 268 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00287 │ │ │ │ │ │ n = particles.size(); │ │ │ │ │ │ 00288 │ │ │ │ │ │ -00289 │ │ │ │ │ │ // store the particle norm^2 │ │ │ │ │ │ +00289 │ │ │ │ │ │ 00290 │ │ │ │ │ │ particles_norm2.resize(n); │ │ │ │ │ │ 00291 │ │ │ │ │ │ for (int i=0;i(ptcomparison)); │ │ │ │ │ │ 00368 │ │ │ │ │ │ -00369 │ │ │ │ │ │ // start off with huge number │ │ │ │ │ │ +00369 │ │ │ │ │ │ 00370 │ │ │ │ │ │ most_ambiguous_split = numeric_limits::max(); │ │ │ │ │ │ 00371 │ │ │ │ │ │ 00372 │ │ │ │ │ │ jets.clear(); │ │ │ │ │ │ 00373 #ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.45 split_merge.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +269 │ │ │ │ │ │ + │ │ │ │ │ │ 00374 │ │ │ │ │ │ if (merge_identical_protocones) │ │ │ │ │ │ 00375 │ │ │ │ │ │ cand_refs.clear(); │ │ │ │ │ │ 00376 #endif │ │ │ │ │ │ 00377 │ │ │ │ │ │ 00378 │ │ │ │ │ │ @@ -23941,87 +23939,80 @@ │ │ │ │ │ │ 00382 │ │ │ │ │ │ 00383 │ │ │ │ │ │ 00384 // full clearance │ │ │ │ │ │ 00385 //---------------00386 int CSphsplit_merge::full_clear(){ │ │ │ │ │ │ 00387 │ │ │ │ │ │ partial_clear(); │ │ │ │ │ │ 00388 │ │ │ │ │ │ -00389 │ │ │ │ │ │ // clear previously allocated memory │ │ │ │ │ │ +00389 │ │ │ │ │ │ 00390 │ │ │ │ │ │ if (indices != NULL){ │ │ │ │ │ │ -delete[] indices; │ │ │ │ │ │ 00391 │ │ │ │ │ │ +delete[] indices; │ │ │ │ │ │ 00392 │ │ │ │ │ │ } │ │ │ │ │ │ 00393 │ │ │ │ │ │ particles.clear(); │ │ │ │ │ │ 00394 │ │ │ │ │ │ -00395 │ │ │ │ │ │ return 0; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.45 split_merge.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -269 │ │ │ │ │ │ - │ │ │ │ │ │ +00395 │ │ │ │ │ │ 00396 } │ │ │ │ │ │ 00397 │ │ │ │ │ │ 00398 │ │ │ │ │ │ 00399 // build the list ’p_uncol_hard’ from p_remain by clustering collinear particles │ │ │ │ │ │ 00400 // note that thins in only used for stable-cone detection │ │ │ │ │ │ 00401 // so the parent_index field is unnecessary │ │ │ │ │ │ 00402 //------------------------------------------------------------------------00403 int CSphsplit_merge::merge_collinear_and_remove_soft(){ │ │ │ │ │ │ int i,j; │ │ │ │ │ │ 00404 │ │ │ │ │ │ 00405 │ │ │ │ │ │ vector p_sorted; │ │ │ │ │ │ -00406 │ │ │ │ │ │ bool collinear; │ │ │ │ │ │ -double dphi; │ │ │ │ │ │ +00406 │ │ │ │ │ │ 00407 │ │ │ │ │ │ +double dphi; │ │ │ │ │ │ 00408 │ │ │ │ │ │ 00409 │ │ │ │ │ │ p_uncol_hard.clear(); │ │ │ │ │ │ 00410 │ │ │ │ │ │ // we first sort the particles according to their theta angle │ │ │ │ │ │ 00411 │ │ │ │ │ │ 00412 │ │ │ │ │ │ for (i=0;i *protocones, double R2, double Emin){ │ │ │ │ │ │ int i; │ │ │ │ │ │ 00463 │ │ │ │ │ │ 00464 │ │ │ │ │ │ CSphmomentum *c; │ │ │ │ │ │ @@ -24085,42 +24083,35 @@ │ │ │ │ │ │ 00466 │ │ │ │ │ │ double tan2R; │ │ │ │ │ │ 00467 │ │ │ │ │ │ CSphjet jet; │ │ │ │ │ │ 00468 │ │ │ │ │ │ 00469 │ │ │ │ │ │ if (protocones->size()==0) │ │ │ │ │ │ -return 1; │ │ │ │ │ │ 00470 │ │ │ │ │ │ +return 1; │ │ │ │ │ │ 00471 │ │ │ │ │ │ 00472 │ │ │ │ │ │ E_min = Emin; │ │ │ │ │ │ -00473 │ │ │ │ │ │ double R = sqrt(R2); │ │ │ │ │ │ +00473 │ │ │ │ │ │ 00474 │ │ │ │ │ │ tan2R = tan(R); │ │ │ │ │ │ 00475 │ │ │ │ │ │ tan2R *= tan2R; │ │ │ │ │ │ 00476 │ │ │ │ │ │ 00477 #ifdef DEBUG_SPLIT_MERGE │ │ │ │ │ │ 00478 │ │ │ │ │ │ cout « "particle list: "; │ │ │ │ │ │ -for (int i2=0;i2::iterator p_it = protocones->begin();p_it != protocones->end();p_it++){ │ │ │ │ │ │ 00489 │ │ │ │ │ │ // initialise variables │ │ │ │ │ │ 00490 │ │ │ │ │ │ c = &(*p_it); │ │ │ │ │ │ 00491 │ │ │ │ │ │ -00492 │ │ │ │ │ │ // browse particles to create cone contents │ │ │ │ │ │ +00492 │ │ │ │ │ │ 00493 │ │ │ │ │ │ // note that jet is always initialised with default values at this level │ │ │ │ │ │ 00494 │ │ │ │ │ │ jet.v = CSphmomentum(); │ │ │ │ │ │ 00495 │ │ │ │ │ │ jet.contents.clear(); │ │ │ │ │ │ -for (i=0;iparent_index); │ │ │ │ │ │ 00500 │ │ │ │ │ │ @@ -24166,42 +24157,42 @@ │ │ │ │ │ │ 00507 │ │ │ │ │ │ // we can’t do that before as it requires knowledge of the jet axis │ │ │ │ │ │ 00508 │ │ │ │ │ │ // which has just been computed. │ │ │ │ │ │ 00509 │ │ │ │ │ │ compute_Etilde(jet); │ │ │ │ │ │ 00510 │ │ │ │ │ │ -00511 │ │ │ │ │ │ // set the momentum in protocones │ │ │ │ │ │ +00511 │ │ │ │ │ │ 00512 │ │ │ │ │ │ // (it was only known through its spatial coordinates up to now) │ │ │ │ │ │ 00513 │ │ │ │ │ │ *c = jet.v; │ │ │ │ │ │ 00514 │ │ │ │ │ │ c->build_thetaphi(); │ │ │ │ │ │ 00515 │ │ │ │ │ │ -// set the jet range │ │ │ │ │ │ 00516 │ │ │ │ │ │ +// set the jet range │ │ │ │ │ │ 00517 │ │ │ │ │ │ jet.range=CSphtheta_phi_range(c->_theta,c->_phi,R); │ │ │ │ │ │ 00518 │ │ │ │ │ │ 00519 #ifdef DEBUG_SPLIT_MERGE │ │ │ │ │ │ 00520 │ │ │ │ │ │ cout « "adding protojet: "; │ │ │ │ │ │ 00521 │ │ │ │ │ │ unsigned int phirange=jet.range.phi_range; │ │ │ │ │ │ 00522 │ │ │ │ │ │ -00523 │ │ │ │ │ │ for (unsigned int i2=0;i2<32;i2++) fprintf(stdout, "%d", (phirange&(1«i2)) » i2 ); │ │ │ │ │ │ +00523 │ │ │ │ │ │ 00524 │ │ │ │ │ │ fprintf(stdout, "\t"); │ │ │ │ │ │ -00525 │ │ │ │ │ │ unsigned int thetarange=jet.range.theta_range; │ │ │ │ │ │ -for (unsigned int i2=0;i2<32;i2++) fprintf(stdout, "%d", (thetarange&(1«i2)) » i2); │ │ │ │ │ │ +00525 │ │ │ │ │ │ 00526 │ │ │ │ │ │ +for (unsigned int i2=0;i2<32;i2++) fprintf(stdout, "%d", (thetarange&(1«i2)) » i2); │ │ │ │ │ │ 00527 │ │ │ │ │ │ fprintf(stdout, "\t"); │ │ │ │ │ │ 00528 │ │ │ │ │ │ for (int i2=0;i2 *protocones, double R2, │ │ │ │ │ │ double Emin){ │ │ │ │ │ │ 00581 │ │ │ │ │ │ -int i; │ │ │ │ │ │ 00582 │ │ │ │ │ │ +int i; │ │ │ │ │ │ 00583 │ │ │ │ │ │ CSphmomentum *c; │ │ │ │ │ │ 00584 │ │ │ │ │ │ CSphmomentum *v; │ │ │ │ │ │ -00585 │ │ │ │ │ │ double R, tan2R; │ │ │ │ │ │ +00585 │ │ │ │ │ │ 00586 │ │ │ │ │ │ CSphjet jet, jet_candidate; │ │ │ │ │ │ -bool found_jet = false; │ │ │ │ │ │ 00587 │ │ │ │ │ │ +bool found_jet = false; │ │ │ │ │ │ 00588 │ │ │ │ │ │ if (protocones->size()==0) │ │ │ │ │ │ 00589 │ │ │ │ │ │ -00590 │ │ │ │ │ │ return 1; │ │ │ │ │ │ +00590 │ │ │ │ │ │ 00591 │ │ │ │ │ │ 00592 │ │ │ │ │ │ E_min = Emin; │ │ │ │ │ │ 00593 │ │ │ │ │ │ R = sqrt(R2); │ │ │ │ │ │ 00594 │ │ │ │ │ │ tan2R = tan(R); │ │ │ │ │ │ @@ -24320,48 +24311,48 @@ │ │ │ │ │ │ 00596 │ │ │ │ │ │ // browse protocones │ │ │ │ │ │ 00597 │ │ │ │ │ │ 00598 │ │ │ │ │ │ // for each of them, build the list of particles in them │ │ │ │ │ │ 00599 │ │ │ │ │ │ for (vector::iterator p_it = protocones->begin();p_it != protocones->end();p_it++){ │ │ │ │ │ │ -// initialise variables │ │ │ │ │ │ 00600 │ │ │ │ │ │ +// initialise variables │ │ │ │ │ │ 00601 │ │ │ │ │ │ c = &(*p_it); │ │ │ │ │ │ 00602 │ │ │ │ │ │ // browse particles to create cone contents │ │ │ │ │ │ 00603 │ │ │ │ │ │ 00604 │ │ │ │ │ │ // note that jet is always initialised with default values at this level │ │ │ │ │ │ 00605 │ │ │ │ │ │ jet_candidate.v = CSphmomentum(); │ │ │ │ │ │ 00606 │ │ │ │ │ │ jet_candidate.contents.clear(); │ │ │ │ │ │ -for (i=0;iparent_index); │ │ │ │ │ │ 00611 │ │ │ │ │ │ jet_candidate.v+= *v; │ │ │ │ │ │ 00612 │ │ │ │ │ │ v->index=0; │ │ │ │ │ │ 00613 │ │ │ │ │ │ } │ │ │ │ │ │ 00614 │ │ │ │ │ │ } │ │ │ │ │ │ 00615 │ │ │ │ │ │ jet_candidate.n=jet_candidate.contents.size(); │ │ │ │ │ │ 00616 │ │ │ │ │ │ -// compute Etilde for that jet. │ │ │ │ │ │ 00617 │ │ │ │ │ │ +// compute Etilde for that jet. │ │ │ │ │ │ 00618 │ │ │ │ │ │ // we can’t do that before as it requires knowledge of the jet axis │ │ │ │ │ │ 00619 │ │ │ │ │ │ // which has just been computed. │ │ │ │ │ │ 00620 │ │ │ │ │ │ compute_Etilde(jet_candidate); │ │ │ │ │ │ 00621 │ │ │ │ │ │ @@ -24375,20 +24366,27 @@ │ │ │ │ │ │ c->build_thetaphi(); │ │ │ │ │ │ 00626 │ │ │ │ │ │ 00627 │ │ │ │ │ │ // set the jet range │ │ │ │ │ │ 00628 │ │ │ │ │ │ jet_candidate.range=CSphtheta_phi_range(c->_theta,c->_phi,R); │ │ │ │ │ │ 00629 │ │ │ │ │ │ -// check that the protojet has large enough pt │ │ │ │ │ │ 00630 │ │ │ │ │ │ +// check that the protojet has large enough pt │ │ │ │ │ │ 00631 │ │ │ │ │ │ if (jet_candidate.v.Eis_larger(jet_candidate, jet) │ │ │ │ │ │ 00647 │ │ │ │ │ │ : ptcomparison(jet_candidate, jet))){ │ │ │ │ │ │ 00648 │ │ │ │ │ │ @@ -24422,21 +24420,14 @@ │ │ │ │ │ │ 00651 │ │ │ │ │ │ } │ │ │ │ │ │ 00652 │ │ │ │ │ │ // make sure at least one of the jets has passed the selection │ │ │ │ │ │ 00653 │ │ │ │ │ │ 00654 │ │ │ │ │ │ if (!found_jet) return 1; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 272 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00655 │ │ │ │ │ │ // add the jet to the list of jets │ │ │ │ │ │ 00656 │ │ │ │ │ │ 00657 │ │ │ │ │ │ jets.push_back(jet); │ │ │ │ │ │ 00658 │ │ │ │ │ │ jets[jets.size()-1].v.build_thetaphi(); │ │ │ │ │ │ @@ -24444,44 +24435,44 @@ │ │ │ │ │ │ jets[jets.size()-1].v.build_norm(); │ │ │ │ │ │ 00660 │ │ │ │ │ │ 00661 #ifdef DEBUG_SPLIT_MERGE │ │ │ │ │ │ 00662 │ │ │ │ │ │ cout « "PR-Jet " « jets.size() « " [size " « jet.contents.size() « "]:"; │ │ │ │ │ │ 00663 #endif │ │ │ │ │ │ 00664 │ │ │ │ │ │ -00665 │ │ │ │ │ │ // update the list of what particles are left │ │ │ │ │ │ +00665 │ │ │ │ │ │ 00666 │ │ │ │ │ │ int p_remain_index = 0; │ │ │ │ │ │ -00667 │ │ │ │ │ │ int contents_index = 0; │ │ │ │ │ │ -//sort(next_jet.contents.begin(),next_jet.contents.end()); │ │ │ │ │ │ +00667 │ │ │ │ │ │ 00668 │ │ │ │ │ │ +//sort(next_jet.contents.begin(),next_jet.contents.end()); │ │ │ │ │ │ 00669 │ │ │ │ │ │ for (int index=0;indexsize()==0) │ │ │ │ │ │ +00722 │ │ │ │ │ │ return 0; │ │ │ │ │ │ 00723 │ │ │ │ │ │ 00724 │ │ │ │ │ │ -if (overlap_tshold>=1.0 || overlap_tshold <= 0) { │ │ │ │ │ │ 00725 │ │ │ │ │ │ +if (overlap_tshold>=1.0 || overlap_tshold <= 0) { │ │ │ │ │ │ 00726 │ │ │ │ │ │ ostringstream message; │ │ │ │ │ │ 00727 │ │ │ │ │ │ message « "Illegal value for overlap_tshold, f = " « overlap_tshold; │ │ │ │ │ │ 00728 │ │ │ │ │ │ message « " (legal values are 0size()>0){ │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.45 split_merge.cpp │ │ │ │ │ │ - │ │ │ │ │ │ 00742 │ │ │ │ │ │ // browse for the first jet │ │ │ │ │ │ 00743 │ │ │ │ │ │ j1 = candidates->begin(); │ │ │ │ │ │ 00744 │ │ │ │ │ │ // if hardest jet does not pass threshold then nothing else will │ │ │ │ │ │ 00745 │ │ │ │ │ │ @@ -24602,16 +24593,16 @@ │ │ │ │ │ │ 00751 │ │ │ │ │ │ j2 = j1; │ │ │ │ │ │ 00752 │ │ │ │ │ │ j2++; │ │ │ │ │ │ int j2_relindex = 1; // used only in ifdef, but costs little so keep it outside │ │ │ │ │ │ 00753 │ │ │ │ │ │ 00754 │ │ │ │ │ │ -while (j2 != candidates->end()){ │ │ │ │ │ │ 00755 │ │ │ │ │ │ +while (j2 != candidates->end()){ │ │ │ │ │ │ 00756 #ifdef DEBUG_SPLIT_MERGE │ │ │ │ │ │ 00757 │ │ │ │ │ │ if (j2_relindex==1) show(); │ │ │ │ │ │ 00758 │ │ │ │ │ │ cout « "check overlap between cdt 1 and cdt " « j2_relindex+1 « " with overlap " « endl; │ │ │ │ │ │ 00759 #endif │ │ │ │ │ │ 00760 │ │ │ │ │ │ @@ -24679,30 +24670,39 @@ │ │ │ │ │ │ 00795 │ │ │ │ │ │ j2_relindex++; │ │ │ │ │ │ 00796 │ │ │ │ │ │ if (j2 != candidates->end()) j2++; │ │ │ │ │ │ 00797 │ │ │ │ │ │ } // end of loop on the second jet │ │ │ │ │ │ 00798 │ │ │ │ │ │ -00799 │ │ │ │ │ │ if (j1 != candidates->end()) { │ │ │ │ │ │ -// all "second jet" passed without overlapping │ │ │ │ │ │ +00799 │ │ │ │ │ │ 00800 │ │ │ │ │ │ +// all "second jet" passed without overlapping │ │ │ │ │ │ 00801 │ │ │ │ │ │ // (otherwise we won’t leave the j2 loop) │ │ │ │ │ │ 00802 │ │ │ │ │ │ // => store jet 1 as real jet │ │ │ │ │ │ 00803 │ │ │ │ │ │ jets.push_back(*j1); │ │ │ │ │ │ 00804 │ │ │ │ │ │ jets[jets.size()-1].v.build_thetaphi(); │ │ │ │ │ │ 00805 │ │ │ │ │ │ jets[jets.size()-1].v.build_norm(); │ │ │ │ │ │ 00806 │ │ │ │ │ │ // a bug where the contents has non-zero size has been cropping │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +273 │ │ │ │ │ │ + │ │ │ │ │ │ + 274 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00807 │ │ │ │ │ │ // up in many contexts -- so catch it! │ │ │ │ │ │ 00808 │ │ │ │ │ │ assert(j1->contents.size() > 0); │ │ │ │ │ │ 00809 │ │ │ │ │ │ jets[jets.size()-1].pass = particles[j1->contents[0]].index; │ │ │ │ │ │ 00810 #ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES │ │ │ │ │ │ @@ -24723,29 +24723,20 @@ │ │ │ │ │ │ 00819 │ │ │ │ │ │ sort(jets.begin(), jets.end(), jets_E_less); │ │ │ │ │ │ 00820 #ifdef DEBUG_SPLIT_MERGE │ │ │ │ │ │ 00821 │ │ │ │ │ │ show(); │ │ │ │ │ │ 00822 #endif │ │ │ │ │ │ 00823 │ │ │ │ │ │ -return jets.size(); │ │ │ │ │ │ 00824 │ │ │ │ │ │ +return jets.size(); │ │ │ │ │ │ 00825 } │ │ │ │ │ │ 00826 │ │ │ │ │ │ 00827 │ │ │ │ │ │ 00828 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -273 │ │ │ │ │ │ - │ │ │ │ │ │ - 274 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00829 // save the event on disk │ │ │ │ │ │ 00830 // - flux │ │ │ │ │ │ stream used to save jet contents │ │ │ │ │ │ 00831 //-------------------------------------------00832 int CSphsplit_merge::save_contents(FILE *flux){ │ │ │ │ │ │ 00833 │ │ │ │ │ │ jet_iterator it_j; │ │ │ │ │ │ 00834 │ │ │ │ │ │ @@ -24753,31 +24744,31 @@ │ │ │ │ │ │ 00835 │ │ │ │ │ │ int i1, i2; │ │ │ │ │ │ 00836 │ │ │ │ │ │ 00837 │ │ │ │ │ │ fprintf(flux, "# %d jets found\n", (int) jets.size()); │ │ │ │ │ │ 00838 │ │ │ │ │ │ fprintf(flux, "# columns are: px, py, pz, E and number of particles for each jet\n"); │ │ │ │ │ │ -00839 │ │ │ │ │ │ for (it_j = jets.begin(), i1=0 ; it_j != jets.end() ; it_j++, i1++){ │ │ │ │ │ │ +00839 │ │ │ │ │ │ 00840 │ │ │ │ │ │ j1 = &(*it_j); │ │ │ │ │ │ 00841 │ │ │ │ │ │ fprintf(flux, "%e\t%e\t%e\t%e\t%d\n", │ │ │ │ │ │ 00842 │ │ │ │ │ │ j1->v.px, j1->v.py, j1->v.pz, j1->v.E, j1->n); │ │ │ │ │ │ 00843 │ │ │ │ │ │ } │ │ │ │ │ │ 00844 │ │ │ │ │ │ 00845 │ │ │ │ │ │ fprintf(flux, "# jet contents\n"); │ │ │ │ │ │ 00846 │ │ │ │ │ │ fprintf(flux, "# columns are: px, py, pz, E, particle index and jet number\n"); │ │ │ │ │ │ -for (it_j = jets.begin(), i1=0 ; it_j != jets.end() ; it_j++, i1++){ │ │ │ │ │ │ 00847 │ │ │ │ │ │ +for (it_j = jets.begin(), i1=0 ; it_j != jets.end() ; it_j++, i1++){ │ │ │ │ │ │ 00848 │ │ │ │ │ │ j1 = &(*it_j); │ │ │ │ │ │ for (i2=0;i2n;i2++) │ │ │ │ │ │ 00849 │ │ │ │ │ │ 00850 │ │ │ │ │ │ fprintf(flux, "%e\t%e\t%e\t%e\t%d\t%d\n", │ │ │ │ │ │ 00851 │ │ │ │ │ │ @@ -24812,89 +24803,89 @@ │ │ │ │ │ │ 00870 │ │ │ │ │ │ j = &(*it_j); │ │ │ │ │ │ 00871 │ │ │ │ │ │ fprintf(stdout, "jet %2d: %e\t%e\t%e\t%e\t", i1+1, │ │ │ │ │ │ 00872 │ │ │ │ │ │ j->v.px, j->v.py, j->v.pz, j->v.E); │ │ │ │ │ │ 00873 │ │ │ │ │ │ -unsigned int phirange=j->range.phi_range; │ │ │ │ │ │ 00874 │ │ │ │ │ │ +unsigned int phirange=j->range.phi_range; │ │ │ │ │ │ for (i2=0;i2<32;i2++) fprintf(stdout, "%d", (phirange&(1«i2)) » i2 ); │ │ │ │ │ │ 00875 │ │ │ │ │ │ 00876 │ │ │ │ │ │ fprintf(stdout, "\t"); │ │ │ │ │ │ -00877 │ │ │ │ │ │ unsigned int thetarange=j->range.theta_range; │ │ │ │ │ │ -for (i2=0;i2<32;i2++) fprintf(stdout, "%d", (thetarange&(1«i2)) » i2); │ │ │ │ │ │ +00877 │ │ │ │ │ │ 00878 │ │ │ │ │ │ +for (i2=0;i2<32;i2++) fprintf(stdout, "%d", (thetarange&(1«i2)) » i2); │ │ │ │ │ │ 00879 │ │ │ │ │ │ fprintf(stdout, "\t"); │ │ │ │ │ │ 00880 │ │ │ │ │ │ -for (i2=0;i2n;i2++) │ │ │ │ │ │ 00881 │ │ │ │ │ │ +for (i2=0;i2n;i2++) │ │ │ │ │ │ 00882 │ │ │ │ │ │ fprintf(stdout, "%d ", j->contents[i2]); │ │ │ │ │ │ 00883 │ │ │ │ │ │ fprintf(stdout, "\n"); │ │ │ │ │ │ 00884 │ │ │ │ │ │ } │ │ │ │ │ │ 00885 │ │ │ │ │ │ -00886 │ │ │ │ │ │ for (it_c = candidates->begin(), i1=0 ; it_c != candidates->end() ; it_c++, i1++){ │ │ │ │ │ │ +00886 │ │ │ │ │ │ 00887 │ │ │ │ │ │ c = &(*it_c); │ │ │ │ │ │ 00888 │ │ │ │ │ │ fprintf(stdout, "cdt %2d: %e\t%e\t%e\t%e\t%e\t", i1+1, │ │ │ │ │ │ 00889 │ │ │ │ │ │ c->v.px, c->v.py, c->v.pz, c->v.E, sqrt(c->sm_var2)); │ │ │ │ │ │ 00890 │ │ │ │ │ │ -00891 │ │ │ │ │ │ unsigned int phirange=c->range.phi_range; │ │ │ │ │ │ +00891 │ │ │ │ │ │ for (i2=0;i2<32;i2++) fprintf(stdout, "%d", (phirange&(1«i2)) » i2 ); │ │ │ │ │ │ 00892 │ │ │ │ │ │ 00893 │ │ │ │ │ │ fprintf(stdout, "\t"); │ │ │ │ │ │ -unsigned int thetarange=c->range.theta_range; │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.45 split_merge.cpp │ │ │ │ │ │ + │ │ │ │ │ │ 00894 │ │ │ │ │ │ -00895 │ │ │ │ │ │ +unsigned int thetarange=c->range.theta_range; │ │ │ │ │ │ for (i2=0;i2<32;i2++) fprintf(stdout, "%d", (thetarange&(1«i2)) » i2); │ │ │ │ │ │ +00895 │ │ │ │ │ │ 00896 │ │ │ │ │ │ fprintf(stdout, "\t"); │ │ │ │ │ │ 00897 │ │ │ │ │ │ for (i2=0;i2n;i2++) │ │ │ │ │ │ 00898 │ │ │ │ │ │ 00899 │ │ │ │ │ │ fprintf(stdout, "%d ", c->contents[i2]); │ │ │ │ │ │ 00900 │ │ │ │ │ │ fprintf(stdout, "\n"); │ │ │ │ │ │ 00901 │ │ │ │ │ │ } │ │ │ │ │ │ 00902 │ │ │ │ │ │ 00903 │ │ │ │ │ │ fprintf(stdout, "\n"); │ │ │ │ │ │ -return 0; │ │ │ │ │ │ 00904 │ │ │ │ │ │ +return 0; │ │ │ │ │ │ 00905 } │ │ │ │ │ │ 00906 │ │ │ │ │ │ 00907 │ │ │ │ │ │ 00908 // get the overlap between 2 jets │ │ │ │ │ │ 00909 // - j1 │ │ │ │ │ │ first jet │ │ │ │ │ │ 00910 // - j2 │ │ │ │ │ │ second jet │ │ │ │ │ │ 00911 // - overlap2 returned overlap^2 (determined by the choice of SM variable) │ │ │ │ │ │ 00912 // return true if overlapping, false if disjoint │ │ │ │ │ │ 00913 //--------------------------------------------------------------------00914 bool CSphsplit_merge::get_overlap(const CSphjet &j1, const CSphjet &j2, double *overlap2){ │ │ │ │ │ │ -00915 │ │ │ │ │ │ // check if ranges overlap │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.45 split_merge.cpp │ │ │ │ │ │ - │ │ │ │ │ │ +00915 │ │ │ │ │ │ 00916 │ │ │ │ │ │ if (!is_range_overlap(j1.range,j2.range)) │ │ │ │ │ │ return false; │ │ │ │ │ │ 00917 │ │ │ │ │ │ 00918 │ │ │ │ │ │ int i1,i2; │ │ │ │ │ │ 00919 │ │ │ │ │ │ @@ -24959,16 +24950,16 @@ │ │ │ │ │ │ indices[idx_size] = j1.contents[i1]; │ │ │ │ │ │ 00951 │ │ │ │ │ │ i1++; │ │ │ │ │ │ 00952 │ │ │ │ │ │ idx_size++; │ │ │ │ │ │ 00953 │ │ │ │ │ │ } │ │ │ │ │ │ -while (i2" all over the place │ │ │ │ │ │ 00987 │ │ │ │ │ │ -const CSphjet & j1 = * it_j1; │ │ │ │ │ │ 00988 │ │ │ │ │ │ -const CSphjet & j2 = * it_j2; │ │ │ │ │ │ 00989 │ │ │ │ │ │ 00990 │ │ │ │ │ │ -i1=i2=0; │ │ │ │ │ │ 00991 │ │ │ │ │ │ -jet2.v = jet1.v = CSphmomentum(); │ │ │ │ │ │ 00992 │ │ │ │ │ │ 00993 │ │ │ │ │ │ -// compute centroids │ │ │ │ │ │ 00994 │ │ │ │ │ │ -// When use_E_weighted_splitting is activated, the │ │ │ │ │ │ 00995 │ │ │ │ │ │ -// "geometrical" distance is weighted by the inverse │ │ │ │ │ │ 00996 │ │ │ │ │ │ -// of the E of the protojet │ │ │ │ │ │ 00997 │ │ │ │ │ │ -// This is stored in E{1,2}_weight │ │ │ │ │ │ 00998 │ │ │ │ │ │ -E1_weight = (use_E_weighted_splitting) ? 1.0/j1.v.E/j1.v.E : 1.0; │ │ │ │ │ │ 00999 │ │ │ │ │ │ -E2_weight = (use_E_weighted_splitting) ? 1.0/j2.v.E/j2.v.E : 1.0; │ │ │ │ │ │ 01000 │ │ │ │ │ │ -// compute jet splitting │ │ │ │ │ │ 01001 │ │ │ │ │ │ 01002 │ │ │ │ │ │ -do{ │ │ │ │ │ │ 01003 │ │ │ │ │ │ -if (j1.contents[i1]_theta,v->_phi); │ │ │ │ │ │ 01011 │ │ │ │ │ │ -} else if (j1.contents[i1]>j2.contents[i2]){ │ │ │ │ │ │ -// particle i2 belong only to jet 2 │ │ │ │ │ │ 01012 │ │ │ │ │ │ 01013 │ │ │ │ │ │ -v = &(particles[j2.contents[i2]]); │ │ │ │ │ │ 01014 │ │ │ │ │ │ -jet2.contents.push_back(j2.contents[i2]); │ │ │ │ │ │ 01015 │ │ │ │ │ │ -jet2.v += *v; │ │ │ │ │ │ 01016 │ │ │ │ │ │ -//jet2.pt_tilde += pt[j2.contents[i2]]; │ │ │ │ │ │ 01017 │ │ │ │ │ │ -i2++; │ │ │ │ │ │ 01018 │ │ │ │ │ │ -jet2.range.add_particle(v->_theta,v->_phi); │ │ │ │ │ │ 01019 │ │ │ │ │ │ -} else { // (j1.contents[i1]==j2.contents[i2]) │ │ │ │ │ │ 01020 │ │ │ │ │ │ -// common particle, decide which is the closest centre │ │ │ │ │ │ 01021 │ │ │ │ │ │ -v = &(particles[j1.contents[i1]]); │ │ │ │ │ │ 01022 │ │ │ │ │ │ -//TODO: improve this brutal use of atan2 and sqrt !!!! │ │ │ │ │ │ 01023 │ │ │ │ │ │ 01024 │ │ │ │ │ │ 01025 │ │ │ │ │ │ -//? what when == ? │ │ │ │ │ │ 01026 │ │ │ │ │ │ -// When use_E_weighted_splitting is activated, the │ │ │ │ │ │ 01027 │ │ │ │ │ │ -// "geometrical" distance is weighted by the inverse │ │ │ │ │ │ 01028 │ │ │ │ │ │ -// of the E of the protojet │ │ │ │ │ │ 01029 │ │ │ │ │ │ -double d1 = get_distance(&(j1.v), v)*E1_weight; │ │ │ │ │ │ 01030 │ │ │ │ │ │ -double d2 = get_distance(&(j2.v), v)*E2_weight; │ │ │ │ │ │ -// do bookkeeping on most ambiguous split │ │ │ │ │ │ 01031 │ │ │ │ │ │ 01032 │ │ │ │ │ │ -if (fabs(d1-d2) < most_ambiguous_split) │ │ │ │ │ │ 01033 │ │ │ │ │ │ -most_ambiguous_split = fabs(d1-d2); │ │ │ │ │ │ 01034 │ │ │ │ │ │ -if (d1_theta,v->_phi); │ │ │ │ │ │ 01041 │ │ │ │ │ │ -} else { │ │ │ │ │ │ 01042 │ │ │ │ │ │ -// particle i2 belong only to jet 2 │ │ │ │ │ │ 01043 │ │ │ │ │ │ -jet2.contents.push_back(j2.contents[i2]); │ │ │ │ │ │ 01044 │ │ │ │ │ │ -jet2.v += *v; │ │ │ │ │ │ 01045 │ │ │ │ │ │ -//jet2.pt_tilde += pt[j2.contents[i2]]; │ │ │ │ │ │ 01046 │ │ │ │ │ │ -jet2.range.add_particle(v->_theta,v->_phi); │ │ │ │ │ │ 01047 │ │ │ │ │ │ -} │ │ │ │ │ │ 01048 │ │ │ │ │ │ 01049 │ │ │ │ │ │ -i1++; │ │ │ │ │ │ 01050 │ │ │ │ │ │ -i2++; │ │ │ │ │ │ 01051 │ │ │ │ │ │ -} │ │ │ │ │ │ 01052 │ │ │ │ │ │ -} while ((i1_theta,v->_phi); │ │ │ │ │ │ 01061 │ │ │ │ │ │ -} │ │ │ │ │ │ -while (i2" all over the place │ │ │ │ │ │ +const CSphjet & j1 = * it_j1; │ │ │ │ │ │ +const CSphjet & j2 = * it_j2; │ │ │ │ │ │ +i1=i2=0; │ │ │ │ │ │ +jet2.v = jet1.v = CSphmomentum(); │ │ │ │ │ │ +// compute centroids │ │ │ │ │ │ +// When use_E_weighted_splitting is activated, the │ │ │ │ │ │ +// "geometrical" distance is weighted by the inverse │ │ │ │ │ │ +// of the E of the protojet │ │ │ │ │ │ +// This is stored in E{1,2}_weight │ │ │ │ │ │ +E1_weight = (use_E_weighted_splitting) ? 1.0/j1.v.E/j1.v.E : 1.0; │ │ │ │ │ │ +E2_weight = (use_E_weighted_splitting) ? 1.0/j2.v.E/j2.v.E : 1.0; │ │ │ │ │ │ +// compute jet splitting │ │ │ │ │ │ +do{ │ │ │ │ │ │ +if (j1.contents[i1]_theta,v->_phi); │ │ │ │ │ │ +} else if (j1.contents[i1]>j2.contents[i2]){ │ │ │ │ │ │ +// particle i2 belong only to jet 2 │ │ │ │ │ │ +v = &(particles[j2.contents[i2]]); │ │ │ │ │ │ +jet2.contents.push_back(j2.contents[i2]); │ │ │ │ │ │ +jet2.v += *v; │ │ │ │ │ │ +//jet2.pt_tilde += pt[j2.contents[i2]]; │ │ │ │ │ │ +i2++; │ │ │ │ │ │ +jet2.range.add_particle(v->_theta,v->_phi); │ │ │ │ │ │ +} else { // (j1.contents[i1]==j2.contents[i2]) │ │ │ │ │ │ +// common particle, decide which is the closest centre │ │ │ │ │ │ +v = &(particles[j1.contents[i1]]); │ │ │ │ │ │ +//TODO: improve this brutal use of atan2 and sqrt !!!! │ │ │ │ │ │ +//? what when == ? │ │ │ │ │ │ +// When use_E_weighted_splitting is activated, the │ │ │ │ │ │ +// "geometrical" distance is weighted by the inverse │ │ │ │ │ │ +// of the E of the protojet │ │ │ │ │ │ +double d1 = get_distance(&(j1.v), v)*E1_weight; │ │ │ │ │ │ +double d2 = get_distance(&(j2.v), v)*E2_weight; │ │ │ │ │ │ +// do bookkeeping on most ambiguous split │ │ │ │ │ │ +if (fabs(d1-d2) < most_ambiguous_split) │ │ │ │ │ │ +most_ambiguous_split = fabs(d1-d2); │ │ │ │ │ │ +if (d1_theta,v->_phi); │ │ │ │ │ │ +} else { │ │ │ │ │ │ +// particle i2 belong only to jet 2 │ │ │ │ │ │ +jet2.contents.push_back(j2.contents[i2]); │ │ │ │ │ │ +jet2.v += *v; │ │ │ │ │ │ +//jet2.pt_tilde += pt[j2.contents[i2]]; │ │ │ │ │ │ +jet2.range.add_particle(v->_theta,v->_phi); │ │ │ │ │ │ +} │ │ │ │ │ │ +i1++; │ │ │ │ │ │ +i2++; │ │ │ │ │ │ +} │ │ │ │ │ │ +} while ((i1_theta,v->_phi); │ │ │ │ │ │ +} │ │ │ │ │ │ +while (i2_theta,v->_phi); │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.45 split_merge.cpp │ │ │ │ │ │ + │ │ │ │ │ │ 01069 │ │ │ │ │ │ } │ │ │ │ │ │ 01070 │ │ │ │ │ │ -01071 │ │ │ │ │ │ // finalise jets │ │ │ │ │ │ +01071 │ │ │ │ │ │ 01072 │ │ │ │ │ │ jet1.n = jet1.contents.size(); │ │ │ │ │ │ 01073 │ │ │ │ │ │ jet2.n = jet2.contents.size(); │ │ │ │ │ │ 01074 │ │ │ │ │ │ 01075 │ │ │ │ │ │ // now the jet axis is known, we can compute Etilde │ │ │ │ │ │ @@ -25210,19 +25207,14 @@ │ │ │ │ │ │ 01087 │ │ │ │ │ │ // reinsert new ones │ │ │ │ │ │ 01088 │ │ │ │ │ │ insert(jet1); │ │ │ │ │ │ 01089 │ │ │ │ │ │ insert(jet2); │ │ │ │ │ │ 01090 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.45 split_merge.cpp │ │ │ │ │ │ - │ │ │ │ │ │ 01091 │ │ │ │ │ │ return true; │ │ │ │ │ │ 01092 } │ │ │ │ │ │ 01093 │ │ │ │ │ │ 01094 // merge the two given jet. │ │ │ │ │ │ 01095 // during this procedure, the jets j1 & j2 are replaced │ │ │ │ │ │ 01096 // by 1 single jets containing both of them. │ │ │ │ │ │ @@ -25284,60 +25276,69 @@ │ │ │ │ │ │ 01131 │ │ │ │ │ │ return true; │ │ │ │ │ │ 01132 │ │ │ │ │ │ 01133 } │ │ │ │ │ │ 01134 │ │ │ │ │ │ 01140 bool CSphsplit_merge::insert(CSphjet &jet){ │ │ │ │ │ │ 01141 │ │ │ │ │ │ -// eventually check that no other candidate are present with the │ │ │ │ │ │ 01142 │ │ │ │ │ │ +// eventually check that no other candidate are present with the │ │ │ │ │ │ 01143 │ │ │ │ │ │ // same cone contents. We recall that this automatic merging of │ │ │ │ │ │ 01144 │ │ │ │ │ │ // identical protocones can lead to infrared-unsafe situations. │ │ │ │ │ │ 01145 #ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES │ │ │ │ │ │ 01146 │ │ │ │ │ │ if ((merge_identical_protocones) && (!cand_refs.insert(jet.v.ref).second)) │ │ │ │ │ │ -01147 │ │ │ │ │ │ return false; │ │ │ │ │ │ +01147 │ │ │ │ │ │ 01148 #endif │ │ │ │ │ │ 01149 │ │ │ │ │ │ // check that the protojet has large enough energy │ │ │ │ │ │ 01150 │ │ │ │ │ │ 01151 │ │ │ │ │ │ if (jet.v.Einsert(jet); │ │ │ │ │ │ 01159 │ │ │ │ │ │ return true; │ │ │ │ │ │ 01160 │ │ │ │ │ │ 01161 } │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +277 │ │ │ │ │ │ + │ │ │ │ │ │ + 278 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 01162 │ │ │ │ │ │ 01169 double CSphsplit_merge::get_sm_var2(CSphmomentum &v, double &E_tilde){ │ │ │ │ │ │ 01170 │ │ │ │ │ │ switch(ptcomparison.split_merge_scale) { │ │ │ │ │ │ case SM_E: │ │ │ │ │ │ return v.E*v.E; │ │ │ │ │ │ 01171 │ │ │ │ │ │ 01172 │ │ │ │ │ │ case SM_Etilde: return E_tilde*E_tilde; │ │ │ │ │ │ -default: │ │ │ │ │ │ 01173 │ │ │ │ │ │ -01174 │ │ │ │ │ │ +default: │ │ │ │ │ │ throw siscone::Csiscone_error("Unsupported split-merge scale choice: " │ │ │ │ │ │ +01174 │ │ │ │ │ │ 01175 │ │ │ │ │ │ + ptcomparison.SM_scale_name()); │ │ │ │ │ │ 01176 │ │ │ │ │ │ } │ │ │ │ │ │ 01177 │ │ │ │ │ │ 01178 │ │ │ │ │ │ //return 0.0; │ │ │ │ │ │ @@ -25348,41 +25349,32 @@ │ │ │ │ │ │ 01184 void CSphsplit_merge::compute_Etilde(CSphjet &jet){ │ │ │ │ │ │ 01185 │ │ │ │ │ │ jet.v.build_norm(); │ │ │ │ │ │ 01186 │ │ │ │ │ │ jet.E_tilde=0.0; │ │ │ │ │ │ 01187 │ │ │ │ │ │ CSph3vector jet_axis = jet.v; │ │ │ │ │ │ -//if (jet.v._norm==0){ │ │ │ │ │ │ 01188 │ │ │ │ │ │ +//if (jet.v._norm==0){ │ │ │ │ │ │ 01189 │ │ │ │ │ │ // jet_axis = CSph3vector(0.0,0.0,0.0); │ │ │ │ │ │ 01190 │ │ │ │ │ │ //} else { │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -277 │ │ │ │ │ │ - │ │ │ │ │ │ - 278 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 01191 │ │ │ │ │ │ jet_axis/=jet.v.E; │ │ │ │ │ │ //} │ │ │ │ │ │ 01192 │ │ │ │ │ │ 01193 │ │ │ │ │ │ //cout « "~~~ Axis: " « jet.v.px « " " « jet.v.py « " " « jet.v.pz « " " « jet.v._norm « endl; │ │ │ │ │ │ 01194 │ │ │ │ │ │ //cout « "~~~ Axis: " « jet_axis.px « " " « jet_axis.py « " " « jet_axis.pz « endl; │ │ │ │ │ │ 01195 │ │ │ │ │ │ for (vector::iterator cont_it=jet.contents.begin(); cont_it!=jet.contents.end(); cont_it++){ │ │ │ │ │ │ -01196 │ │ │ │ │ │ const CSphmomentum &p = particles[*cont_it]; │ │ │ │ │ │ +01196 │ │ │ │ │ │ 01197 │ │ │ │ │ │ jet.E_tilde+=p.E*(1.0+norm2_cross_product3(p,jet_axis)/particles_norm2[*cont_it]); │ │ │ │ │ │ 01198 │ │ │ │ │ │ } │ │ │ │ │ │ 01199 } │ │ │ │ │ │ 01200 │ │ │ │ │ │ 01201 } │ │ │ │ │ │ @@ -25458,14 +25450,19 @@ │ │ │ │ │ │ 00045 * That is, first, its momentum carrying information │ │ │ │ │ │ * │ │ │ │ │ │ 00046 * about its centre and pT, and second, its particle │ │ │ │ │ │ * │ │ │ │ │ │ 00047 * contents │ │ │ │ │ │ * │ │ │ │ │ │ 00048 ********************************************************/ │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.46 split_merge.cpp │ │ │ │ │ │ + │ │ │ │ │ │ 00049 // default ctor │ │ │ │ │ │ 00050 //-------------00051 Cjet::Cjet(){ │ │ │ │ │ │ 00052 │ │ │ │ │ │ n = 0; │ │ │ │ │ │ 00053 │ │ │ │ │ │ v = Cmomentum(); │ │ │ │ │ │ 00054 │ │ │ │ │ │ @@ -25484,19 +25481,14 @@ │ │ │ │ │ │ 00064 } │ │ │ │ │ │ 00065 │ │ │ │ │ │ 00066 // ordering of jets in pt (e.g. used in final jets ordering) │ │ │ │ │ │ 00067 //----------------------------------------------------------00068 bool jets_pt_less(const Cjet &j1, const Cjet &j2){ │ │ │ │ │ │ return j1.v.perp2() > j2.v.perp2(); │ │ │ │ │ │ 00069 │ │ │ │ │ │ 00070 } │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.46 split_merge.cpp │ │ │ │ │ │ - │ │ │ │ │ │ 00071 │ │ │ │ │ │ 00072 │ │ │ │ │ │ 00073 /******************************************************** │ │ │ │ │ │ 00074 * Csplit_merge_ptcomparison implementation │ │ │ │ │ │ * │ │ │ │ │ │ 00075 * This deals with the ordering of the jets candidates * │ │ │ │ │ │ 00076 ********************************************************/ │ │ │ │ │ │ @@ -25513,152 +25505,152 @@ │ │ │ │ │ │ 00087 // │ │ │ │ │ │ 00088 // NB: there is a potential issue in momentum-conserving events, │ │ │ │ │ │ 00089 // whereby the harder of two jets becomes ill-defined when a soft │ │ │ │ │ │ 00090 // particle is emitted --- this may have a knock-on effect on │ │ │ │ │ │ 00091 // subsequent split-merge steps in cases with sufficiently large R │ │ │ │ │ │ 00092 // (but we don’t know what the limit is...) │ │ │ │ │ │ 00093 //-----------------------------------------------------------------00094 bool Csplit_merge_ptcomparison::operator ()(const Cjet &jet1, const Cjet &jet2) const{ │ │ │ │ │ │ -00095 │ │ │ │ │ │ double q1, q2; │ │ │ │ │ │ +00095 │ │ │ │ │ │ 00096 │ │ │ │ │ │ -// compute the value for comparison for both jets │ │ │ │ │ │ 00097 │ │ │ │ │ │ +// compute the value for comparison for both jets │ │ │ │ │ │ 00098 │ │ │ │ │ │ // This depends on the choice of variable (mt is the default) │ │ │ │ │ │ 00099 │ │ │ │ │ │ q1 = jet1.sm_var2; │ │ │ │ │ │ 00100 │ │ │ │ │ │ q2 = jet2.sm_var2; │ │ │ │ │ │ 00101 │ │ │ │ │ │ bool res = q1 > q2; │ │ │ │ │ │ 00102 │ │ │ │ │ │ 00103 │ │ │ │ │ │ -// if we enable the refined version of the comparison (see defines.h), │ │ │ │ │ │ 00104 │ │ │ │ │ │ +// if we enable the refined version of the comparison (see defines.h), │ │ │ │ │ │ 00105 │ │ │ │ │ │ // we compute the difference more precisely when the two jets are very │ │ │ │ │ │ 00106 │ │ │ │ │ │ // close in the ordering variable. │ │ │ │ │ │ 00107 #ifdef EPSILON_SPLITMERGE │ │ │ │ │ │ 00108 │ │ │ │ │ │ if ( (fabs(q1-q2) < EPSILON_SPLITMERGE*max(q1,q2)) && │ │ │ │ │ │ 00109 │ │ │ │ │ │ (jet1.v.ref != jet2.v.ref) ) { │ │ │ │ │ │ // get the momentum of the difference │ │ │ │ │ │ 00110 │ │ │ │ │ │ 00111 │ │ │ │ │ │ Cmomentum difference; │ │ │ │ │ │ -00112 │ │ │ │ │ │ double pt_tilde_difference; │ │ │ │ │ │ +00112 │ │ │ │ │ │ 00113 │ │ │ │ │ │ get_difference(jet1,jet2,&difference,&pt_tilde_difference); │ │ │ │ │ │ 00114 │ │ │ │ │ │ -// use the following relation: pt1^2 - pt2^2 = (pt1+pt2)*(pt1-pt2) │ │ │ │ │ │ 00115 │ │ │ │ │ │ +// use the following relation: pt1^2 - pt2^2 = (pt1+pt2)*(pt1-pt2) │ │ │ │ │ │ 00116 │ │ │ │ │ │ double qdiff; │ │ │ │ │ │ 00117 │ │ │ │ │ │ Cmomentum sum = jet1.v ; │ │ │ │ │ │ 00118 │ │ │ │ │ │ sum += jet2.v; │ │ │ │ │ │ -00119 │ │ │ │ │ │ double pt_tilde_sum = jet1.pt_tilde + jet2.pt_tilde; │ │ │ │ │ │ +00119 │ │ │ │ │ │ 00120 │ │ │ │ │ │ // depending on the choice of ordering variable, set the result │ │ │ │ │ │ 00121 │ │ │ │ │ │ 00122 │ │ │ │ │ │ switch (split_merge_scale){ │ │ │ │ │ │ 00123 │ │ │ │ │ │ case SM_mt: │ │ │ │ │ │ 00124 │ │ │ │ │ │ qdiff = sum.E*difference.E - sum.pz*difference.pz; │ │ │ │ │ │ break; │ │ │ │ │ │ 00125 │ │ │ │ │ │ -00126 │ │ │ │ │ │ case SM_pt: │ │ │ │ │ │ +00126 │ │ │ │ │ │ 00127 │ │ │ │ │ │ qdiff = sum.px*difference.px + sum.py*difference.py; │ │ │ │ │ │ break; │ │ │ │ │ │ 00128 │ │ │ │ │ │ -case SM_pttilde: │ │ │ │ │ │ 00129 │ │ │ │ │ │ +case SM_pttilde: │ │ │ │ │ │ 00130 │ │ │ │ │ │ qdiff = pt_tilde_sum*pt_tilde_difference; │ │ │ │ │ │ -00131 │ │ │ │ │ │ break; │ │ │ │ │ │ -case SM_Et: │ │ │ │ │ │ +00131 │ │ │ │ │ │ 00132 │ │ │ │ │ │ -00133 │ │ │ │ │ │ +case SM_Et: │ │ │ │ │ │ // diff = E^2 (dpt^2 pz^2- pt^2 dpz^2) │ │ │ │ │ │ +00133 │ │ │ │ │ │ 00134 │ │ │ │ │ │ // │ │ │ │ │ │ + dE^2 (pt^2+pz^2) pt2^2 │ │ │ │ │ │ 00135 │ │ │ │ │ │ // where, unless explicitely specified the variables │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +279 │ │ │ │ │ │ + │ │ │ │ │ │ + 280 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00136 │ │ │ │ │ │ // refer to the first jet or differences jet1-jet2. │ │ │ │ │ │ 00137 │ │ │ │ │ │ qdiff = jet1.v.E*jet1.v.E* │ │ │ │ │ │ 00138 │ │ │ │ │ │ ((sum.px*difference.px + sum.py*difference.py)*jet1.v.pz*jet1.v.pz │ │ │ │ │ │ 00139 │ │ │ │ │ │ -jet1.v.perp2()*sum.pz*difference.pz) │ │ │ │ │ │ 00140 │ │ │ │ │ │ +sum.E*difference.E*(jet1.v.perp2()+jet1.v.pz*jet1.v.pz)*jet2.v.perp2(); │ │ │ │ │ │ -break; │ │ │ │ │ │ 00141 │ │ │ │ │ │ -00142 │ │ │ │ │ │ +break; │ │ │ │ │ │ default: │ │ │ │ │ │ -throw Csiscone_error("Unsupported split-merge scale choice: " │ │ │ │ │ │ +00142 │ │ │ │ │ │ 00143 │ │ │ │ │ │ +throw Csiscone_error("Unsupported split-merge scale choice: " │ │ │ │ │ │ 00144 │ │ │ │ │ │ + SM_scale_name()); │ │ │ │ │ │ 00145 │ │ │ │ │ │ } │ │ │ │ │ │ 00146 │ │ │ │ │ │ res = qdiff > 0; │ │ │ │ │ │ 00147 │ │ │ │ │ │ } │ │ │ │ │ │ 00148 #endif // EPSILON_SPLITMERGE │ │ │ │ │ │ 00149 │ │ │ │ │ │ -return res; │ │ │ │ │ │ 00150 │ │ │ │ │ │ +return res; │ │ │ │ │ │ 00151 } │ │ │ │ │ │ 00152 │ │ │ │ │ │ 00153 │ │ │ │ │ │ 00156 std::string split_merge_scale_name(Esplit_merge_scale sms) { │ │ │ │ │ │ 00157 │ │ │ │ │ │ switch(sms) { │ │ │ │ │ │ case SM_pt: │ │ │ │ │ │ 00158 │ │ │ │ │ │ 00159 │ │ │ │ │ │ return "pt (IR unsafe)"; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -279 │ │ │ │ │ │ - │ │ │ │ │ │ - 280 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00160 │ │ │ │ │ │ case SM_Et: │ │ │ │ │ │ return "Et (boost dep.)"; │ │ │ │ │ │ 00161 │ │ │ │ │ │ 00162 │ │ │ │ │ │ case SM_mt: │ │ │ │ │ │ return "mt (IR safe except for pairs of identical decayed heavy particles)"; │ │ │ │ │ │ 00163 │ │ │ │ │ │ 00164 │ │ │ │ │ │ case SM_pttilde: │ │ │ │ │ │ -00165 │ │ │ │ │ │ return "pttilde (scalar sum of pt’s)"; │ │ │ │ │ │ -default: │ │ │ │ │ │ +00165 │ │ │ │ │ │ 00166 │ │ │ │ │ │ +default: │ │ │ │ │ │ 00167 │ │ │ │ │ │ return "[SM scale without a name]"; │ │ │ │ │ │ 00168 │ │ │ │ │ │ } │ │ │ │ │ │ 00169 } │ │ │ │ │ │ 00170 │ │ │ │ │ │ 00171 │ │ │ │ │ │ @@ -25682,22 +25674,22 @@ │ │ │ │ │ │ 00183 │ │ │ │ │ │ i1=i2=0; │ │ │ │ │ │ 00184 │ │ │ │ │ │ *v = Cmomentum(); │ │ │ │ │ │ 00185 │ │ │ │ │ │ *pt_tilde = 0.0; │ │ │ │ │ │ 00186 │ │ │ │ │ │ -// compute overlap │ │ │ │ │ │ 00187 │ │ │ │ │ │ +// compute overlap │ │ │ │ │ │ 00188 │ │ │ │ │ │ // at the same time, we store union in indices │ │ │ │ │ │ 00189 │ │ │ │ │ │ do{ │ │ │ │ │ │ -00190 │ │ │ │ │ │ if (j1.contents[i1]==j2.contents[i2]) { │ │ │ │ │ │ +00190 │ │ │ │ │ │ 00191 │ │ │ │ │ │ i1++; │ │ │ │ │ │ 00192 │ │ │ │ │ │ i2++; │ │ │ │ │ │ 00193 │ │ │ │ │ │ } else if (j1.contents[i1](ptcomparison)); │ │ │ │ │ │ 00240 │ │ │ │ │ │ -// no hardest cut (col-unsafe) │ │ │ │ │ │ 00241 │ │ │ │ │ │ +// no hardest cut (col-unsafe) │ │ │ │ │ │ 00242 │ │ │ │ │ │ SM_var2_hardest_cut_off = -numeric_limits::max(); │ │ │ │ │ │ 00243 │ │ │ │ │ │ // no pt cutoff for the particles to put in p_uncol_hard │ │ │ │ │ │ 00244 │ │ │ │ │ │ 00245 │ │ │ │ │ │ stable_cone_soft_pt2_cutoff = -1.0; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.46 split_merge.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -281 │ │ │ │ │ │ - │ │ │ │ │ │ 00246 │ │ │ │ │ │ // no pt-weighted splitting │ │ │ │ │ │ 00247 │ │ │ │ │ │ 00248 │ │ │ │ │ │ use_pt_weighted_splitting = false; │ │ │ │ │ │ 00249 } │ │ │ │ │ │ 00250 │ │ │ │ │ │ @@ -25827,51 +25819,51 @@ │ │ │ │ │ │ 00270 │ │ │ │ │ │ 00271 // initialisation function for particle list │ │ │ │ │ │ 00272 // - _particles list of particles │ │ │ │ │ │ 00273 //------------------------------------------------------------00274 int Csplit_merge::init_particles(vector &_particles){ │ │ │ │ │ │ 00275 │ │ │ │ │ │ full_clear(); │ │ │ │ │ │ 00276 │ │ │ │ │ │ -// compute the list of particles │ │ │ │ │ │ 00277 │ │ │ │ │ │ +// compute the list of particles │ │ │ │ │ │ 00278 │ │ │ │ │ │ // here, we do not need to throw away particles │ │ │ │ │ │ 00279 │ │ │ │ │ │ // with infinite rapidity (colinear with the beam) │ │ │ │ │ │ 00280 │ │ │ │ │ │ particles = _particles; │ │ │ │ │ │ 00281 │ │ │ │ │ │ n = particles.size(); │ │ │ │ │ │ 00282 │ │ │ │ │ │ -// build the vector of particles’ pt │ │ │ │ │ │ 00283 │ │ │ │ │ │ +// build the vector of particles’ pt │ │ │ │ │ │ 00284 │ │ │ │ │ │ pt.resize(n); │ │ │ │ │ │ 00285 │ │ │ │ │ │ for (int i=0;i p_sorted; │ │ │ │ │ │ bool collinear; │ │ │ │ │ │ 00409 │ │ │ │ │ │ -00410 │ │ │ │ │ │ double dphi; │ │ │ │ │ │ +00410 │ │ │ │ │ │ 00411 │ │ │ │ │ │ 00412 │ │ │ │ │ │ p_uncol_hard.clear(); │ │ │ │ │ │ 00413 │ │ │ │ │ │ 00414 │ │ │ │ │ │ // we first sort the particles according to their rapidity │ │ │ │ │ │ 00415 │ │ │ │ │ │ for (i=0;iM_PI) dphi = twopi-dphi; │ │ │ │ │ │ -if (dphi *protocones, double R2, double ptmin){ │ │ │ │ │ │ -int i; │ │ │ │ │ │ 00461 │ │ │ │ │ │ +int i; │ │ │ │ │ │ 00462 │ │ │ │ │ │ Cmomentum *c; │ │ │ │ │ │ 00463 │ │ │ │ │ │ Cmomentum *v; │ │ │ │ │ │ 00464 │ │ │ │ │ │ double eta, phi; │ │ │ │ │ │ double dx, dy; │ │ │ │ │ │ 00465 │ │ │ │ │ │ 00466 │ │ │ │ │ │ double R; │ │ │ │ │ │ 00467 │ │ │ │ │ │ Cjet jet; │ │ │ │ │ │ 00468 │ │ │ │ │ │ -00469 │ │ │ │ │ │ if (protocones->size()==0) │ │ │ │ │ │ -return 1; │ │ │ │ │ │ +00469 │ │ │ │ │ │ 00470 │ │ │ │ │ │ +return 1; │ │ │ │ │ │ 00471 │ │ │ │ │ │ 00472 │ │ │ │ │ │ pt_min2 = ptmin*ptmin; │ │ │ │ │ │ 00473 │ │ │ │ │ │ R = sqrt(R2); │ │ │ │ │ │ 00474 │ │ │ │ │ │ -// browse protocones │ │ │ │ │ │ 00475 │ │ │ │ │ │ +// browse protocones │ │ │ │ │ │ 00476 │ │ │ │ │ │ // for each of them, build the list of particles in them │ │ │ │ │ │ 00477 │ │ │ │ │ │ for (vector::iterator p_it = protocones->begin();p_it != protocones->end();p_it++){ │ │ │ │ │ │ 00478 │ │ │ │ │ │ // initialise variables │ │ │ │ │ │ 00479 │ │ │ │ │ │ c = &(*p_it); │ │ │ │ │ │ 00480 │ │ │ │ │ │ -// note: cones have been tested => their (eta,phi) coordinates are computed │ │ │ │ │ │ 00481 │ │ │ │ │ │ +// note: cones have been tested => their (eta,phi) coordinates are computed │ │ │ │ │ │ 00482 │ │ │ │ │ │ eta = c->eta; │ │ │ │ │ │ 00483 │ │ │ │ │ │ phi = c->phi; │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 284 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00484 │ │ │ │ │ │ -00485 │ │ │ │ │ │ // browse particles to create cone contents │ │ │ │ │ │ +00485 │ │ │ │ │ │ 00486 │ │ │ │ │ │ // note that jet is always initialised with default values at this level │ │ │ │ │ │ 00487 │ │ │ │ │ │ jet.v = Cmomentum(); │ │ │ │ │ │ 00488 │ │ │ │ │ │ jet.pt_tilde=0; │ │ │ │ │ │ 00489 │ │ │ │ │ │ @@ -26232,21 +26231,14 @@ │ │ │ │ │ │ jet.pt_tilde+= pt[v->parent_index]; │ │ │ │ │ │ 00503 │ │ │ │ │ │ v->index=0; │ │ │ │ │ │ 00504 │ │ │ │ │ │ } │ │ │ │ │ │ 00505 │ │ │ │ │ │ } │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 284 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00506 │ │ │ │ │ │ jet.n=jet.contents.size(); │ │ │ │ │ │ 00507 │ │ │ │ │ │ // set the momentum in protocones │ │ │ │ │ │ 00508 │ │ │ │ │ │ 00509 │ │ │ │ │ │ // (it was only known through eta and phi up to now) │ │ │ │ │ │ @@ -26261,46 +26253,46 @@ │ │ │ │ │ │ 00514 │ │ │ │ │ │ 00515 │ │ │ │ │ │ jet.range=Ceta_phi_range(eta,phi,R); │ │ │ │ │ │ 00516 │ │ │ │ │ │ 00517 #ifdef DEBUG_SPLIT_MERGE │ │ │ │ │ │ 00518 │ │ │ │ │ │ cout « "adding jet: "; │ │ │ │ │ │ -for (int i2=0;i2 *protocones, double R2, double │ │ │ │ │ │ ptmin){ │ │ │ │ │ │ 00572 │ │ │ │ │ │ int i; │ │ │ │ │ │ 00573 │ │ │ │ │ │ 00574 │ │ │ │ │ │ Cmomentum *c; │ │ │ │ │ │ 00575 │ │ │ │ │ │ Cmomentum *v; │ │ │ │ │ │ 00576 │ │ │ │ │ │ double eta, phi; │ │ │ │ │ │ -double dx, dy; │ │ │ │ │ │ 00577 │ │ │ │ │ │ -00578 │ │ │ │ │ │ +double dx, dy; │ │ │ │ │ │ double R; │ │ │ │ │ │ +00578 │ │ │ │ │ │ 00579 │ │ │ │ │ │ Cjet jet, jet_candidate; │ │ │ │ │ │ -bool found_jet = false; │ │ │ │ │ │ 00580 │ │ │ │ │ │ +bool found_jet = false; │ │ │ │ │ │ 00581 │ │ │ │ │ │ if (protocones->size()==0) │ │ │ │ │ │ 00582 │ │ │ │ │ │ -00583 │ │ │ │ │ │ return 1; │ │ │ │ │ │ +00583 │ │ │ │ │ │ 00584 │ │ │ │ │ │ 00585 │ │ │ │ │ │ pt_min2 = ptmin*ptmin; │ │ │ │ │ │ 00586 │ │ │ │ │ │ R = sqrt(R2); │ │ │ │ │ │ 00587 │ │ │ │ │ │ -// browse protocones │ │ │ │ │ │ 00588 │ │ │ │ │ │ +// browse protocones │ │ │ │ │ │ 00589 │ │ │ │ │ │ // for each of them, build the list of particles in them │ │ │ │ │ │ 00590 │ │ │ │ │ │ for (vector::iterator p_it = protocones->begin();p_it != protocones->end();p_it++){ │ │ │ │ │ │ 00591 │ │ │ │ │ │ // initialise variables │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.46 split_merge.cpp │ │ │ │ │ │ - │ │ │ │ │ │ 00592 │ │ │ │ │ │ c = &(*p_it); │ │ │ │ │ │ 00593 │ │ │ │ │ │ // note: cones have been tested => their (eta,phi) coordinates are computed │ │ │ │ │ │ 00594 │ │ │ │ │ │ 00595 │ │ │ │ │ │ eta = c->eta; │ │ │ │ │ │ @@ -26409,16 +26403,16 @@ │ │ │ │ │ │ // browse particles to create cone contents │ │ │ │ │ │ 00602 │ │ │ │ │ │ jet_candidate.v = Cmomentum(); │ │ │ │ │ │ 00603 │ │ │ │ │ │ jet_candidate.pt_tilde=0; │ │ │ │ │ │ 00604 │ │ │ │ │ │ jet_candidate.contents.clear(); │ │ │ │ │ │ -for (i=0;ieta; │ │ │ │ │ │ 00611 │ │ │ │ │ │ dy = fabs(phi - v->phi); │ │ │ │ │ │ if (dy>M_PI) │ │ │ │ │ │ 00612 │ │ │ │ │ │ 00613 │ │ │ │ │ │ dy -= twopi; │ │ │ │ │ │ -00614 │ │ │ │ │ │ if (dx*dx+dy*dyparent_index); │ │ │ │ │ │ 00616 │ │ │ │ │ │ jet_candidate.v+= *v; │ │ │ │ │ │ 00617 │ │ │ │ │ │ jet_candidate.pt_tilde+= pt[v->parent_index]; │ │ │ │ │ │ 00618 │ │ │ │ │ │ @@ -26455,25 +26449,25 @@ │ │ │ │ │ │ 00625 │ │ │ │ │ │ *c = jet_candidate.v; │ │ │ │ │ │ 00626 │ │ │ │ │ │ c->eta = eta; // restore exact original coords │ │ │ │ │ │ 00627 │ │ │ │ │ │ c->phi = phi; // to avoid rounding error inconsistencies │ │ │ │ │ │ 00628 │ │ │ │ │ │ -// set the jet range │ │ │ │ │ │ 00629 │ │ │ │ │ │ +// set the jet range │ │ │ │ │ │ 00630 │ │ │ │ │ │ jet_candidate.range=Ceta_phi_range(eta,phi,R); │ │ │ │ │ │ 00631 │ │ │ │ │ │ // check that the protojet has large enough pt │ │ │ │ │ │ 00632 │ │ │ │ │ │ 00633 │ │ │ │ │ │ if (jet_candidate.v.perp2()is_larger(jet_candidate, jet) │ │ │ │ │ │ 00649 │ │ │ │ │ │ : ptcomparison(jet_candidate, jet))){ │ │ │ │ │ │ 00650 │ │ │ │ │ │ @@ -26507,14 +26501,21 @@ │ │ │ │ │ │ 00653 │ │ │ │ │ │ } │ │ │ │ │ │ 00654 │ │ │ │ │ │ // make sure at least one of the jets has passed the selection │ │ │ │ │ │ 00655 │ │ │ │ │ │ 00656 │ │ │ │ │ │ if (!found_jet) return 1; │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 286 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00657 │ │ │ │ │ │ // add the jet to the list of jets │ │ │ │ │ │ 00658 │ │ │ │ │ │ 00659 │ │ │ │ │ │ jets.push_back(jet); │ │ │ │ │ │ 00660 │ │ │ │ │ │ jets[jets.size()-1].v.build_etaphi(); │ │ │ │ │ │ @@ -26524,43 +26525,34 @@ │ │ │ │ │ │ cout « "PR-Jet " « jets.size() « " [size " « jet.contents.size() « "]:"; │ │ │ │ │ │ 00664 #endif │ │ │ │ │ │ 00665 │ │ │ │ │ │ 00666 │ │ │ │ │ │ // update the list of what particles are left │ │ │ │ │ │ 00667 │ │ │ │ │ │ int p_remain_index = 0; │ │ │ │ │ │ -00668 │ │ │ │ │ │ int contents_index = 0; │ │ │ │ │ │ -//sort(next_jet.contents.begin(),next_jet.contents.end()); │ │ │ │ │ │ +00668 │ │ │ │ │ │ 00669 │ │ │ │ │ │ +//sort(next_jet.contents.begin(),next_jet.contents.end()); │ │ │ │ │ │ 00670 │ │ │ │ │ │ for (int index=0;indexsize()>0){ │ │ │ │ │ │ 00742 │ │ │ │ │ │ 00743 │ │ │ │ │ │ // browse for the first jet │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.46 split_merge.cpp │ │ │ │ │ │ + │ │ │ │ │ │ 00744 │ │ │ │ │ │ j1 = candidates->begin(); │ │ │ │ │ │ 00745 │ │ │ │ │ │ -00746 │ │ │ │ │ │ // if hardest jet does not pass threshold then nothing else will │ │ │ │ │ │ +00746 │ │ │ │ │ │ 00747 │ │ │ │ │ │ // either so one stops the split merge. │ │ │ │ │ │ 00748 │ │ │ │ │ │ if (j1->sm_var2end()){ │ │ │ │ │ │ +00755 │ │ │ │ │ │ 00756 #ifdef DEBUG_SPLIT_MERGE │ │ │ │ │ │ 00757 │ │ │ │ │ │ show(); │ │ │ │ │ │ 00758 #endif │ │ │ │ │ │ 00759 │ │ │ │ │ │ // check overlapping │ │ │ │ │ │ 00760 │ │ │ │ │ │ if (get_overlap(*j1, *j2, &overlap2)){ │ │ │ │ │ │ -// check if overlapping energy passes threshold │ │ │ │ │ │ 00761 │ │ │ │ │ │ +// check if overlapping energy passes threshold │ │ │ │ │ │ 00762 │ │ │ │ │ │ // Note that this depends on the ordering variable │ │ │ │ │ │ 00763 #ifdef DEBUG_SPLIT_MERGE │ │ │ │ │ │ 00764 │ │ │ │ │ │ cout « "overlap between cdt 1 and cdt " « j2_relindex+1 « " with overlap " │ │ │ │ │ │ 00765 │ │ │ │ │ │ « sqrt(overlap2/j2->sm_var2) « endl«endl; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.46 split_merge.cpp │ │ │ │ │ │ - │ │ │ │ │ │ 00766 #endif │ │ │ │ │ │ 00767 │ │ │ │ │ │ if (overlap2sm_var2){ │ │ │ │ │ │ 00768 │ │ │ │ │ │ // split jets │ │ │ │ │ │ 00769 │ │ │ │ │ │ split(j1, j2); │ │ │ │ │ │ 00770 │ │ │ │ │ │ -00771 │ │ │ │ │ │ // update iterators │ │ │ │ │ │ +00771 │ │ │ │ │ │ 00772 │ │ │ │ │ │ j2 = j1 = candidates->begin(); │ │ │ │ │ │ 00773 │ │ │ │ │ │ j2_relindex = 0; │ │ │ │ │ │ 00774 │ │ │ │ │ │ } else { │ │ │ │ │ │ 00775 │ │ │ │ │ │ @@ -26735,31 +26727,31 @@ │ │ │ │ │ │ j2 = j1 = candidates->begin(); │ │ │ │ │ │ 00780 │ │ │ │ │ │ j2_relindex = 0; │ │ │ │ │ │ 00781 │ │ │ │ │ │ } │ │ │ │ │ │ 00782 │ │ │ │ │ │ } │ │ │ │ │ │ -00783 │ │ │ │ │ │ // watch out: split/merge might have caused new jets with pt < │ │ │ │ │ │ +00783 │ │ │ │ │ │ 00784 │ │ │ │ │ │ // ptmin to disappear, so the total number of jets may │ │ │ │ │ │ 00785 │ │ │ │ │ │ // have changed by more than expected and j2 might already by │ │ │ │ │ │ 00786 │ │ │ │ │ │ // the end of the candidates list... │ │ │ │ │ │ 00787 │ │ │ │ │ │ j2_relindex++; │ │ │ │ │ │ -00788 │ │ │ │ │ │ if (j2 != candidates->end()) j2++; │ │ │ │ │ │ +00788 │ │ │ │ │ │ 00789 │ │ │ │ │ │ } // end of loop on the second jet │ │ │ │ │ │ 00790 │ │ │ │ │ │ -if (j1 != candidates->end()) { │ │ │ │ │ │ 00791 │ │ │ │ │ │ +if (j1 != candidates->end()) { │ │ │ │ │ │ 00792 │ │ │ │ │ │ // all "second jet" passed without overlapping │ │ │ │ │ │ 00793 │ │ │ │ │ │ // (otherwise we won’t leave the j2 loop) │ │ │ │ │ │ 00794 │ │ │ │ │ │ // => store jet 1 as real jet │ │ │ │ │ │ 00795 │ │ │ │ │ │ @@ -26793,16 +26785,16 @@ │ │ │ │ │ │ 00811 │ │ │ │ │ │ } │ │ │ │ │ │ 00812 │ │ │ │ │ │ } │ │ │ │ │ │ 00813 │ │ │ │ │ │ } while (candidates->size()>0); │ │ │ │ │ │ 00814 │ │ │ │ │ │ -00815 │ │ │ │ │ │ // sort jets by pT │ │ │ │ │ │ +00815 │ │ │ │ │ │ 00816 │ │ │ │ │ │ sort(jets.begin(), jets.end(), jets_pt_less); │ │ │ │ │ │ 00817 #ifdef DEBUG_SPLIT_MERGE │ │ │ │ │ │ 00818 │ │ │ │ │ │ show(); │ │ │ │ │ │ 00819 #endif │ │ │ │ │ │ 00820 │ │ │ │ │ │ @@ -26816,16 +26808,25 @@ │ │ │ │ │ │ 00827 // - flux │ │ │ │ │ │ stream used to save jet contents │ │ │ │ │ │ 00828 //-------------------------------------------00829 int Csplit_merge::save_contents(FILE *flux){ │ │ │ │ │ │ 00830 │ │ │ │ │ │ jet_iterator it_j; │ │ │ │ │ │ 00831 │ │ │ │ │ │ Cjet *j1; │ │ │ │ │ │ -int i1, i2; │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +287 │ │ │ │ │ │ + │ │ │ │ │ │ + 288 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00832 │ │ │ │ │ │ +int i1, i2; │ │ │ │ │ │ 00833 │ │ │ │ │ │ 00834 │ │ │ │ │ │ fprintf(flux, "# %d jets found\n", (int) jets.size()); │ │ │ │ │ │ 00835 │ │ │ │ │ │ fprintf(flux, "# columns are: eta, phi, pt and number of particles for each jet\n"); │ │ │ │ │ │ 00836 │ │ │ │ │ │ for (it_j = jets.begin(), i1=0 ; it_j != jets.end() ; it_j++, i1++){ │ │ │ │ │ │ @@ -26840,55 +26841,46 @@ │ │ │ │ │ │ 00841 │ │ │ │ │ │ } │ │ │ │ │ │ 00842 │ │ │ │ │ │ 00843 │ │ │ │ │ │ fprintf(flux, "# jet contents\n"); │ │ │ │ │ │ 00844 │ │ │ │ │ │ fprintf(flux, "# columns are: eta, phi, pt, particle index and jet number\n"); │ │ │ │ │ │ -00845 │ │ │ │ │ │ for (it_j = jets.begin(), i1=0 ; it_j != jets.end() ; it_j++, i1++){ │ │ │ │ │ │ +00845 │ │ │ │ │ │ 00846 │ │ │ │ │ │ j1 = &(*it_j); │ │ │ │ │ │ for (i2=0;i2n;i2++) │ │ │ │ │ │ 00847 │ │ │ │ │ │ 00848 │ │ │ │ │ │ fprintf(flux, "%f\t%f\t%e\t%d\t%d\n", │ │ │ │ │ │ 00849 │ │ │ │ │ │ particles[j1->contents[i2]].eta, particles[j1->contents[i2]].phi, │ │ │ │ │ │ 00850 │ │ │ │ │ │ particles[j1->contents[i2]].perp(), j1->contents[i2], i1); │ │ │ │ │ │ 00851 │ │ │ │ │ │ } │ │ │ │ │ │ 00852 │ │ │ │ │ │ -return 0; │ │ │ │ │ │ 00853 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -287 │ │ │ │ │ │ - │ │ │ │ │ │ - 288 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ +return 0; │ │ │ │ │ │ 00854 } │ │ │ │ │ │ 00855 │ │ │ │ │ │ 00856 │ │ │ │ │ │ 00857 // show current jets/candidate status │ │ │ │ │ │ 00858 //-----------------------------------00859 int Csplit_merge::show(){ │ │ │ │ │ │ 00860 │ │ │ │ │ │ jet_iterator it_j; │ │ │ │ │ │ 00861 │ │ │ │ │ │ cjet_iterator it_c; │ │ │ │ │ │ 00862 │ │ │ │ │ │ Cjet *j; │ │ │ │ │ │ 00863 │ │ │ │ │ │ const Cjet *c; │ │ │ │ │ │ -00864 │ │ │ │ │ │ int i1, i2; │ │ │ │ │ │ +00864 │ │ │ │ │ │ 00865 │ │ │ │ │ │ for (it_j = jets.begin(), i1=0 ; it_j != jets.end() ; it_j++, i1++){ │ │ │ │ │ │ 00866 │ │ │ │ │ │ 00867 │ │ │ │ │ │ j = &(*it_j); │ │ │ │ │ │ 00868 │ │ │ │ │ │ fprintf(stdout, "jet %2d: %e\t%e\t%e\t%e\t", i1+1, │ │ │ │ │ │ @@ -26918,33 +26910,33 @@ │ │ │ │ │ │ 00881 │ │ │ │ │ │ fprintf(stdout, "\n"); │ │ │ │ │ │ 00882 │ │ │ │ │ │ } │ │ │ │ │ │ 00883 │ │ │ │ │ │ 00884 │ │ │ │ │ │ fprintf(stdout, "\n"); │ │ │ │ │ │ -00885 │ │ │ │ │ │ return 0; │ │ │ │ │ │ +00885 │ │ │ │ │ │ 00886 } │ │ │ │ │ │ 00887 │ │ │ │ │ │ 00888 │ │ │ │ │ │ 00889 // get the overlap between 2 jets │ │ │ │ │ │ 00890 // - j1 │ │ │ │ │ │ first jet │ │ │ │ │ │ 00891 // - j2 │ │ │ │ │ │ second jet │ │ │ │ │ │ 00892 // - overlap2 returned overlap^2 (determined by the choice of SM variable) │ │ │ │ │ │ 00893 // return true if overlapping, false if disjoint │ │ │ │ │ │ 00894 //--------------------------------------------------------------------00895 bool Csplit_merge::get_overlap(const Cjet &j1, const Cjet &j2, double *overlap2){ │ │ │ │ │ │ -00896 │ │ │ │ │ │ // check if ranges overlap │ │ │ │ │ │ +00896 │ │ │ │ │ │ 00897 │ │ │ │ │ │ if (!is_range_overlap(j1.range,j2.range)) │ │ │ │ │ │ -return false; │ │ │ │ │ │ 00898 │ │ │ │ │ │ +return false; │ │ │ │ │ │ 00899 │ │ │ │ │ │ int i1,i2; │ │ │ │ │ │ 00900 │ │ │ │ │ │ 00901 │ │ │ │ │ │ bool is_overlap; │ │ │ │ │ │ 00902 │ │ │ │ │ │ // initialise │ │ │ │ │ │ @@ -26954,34 +26946,39 @@ │ │ │ │ │ │ 00905 │ │ │ │ │ │ is_overlap = false; │ │ │ │ │ │ 00906 │ │ │ │ │ │ Cmomentum v; │ │ │ │ │ │ double pt_tilde=0.0; │ │ │ │ │ │ 00907 │ │ │ │ │ │ 00908 │ │ │ │ │ │ -00909 │ │ │ │ │ │ // compute overlap │ │ │ │ │ │ +00909 │ │ │ │ │ │ 00910 │ │ │ │ │ │ // at the same time, we store union in indices │ │ │ │ │ │ 00911 │ │ │ │ │ │ do{ │ │ │ │ │ │ -if (j1.contents[i1]j2.contents[i2]){ │ │ │ │ │ │ 00916 │ │ │ │ │ │ indices[idx_size] = j2.contents[i2]; │ │ │ │ │ │ 00917 │ │ │ │ │ │ i2++; │ │ │ │ │ │ 00918 │ │ │ │ │ │ } else { // (j1.contents[i1]==j2.contents[i2]) │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.46 split_merge.cpp │ │ │ │ │ │ + │ │ │ │ │ │ 00919 │ │ │ │ │ │ v += particles[j1.contents[i1]]; │ │ │ │ │ │ 00920 │ │ │ │ │ │ pt_tilde += pt[j1.contents[i1]]; │ │ │ │ │ │ 00921 │ │ │ │ │ │ indices[idx_size] = j1.contents[i1]; │ │ │ │ │ │ 00922 │ │ │ │ │ │ @@ -26993,22 +26990,22 @@ │ │ │ │ │ │ 00925 │ │ │ │ │ │ } │ │ │ │ │ │ 00926 │ │ │ │ │ │ idx_size++; │ │ │ │ │ │ 00927 │ │ │ │ │ │ } while ((i1" all over the place │ │ │ │ │ │ 00970 │ │ │ │ │ │ +// shorthand to avoid having "->" all over the place │ │ │ │ │ │ 00971 │ │ │ │ │ │ const Cjet & j1 = * it_j1; │ │ │ │ │ │ -const Cjet & j2 = * it_j2; │ │ │ │ │ │ 00972 │ │ │ │ │ │ +const Cjet & j2 = * it_j2; │ │ │ │ │ │ 00973 │ │ │ │ │ │ 00974 │ │ │ │ │ │ i1=i2=0; │ │ │ │ │ │ 00975 │ │ │ │ │ │ jet2.v = jet1.v = Cmomentum(); │ │ │ │ │ │ 00976 │ │ │ │ │ │ jet2.pt_tilde = jet1.pt_tilde = 0.0; │ │ │ │ │ │ 00977 │ │ │ │ │ │ -00978 │ │ │ │ │ │ // compute centroids │ │ │ │ │ │ +00978 │ │ │ │ │ │ 00979 │ │ │ │ │ │ // When use_pt_weighted_splitting is activated, the │ │ │ │ │ │ 00980 │ │ │ │ │ │ // "geometrical" distance is weighted by the inverse │ │ │ │ │ │ 00981 │ │ │ │ │ │ // of the pt of the protojet │ │ │ │ │ │ 00982 │ │ │ │ │ │ @@ -27116,34 +27108,43 @@ │ │ │ │ │ │ 00995 │ │ │ │ │ │ jet1.v = jet2.v = Cmomentum(); │ │ │ │ │ │ 00996 │ │ │ │ │ │ // compute jet splitting │ │ │ │ │ │ 00997 │ │ │ │ │ │ 00998 │ │ │ │ │ │ do{ │ │ │ │ │ │ -00999 │ │ │ │ │ │ if (j1.contents[i1]eta,v->phi); │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +289 │ │ │ │ │ │ + │ │ │ │ │ │ + 290 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 01007 │ │ │ │ │ │ } else if (j1.contents[i1]>j2.contents[i2]){ │ │ │ │ │ │ -01008 │ │ │ │ │ │ // particle i2 belong only to jet 2 │ │ │ │ │ │ +01008 │ │ │ │ │ │ 01009 │ │ │ │ │ │ v = &(particles[j2.contents[i2]]); │ │ │ │ │ │ 01010 │ │ │ │ │ │ jet2.contents.push_back(j2.contents[i2]); │ │ │ │ │ │ 01011 │ │ │ │ │ │ jet2.v += *v; │ │ │ │ │ │ 01012 │ │ │ │ │ │ @@ -27172,25 +27173,16 @@ │ │ │ │ │ │ 01024 │ │ │ │ │ │ 01025 │ │ │ │ │ │ // distance w.r.t. centroid 2 │ │ │ │ │ │ 01026 │ │ │ │ │ │ dx2 = eta2 - v->eta; │ │ │ │ │ │ 01027 │ │ │ │ │ │ dy2 = fabs(phi2 - v->phi); │ │ │ │ │ │ -01028 │ │ │ │ │ │ if (dy2>M_PI) │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -289 │ │ │ │ │ │ - │ │ │ │ │ │ - 290 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ +01028 │ │ │ │ │ │ 01029 │ │ │ │ │ │ dy2 -= twopi; │ │ │ │ │ │ 01030 │ │ │ │ │ │ //? what when == ? │ │ │ │ │ │ 01031 │ │ │ │ │ │ 01032 │ │ │ │ │ │ // When use_pt_weighted_splitting is activated, the │ │ │ │ │ │ @@ -27205,18 +27197,18 @@ │ │ │ │ │ │ // do bookkeeping on most ambiguous split │ │ │ │ │ │ 01037 │ │ │ │ │ │ 01038 │ │ │ │ │ │ if (fabs(d1sq-d2sq) < most_ambiguous_split) │ │ │ │ │ │ 01039 │ │ │ │ │ │ most_ambiguous_split = fabs(d1sq-d2sq); │ │ │ │ │ │ 01040 │ │ │ │ │ │ -01041 │ │ │ │ │ │ if (d1sqeta,v->phi); │ │ │ │ │ │ 01067 │ │ │ │ │ │ } │ │ │ │ │ │ -while (i2eta,v->phi); │ │ │ │ │ │ 01075 │ │ │ │ │ │ } │ │ │ │ │ │ 01076 │ │ │ │ │ │ -// finalise jets │ │ │ │ │ │ 01077 │ │ │ │ │ │ +// finalise jets │ │ │ │ │ │ 01078 │ │ │ │ │ │ jet1.n = jet1.contents.size(); │ │ │ │ │ │ 01079 │ │ │ │ │ │ jet2.n = jet2.contents.size(); │ │ │ │ │ │ 01080 │ │ │ │ │ │ -//jet1.range = j1.range; │ │ │ │ │ │ 01081 │ │ │ │ │ │ +//jet1.range = j1.range; │ │ │ │ │ │ 01082 │ │ │ │ │ │ //jet2.range = j2.range; │ │ │ │ │ │ 01083 │ │ │ │ │ │ -01084 │ │ │ │ │ │ // remove previous jets │ │ │ │ │ │ +01084 │ │ │ │ │ │ 01085 #ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES │ │ │ │ │ │ 01086 │ │ │ │ │ │ cand_refs.erase(j1.v.ref); │ │ │ │ │ │ 01087 │ │ │ │ │ │ cand_refs.erase(j2.v.ref); │ │ │ │ │ │ 01088 #endif │ │ │ │ │ │ 01089 │ │ │ │ │ │ candidates->erase(it_j1); │ │ │ │ │ │ 01090 │ │ │ │ │ │ candidates->erase(it_j2); │ │ │ │ │ │ 01091 │ │ │ │ │ │ -// reinsert new ones │ │ │ │ │ │ 01092 │ │ │ │ │ │ +// reinsert new ones │ │ │ │ │ │ 01093 │ │ │ │ │ │ insert(jet1); │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.46 split_merge.cpp │ │ │ │ │ │ + │ │ │ │ │ │ 01094 │ │ │ │ │ │ insert(jet2); │ │ │ │ │ │ 01095 │ │ │ │ │ │ -01096 │ │ │ │ │ │ return true; │ │ │ │ │ │ +01096 │ │ │ │ │ │ 01097 } │ │ │ │ │ │ 01098 │ │ │ │ │ │ 01099 // merge the two given jet. │ │ │ │ │ │ 01100 // during this procedure, the jets j1 & j2 are replaced │ │ │ │ │ │ 01101 // by 1 single jets containing both of them. │ │ │ │ │ │ 01102 // - it_j1 iterator of the first jet in ’candidates’ │ │ │ │ │ │ 01103 // - it_j2 iterator of the second jet in ’candidates’ │ │ │ │ │ │ @@ -27336,31 +27333,24 @@ │ │ │ │ │ │ jet.contents.push_back(indices[i]); │ │ │ │ │ │ 01114 │ │ │ │ │ │ jet.v += particles[indices[i]]; │ │ │ │ │ │ 01115 │ │ │ │ │ │ jet.pt_tilde += pt[indices[i]]; │ │ │ │ │ │ 01116 │ │ │ │ │ │ } │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.47 split_merge.h │ │ │ │ │ │ - │ │ │ │ │ │ -291 │ │ │ │ │ │ - │ │ │ │ │ │ 01117 │ │ │ │ │ │ jet.n = jet.contents.size(); │ │ │ │ │ │ 01118 │ │ │ │ │ │ // deal with ranges │ │ │ │ │ │ 01119 │ │ │ │ │ │ 01120 │ │ │ │ │ │ jet.range = range_union(it_j1->range, it_j2->range); │ │ │ │ │ │ 01121 │ │ │ │ │ │ -01122 │ │ │ │ │ │ // remove old candidates │ │ │ │ │ │ +01122 │ │ │ │ │ │ 01123 #ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES │ │ │ │ │ │ 01124 │ │ │ │ │ │ if (merge_identical_protocones){ │ │ │ │ │ │ 01125 │ │ │ │ │ │ cand_refs.erase(it_j1->v.ref); │ │ │ │ │ │ 01126 │ │ │ │ │ │ cand_refs.erase(it_j2->v.ref); │ │ │ │ │ │ @@ -27368,16 +27358,16 @@ │ │ │ │ │ │ } │ │ │ │ │ │ 01128 #endif │ │ │ │ │ │ 01129 │ │ │ │ │ │ candidates->erase(it_j1); │ │ │ │ │ │ 01130 │ │ │ │ │ │ candidates->erase(it_j2); │ │ │ │ │ │ 01131 │ │ │ │ │ │ -// reinsert new candidate │ │ │ │ │ │ 01132 │ │ │ │ │ │ +// reinsert new candidate │ │ │ │ │ │ 01133 │ │ │ │ │ │ insert(jet); │ │ │ │ │ │ 01134 │ │ │ │ │ │ return true; │ │ │ │ │ │ 01135 │ │ │ │ │ │ 01136 } │ │ │ │ │ │ 01137 │ │ │ │ │ │ @@ -27392,114 +27382,112 @@ │ │ │ │ │ │ 01148 #ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES │ │ │ │ │ │ 01149 │ │ │ │ │ │ if ((merge_identical_protocones) && (!cand_refs.insert(jet.v.ref).second)) │ │ │ │ │ │ 01150 │ │ │ │ │ │ return false; │ │ │ │ │ │ 01151 #endif │ │ │ │ │ │ 01152 │ │ │ │ │ │ -01153 │ │ │ │ │ │ // check that the protojet has large enough pt │ │ │ │ │ │ +01153 │ │ │ │ │ │ 01154 │ │ │ │ │ │ if (jet.v.perp2()insert(jet); │ │ │ │ │ │ 01162 │ │ │ │ │ │ -01163 │ │ │ │ │ │ return true; │ │ │ │ │ │ +01163 │ │ │ │ │ │ 01164 } │ │ │ │ │ │ 01165 │ │ │ │ │ │ 01172 double Csplit_merge::get_sm_var2(Cmomentum &v, double &pt_tilde){ │ │ │ │ │ │ 01173 │ │ │ │ │ │ switch(ptcomparison.split_merge_scale) { │ │ │ │ │ │ case SM_pt: │ │ │ │ │ │ return v.perp2(); │ │ │ │ │ │ 01174 │ │ │ │ │ │ 01175 │ │ │ │ │ │ case SM_mt: │ │ │ │ │ │ return v.perpmass2(); │ │ │ │ │ │ -01176 │ │ │ │ │ │ case SM_pttilde: return pt_tilde*pt_tilde; │ │ │ │ │ │ +01176 │ │ │ │ │ │ +01177 │ │ │ │ │ │ case SM_Et: │ │ │ │ │ │ return v.Et2(); │ │ │ │ │ │ -01177 │ │ │ │ │ │ -01178 │ │ │ │ │ │ default: │ │ │ │ │ │ -throw Csiscone_error("Unsupported split-merge scale choice: " │ │ │ │ │ │ +01178 │ │ │ │ │ │ 01179 │ │ │ │ │ │ +throw Csiscone_error("Unsupported split-merge scale choice: " │ │ │ │ │ │ 01180 │ │ │ │ │ │ + ptcomparison.SM_scale_name()); │ │ │ │ │ │ 01181 │ │ │ │ │ │ } │ │ │ │ │ │ 01182 │ │ │ │ │ │ -01183 │ │ │ │ │ │ //return 0.0; │ │ │ │ │ │ +01183 │ │ │ │ │ │ 01184 } │ │ │ │ │ │ 01185 │ │ │ │ │ │ 01186 } │ │ │ │ │ │ │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +291 │ │ │ │ │ │ + │ │ │ │ │ │ + 292 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 5.47 split_merge.h │ │ │ │ │ │ 00001 // -*- C++ -*00003 // File: split_merge.h │ │ │ │ │ │ -00004 // Description: header file for splitting/merging (contains the CJet class) │ │ │ │ │ │ +// │ │ │ │ │ │ +00004 // Description: header file for splitting/merging (contains the CJet class) // │ │ │ │ │ │ 00005 // This file is part of the SISCone project. │ │ │ │ │ │ +// │ │ │ │ │ │ 00006 // WARNING: this is not the main SISCone trunk but │ │ │ │ │ │ +// │ │ │ │ │ │ 00007 // │ │ │ │ │ │ an adaptation to spherical coordinates │ │ │ │ │ │ +// │ │ │ │ │ │ 00008 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ +// │ │ │ │ │ │ 00009 // │ │ │ │ │ │ +// │ │ │ │ │ │ 00010 // Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez │ │ │ │ │ │ 00011 // │ │ │ │ │ │ -00012 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ -00013 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ -00014 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ -00015 // (at your option) any later version. │ │ │ │ │ │ -00016 // │ │ │ │ │ │ -00017 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ -00018 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ -00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ -00020 // GNU General Public License for more details. │ │ │ │ │ │ -00021 // │ │ │ │ │ │ -00022 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ // │ │ │ │ │ │ +00012 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ // │ │ │ │ │ │ +00013 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ // │ │ │ │ │ │ +00014 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ // │ │ │ │ │ │ +00015 // (at your option) any later version. │ │ │ │ │ │ // │ │ │ │ │ │ +00016 // │ │ │ │ │ │ // │ │ │ │ │ │ +00017 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ // │ │ │ │ │ │ +00018 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ // │ │ │ │ │ │ +00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ // │ │ │ │ │ │ +00020 // GNU General Public License for more details. │ │ │ │ │ │ // │ │ │ │ │ │ +00021 // │ │ │ │ │ │ // │ │ │ │ │ │ +00022 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ // │ │ │ │ │ │ - │ │ │ │ │ │ - 292 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00023 // along with this program; if not, write to the Free Software │ │ │ │ │ │ // │ │ │ │ │ │ 00024 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ 00025 // │ │ │ │ │ │ // │ │ │ │ │ │ 00026 // $Revision:: 404 │ │ │ │ │ │ $// │ │ │ │ │ │ @@ -27529,29 +27517,29 @@ │ │ │ │ │ │ CSphjet(); │ │ │ │ │ │ 00060 │ │ │ │ │ │ 00062 │ │ │ │ │ │ ~CSphjet(); │ │ │ │ │ │ 00063 │ │ │ │ │ │ 00064 │ │ │ │ │ │ CSphmomentum v; │ │ │ │ │ │ -double E_tilde; │ │ │ │ │ │ 00065 │ │ │ │ │ │ +double E_tilde; │ │ │ │ │ │ 00066 │ │ │ │ │ │ int n; │ │ │ │ │ │ 00067 │ │ │ │ │ │ std::vector contents; │ │ │ │ │ │ 00068 │ │ │ │ │ │ double sm_var2; │ │ │ │ │ │ 00080 │ │ │ │ │ │ 00081 │ │ │ │ │ │ 00083 │ │ │ │ │ │ CSphtheta_phi_range range; │ │ │ │ │ │ 00084 │ │ │ │ │ │ -int pass; │ │ │ │ │ │ 00089 │ │ │ │ │ │ +int pass; │ │ │ │ │ │ 00090 }; │ │ │ │ │ │ 00091 │ │ │ │ │ │ 00094 │ │ │ │ │ │ 00096 bool jets_E_less(const CSphjet &j1, const CSphjet &j2); │ │ │ │ │ │ 00097 │ │ │ │ │ │ 00098 │ │ │ │ │ │ 00106 enum Esplit_merge_scale { │ │ │ │ │ │ @@ -27576,16 +27564,25 @@ │ │ │ │ │ │ 00127 │ │ │ │ │ │ 00128 │ │ │ │ │ │ 00129 │ │ │ │ │ │ std::vector * particles; │ │ │ │ │ │ 00130 │ │ │ │ │ │ std::vector * particles_norm2; │ │ │ │ │ │ 00131 │ │ │ │ │ │ -00133 │ │ │ │ │ │ bool operator()(const CSphjet &jet1, const CSphjet &jet2) const; │ │ │ │ │ │ +00133 │ │ │ │ │ │ + │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.47 split_merge.h │ │ │ │ │ │ + │ │ │ │ │ │ +293 │ │ │ │ │ │ + │ │ │ │ │ │ 00134 │ │ │ │ │ │ void get_difference(const CSphjet &j1, const CSphjet &j2, CSphmomentum *v, double *E_tilde) const; │ │ │ │ │ │ 00146 │ │ │ │ │ │ 00147 │ │ │ │ │ │ 00158 │ │ │ │ │ │ Esplit_merge_scale split_merge_scale; │ │ │ │ │ │ 00159 }; │ │ │ │ │ │ @@ -27606,185 +27603,175 @@ │ │ │ │ │ │ 00179 │ │ │ │ │ │ 00181 │ │ │ │ │ │ ~CSphsplit_merge(); │ │ │ │ │ │ 00182 │ │ │ │ │ │ 00183 │ │ │ │ │ │ 00185 │ │ │ │ │ │ // initialisation functions // │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.47 split_merge.h │ │ │ │ │ │ - │ │ │ │ │ │ 00187 │ │ │ │ │ │ 00196 │ │ │ │ │ │ +int init(std::vector &_particles, std::vector *protocones, double R2, │ │ │ │ │ │ +double Emin=0.0); │ │ │ │ │ │ 00197 │ │ │ │ │ │ +int init_particles(std::vector &_particles); │ │ │ │ │ │ 00203 │ │ │ │ │ │ 00204 │ │ │ │ │ │ 00208 │ │ │ │ │ │ +int init_pleft(); │ │ │ │ │ │ 00209 │ │ │ │ │ │ +inline int set_E_weighted_splitting(bool _use_E_weighted_splitting){ │ │ │ │ │ │ 00221 │ │ │ │ │ │ 00222 │ │ │ │ │ │ +use_E_weighted_splitting = _use_E_weighted_splitting; │ │ │ │ │ │ +return 0; │ │ │ │ │ │ 00223 │ │ │ │ │ │ 00224 │ │ │ │ │ │ +} │ │ │ │ │ │ 00225 │ │ │ │ │ │ 00227 │ │ │ │ │ │ +// cleaning functions // │ │ │ │ │ │ 00229 │ │ │ │ │ │ 00231 │ │ │ │ │ │ +int partial_clear(); │ │ │ │ │ │ 00232 │ │ │ │ │ │ +int full_clear(); │ │ │ │ │ │ 00234 │ │ │ │ │ │ 00235 │ │ │ │ │ │ +// user-defined stable-cone ordering // │ │ │ │ │ │ 00237 │ │ │ │ │ │ 00239 │ │ │ │ │ │ +class Cuser_scale_base{ │ │ │ │ │ │ 00245 │ │ │ │ │ │ 00246 │ │ │ │ │ │ +public: │ │ │ │ │ │ +virtual ~Cuser_scale_base(){} │ │ │ │ │ │ 00248 │ │ │ │ │ │ 00249 │ │ │ │ │ │ 00254 │ │ │ │ │ │ +virtual double operator()(const CSphjet & jet) const = 0; │ │ │ │ │ │ 00255 │ │ │ │ │ │ +virtual bool is_larger(const CSphjet & a, const CSphjet & b) const{ │ │ │ │ │ │ 00266 │ │ │ │ │ │ +return (a.sm_var2 > b.sm_var2); │ │ │ │ │ │ 00267 │ │ │ │ │ │ 00268 │ │ │ │ │ │ +} │ │ │ │ │ │ 00269 │ │ │ │ │ │ +}; │ │ │ │ │ │ 00270 │ │ │ │ │ │ 00275 │ │ │ │ │ │ +void set_user_scale(const Cuser_scale_base * user_scale_in){ │ │ │ │ │ │ 00276 │ │ │ │ │ │ +_user_scale = user_scale_in; │ │ │ │ │ │ 00277 │ │ │ │ │ │ +} │ │ │ │ │ │ 00278 │ │ │ │ │ │ +const Cuser_scale_base * user_scale() const { return _user_scale; } │ │ │ │ │ │ 00280 │ │ │ │ │ │ 00281 │ │ │ │ │ │ 00282 │ │ │ │ │ │ 00284 │ │ │ │ │ │ +// main parts of the algorithm // │ │ │ │ │ │ 00286 │ │ │ │ │ │ 00296 │ │ │ │ │ │ +int merge_collinear_and_remove_soft(); │ │ │ │ │ │ 00297 │ │ │ │ │ │ +int add_protocones(std::vector *protocones, double R2, double Emin=0.0); │ │ │ │ │ │ 00305 │ │ │ │ │ │ 00306 │ │ │ │ │ │ +int add_hardest_protocone_to_jets(std::vector *protocones, double R2, double │ │ │ │ │ │ 00317 │ │ │ │ │ │ +Emin=0.0); │ │ │ │ │ │ 00318 │ │ │ │ │ │ +int perform(double overlap_tshold, double Emin=0.0); │ │ │ │ │ │ 00328 │ │ │ │ │ │ 00329 │ │ │ │ │ │ 00330 │ │ │ │ │ │ 00332 │ │ │ │ │ │ +// save and debug functions // │ │ │ │ │ │ 00334 │ │ │ │ │ │ 00337 │ │ │ │ │ │ +int save_contents(FILE *flux); │ │ │ │ │ │ 00338 │ │ │ │ │ │ +int show(); │ │ │ │ │ │ 00340 │ │ │ │ │ │ 00341 │ │ │ │ │ │ +// particle information │ │ │ │ │ │ 00342 │ │ │ │ │ │ 00343 │ │ │ │ │ │ +int n; │ │ │ │ │ │ 00344 │ │ │ │ │ │ +std::vector particles; │ │ │ │ │ │ 00345 │ │ │ │ │ │ +std::vector particles_norm2; │ │ │ │ │ │ +int n_left; │ │ │ │ │ │ 00346 │ │ │ │ │ │ 00347 │ │ │ │ │ │ +std::vector p_remain; │ │ │ │ │ │ 00348 │ │ │ │ │ │ +std::vector p_uncol_hard; │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 294 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00349 │ │ │ │ │ │ +int n_pass; │ │ │ │ │ │ 00350 │ │ │ │ │ │ +double most_ambiguous_split; │ │ │ │ │ │ 00354 │ │ │ │ │ │ 00355 │ │ │ │ │ │ +// jets information │ │ │ │ │ │ 00356 │ │ │ │ │ │ 00357 │ │ │ │ │ │ +std::vector jets; │ │ │ │ │ │ 00358 │ │ │ │ │ │ +// working entries │ │ │ │ │ │ 00359 │ │ │ │ │ │ 00360 │ │ │ │ │ │ +int *indices; │ │ │ │ │ │ +int idx_size; │ │ │ │ │ │ 00361 │ │ │ │ │ │ 00362 │ │ │ │ │ │ +bool merge_identical_protocones; │ │ │ │ │ │ 00371 │ │ │ │ │ │ 00372 │ │ │ │ │ │ 00374 │ │ │ │ │ │ +CSphsplit_merge_ptcomparison ptcomparison; │ │ │ │ │ │ 00375 │ │ │ │ │ │ +double SM_var2_hardest_cut_off; │ │ │ │ │ │ 00382 │ │ │ │ │ │ 00383 │ │ │ │ │ │ 00391 │ │ │ │ │ │ +double stable_cone_soft_E2_cutoff; │ │ │ │ │ │ 00392 │ │ │ │ │ │ -00393 │ │ │ │ │ │ +00393 private: │ │ │ │ │ │ +bool get_overlap(const CSphjet &j1, const CSphjet &j2, double *v); │ │ │ │ │ │ 00401 │ │ │ │ │ │ 00402 │ │ │ │ │ │ 00403 │ │ │ │ │ │ - │ │ │ │ │ │ -293 │ │ │ │ │ │ - │ │ │ │ │ │ -int init(std::vector &_particles, std::vector *protocones, double R2, │ │ │ │ │ │ -double Emin=0.0); │ │ │ │ │ │ -int init_particles(std::vector &_particles); │ │ │ │ │ │ -int init_pleft(); │ │ │ │ │ │ -inline int set_E_weighted_splitting(bool _use_E_weighted_splitting){ │ │ │ │ │ │ -use_E_weighted_splitting = _use_E_weighted_splitting; │ │ │ │ │ │ -return 0; │ │ │ │ │ │ -} │ │ │ │ │ │ -// cleaning functions // │ │ │ │ │ │ -int partial_clear(); │ │ │ │ │ │ -int full_clear(); │ │ │ │ │ │ -// user-defined stable-cone ordering // │ │ │ │ │ │ -class Cuser_scale_base{ │ │ │ │ │ │ -public: │ │ │ │ │ │ -virtual ~Cuser_scale_base(){} │ │ │ │ │ │ -virtual double operator()(const CSphjet & jet) const = 0; │ │ │ │ │ │ -virtual bool is_larger(const CSphjet & a, const CSphjet & b) const{ │ │ │ │ │ │ -return (a.sm_var2 > b.sm_var2); │ │ │ │ │ │ -} │ │ │ │ │ │ -}; │ │ │ │ │ │ -void set_user_scale(const Cuser_scale_base * user_scale_in){ │ │ │ │ │ │ -_user_scale = user_scale_in; │ │ │ │ │ │ -} │ │ │ │ │ │ -const Cuser_scale_base * user_scale() const { return _user_scale; } │ │ │ │ │ │ -// main parts of the algorithm // │ │ │ │ │ │ -int merge_collinear_and_remove_soft(); │ │ │ │ │ │ -int add_protocones(std::vector *protocones, double R2, double Emin=0.0); │ │ │ │ │ │ -int add_hardest_protocone_to_jets(std::vector *protocones, double R2, double │ │ │ │ │ │ -Emin=0.0); │ │ │ │ │ │ -int perform(double overlap_tshold, double Emin=0.0); │ │ │ │ │ │ - │ │ │ │ │ │ -// save and debug functions // │ │ │ │ │ │ -int save_contents(FILE *flux); │ │ │ │ │ │ -int show(); │ │ │ │ │ │ -// particle information │ │ │ │ │ │ -int n; │ │ │ │ │ │ -std::vector particles; │ │ │ │ │ │ -std::vector particles_norm2; │ │ │ │ │ │ -int n_left; │ │ │ │ │ │ -std::vector p_remain; │ │ │ │ │ │ -std::vector p_uncol_hard; │ │ │ │ │ │ -int n_pass; │ │ │ │ │ │ -double most_ambiguous_split; │ │ │ │ │ │ -// jets information │ │ │ │ │ │ -std::vector jets; │ │ │ │ │ │ -// working entries │ │ │ │ │ │ -int *indices; │ │ │ │ │ │ -int idx_size; │ │ │ │ │ │ -bool merge_identical_protocones; │ │ │ │ │ │ -CSphsplit_merge_ptcomparison ptcomparison; │ │ │ │ │ │ -double SM_var2_hardest_cut_off; │ │ │ │ │ │ -double stable_cone_soft_E2_cutoff; │ │ │ │ │ │ -private: │ │ │ │ │ │ -bool get_overlap(const CSphjet &j1, const CSphjet &j2, double *v); │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 294 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00415 │ │ │ │ │ │ bool split(cjet_iterator &it_j1, cjet_iterator &it_j2); │ │ │ │ │ │ +00415 │ │ │ │ │ │ 00416 │ │ │ │ │ │ bool merge(cjet_iterator &it_j1, cjet_iterator &it_j2); │ │ │ │ │ │ 00425 │ │ │ │ │ │ 00426 │ │ │ │ │ │ bool insert(CSphjet &jet); │ │ │ │ │ │ 00433 │ │ │ │ │ │ 00434 │ │ │ │ │ │ -double get_sm_var2(CSphmomentum &v, double &E_tilde); │ │ │ │ │ │ 00441 │ │ │ │ │ │ +double get_sm_var2(CSphmomentum &v, double &E_tilde); │ │ │ │ │ │ 00442 │ │ │ │ │ │ void compute_Etilde(CSphjet &j); │ │ │ │ │ │ 00444 │ │ │ │ │ │ 00445 │ │ │ │ │ │ -00446 │ │ │ │ │ │ // jet information │ │ │ │ │ │ +00446 │ │ │ │ │ │ 00448 #ifdef SISCONE_USES_UNIQUE_PTR_AS_AUTO_PTR │ │ │ │ │ │ 00449 │ │ │ │ │ │ std::unique_ptr > candidates; │ │ │ │ │ │ 00450 #else │ │ │ │ │ │ 00451 │ │ │ │ │ │ std::auto_ptr > candidates; │ │ │ │ │ │ 00452 #endif │ │ │ │ │ │ @@ -27851,14 +27838,21 @@ │ │ │ │ │ │ 00023 // │ │ │ │ │ │ // │ │ │ │ │ │ 00024 // $Revision:: 405 │ │ │ │ │ │ $// │ │ │ │ │ │ 00025 // $Date:: 2016-05-23 20:15:02 +0200 (Mon, 23 May 2016) │ │ │ │ │ │ $// │ │ │ │ │ │ 00027 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.48 split_merge.h │ │ │ │ │ │ + │ │ │ │ │ │ +295 │ │ │ │ │ │ + │ │ │ │ │ │ 00028 #ifndef __SPLIT_MERGE_H__ │ │ │ │ │ │ 00029 #define __SPLIT_MERGE_H__ │ │ │ │ │ │ 00030 │ │ │ │ │ │ 00031 #include │ │ │ │ │ │ 00032 #include "defines.h" │ │ │ │ │ │ 00033 #include "geom_2d.h" │ │ │ │ │ │ 00034 #include "momentum.h" │ │ │ │ │ │ @@ -27876,38 +27870,31 @@ │ │ │ │ │ │ 00055 public: │ │ │ │ │ │ 00057 │ │ │ │ │ │ Cjet(); │ │ │ │ │ │ 00058 │ │ │ │ │ │ 00060 │ │ │ │ │ │ ~Cjet(); │ │ │ │ │ │ 00061 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.48 split_merge.h │ │ │ │ │ │ - │ │ │ │ │ │ -295 │ │ │ │ │ │ - │ │ │ │ │ │ 00062 │ │ │ │ │ │ Cmomentum v; │ │ │ │ │ │ double pt_tilde; │ │ │ │ │ │ 00063 │ │ │ │ │ │ -00064 │ │ │ │ │ │ int n; │ │ │ │ │ │ +00064 │ │ │ │ │ │ 00065 │ │ │ │ │ │ std::vector contents; │ │ │ │ │ │ 00066 │ │ │ │ │ │ 00073 │ │ │ │ │ │ double sm_var2; │ │ │ │ │ │ 00074 │ │ │ │ │ │ 00076 │ │ │ │ │ │ Ceta_phi_range range; │ │ │ │ │ │ 00077 │ │ │ │ │ │ -00082 │ │ │ │ │ │ int pass; │ │ │ │ │ │ +00082 │ │ │ │ │ │ 00083 }; │ │ │ │ │ │ 00084 │ │ │ │ │ │ 00086 bool jets_pt_less(const Cjet &j1, const Cjet &j2); │ │ │ │ │ │ 00087 │ │ │ │ │ │ 00088 │ │ │ │ │ │ 00096 enum Esplit_merge_scale { │ │ │ │ │ │ 00097 │ │ │ │ │ │ @@ -27938,16 +27925,16 @@ │ │ │ │ │ │ std::vector * particles; │ │ │ │ │ │ 00127 │ │ │ │ │ │ std::vector * pt; │ │ │ │ │ │ 00128 │ │ │ │ │ │ 00130 │ │ │ │ │ │ bool operator()(const Cjet &jet1, const Cjet &jet2) const; │ │ │ │ │ │ 00131 │ │ │ │ │ │ -void get_difference(const Cjet &j1, const Cjet &j2, Cmomentum *v, double *pt_tilde) const; │ │ │ │ │ │ 00143 │ │ │ │ │ │ +void get_difference(const Cjet &j1, const Cjet &j2, Cmomentum *v, double *pt_tilde) const; │ │ │ │ │ │ 00144 │ │ │ │ │ │ 00163 │ │ │ │ │ │ Esplit_merge_scale split_merge_scale; │ │ │ │ │ │ 00164 }; │ │ │ │ │ │ 00165 │ │ │ │ │ │ 00166 │ │ │ │ │ │ 00167 // iterator types │ │ │ │ │ │ @@ -27962,170 +27949,180 @@ │ │ │ │ │ │ 00183 │ │ │ │ │ │ Csplit_merge(); │ │ │ │ │ │ 00184 │ │ │ │ │ │ 00186 │ │ │ │ │ │ ~Csplit_merge(); │ │ │ │ │ │ 00187 │ │ │ │ │ │ 00188 │ │ │ │ │ │ -00190 │ │ │ │ │ │ // initialisation functions // │ │ │ │ │ │ +00190 │ │ │ │ │ │ 00192 │ │ │ │ │ │ -00201 │ │ │ │ │ │ int init(std::vector &_particles, std::vector *protocones, double R2, double │ │ │ │ │ │ +00201 │ │ │ │ │ │ ptmin=0.0); │ │ │ │ │ │ 00202 │ │ │ │ │ │ int init_particles(std::vector &_particles); │ │ │ │ │ │ 00208 │ │ │ │ │ │ 00209 │ │ │ │ │ │ -int init_pleft(); │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 296 │ │ │ │ │ │ + │ │ │ │ │ │ 00213 │ │ │ │ │ │ 00214 │ │ │ │ │ │ -inline int set_pt_weighted_splitting(bool _use_pt_weighted_splitting){ │ │ │ │ │ │ 00226 │ │ │ │ │ │ 00227 │ │ │ │ │ │ -use_pt_weighted_splitting = _use_pt_weighted_splitting; │ │ │ │ │ │ -return 0; │ │ │ │ │ │ 00228 │ │ │ │ │ │ 00229 │ │ │ │ │ │ -} │ │ │ │ │ │ 00230 │ │ │ │ │ │ 00232 │ │ │ │ │ │ -// cleaning functions // │ │ │ │ │ │ 00234 │ │ │ │ │ │ 00236 │ │ │ │ │ │ -int partial_clear(); │ │ │ │ │ │ 00237 │ │ │ │ │ │ -int full_clear(); │ │ │ │ │ │ 00239 │ │ │ │ │ │ 00240 │ │ │ │ │ │ -// user-defined stable-cone ordering // │ │ │ │ │ │ 00242 │ │ │ │ │ │ 00244 │ │ │ │ │ │ -class Cuser_scale_base{ │ │ │ │ │ │ 00250 │ │ │ │ │ │ 00251 │ │ │ │ │ │ -public: │ │ │ │ │ │ 00253 │ │ │ │ │ │ -virtual ~Cuser_scale_base(){} │ │ │ │ │ │ 00254 │ │ │ │ │ │ -virtual double operator()(const Cjet & jet) const = 0; │ │ │ │ │ │ 00259 │ │ │ │ │ │ 00260 │ │ │ │ │ │ -virtual bool is_larger(const Cjet & a, const Cjet & b) const{ │ │ │ │ │ │ 00271 │ │ │ │ │ │ 00272 │ │ │ │ │ │ -return (a.sm_var2 > b.sm_var2); │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 296 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00273 │ │ │ │ │ │ -} │ │ │ │ │ │ 00274 │ │ │ │ │ │ -}; │ │ │ │ │ │ 00275 │ │ │ │ │ │ -void set_user_scale(const Cuser_scale_base * user_scale_in){ │ │ │ │ │ │ 00280 │ │ │ │ │ │ 00281 │ │ │ │ │ │ -_user_scale = user_scale_in; │ │ │ │ │ │ 00282 │ │ │ │ │ │ -} │ │ │ │ │ │ 00283 │ │ │ │ │ │ 00285 │ │ │ │ │ │ -const Cuser_scale_base * user_scale() const { return _user_scale; } │ │ │ │ │ │ 00286 │ │ │ │ │ │ 00287 │ │ │ │ │ │ 00289 │ │ │ │ │ │ -// main parts of the algorithm // │ │ │ │ │ │ 00291 │ │ │ │ │ │ 00299 │ │ │ │ │ │ -int merge_collinear_and_remove_soft(); │ │ │ │ │ │ 00300 │ │ │ │ │ │ -int add_protocones(std::vector *protocones, double R2, double ptmin=0.0); │ │ │ │ │ │ 00308 │ │ │ │ │ │ 00309 │ │ │ │ │ │ -int add_hardest_protocone_to_jets(std::vector *protocones, double R2, double ptmin=0.0); │ │ │ │ │ │ 00320 │ │ │ │ │ │ 00321 │ │ │ │ │ │ -int perform(double overlap_tshold, double ptmin=0.0); │ │ │ │ │ │ 00331 │ │ │ │ │ │ 00332 │ │ │ │ │ │ 00333 │ │ │ │ │ │ 00335 │ │ │ │ │ │ -// save and debug functions // │ │ │ │ │ │ 00337 │ │ │ │ │ │ -int save_contents(FILE *flux); │ │ │ │ │ │ 00340 │ │ │ │ │ │ 00341 │ │ │ │ │ │ -int show(); │ │ │ │ │ │ 00343 │ │ │ │ │ │ 00344 │ │ │ │ │ │ -// particle information │ │ │ │ │ │ 00345 │ │ │ │ │ │ 00346 │ │ │ │ │ │ -int n; │ │ │ │ │ │ 00347 │ │ │ │ │ │ -std::vector particles; │ │ │ │ │ │ 00348 │ │ │ │ │ │ -std::vector pt; │ │ │ │ │ │ -int n_left; │ │ │ │ │ │ 00349 │ │ │ │ │ │ 00350 │ │ │ │ │ │ -std::vector p_remain; │ │ │ │ │ │ 00351 │ │ │ │ │ │ -std::vector p_uncol_hard; │ │ │ │ │ │ -int n_pass; │ │ │ │ │ │ 00352 │ │ │ │ │ │ 00353 │ │ │ │ │ │ 00357 │ │ │ │ │ │ -double most_ambiguous_split; │ │ │ │ │ │ 00358 │ │ │ │ │ │ -// jets information │ │ │ │ │ │ 00359 │ │ │ │ │ │ 00360 │ │ │ │ │ │ -std::vector jets; │ │ │ │ │ │ 00361 │ │ │ │ │ │ 00362 │ │ │ │ │ │ -// working entries │ │ │ │ │ │ 00363 │ │ │ │ │ │ -int *indices; │ │ │ │ │ │ -int idx_size; │ │ │ │ │ │ 00364 │ │ │ │ │ │ 00365 │ │ │ │ │ │ -bool merge_identical_protocones; │ │ │ │ │ │ 00374 │ │ │ │ │ │ 00375 │ │ │ │ │ │ 00377 │ │ │ │ │ │ -Csplit_merge_ptcomparison ptcomparison; │ │ │ │ │ │ 00378 │ │ │ │ │ │ -double SM_var2_hardest_cut_off; │ │ │ │ │ │ 00385 │ │ │ │ │ │ 00386 │ │ │ │ │ │ -double stable_cone_soft_pt2_cutoff; │ │ │ │ │ │ 00394 │ │ │ │ │ │ 00395 │ │ │ │ │ │ -00396 private: │ │ │ │ │ │ +00396 │ │ │ │ │ │ 00404 │ │ │ │ │ │ -bool get_overlap(const Cjet &j1, const Cjet &j2, double *v); │ │ │ │ │ │ 00405 │ │ │ │ │ │ 00406 │ │ │ │ │ │ -bool split(cjet_iterator &it_j1, cjet_iterator &it_j2); │ │ │ │ │ │ 00418 │ │ │ │ │ │ 00419 │ │ │ │ │ │ -bool merge(cjet_iterator &it_j1, cjet_iterator &it_j2); │ │ │ │ │ │ 00428 │ │ │ │ │ │ 00429 │ │ │ │ │ │ -bool insert(Cjet &jet); │ │ │ │ │ │ 00436 │ │ │ │ │ │ 00437 │ │ │ │ │ │ -double get_sm_var2(Cmomentum &v, double &pt_tilde); │ │ │ │ │ │ 00444 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +int init_pleft(); │ │ │ │ │ │ +inline int set_pt_weighted_splitting(bool _use_pt_weighted_splitting){ │ │ │ │ │ │ +use_pt_weighted_splitting = _use_pt_weighted_splitting; │ │ │ │ │ │ +return 0; │ │ │ │ │ │ +} │ │ │ │ │ │ +// cleaning functions // │ │ │ │ │ │ +int partial_clear(); │ │ │ │ │ │ +int full_clear(); │ │ │ │ │ │ +// user-defined stable-cone ordering // │ │ │ │ │ │ +class Cuser_scale_base{ │ │ │ │ │ │ +public: │ │ │ │ │ │ +virtual ~Cuser_scale_base(){} │ │ │ │ │ │ +virtual double operator()(const Cjet & jet) const = 0; │ │ │ │ │ │ +virtual bool is_larger(const Cjet & a, const Cjet & b) const{ │ │ │ │ │ │ +return (a.sm_var2 > b.sm_var2); │ │ │ │ │ │ +} │ │ │ │ │ │ +}; │ │ │ │ │ │ +void set_user_scale(const Cuser_scale_base * user_scale_in){ │ │ │ │ │ │ +_user_scale = user_scale_in; │ │ │ │ │ │ +} │ │ │ │ │ │ +const Cuser_scale_base * user_scale() const { return _user_scale; } │ │ │ │ │ │ +// main parts of the algorithm // │ │ │ │ │ │ +int merge_collinear_and_remove_soft(); │ │ │ │ │ │ +int add_protocones(std::vector *protocones, double R2, double ptmin=0.0); │ │ │ │ │ │ +int add_hardest_protocone_to_jets(std::vector *protocones, double R2, double ptmin=0.0); │ │ │ │ │ │ +int perform(double overlap_tshold, double ptmin=0.0); │ │ │ │ │ │ + │ │ │ │ │ │ +// save and debug functions // │ │ │ │ │ │ +int save_contents(FILE *flux); │ │ │ │ │ │ +int show(); │ │ │ │ │ │ +// particle information │ │ │ │ │ │ +int n; │ │ │ │ │ │ +std::vector particles; │ │ │ │ │ │ +std::vector pt; │ │ │ │ │ │ +int n_left; │ │ │ │ │ │ +std::vector p_remain; │ │ │ │ │ │ +std::vector p_uncol_hard; │ │ │ │ │ │ +int n_pass; │ │ │ │ │ │ +double most_ambiguous_split; │ │ │ │ │ │ +// jets information │ │ │ │ │ │ +std::vector jets; │ │ │ │ │ │ +// working entries │ │ │ │ │ │ +int *indices; │ │ │ │ │ │ +int idx_size; │ │ │ │ │ │ +bool merge_identical_protocones; │ │ │ │ │ │ +Csplit_merge_ptcomparison ptcomparison; │ │ │ │ │ │ +double SM_var2_hardest_cut_off; │ │ │ │ │ │ +double stable_cone_soft_pt2_cutoff; │ │ │ │ │ │ +private: │ │ │ │ │ │ +bool get_overlap(const Cjet &j1, const Cjet &j2, double *v); │ │ │ │ │ │ +bool split(cjet_iterator &it_j1, cjet_iterator &it_j2); │ │ │ │ │ │ +bool merge(cjet_iterator &it_j1, cjet_iterator &it_j2); │ │ │ │ │ │ +bool insert(Cjet &jet); │ │ │ │ │ │ +double get_sm_var2(Cmomentum &v, double &pt_tilde); │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.49 vicinity.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +297 │ │ │ │ │ │ + │ │ │ │ │ │ 00445 │ │ │ │ │ │ // jet information │ │ │ │ │ │ 00446 │ │ │ │ │ │ 00448 #ifdef SISCONE_USES_UNIQUE_PTR_AS_AUTO_PTR │ │ │ │ │ │ 00449 │ │ │ │ │ │ std::unique_ptr > candidates; │ │ │ │ │ │ 00450 #else │ │ │ │ │ │ @@ -28149,381 +28146,15 @@ │ │ │ │ │ │ 00472 }; │ │ │ │ │ │ 00473 │ │ │ │ │ │ 00474 } │ │ │ │ │ │ 00475 │ │ │ │ │ │ 00476 │ │ │ │ │ │ 00477 #endif │ │ │ │ │ │ │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.49 vicinity.h │ │ │ │ │ │ - │ │ │ │ │ │ -297 │ │ │ │ │ │ - │ │ │ │ │ │ -5.49 vicinity.h │ │ │ │ │ │ -00001 // -*- C++ -*00003 // File: vicinity.h │ │ │ │ │ │ -// │ │ │ │ │ │ -00004 // Description: header file for particle vicinity (Cvicinity class) │ │ │ │ │ │ -// │ │ │ │ │ │ -00005 // This file is part of the SISCone project. │ │ │ │ │ │ -// │ │ │ │ │ │ -00006 // WARNING: this is not the main SISCone trunk but │ │ │ │ │ │ -// │ │ │ │ │ │ -00007 // │ │ │ │ │ │ -an adaptation to spherical coordinates │ │ │ │ │ │ -// │ │ │ │ │ │ -00008 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ -// │ │ │ │ │ │ -00009 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00010 // Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez │ │ │ │ │ │ -00011 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00012 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ -// │ │ │ │ │ │ -00013 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ -// │ │ │ │ │ │ -00014 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ -// │ │ │ │ │ │ -00015 // (at your option) any later version. │ │ │ │ │ │ -// │ │ │ │ │ │ -00016 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00017 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ -// │ │ │ │ │ │ -00018 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ -// │ │ │ │ │ │ -00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ -// │ │ │ │ │ │ -00020 // GNU General Public License for more details. │ │ │ │ │ │ -// │ │ │ │ │ │ -00021 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00022 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ -// │ │ │ │ │ │ -00023 // along with this program; if not, write to the Free Software │ │ │ │ │ │ -// │ │ │ │ │ │ -00024 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ -00025 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00026 // $Revision:: 255 │ │ │ │ │ │ -$// │ │ │ │ │ │ -00027 // $Date:: 2008-07-12 17:40:35 +0200 (Sat, 12 Jul 2008) │ │ │ │ │ │ -$// │ │ │ │ │ │ -00029 │ │ │ │ │ │ -00030 #ifndef __SPH_VICINITY_H__ │ │ │ │ │ │ -00031 #define __SPH_VICINITY_H__ │ │ │ │ │ │ -00032 │ │ │ │ │ │ -00033 #include │ │ │ │ │ │ -00034 #include │ │ │ │ │ │ -00035 #include │ │ │ │ │ │ -00036 #include "momentum.h" │ │ │ │ │ │ -00037 #include │ │ │ │ │ │ -00038 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ -00039 #include │ │ │ │ │ │ -00040 #endif │ │ │ │ │ │ -00041 │ │ │ │ │ │ -00042 namespace siscone_spherical{ │ │ │ │ │ │ -00043 │ │ │ │ │ │ -00044 │ │ │ │ │ │ -00052 class CSphvicinity_elm{ │ │ │ │ │ │ -00053 public: │ │ │ │ │ │ -00055 │ │ │ │ │ │ -CSphmomentum *v; │ │ │ │ │ │ -00056 │ │ │ │ │ │ -00058 │ │ │ │ │ │ -siscone::Cvicinity_inclusion *is_inside; │ │ │ │ │ │ -00059 │ │ │ │ │ │ -00060 │ │ │ │ │ │ -// centre variables │ │ │ │ │ │ -00061 │ │ │ │ │ │ -CSph3vector centre; │ │ │ │ │ │ -double angle; │ │ │ │ │ │ -00062 │ │ │ │ │ │ -00063 │ │ │ │ │ │ -bool side; │ │ │ │ │ │ -00064 │ │ │ │ │ │ -double cocircular_range; │ │ │ │ │ │ -00066 │ │ │ │ │ │ -00069 │ │ │ │ │ │ -std::list cocircular; │ │ │ │ │ │ -00070 }; │ │ │ │ │ │ -00071 │ │ │ │ │ │ -00073 bool ve_less(CSphvicinity_elm *ve1, CSphvicinity_elm *ve2); │ │ │ │ │ │ -00074 │ │ │ │ │ │ -00075 │ │ │ │ │ │ -00083 class CSphvicinity{ │ │ │ │ │ │ -00084 public: │ │ │ │ │ │ -00086 │ │ │ │ │ │ -CSphvicinity(); │ │ │ │ │ │ -00087 │ │ │ │ │ │ -00089 │ │ │ │ │ │ -CSphvicinity(std::vector &_particle_list); │ │ │ │ │ │ -00090 │ │ │ │ │ │ -00092 │ │ │ │ │ │ -~CSphvicinity(); │ │ │ │ │ │ -00093 │ │ │ │ │ │ -void set_particle_list(std::vector &_particle_list); │ │ │ │ │ │ -00098 │ │ │ │ │ │ -00099 │ │ │ │ │ │ -void build(CSphmomentum *_parent, double _VR); │ │ │ │ │ │ -00105 │ │ │ │ │ │ -00106 │ │ │ │ │ │ -// cone kinematical information │ │ │ │ │ │ -00107 │ │ │ │ │ │ -00108 │ │ │ │ │ │ -CSphmomentum *parent; │ │ │ │ │ │ -double VR; │ │ │ │ │ │ -00109 │ │ │ │ │ │ -00110 │ │ │ │ │ │ -double VR2; │ │ │ │ │ │ -double cosVR; │ │ │ │ │ │ -00111 │ │ │ │ │ │ -00112 │ │ │ │ │ │ -double R; │ │ │ │ │ │ -00113 │ │ │ │ │ │ -double R2; │ │ │ │ │ │ -double tan2R; │ │ │ │ │ │ -00114 │ │ │ │ │ │ -00115 │ │ │ │ │ │ -double D2_R; │ │ │ │ │ │ -double inv_R_EPS_COCIRC; │ │ │ │ │ │ -00116 │ │ │ │ │ │ -double inv_R_2EPS_COCIRC; │ │ │ │ │ │ -00117 │ │ │ │ │ │ -00118 │ │ │ │ │ │ -00119 │ │ │ │ │ │ -// particle list information │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -// │ │ │ │ │ │ - │ │ │ │ │ │ - 298 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00120 │ │ │ │ │ │ -int n_part; │ │ │ │ │ │ -00121 │ │ │ │ │ │ -std::vector plist; │ │ │ │ │ │ -00123 │ │ │ │ │ │ -std::vector pincluded; │ │ │ │ │ │ -00124 │ │ │ │ │ │ -CSphvicinity_elm *ve_list; │ │ │ │ │ │ -00125 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ -00126 │ │ │ │ │ │ -siscone::Cquadtree *quadtree; │ │ │ │ │ │ -00127 #endif │ │ │ │ │ │ -00128 │ │ │ │ │ │ -// vicinity information │ │ │ │ │ │ -00129 │ │ │ │ │ │ -00130 │ │ │ │ │ │ -std::vector vicinity; │ │ │ │ │ │ -00131 │ │ │ │ │ │ -unsigned int vicinity_size; │ │ │ │ │ │ -00132 │ │ │ │ │ │ -00133 protected: │ │ │ │ │ │ -void append_to_vicinity(CSphmomentum *v); │ │ │ │ │ │ -00139 │ │ │ │ │ │ -00140 │ │ │ │ │ │ -// internal variables │ │ │ │ │ │ -00141 │ │ │ │ │ │ -00142 │ │ │ │ │ │ -CSph3vector parent_centre; │ │ │ │ │ │ -00143 │ │ │ │ │ │ -CSph3vector angular_dir1; │ │ │ │ │ │ -00144 │ │ │ │ │ │ -CSph3vector angular_dir2; │ │ │ │ │ │ -00145 }; │ │ │ │ │ │ -00146 │ │ │ │ │ │ -00147 } │ │ │ │ │ │ -00148 │ │ │ │ │ │ -00149 #endif │ │ │ │ │ │ - │ │ │ │ │ │ -5.50 vicinity.h │ │ │ │ │ │ -00001 // -*- C++ -*00003 // File: vicinity.h │ │ │ │ │ │ -// │ │ │ │ │ │ -00004 // Description: header file for particle vicinity (Cvicinity class) │ │ │ │ │ │ -// │ │ │ │ │ │ -00005 // This file is part of the SISCone project. │ │ │ │ │ │ -// │ │ │ │ │ │ -00006 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ -// │ │ │ │ │ │ -00007 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00008 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ -// │ │ │ │ │ │ -00009 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00010 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ -// │ │ │ │ │ │ -00011 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ -// │ │ │ │ │ │ -00012 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ -// │ │ │ │ │ │ -00013 // (at your option) any later version. │ │ │ │ │ │ -// │ │ │ │ │ │ -00014 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00015 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ -// │ │ │ │ │ │ -00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ -// │ │ │ │ │ │ -00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ -// │ │ │ │ │ │ -00018 // GNU General Public License for more details. │ │ │ │ │ │ -// │ │ │ │ │ │ -00019 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00020 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ -// │ │ │ │ │ │ -00021 // along with this program; if not, write to the Free Software │ │ │ │ │ │ -// │ │ │ │ │ │ -00022 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ -00023 // │ │ │ │ │ │ -// │ │ │ │ │ │ -00024 // $Revision:: 123 │ │ │ │ │ │ -$// │ │ │ │ │ │ -00025 // $Date:: 2007-03-01 02:52:16 +0100 (Thu, 01 Mar 2007) │ │ │ │ │ │ -$// │ │ │ │ │ │ -00027 │ │ │ │ │ │ -00028 #ifndef __VICINITY_H__ │ │ │ │ │ │ -00029 #define __VICINITY_H__ │ │ │ │ │ │ -00030 │ │ │ │ │ │ -00031 #include │ │ │ │ │ │ -00032 #include │ │ │ │ │ │ -00033 #include "momentum.h" │ │ │ │ │ │ -00034 #include "defines.h" │ │ │ │ │ │ -00035 #include "quadtree.h" │ │ │ │ │ │ -00036 │ │ │ │ │ │ -00037 namespace siscone{ │ │ │ │ │ │ -00038 │ │ │ │ │ │ -00039 │ │ │ │ │ │ -00040 │ │ │ │ │ │ -00046 class Cvicinity_inclusion { │ │ │ │ │ │ -00047 public: │ │ │ │ │ │ -00049 │ │ │ │ │ │ -Cvicinity_inclusion() : cone(false), cocirc(false) {} │ │ │ │ │ │ -00050 │ │ │ │ │ │ -00051 │ │ │ │ │ │ -bool cone; │ │ │ │ │ │ -00052 │ │ │ │ │ │ -bool cocirc; │ │ │ │ │ │ -00053 }; │ │ │ │ │ │ -00054 │ │ │ │ │ │ -00055 │ │ │ │ │ │ -00063 class Cvicinity_elm{ │ │ │ │ │ │ -00064 public: │ │ │ │ │ │ -00066 │ │ │ │ │ │ -Cmomentum *v; │ │ │ │ │ │ -00067 │ │ │ │ │ │ -00069 │ │ │ │ │ │ -Cvicinity_inclusion *is_inside; │ │ │ │ │ │ -00070 │ │ │ │ │ │ -// centre variables │ │ │ │ │ │ -00071 │ │ │ │ │ │ -00072 │ │ │ │ │ │ -double eta; │ │ │ │ │ │ -double phi; │ │ │ │ │ │ -00073 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.51 vicinity.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -299 │ │ │ │ │ │ - │ │ │ │ │ │ -00074 │ │ │ │ │ │ -double angle; │ │ │ │ │ │ -bool side; │ │ │ │ │ │ -00075 │ │ │ │ │ │ -00076 │ │ │ │ │ │ -double cocircular_range; │ │ │ │ │ │ -00078 │ │ │ │ │ │ -00081 │ │ │ │ │ │ -std::list cocircular; │ │ │ │ │ │ -00082 }; │ │ │ │ │ │ -00083 │ │ │ │ │ │ -00085 bool ve_less(Cvicinity_elm *ve1, Cvicinity_elm *ve2); │ │ │ │ │ │ -00086 │ │ │ │ │ │ -00087 │ │ │ │ │ │ -00095 class Cvicinity{ │ │ │ │ │ │ -00096 public: │ │ │ │ │ │ -00098 │ │ │ │ │ │ -Cvicinity(); │ │ │ │ │ │ -00099 │ │ │ │ │ │ -00101 │ │ │ │ │ │ -Cvicinity(std::vector &_particle_list); │ │ │ │ │ │ -00102 │ │ │ │ │ │ -00104 │ │ │ │ │ │ -~Cvicinity(); │ │ │ │ │ │ -00105 │ │ │ │ │ │ -void set_particle_list(std::vector &_particle_list); │ │ │ │ │ │ -00110 │ │ │ │ │ │ -00111 │ │ │ │ │ │ -void build(Cmomentum *_parent, double _VR); │ │ │ │ │ │ -00117 │ │ │ │ │ │ -00118 │ │ │ │ │ │ -00119 │ │ │ │ │ │ -// cone kinematical information │ │ │ │ │ │ -00120 │ │ │ │ │ │ -Cmomentum *parent; │ │ │ │ │ │ -00121 │ │ │ │ │ │ -double VR; │ │ │ │ │ │ -double VR2; │ │ │ │ │ │ -00122 │ │ │ │ │ │ -00123 │ │ │ │ │ │ -double R; │ │ │ │ │ │ -double R2; │ │ │ │ │ │ -00124 │ │ │ │ │ │ -00125 │ │ │ │ │ │ -double inv_R_EPS_COCIRC; │ │ │ │ │ │ -00126 │ │ │ │ │ │ -double inv_R_2EPS_COCIRC; │ │ │ │ │ │ -00127 │ │ │ │ │ │ -// particle list information │ │ │ │ │ │ -00128 │ │ │ │ │ │ -00129 │ │ │ │ │ │ -int n_part; │ │ │ │ │ │ -00130 │ │ │ │ │ │ -std::vector plist; │ │ │ │ │ │ -00131 │ │ │ │ │ │ -std::vector pincluded; │ │ │ │ │ │ -00132 │ │ │ │ │ │ -Cvicinity_elm *ve_list; │ │ │ │ │ │ -00133 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ -00134 │ │ │ │ │ │ -Cquadtree *quadtree; │ │ │ │ │ │ -00135 #endif │ │ │ │ │ │ -00136 │ │ │ │ │ │ -00137 │ │ │ │ │ │ -// vicinity information │ │ │ │ │ │ -00138 │ │ │ │ │ │ -std::vector vicinity; │ │ │ │ │ │ -unsigned int vicinity_size; │ │ │ │ │ │ -00139 │ │ │ │ │ │ -00140 │ │ │ │ │ │ -00141 protected: │ │ │ │ │ │ -00147 │ │ │ │ │ │ -void append_to_vicinity(Cmomentum *v); │ │ │ │ │ │ -00148 │ │ │ │ │ │ -// internal variables │ │ │ │ │ │ -00149 │ │ │ │ │ │ -00150 │ │ │ │ │ │ -double pcx; │ │ │ │ │ │ -double pcy; │ │ │ │ │ │ -00151 │ │ │ │ │ │ -00152 }; │ │ │ │ │ │ -00153 │ │ │ │ │ │ -00154 } │ │ │ │ │ │ -00155 │ │ │ │ │ │ -00156 #endif │ │ │ │ │ │ - │ │ │ │ │ │ -5.51 vicinity.cpp │ │ │ │ │ │ +5.49 vicinity.cpp │ │ │ │ │ │ 00001 │ │ │ │ │ │ // │ │ │ │ │ │ 00002 // File: vicinity.cpp │ │ │ │ │ │ 00003 // Description: source file for particle vicinity (Cvicinity class) │ │ │ │ │ │ // │ │ │ │ │ │ 00004 // This file is part of the SISCone project. │ │ │ │ │ │ // │ │ │ │ │ │ @@ -28564,23 +28195,14 @@ │ │ │ │ │ │ 00022 // along with this program; if not, write to the Free Software │ │ │ │ │ │ // │ │ │ │ │ │ 00023 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ 00024 // │ │ │ │ │ │ // │ │ │ │ │ │ 00025 // $Revision:: 255 │ │ │ │ │ │ $// │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -// │ │ │ │ │ │ - │ │ │ │ │ │ - 300 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00026 // $Date:: 2008-07-12 17:40:35 +0200 (Sat, 12 Jul 2008) │ │ │ │ │ │ $// │ │ │ │ │ │ 00028 │ │ │ │ │ │ 00029 #include "vicinity.h" │ │ │ │ │ │ 00030 #include │ │ │ │ │ │ 00031 #include │ │ │ │ │ │ 00032 #include │ │ │ │ │ │ @@ -28614,14 +28236,23 @@ │ │ │ │ │ │ * │ │ │ │ │ │ 00055 * class used to manage the points which are in the vicinity * │ │ │ │ │ │ 00056 * of a parent point. The construction of the list can be │ │ │ │ │ │ * │ │ │ │ │ │ 00057 * made from a list of points or from a quadtree. │ │ │ │ │ │ * │ │ │ │ │ │ 00058 *************************************************************/ │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ + 298 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00059 │ │ │ │ │ │ 00060 // default constructor │ │ │ │ │ │ 00061 //--------------------00062 CSphvicinity::CSphvicinity(){ │ │ │ │ │ │ 00063 │ │ │ │ │ │ n_part = 0; │ │ │ │ │ │ 00064 │ │ │ │ │ │ 00065 │ │ │ │ │ │ @@ -28653,53 +28284,48 @@ │ │ │ │ │ │ 00084 │ │ │ │ │ │ 00085 │ │ │ │ │ │ set_particle_list(_particle_list); │ │ │ │ │ │ 00086 } │ │ │ │ │ │ 00087 │ │ │ │ │ │ 00088 // default destructor │ │ │ │ │ │ 00089 //-------------------00090 CSphvicinity::~CSphvicinity(){ │ │ │ │ │ │ -00091 │ │ │ │ │ │ if (ve_list!=NULL) │ │ │ │ │ │ -delete[] ve_list; │ │ │ │ │ │ +00091 │ │ │ │ │ │ 00092 │ │ │ │ │ │ +delete[] ve_list; │ │ │ │ │ │ 00093 │ │ │ │ │ │ 00094 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ 00095 │ │ │ │ │ │ if (quadtree!=NULL) │ │ │ │ │ │ -00096 │ │ │ │ │ │ delete quadtree; │ │ │ │ │ │ +00096 │ │ │ │ │ │ 00097 #endif │ │ │ │ │ │ 00098 } │ │ │ │ │ │ 00099 │ │ │ │ │ │ 00100 /* │ │ │ │ │ │ 00101 * set the particle_list │ │ │ │ │ │ -00102 * - particle_list │ │ │ │ │ │ list of particles (type CSphmomentum) │ │ │ │ │ │ -number of particles in the list │ │ │ │ │ │ +00102 * - particle_list │ │ │ │ │ │ 00103 * - n │ │ │ │ │ │ +number of particles in the list │ │ │ │ │ │ 00104 ************************************************************/ │ │ │ │ │ │ 00105 void CSphvicinity::set_particle_list(vector &_particle_list){ │ │ │ │ │ │ -int i,j; │ │ │ │ │ │ 00106 │ │ │ │ │ │ +int i,j; │ │ │ │ │ │ 00107 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ 00108 │ │ │ │ │ │ double eta_max=0.0; │ │ │ │ │ │ 00109 #endif │ │ │ │ │ │ 00110 │ │ │ │ │ │ -// if the particle list is not empty, destroy it ! │ │ │ │ │ │ 00111 │ │ │ │ │ │ +// if the particle list is not empty, destroy it ! │ │ │ │ │ │ 00112 │ │ │ │ │ │ if (ve_list!=NULL){ │ │ │ │ │ │ 00113 │ │ │ │ │ │ delete[] ve_list; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.51 vicinity.cpp │ │ │ │ │ │ - │ │ │ │ │ │ 00114 │ │ │ │ │ │ } │ │ │ │ │ │ 00115 │ │ │ │ │ │ vicinity.clear(); │ │ │ │ │ │ 00116 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ 00117 │ │ │ │ │ │ if (quadtree!=NULL) │ │ │ │ │ │ @@ -28716,16 +28342,16 @@ │ │ │ │ │ │ - we allocate indices to particles │ │ │ │ │ │ 00124 │ │ │ │ │ │ n_part = 0; │ │ │ │ │ │ 00125 │ │ │ │ │ │ plist.clear(); │ │ │ │ │ │ 00126 │ │ │ │ │ │ pincluded.clear(); │ │ │ │ │ │ -for (i=0;i<(int) _particle_list.size();i++){ │ │ │ │ │ │ 00127 │ │ │ │ │ │ +for (i=0;i<(int) _particle_list.size();i++){ │ │ │ │ │ │ 00128 │ │ │ │ │ │ // if a particle is colinear with the beam (infinite rapidity) │ │ │ │ │ │ 00129 │ │ │ │ │ │ // we do not take it into account │ │ │ │ │ │ 00130 │ │ │ │ │ │ //if (fabs(_particle_list[i].pz)!=_particle_list[i].E){ │ │ │ │ │ │ 00131 │ │ │ │ │ │ @@ -28740,49 +28366,54 @@ │ │ │ │ │ │ 00136 │ │ │ │ │ │ // Hence, it is not required here any longer. │ │ │ │ │ │ 00137 │ │ │ │ │ │ // plist[n_part].parent_index = i; │ │ │ │ │ │ 00138 │ │ │ │ │ │ plist[n_part].index = n_part; │ │ │ │ │ │ 00139 │ │ │ │ │ │ -// make sure the reference is randomly created │ │ │ │ │ │ 00140 │ │ │ │ │ │ +// make sure the reference is randomly created │ │ │ │ │ │ 00141 │ │ │ │ │ │ plist[n_part].ref.randomize(); │ │ │ │ │ │ 00142 │ │ │ │ │ │ 00143 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ 00144 │ │ │ │ │ │ if (fabs(plist[n_part].eta)>eta_max) eta_max=fabs(plist[n_part].eta); │ │ │ │ │ │ 00145 #endif │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.49 vicinity.cpp │ │ │ │ │ │ + │ │ │ │ │ │ 00146 │ │ │ │ │ │ n_part++; │ │ │ │ │ │ -00147 │ │ │ │ │ │ //} │ │ │ │ │ │ +00147 │ │ │ │ │ │ 00148 │ │ │ │ │ │ } │ │ │ │ │ │ 00149 │ │ │ │ │ │ -00150 │ │ │ │ │ │ // allocate quadtree and vicinity_elm list │ │ │ │ │ │ +00150 │ │ │ │ │ │ 00151 │ │ │ │ │ │ // note: we set phi in [-pi:pi] as it is the natural range for atan2! │ │ │ │ │ │ 00152 │ │ │ │ │ │ ve_list = new CSphvicinity_elm[2*n_part]; │ │ │ │ │ │ 00153 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ 00154 │ │ │ │ │ │ eta_max+=0.1; │ │ │ │ │ │ 00155 │ │ │ │ │ │ quadtree = new siscone::Cquadtree(0.0, 0.0, eta_max, M_PI); │ │ │ │ │ │ 00156 #endif │ │ │ │ │ │ 00157 │ │ │ │ │ │ -// append particle to the vicinity_elm list │ │ │ │ │ │ 00158 │ │ │ │ │ │ +// append particle to the vicinity_elm list │ │ │ │ │ │ 00159 │ │ │ │ │ │ j = 0; │ │ │ │ │ │ -for (i=0;iadd(&plist[i]); │ │ │ │ │ │ 00163 #endif │ │ │ │ │ │ 00164 │ │ │ │ │ │ ve_list[j].v = ve_list[j+1].v = &plist[i]; │ │ │ │ │ │ 00165 │ │ │ │ │ │ @@ -28793,22 +28424,22 @@ │ │ │ │ │ │ } │ │ │ │ │ │ 00168 │ │ │ │ │ │ 00169 } │ │ │ │ │ │ 00170 │ │ │ │ │ │ 00171 │ │ │ │ │ │ 00172 /* │ │ │ │ │ │ 00173 * build the vicinity list from a list of points. │ │ │ │ │ │ -reference particle │ │ │ │ │ │ 00174 * - _parent │ │ │ │ │ │ -00175 * - _VR │ │ │ │ │ │ +reference particle │ │ │ │ │ │ vicinity radius │ │ │ │ │ │ +00175 * - _VR │ │ │ │ │ │ 00176 ************************************************************/ │ │ │ │ │ │ 00177 void CSphvicinity::build(CSphmomentum *_parent, double _VR){ │ │ │ │ │ │ -00178 │ │ │ │ │ │ int i; │ │ │ │ │ │ +00178 │ │ │ │ │ │ 00179 │ │ │ │ │ │ // set parent and radius │ │ │ │ │ │ 00180 │ │ │ │ │ │ 00181 │ │ │ │ │ │ parent = _parent; │ │ │ │ │ │ 00182 │ │ │ │ │ │ 00183 │ │ │ │ │ │ @@ -28841,23 +28472,14 @@ │ │ │ │ │ │ 00197 │ │ │ │ │ │ vicinity.clear(); │ │ │ │ │ │ 00198 │ │ │ │ │ │ // init parent variables │ │ │ │ │ │ 00199 │ │ │ │ │ │ 00200 │ │ │ │ │ │ // we cpte the direction of the centre and two orthogonal ones │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -301 │ │ │ │ │ │ - │ │ │ │ │ │ - 302 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00201 │ │ │ │ │ │ // to measure the angles. Those are taken orthogonal to the │ │ │ │ │ │ 00202 │ │ │ │ │ │ // axis of smallest components (of the centre) to increase precision │ │ │ │ │ │ 00203 │ │ │ │ │ │ parent_centre = (*parent)/parent->_norm; │ │ │ │ │ │ 00204 │ │ │ │ │ │ @@ -28886,62 +28508,71 @@ │ │ │ │ │ │ 00217 } │ │ │ │ │ │ 00218 │ │ │ │ │ │ 00219 │ │ │ │ │ │ 00221 //TODO// │ │ │ │ │ │ 00222 inline double sort_angle(double s, double c){ │ │ │ │ │ │ 00223 │ │ │ │ │ │ if (s==0) return (c>0) ? 0.0 : 2.0; │ │ │ │ │ │ -00224 │ │ │ │ │ │ double t=c/s; │ │ │ │ │ │ -return (s>0) ? 1-t/(1+fabs(t)) : 3-t/(1+fabs(t)); │ │ │ │ │ │ +00224 │ │ │ │ │ │ 00225 │ │ │ │ │ │ +return (s>0) ? 1-t/(1+fabs(t)) : 3-t/(1+fabs(t)); │ │ │ │ │ │ 00226 } │ │ │ │ │ │ 00227 │ │ │ │ │ │ 00228 │ │ │ │ │ │ 00229 /* │ │ │ │ │ │ 00230 * append a particle to the ’vicinity’ list after │ │ │ │ │ │ 00231 * having computed the angular-ordering quantities │ │ │ │ │ │ 00232 * - v │ │ │ │ │ │ vector to test │ │ │ │ │ │ 00233 **********************************************************/ │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +299 │ │ │ │ │ │ + │ │ │ │ │ │ + 300 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00234 void CSphvicinity::append_to_vicinity(CSphmomentum *v){ │ │ │ │ │ │ -00235 │ │ │ │ │ │ // skip the particle itself) │ │ │ │ │ │ +00235 │ │ │ │ │ │ 00236 │ │ │ │ │ │ if (v==parent) │ │ │ │ │ │ -00237 │ │ │ │ │ │ return; │ │ │ │ │ │ +00237 │ │ │ │ │ │ 00238 │ │ │ │ │ │ -int i=2*(v->index); │ │ │ │ │ │ 00239 │ │ │ │ │ │ +int i=2*(v->index); │ │ │ │ │ │ 00240 │ │ │ │ │ │ // compute the distance of the i-th particle with the parent │ │ │ │ │ │ 00241 │ │ │ │ │ │ 00242 │ │ │ │ │ │ double dot = dot_product3(parent_centre,*v); │ │ │ │ │ │ 00243 │ │ │ │ │ │ CSph3vector vnormal = *v; │ │ │ │ │ │ 00244 │ │ │ │ │ │ vnormal/=v->_norm; │ │ │ │ │ │ 00245 │ │ │ │ │ │ dot/=v->_norm; │ │ │ │ │ │ 00246 │ │ │ │ │ │ -// really check if the distance is less than VR │ │ │ │ │ │ 00247 │ │ │ │ │ │ +// really check if the distance is less than VR │ │ │ │ │ │ 00248 │ │ │ │ │ │ if (dot>cosVR){ │ │ │ │ │ │ 00249 │ │ │ │ │ │ CSph3vector cross = cross_product3(parent_centre,vnormal); │ │ │ │ │ │ 00250 │ │ │ │ │ │ 00251 │ │ │ │ │ │ // for the centres │ │ │ │ │ │ 00252 │ │ │ │ │ │ CSph3vector median = (parent_centre+vnormal); │ │ │ │ │ │ -double amplT = sqrt((tan2R*(1+dot)+(dot-1))*(1+dot)); │ │ │ │ │ │ 00253 │ │ │ │ │ │ +double amplT = sqrt((tan2R*(1+dot)+(dot-1))*(1+dot)); │ │ │ │ │ │ 00254 │ │ │ │ │ │ CSph3vector transverse = amplT*cross/cross._norm; │ │ │ │ │ │ 00255 │ │ │ │ │ │ 00256 │ │ │ │ │ │ // first angle (+) │ │ │ │ │ │ 00257 │ │ │ │ │ │ ve_list[i].centre = median + transverse; │ │ │ │ │ │ @@ -28978,40 +28609,35 @@ │ │ │ │ │ │ 00273 │ │ │ │ │ │ ve_list[i+1].side = false; │ │ │ │ │ │ 00274 │ │ │ │ │ │ ve_list[i+1].cocircular.clear(); │ │ │ │ │ │ 00275 │ │ │ │ │ │ vicinity.push_back(&(ve_list[i+1])); │ │ │ │ │ │ 00276 │ │ │ │ │ │ -00277 │ │ │ │ │ │ // now work out the cocircularity range for the two points (range │ │ │ │ │ │ +00277 │ │ │ │ │ │ 00278 │ │ │ │ │ │ // of angle within which the points stay within a distance │ │ │ │ │ │ 00279 │ │ │ │ │ │ // EPSILON_COCIRCULAR of circule │ │ │ │ │ │ 00280 │ │ │ │ │ │ // P = parent; C = child; O = Origin (center of circle) │ │ │ │ │ │ 00281 │ │ │ │ │ │ CSph3vector OP = parent_centre - ve_list[i+1].centre; │ │ │ │ │ │ 00282 │ │ │ │ │ │ CSph3vector OC = vnormal - ve_list[i+1].centre; │ │ │ │ │ │ 00283 │ │ │ │ │ │ -00284 │ │ │ │ │ │ // two sources of error are (GPS CCN29-19) epsilon/(R sin theta) │ │ │ │ │ │ +00284 │ │ │ │ │ │ 00285 │ │ │ │ │ │ // and sqrt(2*epsilon/(R (1-cos theta))) and the way things work │ │ │ │ │ │ 00286 │ │ │ │ │ │ // out, it is the _smaller_ of the two that is relevant [NB have │ │ │ │ │ │ 00287 │ │ │ │ │ │ // changed definition of theta here relative to that used in │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.52 vicinity.cpp │ │ │ │ │ │ - │ │ │ │ │ │ 00288 │ │ │ │ │ │ // CCN29] [NB2: write things so as to avoid zero denominators and │ │ │ │ │ │ 00289 │ │ │ │ │ │ // to minimize the multiplications, divisions and above all sqrts │ │ │ │ │ │ 00290 │ │ │ │ │ │ // -- that means that c & s are defined including a factor of VR2] │ │ │ │ │ │ 00291 │ │ │ │ │ │ @@ -29028,38 +28654,44 @@ │ │ │ │ │ │ ve_list[i+1].cocircular_range = ve_list[i].cocircular_range; │ │ │ │ │ │ 00297 │ │ │ │ │ │ } │ │ │ │ │ │ 00298 } │ │ │ │ │ │ 00299 │ │ │ │ │ │ 00300 } │ │ │ │ │ │ │ │ │ │ │ │ -5.52 vicinity.cpp │ │ │ │ │ │ +5.50 vicinity.cpp │ │ │ │ │ │ 00001 │ │ │ │ │ │ 00002 // File: vicinity.cpp │ │ │ │ │ │ -// │ │ │ │ │ │ 00003 // Description: source file for particle vicinity (Cvicinity class) │ │ │ │ │ │ -// │ │ │ │ │ │ 00004 // This file is part of the SISCone project. │ │ │ │ │ │ -// │ │ │ │ │ │ 00005 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ -// │ │ │ │ │ │ 00006 // │ │ │ │ │ │ -// │ │ │ │ │ │ 00007 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ -// │ │ │ │ │ │ 00008 // │ │ │ │ │ │ -// │ │ │ │ │ │ 00009 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ -// │ │ │ │ │ │ 00010 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ -// │ │ │ │ │ │ 00011 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ -// │ │ │ │ │ │ 00012 // (at your option) any later version. │ │ │ │ │ │ + │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ // │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.50 vicinity.cpp │ │ │ │ │ │ + │ │ │ │ │ │ 00013 // │ │ │ │ │ │ // │ │ │ │ │ │ 00014 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ // │ │ │ │ │ │ 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ // │ │ │ │ │ │ 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ @@ -29098,16 +28730,16 @@ │ │ │ │ │ │ * │ │ │ │ │ │ 00040 * of a parent point. │ │ │ │ │ │ * │ │ │ │ │ │ 00041 *************************************************************/ │ │ │ │ │ │ 00042 │ │ │ │ │ │ 00043 // ordering pointers to Cvicinity_elm │ │ │ │ │ │ 00044 //-----------------------------------00045 bool ve_less(Cvicinity_elm *ve1, Cvicinity_elm *ve2){ │ │ │ │ │ │ -00046 │ │ │ │ │ │ return ve1->angle < ve2->angle; │ │ │ │ │ │ +00046 │ │ │ │ │ │ 00047 } │ │ │ │ │ │ 00048 │ │ │ │ │ │ 00049 │ │ │ │ │ │ 00050 /************************************************************* │ │ │ │ │ │ 00051 * Cvicinity implementation │ │ │ │ │ │ * │ │ │ │ │ │ 00052 * list of element in the vicinity of a parent. │ │ │ │ │ │ @@ -29129,23 +28761,14 @@ │ │ │ │ │ │ 00064 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ 00065 │ │ │ │ │ │ quadtree = NULL; │ │ │ │ │ │ 00066 #endif │ │ │ │ │ │ 00067 │ │ │ │ │ │ 00068 │ │ │ │ │ │ parent = NULL; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -303 │ │ │ │ │ │ - │ │ │ │ │ │ - 304 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00069 │ │ │ │ │ │ VR2 = VR = 0.0; │ │ │ │ │ │ 00070 │ │ │ │ │ │ 00071 } │ │ │ │ │ │ 00072 │ │ │ │ │ │ 00073 // constructor with initialisation │ │ │ │ │ │ 00074 //--------------------------------00075 Cvicinity::Cvicinity(vector &_particle_list){ │ │ │ │ │ │ @@ -29170,79 +28793,88 @@ │ │ │ │ │ │ 00089 │ │ │ │ │ │ 00090 │ │ │ │ │ │ delete[] ve_list; │ │ │ │ │ │ 00091 │ │ │ │ │ │ 00092 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ 00093 │ │ │ │ │ │ if (quadtree!=NULL) │ │ │ │ │ │ -delete quadtree; │ │ │ │ │ │ 00094 │ │ │ │ │ │ +delete quadtree; │ │ │ │ │ │ 00095 #endif │ │ │ │ │ │ 00096 } │ │ │ │ │ │ 00097 │ │ │ │ │ │ 00098 /* │ │ │ │ │ │ 00099 * set the particle_list │ │ │ │ │ │ list of particles (type Cmomentum) │ │ │ │ │ │ 00100 * - particle_list │ │ │ │ │ │ -00101 * - n │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +301 │ │ │ │ │ │ + │ │ │ │ │ │ + 302 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ number of particles in the list │ │ │ │ │ │ +00101 * - n │ │ │ │ │ │ 00102 ************************************************************/ │ │ │ │ │ │ 00103 void Cvicinity::set_particle_list(vector &_particle_list){ │ │ │ │ │ │ -00104 │ │ │ │ │ │ int i,j; │ │ │ │ │ │ +00104 │ │ │ │ │ │ 00105 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ 00106 │ │ │ │ │ │ double eta_max=0.0; │ │ │ │ │ │ 00107 #endif │ │ │ │ │ │ 00108 │ │ │ │ │ │ -00109 │ │ │ │ │ │ // if the particle list is not empty, destroy it ! │ │ │ │ │ │ +00109 │ │ │ │ │ │ 00110 │ │ │ │ │ │ if (ve_list!=NULL){ │ │ │ │ │ │ -delete[] ve_list; │ │ │ │ │ │ 00111 │ │ │ │ │ │ +delete[] ve_list; │ │ │ │ │ │ 00112 │ │ │ │ │ │ } │ │ │ │ │ │ 00113 │ │ │ │ │ │ vicinity.clear(); │ │ │ │ │ │ 00114 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ 00115 │ │ │ │ │ │ if (quadtree!=NULL) │ │ │ │ │ │ -00116 │ │ │ │ │ │ delete quadtree; │ │ │ │ │ │ +00116 │ │ │ │ │ │ 00117 #endif │ │ │ │ │ │ 00118 │ │ │ │ │ │ -00119 │ │ │ │ │ │ // allocate memory array for particles │ │ │ │ │ │ +00119 │ │ │ │ │ │ 00120 │ │ │ │ │ │ // Note: - we compute max for |eta| │ │ │ │ │ │ 00121 │ │ │ │ │ │ // │ │ │ │ │ │ - we allocate indices to particles │ │ │ │ │ │ 00122 │ │ │ │ │ │ n_part = 0; │ │ │ │ │ │ 00123 │ │ │ │ │ │ plist.clear(); │ │ │ │ │ │ 00124 │ │ │ │ │ │ pincluded.clear(); │ │ │ │ │ │ -00125 │ │ │ │ │ │ for (i=0;i<(int) _particle_list.size();i++){ │ │ │ │ │ │ -00126 │ │ │ │ │ │ +00125 │ │ │ │ │ │ // if a particle is colinear with the beam (infinite rapidity) │ │ │ │ │ │ +00126 │ │ │ │ │ │ 00127 │ │ │ │ │ │ // we do not take it into account │ │ │ │ │ │ 00128 │ │ │ │ │ │ if (fabs(_particle_list[i].pz)!=_particle_list[i].E){ │ │ │ │ │ │ 00129 │ │ │ │ │ │ plist.push_back(_particle_list[i]); │ │ │ │ │ │ 00130 │ │ │ │ │ │ pincluded.push_back(Cvicinity_inclusion()); // zero inclusion status │ │ │ │ │ │ 00131 │ │ │ │ │ │ -// the parent_index is handled in the split_merge because │ │ │ │ │ │ 00132 │ │ │ │ │ │ +// the parent_index is handled in the split_merge because │ │ │ │ │ │ 00133 │ │ │ │ │ │ // of our multiple-pass procedure. │ │ │ │ │ │ 00134 │ │ │ │ │ │ // Hence, it is not required here any longer. │ │ │ │ │ │ 00135 │ │ │ │ │ │ // plist[n_part].parent_index = i; │ │ │ │ │ │ 00136 │ │ │ │ │ │ @@ -29261,31 +28893,26 @@ │ │ │ │ │ │ 00145 │ │ │ │ │ │ n_part++; │ │ │ │ │ │ 00146 │ │ │ │ │ │ } │ │ │ │ │ │ 00147 │ │ │ │ │ │ } │ │ │ │ │ │ 00148 │ │ │ │ │ │ -00149 │ │ │ │ │ │ // allocate quadtree and vicinity_elm list │ │ │ │ │ │ +00149 │ │ │ │ │ │ 00150 │ │ │ │ │ │ // note: we set phi in [-pi:pi] as it is the natural range for atan2! │ │ │ │ │ │ 00151 │ │ │ │ │ │ ve_list = new Cvicinity_elm[2*n_part]; │ │ │ │ │ │ 00152 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ 00153 │ │ │ │ │ │ eta_max+=0.1; │ │ │ │ │ │ 00154 │ │ │ │ │ │ quadtree = new Cquadtree(0.0, 0.0, eta_max, M_PI); │ │ │ │ │ │ 00155 #endif │ │ │ │ │ │ - │ │ │ │ │ │ -Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.52 vicinity.cpp │ │ │ │ │ │ - │ │ │ │ │ │ 00156 │ │ │ │ │ │ // append particle to the vicinity_elm list │ │ │ │ │ │ 00157 │ │ │ │ │ │ 00158 │ │ │ │ │ │ j = 0; │ │ │ │ │ │ for (i=0;ieta; │ │ │ │ │ │ 00193 │ │ │ │ │ │ pcy = parent->phi; │ │ │ │ │ │ 00194 │ │ │ │ │ │ -// really browse the particle list │ │ │ │ │ │ 00195 │ │ │ │ │ │ +// really browse the particle list │ │ │ │ │ │ 00196 │ │ │ │ │ │ for (i=0;i0) ? 0.0 : 2.0; │ │ │ │ │ │ -double t=c/s; │ │ │ │ │ │ +00209 │ │ │ │ │ │ 00210 │ │ │ │ │ │ +double t=c/s; │ │ │ │ │ │ 00211 │ │ │ │ │ │ return (s>0) ? 1-t/(1+fabs(t)) : 3-t/(1+fabs(t)); │ │ │ │ │ │ 00212 } │ │ │ │ │ │ 00213 │ │ │ │ │ │ 00214 │ │ │ │ │ │ 00215 /* │ │ │ │ │ │ 00216 * append a particle to the ’vicinity’ list after │ │ │ │ │ │ 00217 * having computed the angular-ordering quantities │ │ │ │ │ │ -00218 * - v │ │ │ │ │ │ vector to test │ │ │ │ │ │ +00218 * - v │ │ │ │ │ │ 00219 **********************************************************/ │ │ │ │ │ │ 00220 void Cvicinity::append_to_vicinity(Cmomentum *v){ │ │ │ │ │ │ -00221 │ │ │ │ │ │ double dx, dy, d2; │ │ │ │ │ │ +00221 │ │ │ │ │ │ 00222 │ │ │ │ │ │ // skip the particle itself) │ │ │ │ │ │ 00223 │ │ │ │ │ │ 00224 │ │ │ │ │ │ if (v==parent) │ │ │ │ │ │ -return; │ │ │ │ │ │ 00225 │ │ │ │ │ │ +return; │ │ │ │ │ │ 00226 │ │ │ │ │ │ int i=2*(v->index); │ │ │ │ │ │ 00227 │ │ │ │ │ │ 00228 │ │ │ │ │ │ // compute the distance of the i-th particle with the parent │ │ │ │ │ │ 00229 │ │ │ │ │ │ 00230 │ │ │ │ │ │ dx = v->eta - pcx; │ │ │ │ │ │ 00231 │ │ │ │ │ │ dy = v->phi - pcy; │ │ │ │ │ │ 00232 │ │ │ │ │ │ -00233 │ │ │ │ │ │ // pay attention to the periodicity in phi ! │ │ │ │ │ │ +00233 │ │ │ │ │ │ 00234 │ │ │ │ │ │ if (dy>M_PI) │ │ │ │ │ │ 00235 │ │ │ │ │ │ dy -= twopi; │ │ │ │ │ │ else if (dy<-M_PI) │ │ │ │ │ │ 00236 │ │ │ │ │ │ 00237 │ │ │ │ │ │ @@ -29418,36 +29050,27 @@ │ │ │ │ │ │ 00240 │ │ │ │ │ │ 00241 │ │ │ │ │ │ // really check if the distance is less than VR │ │ │ │ │ │ 00242 │ │ │ │ │ │ if (d2eta - ve_list[i+1].eta, │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +303 │ │ │ │ │ │ + │ │ │ │ │ │ + 304 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00276 │ │ │ │ │ │ phi_in_range(v->phi-ve_list[i+1].phi)); │ │ │ │ │ │ 00277 │ │ │ │ │ │ // two sources of error are (GPS CCN29-19) epsilon/(R sin theta) │ │ │ │ │ │ 00278 │ │ │ │ │ │ 00279 │ │ │ │ │ │ // and sqrt(2*epsilon/(R (1-cos theta))) and the way things work │ │ │ │ │ │ @@ -29513,30 +29145,390 @@ │ │ │ │ │ │ // -- that means that c & s are defined including a factor of VR2] │ │ │ │ │ │ 00285 │ │ │ │ │ │ c = dot_product(OP,OC); │ │ │ │ │ │ 00286 │ │ │ │ │ │ s = fabs(cross_product(OP,OC)); │ │ │ │ │ │ double inv_err1 = s * inv_R_EPS_COCIRC; │ │ │ │ │ │ 00287 │ │ │ │ │ │ -double inv_err2_sq = (R2-c) * inv_R_2EPS_COCIRC; │ │ │ │ │ │ 00288 │ │ │ │ │ │ +double inv_err2_sq = (R2-c) * inv_R_2EPS_COCIRC; │ │ │ │ │ │ 00289 │ │ │ │ │ │ ve_list[i].cocircular_range = pow2(inv_err1) > inv_err2_sq ? │ │ │ │ │ │ 00290 │ │ │ │ │ │ 1.0/inv_err1 : │ │ │ │ │ │ 00291 │ │ │ │ │ │ sqrt(1.0/inv_err2_sq); │ │ │ │ │ │ 00292 │ │ │ │ │ │ ve_list[i+1].cocircular_range = ve_list[i].cocircular_range; │ │ │ │ │ │ 00293 │ │ │ │ │ │ } │ │ │ │ │ │ 00294 } │ │ │ │ │ │ 00295 │ │ │ │ │ │ 00296 } │ │ │ │ │ │ │ │ │ │ │ │ +5.51 vicinity.h │ │ │ │ │ │ +00001 // -*- C++ -*00003 // File: vicinity.h │ │ │ │ │ │ +// │ │ │ │ │ │ +00004 // Description: header file for particle vicinity (Cvicinity class) │ │ │ │ │ │ +// │ │ │ │ │ │ +00005 // This file is part of the SISCone project. │ │ │ │ │ │ +// │ │ │ │ │ │ +00006 // WARNING: this is not the main SISCone trunk but │ │ │ │ │ │ +// │ │ │ │ │ │ +00007 // │ │ │ │ │ │ +an adaptation to spherical coordinates │ │ │ │ │ │ +// │ │ │ │ │ │ +00008 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ +// │ │ │ │ │ │ +00009 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00010 // Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez │ │ │ │ │ │ +00011 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00012 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ +// │ │ │ │ │ │ +00013 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ +// │ │ │ │ │ │ +00014 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ +// │ │ │ │ │ │ +00015 // (at your option) any later version. │ │ │ │ │ │ +// │ │ │ │ │ │ +00016 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00017 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ +// │ │ │ │ │ │ +00018 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ +// │ │ │ │ │ │ +00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ +// │ │ │ │ │ │ +00020 // GNU General Public License for more details. │ │ │ │ │ │ +// │ │ │ │ │ │ +00021 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00022 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ +// │ │ │ │ │ │ +00023 // along with this program; if not, write to the Free Software │ │ │ │ │ │ +// │ │ │ │ │ │ +00024 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ +00025 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00026 // $Revision:: 255 │ │ │ │ │ │ +$// │ │ │ │ │ │ +00027 // $Date:: 2008-07-12 17:40:35 +0200 (Sat, 12 Jul 2008) │ │ │ │ │ │ +$// │ │ │ │ │ │ +00029 │ │ │ │ │ │ +00030 #ifndef __SPH_VICINITY_H__ │ │ │ │ │ │ +00031 #define __SPH_VICINITY_H__ │ │ │ │ │ │ +00032 │ │ │ │ │ │ +00033 #include │ │ │ │ │ │ +00034 #include │ │ │ │ │ │ +00035 #include │ │ │ │ │ │ +00036 #include "momentum.h" │ │ │ │ │ │ +00037 #include │ │ │ │ │ │ +00038 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ +00039 #include │ │ │ │ │ │ +00040 #endif │ │ │ │ │ │ +00041 │ │ │ │ │ │ +00042 namespace siscone_spherical{ │ │ │ │ │ │ +00043 │ │ │ │ │ │ +00044 │ │ │ │ │ │ +00052 class CSphvicinity_elm{ │ │ │ │ │ │ +00053 public: │ │ │ │ │ │ +00055 │ │ │ │ │ │ +CSphmomentum *v; │ │ │ │ │ │ +00056 │ │ │ │ │ │ +00058 │ │ │ │ │ │ +siscone::Cvicinity_inclusion *is_inside; │ │ │ │ │ │ +00059 │ │ │ │ │ │ +00060 │ │ │ │ │ │ +// centre variables │ │ │ │ │ │ +00061 │ │ │ │ │ │ +CSph3vector centre; │ │ │ │ │ │ +double angle; │ │ │ │ │ │ +00062 │ │ │ │ │ │ +00063 │ │ │ │ │ │ +bool side; │ │ │ │ │ │ +double cocircular_range; │ │ │ │ │ │ +00064 │ │ │ │ │ │ +00066 │ │ │ │ │ │ +00069 │ │ │ │ │ │ +std::list cocircular; │ │ │ │ │ │ +00070 }; │ │ │ │ │ │ +00071 │ │ │ │ │ │ +00073 bool ve_less(CSphvicinity_elm *ve1, CSphvicinity_elm *ve2); │ │ │ │ │ │ +00074 │ │ │ │ │ │ + │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.52 vicinity.h │ │ │ │ │ │ + │ │ │ │ │ │ +00075 │ │ │ │ │ │ +00083 class CSphvicinity{ │ │ │ │ │ │ +00084 public: │ │ │ │ │ │ +00086 │ │ │ │ │ │ +CSphvicinity(); │ │ │ │ │ │ +00087 │ │ │ │ │ │ +00089 │ │ │ │ │ │ +CSphvicinity(std::vector &_particle_list); │ │ │ │ │ │ +00090 │ │ │ │ │ │ +00092 │ │ │ │ │ │ +~CSphvicinity(); │ │ │ │ │ │ +00093 │ │ │ │ │ │ +00098 │ │ │ │ │ │ +void set_particle_list(std::vector &_particle_list); │ │ │ │ │ │ +00099 │ │ │ │ │ │ +void build(CSphmomentum *_parent, double _VR); │ │ │ │ │ │ +00105 │ │ │ │ │ │ +00106 │ │ │ │ │ │ +// cone kinematical information │ │ │ │ │ │ +00107 │ │ │ │ │ │ +00108 │ │ │ │ │ │ +CSphmomentum *parent; │ │ │ │ │ │ +double VR; │ │ │ │ │ │ +00109 │ │ │ │ │ │ +00110 │ │ │ │ │ │ +double VR2; │ │ │ │ │ │ +00111 │ │ │ │ │ │ +double cosVR; │ │ │ │ │ │ +double R; │ │ │ │ │ │ +00112 │ │ │ │ │ │ +00113 │ │ │ │ │ │ +double R2; │ │ │ │ │ │ +double tan2R; │ │ │ │ │ │ +00114 │ │ │ │ │ │ +00115 │ │ │ │ │ │ +double D2_R; │ │ │ │ │ │ +00116 │ │ │ │ │ │ +double inv_R_EPS_COCIRC; │ │ │ │ │ │ +double inv_R_2EPS_COCIRC; │ │ │ │ │ │ +00117 │ │ │ │ │ │ +00118 │ │ │ │ │ │ +// particle list information │ │ │ │ │ │ +00119 │ │ │ │ │ │ +00120 │ │ │ │ │ │ +int n_part; │ │ │ │ │ │ +00121 │ │ │ │ │ │ +std::vector plist; │ │ │ │ │ │ +00123 │ │ │ │ │ │ +std::vector pincluded; │ │ │ │ │ │ +00124 │ │ │ │ │ │ +CSphvicinity_elm *ve_list; │ │ │ │ │ │ +00125 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ +00126 │ │ │ │ │ │ +siscone::Cquadtree *quadtree; │ │ │ │ │ │ +00127 #endif │ │ │ │ │ │ +00128 │ │ │ │ │ │ +// vicinity information │ │ │ │ │ │ +00129 │ │ │ │ │ │ +00130 │ │ │ │ │ │ +std::vector vicinity; │ │ │ │ │ │ +00131 │ │ │ │ │ │ +unsigned int vicinity_size; │ │ │ │ │ │ +00132 │ │ │ │ │ │ +00133 protected: │ │ │ │ │ │ +void append_to_vicinity(CSphmomentum *v); │ │ │ │ │ │ +00139 │ │ │ │ │ │ +00140 │ │ │ │ │ │ +00141 │ │ │ │ │ │ +// internal variables │ │ │ │ │ │ +00142 │ │ │ │ │ │ +CSph3vector parent_centre; │ │ │ │ │ │ +00143 │ │ │ │ │ │ +CSph3vector angular_dir1; │ │ │ │ │ │ +00144 │ │ │ │ │ │ +CSph3vector angular_dir2; │ │ │ │ │ │ +00145 }; │ │ │ │ │ │ +00146 │ │ │ │ │ │ +00147 } │ │ │ │ │ │ +00148 │ │ │ │ │ │ +00149 #endif │ │ │ │ │ │ + │ │ │ │ │ │ +5.52 vicinity.h │ │ │ │ │ │ +00001 // -*- C++ -*00003 // File: vicinity.h │ │ │ │ │ │ +// │ │ │ │ │ │ +00004 // Description: header file for particle vicinity (Cvicinity class) │ │ │ │ │ │ +// │ │ │ │ │ │ +00005 // This file is part of the SISCone project. │ │ │ │ │ │ +// │ │ │ │ │ │ +00006 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ +// │ │ │ │ │ │ +00007 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00008 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ +// │ │ │ │ │ │ +00009 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00010 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ +// │ │ │ │ │ │ +00011 // it under the terms of the GNU General Public License as published by │ │ │ │ │ │ +// │ │ │ │ │ │ +00012 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ +// │ │ │ │ │ │ +00013 // (at your option) any later version. │ │ │ │ │ │ +// │ │ │ │ │ │ +00014 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00015 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ +// │ │ │ │ │ │ +00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ +// │ │ │ │ │ │ +00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ +// │ │ │ │ │ │ +00018 // GNU General Public License for more details. │ │ │ │ │ │ +// │ │ │ │ │ │ +00019 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00020 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ +// │ │ │ │ │ │ +00021 // along with this program; if not, write to the Free Software │ │ │ │ │ │ +// │ │ │ │ │ │ +00022 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ +00023 // │ │ │ │ │ │ +// │ │ │ │ │ │ +00024 // $Revision:: 123 │ │ │ │ │ │ +$// │ │ │ │ │ │ +00025 // $Date:: 2007-03-01 02:52:16 +0100 (Thu, 01 Mar 2007) │ │ │ │ │ │ +$// │ │ │ │ │ │ +00027 │ │ │ │ │ │ +00028 #ifndef __VICINITY_H__ │ │ │ │ │ │ +00029 #define __VICINITY_H__ │ │ │ │ │ │ +00030 │ │ │ │ │ │ +00031 #include │ │ │ │ │ │ +00032 #include │ │ │ │ │ │ + │ │ │ │ │ │ +Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +305 │ │ │ │ │ │ + │ │ │ │ │ │ + 306 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +00033 #include "momentum.h" │ │ │ │ │ │ +00034 #include "defines.h" │ │ │ │ │ │ +00035 #include "quadtree.h" │ │ │ │ │ │ +00036 │ │ │ │ │ │ +00037 namespace siscone{ │ │ │ │ │ │ +00038 │ │ │ │ │ │ +00039 │ │ │ │ │ │ +00040 │ │ │ │ │ │ +00046 class Cvicinity_inclusion { │ │ │ │ │ │ +00047 public: │ │ │ │ │ │ +00049 │ │ │ │ │ │ +Cvicinity_inclusion() : cone(false), cocirc(false) {} │ │ │ │ │ │ +00050 │ │ │ │ │ │ +00051 │ │ │ │ │ │ +bool cone; │ │ │ │ │ │ +bool cocirc; │ │ │ │ │ │ +00052 │ │ │ │ │ │ +00053 }; │ │ │ │ │ │ +00054 │ │ │ │ │ │ +00055 │ │ │ │ │ │ +00063 class Cvicinity_elm{ │ │ │ │ │ │ +00064 public: │ │ │ │ │ │ +00066 │ │ │ │ │ │ +Cmomentum *v; │ │ │ │ │ │ +00067 │ │ │ │ │ │ +00069 │ │ │ │ │ │ +Cvicinity_inclusion *is_inside; │ │ │ │ │ │ +00070 │ │ │ │ │ │ +00071 │ │ │ │ │ │ +// centre variables │ │ │ │ │ │ +00072 │ │ │ │ │ │ +double eta; │ │ │ │ │ │ +double phi; │ │ │ │ │ │ +00073 │ │ │ │ │ │ +00074 │ │ │ │ │ │ +double angle; │ │ │ │ │ │ +bool side; │ │ │ │ │ │ +00075 │ │ │ │ │ │ +00076 │ │ │ │ │ │ +double cocircular_range; │ │ │ │ │ │ +00078 │ │ │ │ │ │ +00081 │ │ │ │ │ │ +std::list cocircular; │ │ │ │ │ │ +00082 }; │ │ │ │ │ │ +00083 │ │ │ │ │ │ +00085 bool ve_less(Cvicinity_elm *ve1, Cvicinity_elm *ve2); │ │ │ │ │ │ +00086 │ │ │ │ │ │ +00087 │ │ │ │ │ │ +00095 class Cvicinity{ │ │ │ │ │ │ +00096 public: │ │ │ │ │ │ +00098 │ │ │ │ │ │ +Cvicinity(); │ │ │ │ │ │ +00099 │ │ │ │ │ │ +00101 │ │ │ │ │ │ +Cvicinity(std::vector &_particle_list); │ │ │ │ │ │ +00102 │ │ │ │ │ │ +00104 │ │ │ │ │ │ +~Cvicinity(); │ │ │ │ │ │ +00105 │ │ │ │ │ │ +00110 │ │ │ │ │ │ +void set_particle_list(std::vector &_particle_list); │ │ │ │ │ │ +00111 │ │ │ │ │ │ +void build(Cmomentum *_parent, double _VR); │ │ │ │ │ │ +00117 │ │ │ │ │ │ +00118 │ │ │ │ │ │ +00119 │ │ │ │ │ │ +// cone kinematical information │ │ │ │ │ │ +00120 │ │ │ │ │ │ +Cmomentum *parent; │ │ │ │ │ │ +00121 │ │ │ │ │ │ +double VR; │ │ │ │ │ │ +double VR2; │ │ │ │ │ │ +00122 │ │ │ │ │ │ +00123 │ │ │ │ │ │ +double R; │ │ │ │ │ │ +double R2; │ │ │ │ │ │ +00124 │ │ │ │ │ │ +00125 │ │ │ │ │ │ +double inv_R_EPS_COCIRC; │ │ │ │ │ │ +00126 │ │ │ │ │ │ +double inv_R_2EPS_COCIRC; │ │ │ │ │ │ +00127 │ │ │ │ │ │ +// particle list information │ │ │ │ │ │ +00128 │ │ │ │ │ │ +00129 │ │ │ │ │ │ +int n_part; │ │ │ │ │ │ +00130 │ │ │ │ │ │ +std::vector plist; │ │ │ │ │ │ +00131 │ │ │ │ │ │ +std::vector pincluded; │ │ │ │ │ │ +00132 │ │ │ │ │ │ +Cvicinity_elm *ve_list; │ │ │ │ │ │ +00133 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ +00134 │ │ │ │ │ │ +Cquadtree *quadtree; │ │ │ │ │ │ +00135 #endif │ │ │ │ │ │ +00136 │ │ │ │ │ │ +00137 │ │ │ │ │ │ +// vicinity information │ │ │ │ │ │ +00138 │ │ │ │ │ │ +std::vector vicinity; │ │ │ │ │ │ +unsigned int vicinity_size; │ │ │ │ │ │ +00139 │ │ │ │ │ │ +00140 │ │ │ │ │ │ +00141 protected: │ │ │ │ │ │ +00147 │ │ │ │ │ │ +void append_to_vicinity(Cmomentum *v); │ │ │ │ │ │ +00148 │ │ │ │ │ │ +// internal variables │ │ │ │ │ │ +00149 │ │ │ │ │ │ +00150 │ │ │ │ │ │ +double pcx; │ │ │ │ │ │ +double pcy; │ │ │ │ │ │ +00151 │ │ │ │ │ │ +00152 }; │ │ │ │ │ │ +00153 │ │ │ │ │ │ +00154 } │ │ │ │ │ │ +00155 │ │ │ │ │ │ +00156 #endif │ │ │ │ │ │ + │ │ │ │ │ │ Generated on Tue Jan 10 2023 17:32:40 for SISCone by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ Index │ │ │ │ │ │ _norm │ │ │ │ │ │ siscone::Cjet_area, 31 │ │ │ │ │ │ siscone_spherical::CSph3vector, 69 │ │ │ │ │ │ add │ │ │ │ │ │ @@ -29779,22 +29771,22 @@ │ │ │ │ │ │ siscone::Ceta_phi_range, 20 │ │ │ │ │ │ eta_min │ │ │ │ │ │ siscone::Ceta_phi_range, 20 │ │ │ │ │ │ eta_range │ │ │ │ │ │ siscone::Ceta_phi_range, 21 │ │ │ │ │ │ ev_name │ │ │ │ │ │ Coptions, 41 │ │ │ │ │ │ -examples/area.cpp, 185 │ │ │ │ │ │ -examples/main.cpp, 175 │ │ │ │ │ │ -examples/options.cpp, 176 │ │ │ │ │ │ -examples/options.h, 179 │ │ │ │ │ │ -examples/sample.cpp, 180 │ │ │ │ │ │ -examples/spherical.cpp, 181 │ │ │ │ │ │ -examples/test.cpp, 182 │ │ │ │ │ │ -examples/times.cpp, 184 │ │ │ │ │ │ +examples/area.cpp, 175 │ │ │ │ │ │ +examples/main.cpp, 180 │ │ │ │ │ │ +examples/options.cpp, 182 │ │ │ │ │ │ +examples/options.h, 185 │ │ │ │ │ │ +examples/sample.cpp, 185 │ │ │ │ │ │ +examples/spherical.cpp, 187 │ │ │ │ │ │ +examples/test.cpp, 188 │ │ │ │ │ │ +examples/times.cpp, 189 │ │ │ │ │ │ │ │ │ │ │ │ 309 │ │ │ │ │ │ │ │ │ │ │ │ siscone::hash_cones, 165 │ │ │ │ │ │ siscone_spherical::sph_hash_cones, 172 │ │ │ │ │ │ hash_cones │ │ │ │ │ │ siscone::hash_cones, 163 │ │ │ │ │ │ @@ -30131,23 +30123,23 @@ │ │ │ │ │ │ siscone_spherical::sph_hash_cones, 172 │ │ │ │ │ │ randomize │ │ │ │ │ │ siscone::Creference, 51 │ │ │ │ │ │ range │ │ │ │ │ │ siscone::Cjet, 27 │ │ │ │ │ │ siscone_spherical::CSphjet, 75 │ │ │ │ │ │ ranlux.h │ │ │ │ │ │ -ranlux_get, 219 │ │ │ │ │ │ -ranlux_init, 219 │ │ │ │ │ │ -ranlux_print_state, 219 │ │ │ │ │ │ +ranlux_get, 248 │ │ │ │ │ │ +ranlux_init, 248 │ │ │ │ │ │ +ranlux_print_state, 248 │ │ │ │ │ │ ranlux_get │ │ │ │ │ │ -ranlux.h, 219 │ │ │ │ │ │ +ranlux.h, 248 │ │ │ │ │ │ ranlux_init │ │ │ │ │ │ -ranlux.h, 219 │ │ │ │ │ │ +ranlux.h, 248 │ │ │ │ │ │ ranlux_print_state │ │ │ │ │ │ -ranlux.h, 219 │ │ │ │ │ │ +ranlux.h, 248 │ │ │ │ │ │ recompute_jets │ │ │ │ │ │ siscone::Csiscone, 59 │ │ │ │ │ │ siscone_spherical::CSphsiscone, 90 │ │ │ │ │ │ ref │ │ │ │ │ │ siscone::Cmomentum, 38 │ │ │ │ │ │ siscone::Creference, 52 │ │ │ │ │ │ siscone::hash_element, 167 │ │ │ │ │ │ @@ -30181,56 +30173,56 @@ │ │ │ │ │ │ siscone_spherical::CSphsplit_merge, 99 │ │ │ │ │ │ side │ │ │ │ │ │ siscone::Cvicinity_elm, 160 │ │ │ │ │ │ siscone_spherical::CSphvicinity_elm, 125 │ │ │ │ │ │ │ │ │ │ │ │ INDEX │ │ │ │ │ │ │ │ │ │ │ │ -siscone/area.cpp, 187 │ │ │ │ │ │ +siscone/area.cpp, 176 │ │ │ │ │ │ siscone/area.h, 191 │ │ │ │ │ │ siscone/circulator.h, 192 │ │ │ │ │ │ siscone/config.h, 193 │ │ │ │ │ │ siscone/config_raw.h, 194 │ │ │ │ │ │ siscone/defines.h, 195, 197 │ │ │ │ │ │ siscone/geom_2d.cpp, 198 │ │ │ │ │ │ -siscone/geom_2d.h, 202 │ │ │ │ │ │ -siscone/hash.cpp, 233 │ │ │ │ │ │ -siscone/hash.h, 238 │ │ │ │ │ │ -siscone/momentum.cpp, 239 │ │ │ │ │ │ -siscone/momentum.h, 204 │ │ │ │ │ │ -siscone/protocones.cpp, 245 │ │ │ │ │ │ -siscone/protocones.h, 208 │ │ │ │ │ │ -siscone/quadtree.cpp, 212 │ │ │ │ │ │ -siscone/quadtree.h, 215 │ │ │ │ │ │ -siscone/ranlux.cpp, 216 │ │ │ │ │ │ -siscone/ranlux.h, 218, 219 │ │ │ │ │ │ -siscone/reference.cpp, 220 │ │ │ │ │ │ -siscone/reference.h, 221 │ │ │ │ │ │ -siscone/siscone.cpp, 222 │ │ │ │ │ │ -siscone/siscone.h, 229 │ │ │ │ │ │ -siscone/siscone_error.cpp, 231 │ │ │ │ │ │ -siscone/siscone_error.h, 232 │ │ │ │ │ │ +siscone/geom_2d.h, 262 │ │ │ │ │ │ +siscone/hash.cpp, 202 │ │ │ │ │ │ +siscone/hash.h, 207 │ │ │ │ │ │ +siscone/momentum.cpp, 209 │ │ │ │ │ │ +siscone/momentum.h, 214 │ │ │ │ │ │ +siscone/protocones.cpp, 218 │ │ │ │ │ │ +siscone/protocones.h, 237 │ │ │ │ │ │ +siscone/quadtree.cpp, 241 │ │ │ │ │ │ +siscone/quadtree.h, 245 │ │ │ │ │ │ +siscone/ranlux.cpp, 245 │ │ │ │ │ │ +siscone/ranlux.h, 247, 249 │ │ │ │ │ │ +siscone/reference.cpp, 249 │ │ │ │ │ │ +siscone/reference.h, 251 │ │ │ │ │ │ +siscone/siscone.cpp, 252 │ │ │ │ │ │ +siscone/siscone.h, 259 │ │ │ │ │ │ +siscone/siscone_error.cpp, 261 │ │ │ │ │ │ +siscone/siscone_error.h, 261 │ │ │ │ │ │ siscone/spherical/geom_2d.cpp, 200 │ │ │ │ │ │ -siscone/spherical/geom_2d.h, 203 │ │ │ │ │ │ -siscone/spherical/hash.cpp, 235 │ │ │ │ │ │ -siscone/spherical/hash.h, 239 │ │ │ │ │ │ -siscone/spherical/momentum.cpp, 241 │ │ │ │ │ │ -siscone/spherical/momentum.h, 206 │ │ │ │ │ │ -siscone/spherical/protocones.cpp, 254 │ │ │ │ │ │ -siscone/spherical/protocones.h, 210 │ │ │ │ │ │ -siscone/spherical/siscone.cpp, 226 │ │ │ │ │ │ -siscone/spherical/siscone.h, 230 │ │ │ │ │ │ +siscone/spherical/geom_2d.h, 263 │ │ │ │ │ │ +siscone/spherical/hash.cpp, 205 │ │ │ │ │ │ +siscone/spherical/hash.h, 208 │ │ │ │ │ │ +siscone/spherical/momentum.cpp, 211 │ │ │ │ │ │ +siscone/spherical/momentum.h, 216 │ │ │ │ │ │ +siscone/spherical/protocones.cpp, 227 │ │ │ │ │ │ +siscone/spherical/protocones.h, 239 │ │ │ │ │ │ +siscone/spherical/siscone.cpp, 255 │ │ │ │ │ │ +siscone/spherical/siscone.h, 260 │ │ │ │ │ │ siscone/spherical/split_merge.cpp, 264 │ │ │ │ │ │ -siscone/spherical/split_merge.h, 291 │ │ │ │ │ │ -siscone/spherical/vicinity.cpp, 299 │ │ │ │ │ │ -siscone/spherical/vicinity.h, 297 │ │ │ │ │ │ +siscone/spherical/split_merge.h, 292 │ │ │ │ │ │ +siscone/spherical/vicinity.cpp, 297 │ │ │ │ │ │ +siscone/spherical/vicinity.h, 304 │ │ │ │ │ │ siscone/split_merge.cpp, 278 │ │ │ │ │ │ siscone/split_merge.h, 294 │ │ │ │ │ │ -siscone/vicinity.cpp, 303 │ │ │ │ │ │ -siscone/vicinity.h, 298 │ │ │ │ │ │ +siscone/vicinity.cpp, 300 │ │ │ │ │ │ +siscone/vicinity.h, 305 │ │ │ │ │ │ siscone::Carea, 7 │ │ │ │ │ │ ∼Carea, 13 │ │ │ │ │ │ Carea, 13 │ │ │ │ │ │ compute_active_areas, 13 │ │ │ │ │ │ compute_areas, 13 │ │ │ │ │ │ compute_passive_areas, 14 │ │ │ │ │ │ grid_eta_max, 15