--- /srv/reproducible-results/rbuild-debian/r-b-build.PJ3vv1Od/b1/siscone_3.0.5-2_armhf.changes +++ /srv/reproducible-results/rbuild-debian/r-b-build.PJ3vv1Od/b2/siscone_3.0.5-2_armhf.changes ├── Files │ @@ -2,9 +2,9 @@ │ 53778456c070332e66c16526b37a68c1 79112 libdevel optional libsiscone-dev_3.0.5-2_armhf.deb │ b0cfad68d1b6f853e904c9cb6fb1d1be 70760 libdevel optional libsiscone-spherical-dev_3.0.5-2_armhf.deb │ 823ff6f9c2341bf3a6b9d839e5861b08 416192 debug optional libsiscone-spherical0v5-dbgsym_3.0.5-2_armhf.deb │ f7f8e90018f87b59a85185a51a6b4bf3 52888 libs optional libsiscone-spherical0v5_3.0.5-2_armhf.deb │ 9a3a55f423e4fbdc0360725c1d5147e4 489168 debug optional libsiscone0v5-dbgsym_3.0.5-2_armhf.deb │ 99bd89d6bd474ff9af30f3ed644583b0 58192 libs optional libsiscone0v5_3.0.5-2_armhf.deb │ 59a250410c9d2ecd52fc5a9f5ac3e048 1054600 doc optional siscone-doc-html_3.0.5-2_all.deb │ - 96efb1ac72f6e2380df8558416701794 1465328 doc optional siscone-doc-pdf_3.0.5-2_all.deb │ + 38f050ebce99180d82dd6e4bcf7435ab 1464260 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-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 1464328 2023-01-10 17:32:40.000000 data.tar.xz │ │ +-rw-r--r-- 0 0 0 1463260 2023-01-10 17:32:40.000000 data.tar.xz │ ├── control.tar.xz │ │ ├── control.tar │ │ │ ├── ./control │ │ │ │ @@ -1,13 +1,13 @@ │ │ │ │ Package: siscone-doc-pdf │ │ │ │ Source: siscone │ │ │ │ Version: 3.0.5-2 │ │ │ │ Architecture: all │ │ │ │ Maintainer: Debian Science Maintainers │ │ │ │ -Installed-Size: 1446 │ │ │ │ +Installed-Size: 1445 │ │ │ │ Section: doc │ │ │ │ Priority: optional │ │ │ │ Multi-Arch: foreign │ │ │ │ Homepage: http://projects.hepforge.org/siscone/ │ │ │ │ Description: Developer's reference manual of SISCone (PDF) │ │ │ │ SISCone implements a Seedless Infrared (IR) Safe Cone jet algorithm, it takes │ │ │ │ N^2*ln(N) time to find jets among N particles, comparing to N*2^N time of │ │ │ ├── ./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) 1449164 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) 1448729 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 {} - │ │ │ │ │ │ @@ -1749,67 +1749,67 @@ │ │ │ │ │ │ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 │ │ │ │ │ │ │ │ │ │ │ │ 5.14.2 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 │ │ │ │ │ │ 5.14.2.1 twopi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 │ │ │ │ │ │ 5.15 defines.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 │ │ │ │ │ │ 5.16 geom_2d.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 │ │ │ │ │ │ 5.17 geom_2d.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 │ │ │ │ │ │ -5.18 hash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 │ │ │ │ │ │ -5.19 hash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 │ │ │ │ │ │ -5.20 protocones.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 │ │ │ │ │ │ -5.21 protocones.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 │ │ │ │ │ │ -5.22 protocones.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 │ │ │ │ │ │ -5.23 protocones.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 │ │ │ │ │ │ -5.24 quadtree.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 │ │ │ │ │ │ -5.25 quadtree.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 │ │ │ │ │ │ -5.26 ranlux.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 │ │ │ │ │ │ -5.27 siscone/ranlux.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 │ │ │ │ │ │ -5.27.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 │ │ │ │ │ │ -5.27.1.1 ranlux_get() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 │ │ │ │ │ │ -5.27.1.2 ranlux_init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 │ │ │ │ │ │ -5.27.1.3 ranlux_print_state() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 │ │ │ │ │ │ -5.28 ranlux.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 │ │ │ │ │ │ -5.29 reference.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 │ │ │ │ │ │ -5.30 reference.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 │ │ │ │ │ │ -5.31 siscone.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 │ │ │ │ │ │ -5.32 siscone.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 │ │ │ │ │ │ -5.33 siscone.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 │ │ │ │ │ │ -5.34 siscone.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 │ │ │ │ │ │ -5.35 siscone_error.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 │ │ │ │ │ │ -5.36 siscone_error.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 │ │ │ │ │ │ -5.37 geom_2d.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 │ │ │ │ │ │ -5.38 geom_2d.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 │ │ │ │ │ │ -5.39 hash.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 │ │ │ │ │ │ -5.40 hash.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 │ │ │ │ │ │ -5.41 momentum.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 │ │ │ │ │ │ -5.42 momentum.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 │ │ │ │ │ │ +5.18 geom_2d.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 │ │ │ │ │ │ +5.19 geom_2d.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 │ │ │ │ │ │ +5.20 hash.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 │ │ │ │ │ │ +5.21 hash.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 │ │ │ │ │ │ +5.22 momentum.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 │ │ │ │ │ │ +5.23 momentum.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 │ │ │ │ │ │ +5.24 momentum.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 │ │ │ │ │ │ +5.25 momentum.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 │ │ │ │ │ │ +5.26 protocones.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 │ │ │ │ │ │ +5.27 protocones.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 │ │ │ │ │ │ +5.28 protocones.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 │ │ │ │ │ │ +5.29 protocones.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241 │ │ │ │ │ │ +5.30 quadtree.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 │ │ │ │ │ │ +5.31 quadtree.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 │ │ │ │ │ │ +5.32 ranlux.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 │ │ │ │ │ │ +5.33 siscone/ranlux.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 │ │ │ │ │ │ +5.33.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 │ │ │ │ │ │ +5.33.1.1 ranlux_get() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 │ │ │ │ │ │ +5.33.1.2 ranlux_init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 │ │ │ │ │ │ +5.33.1.3 ranlux_print_state() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 │ │ │ │ │ │ +5.34 ranlux.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 │ │ │ │ │ │ +5.35 reference.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 │ │ │ │ │ │ +5.36 reference.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 │ │ │ │ │ │ +5.37 siscone.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 │ │ │ │ │ │ +5.38 siscone.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 │ │ │ │ │ │ +5.39 siscone.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261 │ │ │ │ │ │ +5.40 siscone.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 │ │ │ │ │ │ +5.41 siscone_error.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 │ │ │ │ │ │ +5.42 siscone_error.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ xvi │ │ │ │ │ │ │ │ │ │ │ │ -5.43 momentum.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 │ │ │ │ │ │ -5.44 momentum.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 │ │ │ │ │ │ -5.45 vicinity.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 │ │ │ │ │ │ -5.46 vicinity.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 │ │ │ │ │ │ +5.43 hash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 │ │ │ │ │ │ +5.44 hash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265 │ │ │ │ │ │ +5.45 vicinity.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 │ │ │ │ │ │ +5.46 vicinity.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 │ │ │ │ │ │ 5.47 split_merge.cpp │ │ │ │ │ │ │ │ │ │ │ │ -. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 │ │ │ │ │ │ +. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269 │ │ │ │ │ │ │ │ │ │ │ │ 5.48 split_merge.cpp │ │ │ │ │ │ │ │ │ │ │ │ -. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 │ │ │ │ │ │ +. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283 │ │ │ │ │ │ │ │ │ │ │ │ -5.49 split_merge.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300 │ │ │ │ │ │ -5.50 split_merge.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 │ │ │ │ │ │ -5.51 vicinity.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 │ │ │ │ │ │ -5.52 vicinity.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 │ │ │ │ │ │ +5.49 split_merge.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 │ │ │ │ │ │ +5.50 split_merge.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299 │ │ │ │ │ │ +5.51 vicinity.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 │ │ │ │ │ │ +5.52 vicinity.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305 │ │ │ │ │ │ Index │ │ │ │ │ │ │ │ │ │ │ │ -311 │ │ │ │ │ │ +309 │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ Chapter 1 │ │ │ │ │ │ │ │ │ │ │ │ Hierarchical Index │ │ │ │ │ │ │ │ │ │ │ │ @@ -2079,34 +2079,34 @@ │ │ │ │ │ │ 176 │ │ │ │ │ │ 191 │ │ │ │ │ │ 192 │ │ │ │ │ │ 193 │ │ │ │ │ │ 194 │ │ │ │ │ │ 196 │ │ │ │ │ │ 199 │ │ │ │ │ │ -249 │ │ │ │ │ │ -252 │ │ │ │ │ │ 203 │ │ │ │ │ │ -257 │ │ │ │ │ │ -262 │ │ │ │ │ │ 205 │ │ │ │ │ │ -224 │ │ │ │ │ │ -228 │ │ │ │ │ │ -232 │ │ │ │ │ │ -232 │ │ │ │ │ │ -235 │ │ │ │ │ │ -236 │ │ │ │ │ │ -238 │ │ │ │ │ │ +264 │ │ │ │ │ │ +211 │ │ │ │ │ │ +216 │ │ │ │ │ │ +220 │ │ │ │ │ │ 239 │ │ │ │ │ │ +243 │ │ │ │ │ │ 246 │ │ │ │ │ │ -248 │ │ │ │ │ │ -248 │ │ │ │ │ │ -287 │ │ │ │ │ │ -303 │ │ │ │ │ │ -270 │ │ │ │ │ │ +247 │ │ │ │ │ │ +249 │ │ │ │ │ │ +251 │ │ │ │ │ │ +253 │ │ │ │ │ │ +254 │ │ │ │ │ │ +261 │ │ │ │ │ │ +263 │ │ │ │ │ │ +263 │ │ │ │ │ │ +283 │ │ │ │ │ │ +299 │ │ │ │ │ │ +305 │ │ │ │ │ │ │ │ │ │ │ │ 6 │ │ │ │ │ │ │ │ │ │ │ │ File Index │ │ │ │ │ │ │ │ │ │ │ │ siscone/vicinity.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . │ │ │ │ │ │ siscone/spherical/geom_2d.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . │ │ │ │ │ │ @@ -2120,29 +2120,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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . │ │ │ │ │ │ │ │ │ │ │ │ -307 │ │ │ │ │ │ +267 │ │ │ │ │ │ 201 │ │ │ │ │ │ -251 │ │ │ │ │ │ -254 │ │ │ │ │ │ 204 │ │ │ │ │ │ -259 │ │ │ │ │ │ -264 │ │ │ │ │ │ -214 │ │ │ │ │ │ -226 │ │ │ │ │ │ -242 │ │ │ │ │ │ -247 │ │ │ │ │ │ -273 │ │ │ │ │ │ -300 │ │ │ │ │ │ +208 │ │ │ │ │ │ +265 │ │ │ │ │ │ +212 │ │ │ │ │ │ +217 │ │ │ │ │ │ +229 │ │ │ │ │ │ +241 │ │ │ │ │ │ +257 │ │ │ │ │ │ +262 │ │ │ │ │ │ +269 │ │ │ │ │ │ +296 │ │ │ │ │ │ +301 │ │ │ │ │ │ 266 │ │ │ │ │ │ -306 │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ Chapter 4 │ │ │ │ │ │ │ │ │ │ │ │ Class Documentation │ │ │ │ │ │ │ │ │ │ │ │ @@ -13918,15 +13918,15 @@ │ │ │ │ │ │ 00149 │ │ │ │ │ │ 00150 // test overlap │ │ │ │ │ │ 00151 // - r1 first range │ │ │ │ │ │ 00152 // - r2 second range │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 5.18 hash.h │ │ │ │ │ │ + 5.18 geom_2d.h │ │ │ │ │ │ │ │ │ │ │ │ 203 │ │ │ │ │ │ │ │ │ │ │ │ 00153 // return true if overlap, false otherwise. │ │ │ │ │ │ 00154 //-----------------------------------------00155 bool is_range_overlap(const CSphtheta_phi_range &r1, const CSphtheta_phi_range &r2){ │ │ │ │ │ │ 00156 │ │ │ │ │ │ // check overlap in eta AND phi │ │ │ │ │ │ @@ -13955,18 +13955,18 @@ │ │ │ │ │ │ 00174 │ │ │ │ │ │ 00175 │ │ │ │ │ │ return tmp; │ │ │ │ │ │ 00176 } │ │ │ │ │ │ 00177 │ │ │ │ │ │ 00178 } │ │ │ │ │ │ │ │ │ │ │ │ -5.18 hash.h │ │ │ │ │ │ -00001 // -*- C++ -*00003 // File: hash.h │ │ │ │ │ │ +5.18 geom_2d.h │ │ │ │ │ │ +00001 // -*- C++ -*00003 // File: geom_2d.h │ │ │ │ │ │ // │ │ │ │ │ │ -00004 // Description: header file for classes hash_element and hash_cones │ │ │ │ │ │ +00004 // Description: header file for two-dimensional geometry tools │ │ │ │ │ │ // │ │ │ │ │ │ 00005 // This file is part of the SISCone project. │ │ │ │ │ │ // │ │ │ │ │ │ 00006 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ // │ │ │ │ │ │ 00007 // │ │ │ │ │ │ // │ │ │ │ │ │ @@ -13997,109 +13997,1905 @@ │ │ │ │ │ │ 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 │ │ │ │ │ │ +00024 // $Revision:: 422 │ │ │ │ │ │ $// │ │ │ │ │ │ -00025 // $Date:: 2008-05-16 19:58:30 +0200 (Fri, 16 May 2008) │ │ │ │ │ │ +00025 // $Date:: 2020-04-22 11:51:09 +0200 (Wed, 22 Apr 2020) │ │ │ │ │ │ $// │ │ │ │ │ │ 00027 │ │ │ │ │ │ -00028 #ifndef __HASH_H__ │ │ │ │ │ │ -00029 #define __HASH_H__ │ │ │ │ │ │ +00028 #ifndef __GEOM_2D_H__ │ │ │ │ │ │ +00029 #define __GEOM_2D_H__ │ │ │ │ │ │ 00030 │ │ │ │ │ │ -00031 #include "momentum.h" │ │ │ │ │ │ -00032 #include "reference.h" │ │ │ │ │ │ +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) { │ │ │ │ │ │ +double delta = fabs(phi1-phi2); │ │ │ │ │ │ +00061 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 204 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +00062 │ │ │ │ │ │ +return delta > M_PI ? twopi-delta : delta; │ │ │ │ │ │ +00063 } │ │ │ │ │ │ +00064 │ │ │ │ │ │ +00066 inline double pow2(double x) {return x*x;} │ │ │ │ │ │ +00067 │ │ │ │ │ │ +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; │ │ │ │ │ │ +static double eta_max; │ │ │ │ │ │ +00150 │ │ │ │ │ │ +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 │ │ │ │ │ │ +} │ │ │ │ │ │ +00157 │ │ │ │ │ │ +inline unsigned int get_phi_cell(double phi){ │ │ │ │ │ │ +00159 │ │ │ │ │ │ +00160 │ │ │ │ │ │ +return (unsigned int) (1u « ((int) (32*phi/twopi+16)%32)); │ │ │ │ │ │ +00161 │ │ │ │ │ │ +} │ │ │ │ │ │ +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.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 // │ │ │ │ │ │ +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. │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.20 hash.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +205 │ │ │ │ │ │ + │ │ │ │ │ │ +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:: 422 │ │ │ │ │ │ +$// │ │ │ │ │ │ +00027 // $Date:: 2020-04-22 11:51:09 +0200 (Wed, 22 Apr 2020) │ │ │ │ │ │ +$// │ │ │ │ │ │ +00029 │ │ │ │ │ │ +00030 #ifndef __SPH_GEOM_2D_H__ │ │ │ │ │ │ +00031 #define __SPH_GEOM_2D_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{ │ │ │ │ │ │ +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 │ │ │ │ │ │ +int add_particle(const double theta, const double phi); │ │ │ │ │ │ +00072 │ │ │ │ │ │ +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 │ │ │ │ │ │ +} │ │ │ │ │ │ +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.20 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 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ + 206 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +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 namespace siscone{ │ │ │ │ │ │ +00034 using namespace std; │ │ │ │ │ │ 00035 │ │ │ │ │ │ -00045 class hash_element{ │ │ │ │ │ │ -00046 public: │ │ │ │ │ │ -00047 │ │ │ │ │ │ -Creference ref; │ │ │ │ │ │ +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){ │ │ │ │ │ │ +int i; │ │ │ │ │ │ 00048 │ │ │ │ │ │ -double eta; │ │ │ │ │ │ -double phi; │ │ │ │ │ │ 00049 │ │ │ │ │ │ 00050 │ │ │ │ │ │ -bool is_stable; │ │ │ │ │ │ -00051 │ │ │ │ │ │ +n_cones = 0; │ │ │ │ │ │ +00051 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ 00052 │ │ │ │ │ │ -hash_element *next; │ │ │ │ │ │ -00053 }; │ │ │ │ │ │ +n_occupied_cells = 0; │ │ │ │ │ │ +00053 #endif │ │ │ │ │ │ 00054 │ │ │ │ │ │ -00062 class hash_cones{ │ │ │ │ │ │ -00063 public: │ │ │ │ │ │ +// 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)); │ │ │ │ │ │ +if (nbits<1) nbits=1; │ │ │ │ │ │ +00060 │ │ │ │ │ │ +00061 │ │ │ │ │ │ +mask = 1 « nbits; │ │ │ │ │ │ +00062 │ │ │ │ │ │ +00063 │ │ │ │ │ │ +// create hash │ │ │ │ │ │ +00064 │ │ │ │ │ │ +hash_array = new hash_element*[mask]; │ │ │ │ │ │ +00065 │ │ │ │ │ │ +mask--; │ │ │ │ │ │ +00066 │ │ │ │ │ │ +// set the array to 0 │ │ │ │ │ │ 00067 │ │ │ │ │ │ -hash_cones(int _Np, double _R2); │ │ │ │ │ │ 00068 │ │ │ │ │ │ +//? needed ? │ │ │ │ │ │ +00069 │ │ │ │ │ │ +for (i=0;inext; │ │ │ │ │ │ +00085 │ │ │ │ │ │ +delete elm; │ │ │ │ │ │ +00086 │ │ │ │ │ │ +} │ │ │ │ │ │ +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){ │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 204 │ │ │ │ │ │ + 5.20 hash.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +00103 │ │ │ │ │ │ +hash_element *elm; │ │ │ │ │ │ +int index = (v->ref.ref[0]) & mask; │ │ │ │ │ │ +00104 │ │ │ │ │ │ +00105 │ │ │ │ │ │ +00106 │ │ │ │ │ │ +// check the array cell corresponding to our reference │ │ │ │ │ │ +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){ │ │ │ │ │ │ +00117 │ │ │ │ │ │ +// create element │ │ │ │ │ │ +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 │ │ │ │ │ │ +00125 │ │ │ │ │ │ +//compute vectors centre │ │ │ │ │ │ +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++; │ │ │ │ │ │ +00139 │ │ │ │ │ │ +return 0; │ │ │ │ │ │ +00140 │ │ │ │ │ │ +} │ │ │ │ │ │ +00141 │ │ │ │ │ │ +// if the cone is already there, simply update stability status │ │ │ │ │ │ +00142 │ │ │ │ │ │ +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 │ │ │ │ │ │ +} │ │ │ │ │ │ +00155 │ │ │ │ │ │ +return 0; │ │ │ │ │ │ +00156 │ │ │ │ │ │ +} │ │ │ │ │ │ +00157 │ │ │ │ │ │ +00158 │ │ │ │ │ │ +elm = elm->next; │ │ │ │ │ │ +00159 │ │ │ │ │ │ +} while (1); │ │ │ │ │ │ +00160 │ │ │ │ │ │ +return 1; │ │ │ │ │ │ +00161 │ │ │ │ │ │ +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; │ │ │ │ │ │ +int index = (v->ref.ref[0]) & mask; │ │ │ │ │ │ +00173 │ │ │ │ │ │ +00174 │ │ │ │ │ │ +//cout « "-- stable candidate: " « v->ref[0] « ":" « endl; │ │ │ │ │ │ +00175 │ │ │ │ │ │ +00176 │ │ │ │ │ │ +// check the array cell corresponding to our reference │ │ │ │ │ │ +00177 │ │ │ │ │ │ +elm = hash_array[index]; │ │ │ │ │ │ +do{ │ │ │ │ │ │ +00178 │ │ │ │ │ │ +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; │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +207 │ │ │ │ │ │ + │ │ │ │ │ │ + 208 │ │ │ │ │ │ │ │ │ │ │ │ File Documentation │ │ │ │ │ │ │ │ │ │ │ │ +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’. │ │ │ │ │ │ +00215 * - centre │ │ │ │ │ │ +centre of the circle │ │ │ │ │ │ +particle to test │ │ │ │ │ │ +00216 * - v │ │ │ │ │ │ +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 │ │ │ │ │ │ + │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.21 hash.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +209 │ │ │ │ │ │ + │ │ │ │ │ │ +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 │ │ │ │ │ │ +// create hash │ │ │ │ │ │ +00065 │ │ │ │ │ │ +00066 │ │ │ │ │ │ +hash_array = new sph_hash_element*[mask]; │ │ │ │ │ │ +00067 │ │ │ │ │ │ +mask--; │ │ │ │ │ │ +00068 │ │ │ │ │ │ +// set the array to 0 │ │ │ │ │ │ +00069 │ │ │ │ │ │ +00070 │ │ │ │ │ │ +//? needed ? │ │ │ │ │ │ +00071 │ │ │ │ │ │ +for (i=0;inext; │ │ │ │ │ │ +00088 │ │ │ │ │ │ +delete elm; │ │ │ │ │ │ +00089 │ │ │ │ │ │ +} │ │ │ │ │ │ 00090 │ │ │ │ │ │ -int insert(Cmomentum *v); │ │ │ │ │ │ +} │ │ │ │ │ │ 00091 │ │ │ │ │ │ -00093 │ │ │ │ │ │ -hash_element **hash_array; │ │ │ │ │ │ +delete[] hash_array; │ │ │ │ │ │ +00092 │ │ │ │ │ │ +00093 } │ │ │ │ │ │ 00094 │ │ │ │ │ │ -00096 │ │ │ │ │ │ -int n_cones; │ │ │ │ │ │ +00095 │ │ │ │ │ │ +00096 /* │ │ │ │ │ │ +00097 * insert a new candidate into the hash. │ │ │ │ │ │ +4-momentum of the cone to add │ │ │ │ │ │ +00098 * - v │ │ │ │ │ │ +00099 * - parent parent particle defining the cone │ │ │ │ │ │ +child particle defining the cone │ │ │ │ │ │ +00100 * - child │ │ │ │ │ │ +00101 * - p_io │ │ │ │ │ │ +whether the parent has to belong to the cone or not │ │ │ │ │ │ +whether the child has to belong to the cone or not │ │ │ │ │ │ +00102 * - c_io │ │ │ │ │ │ +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{ │ │ │ │ │ │ +00118 │ │ │ │ │ │ +// if it is not present, add it │ │ │ │ │ │ +00119 │ │ │ │ │ │ +if (elm==NULL){ │ │ │ │ │ │ +00120 │ │ │ │ │ │ +// create element │ │ │ │ │ │ +00121 │ │ │ │ │ │ +elm = new sph_hash_element; │ │ │ │ │ │ +00122 │ │ │ │ │ │ +00123 │ │ │ │ │ │ +// set its varibles │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 210 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +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++; │ │ │ │ │ │ +return 0; │ │ │ │ │ │ +00138 │ │ │ │ │ │ +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)); │ │ │ │ │ │ +00146 │ │ │ │ │ │ +//cout « " parent/child: " │ │ │ │ │ │ +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 │ │ │ │ │ │ +} │ │ │ │ │ │ +00153 │ │ │ │ │ │ +return 0; │ │ │ │ │ │ +00154 │ │ │ │ │ │ +} │ │ │ │ │ │ +00155 │ │ │ │ │ │ +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 │ │ │ │ │ │ +00174 │ │ │ │ │ │ +// check the array cell corresponding to our reference │ │ │ │ │ │ +00175 │ │ │ │ │ │ +elm = hash_array[index]; │ │ │ │ │ │ +00176 │ │ │ │ │ │ +do{ │ │ │ │ │ │ +// if it is not present, add it │ │ │ │ │ │ +00177 │ │ │ │ │ │ +00178 │ │ │ │ │ │ +if (elm==NULL){ │ │ │ │ │ │ +00179 │ │ │ │ │ │ +// create element │ │ │ │ │ │ +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 │ │ │ │ │ │ +// if the cone is already there, we have nothing to do │ │ │ │ │ │ +00196 │ │ │ │ │ │ +00197 │ │ │ │ │ │ +if (v->ref == elm->centre.ref){ │ │ │ │ │ │ +00198 │ │ │ │ │ │ +return 0; │ │ │ │ │ │ +00199 │ │ │ │ │ │ +} │ │ │ │ │ │ +00200 │ │ │ │ │ │ +00201 │ │ │ │ │ │ +elm = elm->next; │ │ │ │ │ │ +00202 │ │ │ │ │ │ +} while (1); │ │ │ │ │ │ +00203 │ │ │ │ │ │ +return 1; │ │ │ │ │ │ +00204 │ │ │ │ │ │ +00205 } │ │ │ │ │ │ +00206 │ │ │ │ │ │ +00207 } │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.22 momentum.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +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 │ │ │ │ │ │ +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; │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +211 │ │ │ │ │ │ + │ │ │ │ │ │ + 212 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +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 │ │ │ │ │ │ -00099 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ +Cmomentum tmp = *this; │ │ │ │ │ │ +00098 │ │ │ │ │ │ +return tmp+=v; │ │ │ │ │ │ +00099 } │ │ │ │ │ │ 00100 │ │ │ │ │ │ -int n_occupied_cells; │ │ │ │ │ │ -00101 #endif │ │ │ │ │ │ +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 │ │ │ │ │ │ +return *this; │ │ │ │ │ │ +00112 │ │ │ │ │ │ +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(){ │ │ │ │ │ │ +00135 │ │ │ │ │ │ +// note: the factor n (ref.nb) cancels in all expressions !! │ │ │ │ │ │ +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.23 momentum.cpp │ │ │ │ │ │ +00001 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.23 momentum.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +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(); │ │ │ │ │ │ +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 //------------------------------------------------ │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +213 │ │ │ │ │ │ + │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ + 214 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +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; │ │ │ │ │ │ 00102 │ │ │ │ │ │ +return tmp/=r; │ │ │ │ │ │ +00103 } │ │ │ │ │ │ 00104 │ │ │ │ │ │ -int mask; │ │ │ │ │ │ -00105 │ │ │ │ │ │ -double R2; │ │ │ │ │ │ +00105 // incrementation │ │ │ │ │ │ +00106 //-----------------------------------------------00107 CSph3vector& CSph3vector::operator += (const CSph3vector &v){ │ │ │ │ │ │ 00108 │ │ │ │ │ │ +px+=v.px; │ │ │ │ │ │ 00109 │ │ │ │ │ │ -inline bool is_inside(Cmomentum *centre, Cmomentum *v); │ │ │ │ │ │ +py+=v.py; │ │ │ │ │ │ +00110 │ │ │ │ │ │ +pz+=v.pz; │ │ │ │ │ │ +00111 │ │ │ │ │ │ +return *this; │ │ │ │ │ │ +00112 │ │ │ │ │ │ +00113 } │ │ │ │ │ │ +00114 │ │ │ │ │ │ +00115 // decrementation │ │ │ │ │ │ +00116 //-----------------------------------------------00117 CSph3vector& CSph3vector::operator -= (const CSph3vector &v){ │ │ │ │ │ │ 00118 │ │ │ │ │ │ -00119 }; │ │ │ │ │ │ +px-=v.px; │ │ │ │ │ │ +00119 │ │ │ │ │ │ +py-=v.py; │ │ │ │ │ │ 00120 │ │ │ │ │ │ -00121 } │ │ │ │ │ │ -00122 #endif │ │ │ │ │ │ +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 { │ │ │ │ │ │ +if (pz < py){ │ │ │ │ │ │ +00171 │ │ │ │ │ │ +00172 │ │ │ │ │ │ +// z smallest │ │ │ │ │ │ │ │ │ │ │ │ -5.19 hash.h │ │ │ │ │ │ -00001 // -*- C++ -*00003 // File: hash.h │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.23 momentum.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +00173 │ │ │ │ │ │ +angular_dir1 = CSph3vector(-py, px, 0.0); │ │ │ │ │ │ +00174 │ │ │ │ │ │ +} else { │ │ │ │ │ │ +00175 │ │ │ │ │ │ +// y smallest │ │ │ │ │ │ +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 │ │ │ │ │ │ +// 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; │ │ │ │ │ │ +00235 │ │ │ │ │ │ +return *this; │ │ │ │ │ │ +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 } │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +215 │ │ │ │ │ │ + │ │ │ │ │ │ + 216 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +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; │ │ │ │ │ │ +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){ │ │ │ │ │ │ +return v1._theta < v2._theta; │ │ │ │ │ │ +00284 │ │ │ │ │ │ +00285 } │ │ │ │ │ │ +00286 │ │ │ │ │ │ +00287 // ordering of vectors in pt │ │ │ │ │ │ +00288 //--------------------------00289 bool momentum_pt_less(const CSphmomentum &v1, const CSphmomentum &v2){ │ │ │ │ │ │ +00290 │ │ │ │ │ │ +return v1.perp2() < v2.perp2(); │ │ │ │ │ │ +00291 } │ │ │ │ │ │ +00292 │ │ │ │ │ │ +00293 } │ │ │ │ │ │ +00294 │ │ │ │ │ │ + │ │ │ │ │ │ +5.24 momentum.h │ │ │ │ │ │ +00001 // -*- C++ -*00003 // File: momentum.h │ │ │ │ │ │ // │ │ │ │ │ │ -00004 // Description: header file for classes hash_element and hash_cones │ │ │ │ │ │ +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 │ │ │ │ │ │ +00006 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ // │ │ │ │ │ │ 00007 // │ │ │ │ │ │ -an adaptation to spherical coordinates │ │ │ │ │ │ // │ │ │ │ │ │ -00008 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ +00008 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ // │ │ │ │ │ │ 00009 // │ │ │ │ │ │ // │ │ │ │ │ │ -00010 // Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez │ │ │ │ │ │ +00010 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ // │ │ │ │ │ │ -00011 // │ │ │ │ │ │ +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:: 163 │ │ │ │ │ │ +$// │ │ │ │ │ │ +00025 // $Date:: 2007-04-26 22:31:02 +0200 (Thu, 26 Apr 2007) │ │ │ │ │ │ +$// │ │ │ │ │ │ +00027 │ │ │ │ │ │ +00028 #ifndef __VECTOR_H__ │ │ │ │ │ │ +00029 #define __VECTOR_H__ │ │ │ │ │ │ +00030 │ │ │ │ │ │ +00031 #include │ │ │ │ │ │ +00032 #include │ │ │ │ │ │ +00033 #include "reference.h" │ │ │ │ │ │ +00034 #include "geom_2d.h" │ │ │ │ │ │ +00035 #include "defines.h" │ │ │ │ │ │ +00036 │ │ │ │ │ │ +00037 namespace siscone{ │ │ │ │ │ │ +00038 │ │ │ │ │ │ +00049 class Cmomentum{ │ │ │ │ │ │ +00050 public: │ │ │ │ │ │ +00052 │ │ │ │ │ │ +Cmomentum(); │ │ │ │ │ │ +00053 │ │ │ │ │ │ +00055 │ │ │ │ │ │ +Cmomentum(double _px, double _py, double _pz, double _E); │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.25 momentum.h │ │ │ │ │ │ + │ │ │ │ │ │ +217 │ │ │ │ │ │ + │ │ │ │ │ │ +00056 │ │ │ │ │ │ +00058 │ │ │ │ │ │ +Cmomentum(double _eta, double _phi, Creference _ref); │ │ │ │ │ │ +00059 │ │ │ │ │ │ +00061 │ │ │ │ │ │ +~Cmomentum(); │ │ │ │ │ │ +00062 │ │ │ │ │ │ +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 │ │ │ │ │ │ +inline double mass2()const {return perpmass2()-perp2();} │ │ │ │ │ │ +00073 │ │ │ │ │ │ +00074 │ │ │ │ │ │ +inline double perpmass()const {return sqrt((E-pz)*(E+pz));} │ │ │ │ │ │ +00076 │ │ │ │ │ │ +00077 │ │ │ │ │ │ +00079 │ │ │ │ │ │ +inline double perpmass2()const {return (E-pz)*(E+pz);} │ │ │ │ │ │ +00080 │ │ │ │ │ │ +inline double Et()const {return E/sqrt(1.0+pz*pz/perp2());} │ │ │ │ │ │ +00082 │ │ │ │ │ │ +00083 │ │ │ │ │ │ +inline double Et2()const {return E*E/(1.0+pz*pz/perp2());} │ │ │ │ │ │ +00085 │ │ │ │ │ │ +00086 │ │ │ │ │ │ +00088 │ │ │ │ │ │ +Cmomentum& operator = (const Cmomentum &v); │ │ │ │ │ │ +00089 │ │ │ │ │ │ +const Cmomentum operator + (const Cmomentum &v); │ │ │ │ │ │ +00092 │ │ │ │ │ │ +00093 │ │ │ │ │ │ +00096 │ │ │ │ │ │ +Cmomentum& operator += (const Cmomentum &v); │ │ │ │ │ │ +00097 │ │ │ │ │ │ +00100 │ │ │ │ │ │ +Cmomentum& operator -= (const Cmomentum &v); │ │ │ │ │ │ +00101 │ │ │ │ │ │ +00107 │ │ │ │ │ │ +void build_etaphi(); │ │ │ │ │ │ +00108 │ │ │ │ │ │ +double px; │ │ │ │ │ │ +00109 │ │ │ │ │ │ +double py; │ │ │ │ │ │ +00110 │ │ │ │ │ │ +00111 │ │ │ │ │ │ +double pz; │ │ │ │ │ │ +00112 │ │ │ │ │ │ +double E; │ │ │ │ │ │ +00113 │ │ │ │ │ │ +double eta; │ │ │ │ │ │ +00114 │ │ │ │ │ │ +double phi; │ │ │ │ │ │ +00115 │ │ │ │ │ │ +00116 │ │ │ │ │ │ +int parent_index; │ │ │ │ │ │ +int index; │ │ │ │ │ │ +00117 │ │ │ │ │ │ +00118 │ │ │ │ │ │ +00120 │ │ │ │ │ │ +// the following part is used for checksums // │ │ │ │ │ │ +00122 │ │ │ │ │ │ +Creference ref; │ │ │ │ │ │ +00123 }; │ │ │ │ │ │ +00124 │ │ │ │ │ │ +00127 bool operator < (const Cmomentum &v1, const Cmomentum &v2); │ │ │ │ │ │ +00128 │ │ │ │ │ │ +00130 bool momentum_eta_less(const Cmomentum &v1, const Cmomentum &v2); │ │ │ │ │ │ +00131 │ │ │ │ │ │ +00133 bool momentum_pt_less(const Cmomentum &v1, const Cmomentum &v2); │ │ │ │ │ │ +00134 │ │ │ │ │ │ +00135 │ │ │ │ │ │ +00137 // some handy utilities // │ │ │ │ │ │ +00139 │ │ │ │ │ │ +00144 inline double get_distance(double eta, double phi, Cmomentum *v){ │ │ │ │ │ │ +00145 │ │ │ │ │ │ +double dx, dy; │ │ │ │ │ │ +00146 │ │ │ │ │ │ +00147 │ │ │ │ │ │ +dx = eta - v->eta; │ │ │ │ │ │ +00148 │ │ │ │ │ │ +dy = fabs(phi - v->phi); │ │ │ │ │ │ +if (dy>M_PI) │ │ │ │ │ │ +00149 │ │ │ │ │ │ +00150 │ │ │ │ │ │ +dy -= twopi; │ │ │ │ │ │ +00151 │ │ │ │ │ │ +00152 │ │ │ │ │ │ +return dx*dx+dy*dy; │ │ │ │ │ │ +00153 } │ │ │ │ │ │ +00154 │ │ │ │ │ │ +00155 } │ │ │ │ │ │ +00156 │ │ │ │ │ │ +00157 #endif │ │ │ │ │ │ + │ │ │ │ │ │ +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 │ │ │ │ │ │ +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 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ // │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ + 218 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 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 // │ │ │ │ │ │ @@ -14117,83 +15913,275 @@ │ │ │ │ │ │ 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 │ │ │ │ │ │ +00026 // $Revision:: 256 │ │ │ │ │ │ $// │ │ │ │ │ │ -00027 // $Date:: 2009-05-01 17:15:04 +0200 (Fri, 01 May 2009) │ │ │ │ │ │ +00027 // $Date:: 2008-07-14 13:52:16 +0200 (Mon, 14 Jul 2008) │ │ │ │ │ │ $// │ │ │ │ │ │ 00029 │ │ │ │ │ │ -00030 #ifndef __SPH_HASH_H__ │ │ │ │ │ │ -00031 #define __SPH_HASH_H__ │ │ │ │ │ │ +00030 #ifndef __SPH_VECTOR_H__ │ │ │ │ │ │ +00031 #define __SPH_VECTOR_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); │ │ │ │ │ │ +00033 #include │ │ │ │ │ │ +00034 #include │ │ │ │ │ │ +00035 #include │ │ │ │ │ │ +00036 #include "geom_2d.h" │ │ │ │ │ │ +00037 #include │ │ │ │ │ │ +00038 │ │ │ │ │ │ +00039 namespace siscone_spherical{ │ │ │ │ │ │ +00040 │ │ │ │ │ │ +00054 class CSph3vector{ │ │ │ │ │ │ +00055 public: │ │ │ │ │ │ +00057 │ │ │ │ │ │ +CSph3vector(); │ │ │ │ │ │ +00058 │ │ │ │ │ │ +00060 │ │ │ │ │ │ +CSph3vector(double _px, double _py, double _pz); │ │ │ │ │ │ +00061 │ │ │ │ │ │ +00063 │ │ │ │ │ │ +~CSph3vector(); │ │ │ │ │ │ +00064 │ │ │ │ │ │ 00066 │ │ │ │ │ │ -00068 │ │ │ │ │ │ -~sph_hash_cones(); │ │ │ │ │ │ -00069 │ │ │ │ │ │ +CSph3vector& operator = (const CSph3vector &v); │ │ │ │ │ │ +00067 │ │ │ │ │ │ +const CSph3vector operator + (const CSph3vector &v); │ │ │ │ │ │ +00070 │ │ │ │ │ │ +00071 │ │ │ │ │ │ +00074 │ │ │ │ │ │ +const CSph3vector operator - (const CSph3vector &v); │ │ │ │ │ │ +00075 │ │ │ │ │ │ +const CSph3vector operator / (const double &r); │ │ │ │ │ │ +00078 │ │ │ │ │ │ 00079 │ │ │ │ │ │ -int insert(CSphmomentum *v, CSphmomentum *parent, CSphmomentum *child, bool p_io, bool c_io); │ │ │ │ │ │ -00080 │ │ │ │ │ │ -int insert(CSphmomentum *v); │ │ │ │ │ │ -00088 │ │ │ │ │ │ -00089 │ │ │ │ │ │ +00082 │ │ │ │ │ │ +CSph3vector& operator += (const CSph3vector &v); │ │ │ │ │ │ +00083 │ │ │ │ │ │ +00086 │ │ │ │ │ │ +CSph3vector& operator -= (const CSph3vector &v); │ │ │ │ │ │ +00087 │ │ │ │ │ │ +00090 │ │ │ │ │ │ +CSph3vector& operator *= (const double &r); │ │ │ │ │ │ 00091 │ │ │ │ │ │ -sph_hash_element **hash_array; │ │ │ │ │ │ -00092 │ │ │ │ │ │ -int n_cones; │ │ │ │ │ │ 00094 │ │ │ │ │ │ +CSph3vector& operator /= (const double &r); │ │ │ │ │ │ 00095 │ │ │ │ │ │ -00097 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ +inline double perp()const {return sqrt(perp2());} │ │ │ │ │ │ +00097 │ │ │ │ │ │ 00098 │ │ │ │ │ │ -int n_occupied_cells; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.20 protocones.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -205 │ │ │ │ │ │ - │ │ │ │ │ │ -00099 #endif │ │ │ │ │ │ 00100 │ │ │ │ │ │ -00102 │ │ │ │ │ │ -int mask; │ │ │ │ │ │ +inline double perp2()const {return px*px+py*py;} │ │ │ │ │ │ +00101 │ │ │ │ │ │ +inline double norm()const {return sqrt(px*px+py*py+pz*pz);} │ │ │ │ │ │ 00103 │ │ │ │ │ │ -double R2; │ │ │ │ │ │ +00104 │ │ │ │ │ │ +inline double norm2()const {return px*px+py*py+pz*pz;} │ │ │ │ │ │ 00106 │ │ │ │ │ │ 00107 │ │ │ │ │ │ -double tan2R; │ │ │ │ │ │ +inline double phi()const {return atan2(py, px);} │ │ │ │ │ │ 00109 │ │ │ │ │ │ -00110 }; │ │ │ │ │ │ -00111 │ │ │ │ │ │ -00112 } │ │ │ │ │ │ -00113 #endif │ │ │ │ │ │ +00110 │ │ │ │ │ │ +inline double theta()const {return atan2(perp(),pz);} │ │ │ │ │ │ +00112 │ │ │ │ │ │ +00113 │ │ │ │ │ │ +void build_norm(); │ │ │ │ │ │ +00120 │ │ │ │ │ │ +00121 │ │ │ │ │ │ +00125 │ │ │ │ │ │ +void build_thetaphi(); │ │ │ │ │ │ +00126 │ │ │ │ │ │ +void get_angular_directions(CSph3vector &angular_dir1, CSph3vector &angular_dir2); │ │ │ │ │ │ +00129 │ │ │ │ │ │ +00130 │ │ │ │ │ │ +double px; │ │ │ │ │ │ +00131 │ │ │ │ │ │ +double py; │ │ │ │ │ │ +00132 │ │ │ │ │ │ +00133 │ │ │ │ │ │ +double pz; │ │ │ │ │ │ +00134 │ │ │ │ │ │ +double _norm; │ │ │ │ │ │ +00135 │ │ │ │ │ │ +00136 │ │ │ │ │ │ +double _theta; │ │ │ │ │ │ +double _phi; │ │ │ │ │ │ +00137 │ │ │ │ │ │ +00138 │ │ │ │ │ │ +// the following part is used for checksums // │ │ │ │ │ │ +00140 │ │ │ │ │ │ +00142 │ │ │ │ │ │ +siscone::Creference ref; │ │ │ │ │ │ +00143 }; │ │ │ │ │ │ +00144 │ │ │ │ │ │ +00158 class CSphmomentum : public CSph3vector{ │ │ │ │ │ │ +00159 public: │ │ │ │ │ │ +00161 │ │ │ │ │ │ +CSphmomentum(); │ │ │ │ │ │ +00162 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.25 momentum.h │ │ │ │ │ │ + │ │ │ │ │ │ +219 │ │ │ │ │ │ + │ │ │ │ │ │ +00164 │ │ │ │ │ │ +CSphmomentum(CSph3vector &init, double E=0.0); │ │ │ │ │ │ +00165 │ │ │ │ │ │ +00167 │ │ │ │ │ │ +CSphmomentum(double _px, double _py, double _pz, double _E); │ │ │ │ │ │ +00168 │ │ │ │ │ │ +//CSphmomentum(double _eta, double _phi, siscone::Creference _ref); │ │ │ │ │ │ +00170 │ │ │ │ │ │ +00171 │ │ │ │ │ │ +00173 │ │ │ │ │ │ +~CSphmomentum(); │ │ │ │ │ │ +00174 │ │ │ │ │ │ +00176 │ │ │ │ │ │ +inline double mass()const {return sqrt(mass2());} │ │ │ │ │ │ +00177 │ │ │ │ │ │ +00179 │ │ │ │ │ │ +inline double mass2()const {return perpmass2()-perp2();} │ │ │ │ │ │ +00180 │ │ │ │ │ │ +inline double perpmass()const {return sqrt((E-pz)*(E+pz));} │ │ │ │ │ │ +00182 │ │ │ │ │ │ +00183 │ │ │ │ │ │ +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 │ │ │ │ │ │ +00194 │ │ │ │ │ │ +CSphmomentum& operator = (const CSphmomentum &v); │ │ │ │ │ │ +00195 │ │ │ │ │ │ +00198 │ │ │ │ │ │ +const CSphmomentum operator + (const CSphmomentum &v); │ │ │ │ │ │ +00199 │ │ │ │ │ │ +00202 │ │ │ │ │ │ +CSphmomentum& operator += (const CSphmomentum &v); │ │ │ │ │ │ +00203 │ │ │ │ │ │ +00206 │ │ │ │ │ │ +CSphmomentum& operator -= (const CSphmomentum &v); │ │ │ │ │ │ +00207 │ │ │ │ │ │ +double E; │ │ │ │ │ │ +00208 │ │ │ │ │ │ +00209 │ │ │ │ │ │ +int parent_index; │ │ │ │ │ │ +00210 │ │ │ │ │ │ +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); │ │ │ │ │ │ +00223 │ │ │ │ │ │ +00224 │ │ │ │ │ │ +00226 // some handy utilities // │ │ │ │ │ │ +00228 │ │ │ │ │ │ +00230 inline double sqr(double x){return x*x;} │ │ │ │ │ │ +00231 │ │ │ │ │ │ +00235 inline double dot_product3(const CSph3vector &v1, const CSph3vector &v2){ │ │ │ │ │ │ +//double tmp = v1.px*v2.px + v1.py*v2.py + v1.pz*v2.pz; │ │ │ │ │ │ +00236 │ │ │ │ │ │ +00237 │ │ │ │ │ │ +//if (!isfinite(tmp)){ │ │ │ │ │ │ +00238 │ │ │ │ │ │ +// std::cout « "dot_product inf: " « std::endl; │ │ │ │ │ │ +00239 │ │ │ │ │ │ +// std::cout « " angles: " « v1._theta « " " « v1._phi « " and " « v2._theta « " " « v2._phi « │ │ │ │ │ │ +std::endl; │ │ │ │ │ │ +00240 │ │ │ │ │ │ +// std::cout « " moms : " « v1.px « " " « v1.py « " " « v1.pz │ │ │ │ │ │ +00241 │ │ │ │ │ │ +// │ │ │ │ │ │ +« " and " │ │ │ │ │ │ +« v2.px « " " « v2.py « " " « v2.pz « std::endl; │ │ │ │ │ │ +00242 │ │ │ │ │ │ +//} │ │ │ │ │ │ +00243 │ │ │ │ │ │ +return v1.px*v2.px + v1.py*v2.py + v1.pz*v2.pz; │ │ │ │ │ │ +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; │ │ │ │ │ │ +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); │ │ │ │ │ │ +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); │ │ │ │ │ │ +00265 } │ │ │ │ │ │ +00266 │ │ │ │ │ │ +00270 inline double get_tan2_distance(const CSphmomentum &v1, const CSphmomentum &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){ │ │ │ │ │ │ +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); │ │ │ │ │ │ +return (dot>=0) && (norm2_cross_product3(*v1,*v2)<=tan2R*dot*dot); │ │ │ │ │ │ +00291 │ │ │ │ │ │ +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()); │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 220 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +00301 │ │ │ │ │ │ +//double dot = dot_product3(*v1,*v2); │ │ │ │ │ │ +00302 │ │ │ │ │ │ +//return (dot>=0) && (norm2_cross_product3(*v1,*v2) │ │ │ │ │ │ 00063 #include │ │ │ │ │ │ 00064 #include "circulator.h" │ │ │ │ │ │ 00065 #include │ │ │ │ │ │ 00066 │ │ │ │ │ │ 00067 namespace siscone{ │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ +00068 │ │ │ │ │ │ │ │ │ │ │ │ * │ │ │ │ │ │ │ │ │ │ │ │ - 206 │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.26 protocones.cpp │ │ │ │ │ │ │ │ │ │ │ │ -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 │ │ │ │ │ │ // │ │ │ │ │ │ +00080 // INITIALISATION FUNCTIONS │ │ │ │ │ │ 00081 // - ctor() │ │ │ │ │ │ // │ │ │ │ │ │ 00082 // - ctor(particle_list) │ │ │ │ │ │ // │ │ │ │ │ │ 00083 // - dtor() │ │ │ │ │ │ // │ │ │ │ │ │ 00084 // - init(particle_list) │ │ │ │ │ │ @@ -14355,107 +16343,109 @@ │ │ │ │ │ │ nb_tot = 0; │ │ │ │ │ │ 00100 │ │ │ │ │ │ hc = NULL; │ │ │ │ │ │ 00101 } │ │ │ │ │ │ 00102 │ │ │ │ │ │ 00103 // default dtor │ │ │ │ │ │ 00104 //-------------00105 Cstable_cones::~Cstable_cones(){ │ │ │ │ │ │ -if (hc!=NULL) delete hc; │ │ │ │ │ │ 00106 │ │ │ │ │ │ +if (hc!=NULL) delete hc; │ │ │ │ │ │ 00107 } │ │ │ │ │ │ 00108 │ │ │ │ │ │ 00109 /* │ │ │ │ │ │ 00110 * initialisation │ │ │ │ │ │ 00111 * - _particle_list list of particles │ │ │ │ │ │ -number of particles │ │ │ │ │ │ 00112 * - _n │ │ │ │ │ │ +number of particles │ │ │ │ │ │ 00113 *********************************************************************/ │ │ │ │ │ │ 00114 void Cstable_cones::init(vector &_particle_list){ │ │ │ │ │ │ -// check already allocated mem │ │ │ │ │ │ 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 │ │ │ │ │ │ +00124 │ │ │ │ │ │ 00125 │ │ │ │ │ │ set_particle_list(_particle_list); │ │ │ │ │ │ 00126 } │ │ │ │ │ │ 00127 │ │ │ │ │ │ 00128 │ │ │ │ │ │ -00130 // ALGORITHM MAIN ENTRY │ │ │ │ │ │ // │ │ │ │ │ │ +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) │ │ │ │ │ │ -radius of the cones │ │ │ │ │ │ 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){ │ │ │ │ │ │ -00142 │ │ │ │ │ │ int p_idx; │ │ │ │ │ │ +00142 │ │ │ │ │ │ 00143 │ │ │ │ │ │ // check if everything is correctly initialised │ │ │ │ │ │ 00144 │ │ │ │ │ │ 00145 │ │ │ │ │ │ if (n_part==0){ │ │ │ │ │ │ -return 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 │ │ │ │ │ │ -00155 │ │ │ │ │ │ // 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 │ │ │ │ │ │ +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; │ │ │ │ │ │ @@ -14575,57 +16565,53 @@ │ │ │ │ │ │ 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: │ │ │ │ │ │ +00243 │ │ │ │ │ │ 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){ │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -207 │ │ │ │ │ │ - │ │ │ │ │ │ - 208 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ + 5.26 protocones.cpp │ │ │ │ │ │ │ │ │ │ │ │ -00247 │ │ │ │ │ │ -if (centre->side){ │ │ │ │ │ │ -// test when both particles are not in the cone │ │ │ │ │ │ 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()){ │ │ │ │ │ │ +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 { │ │ │ │ │ │ -// test when 1! of the particles is in the cone │ │ │ │ │ │ 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; │ │ │ │ │ │ @@ -14644,44 +16630,44 @@ │ │ │ │ │ │ 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(){ │ │ │ │ │ │ -00280 │ │ │ │ │ │ // get the next child and centre │ │ │ │ │ │ +00280 │ │ │ │ │ │ 00281 │ │ │ │ │ │ centre_idx++; │ │ │ │ │ │ -if (centre_idx==vicinity_size) │ │ │ │ │ │ 00282 │ │ │ │ │ │ +if (centre_idx==vicinity_size) │ │ │ │ │ │ 00283 │ │ │ │ │ │ centre_idx=0; │ │ │ │ │ │ if (centre_idx==first_cone) │ │ │ │ │ │ 00284 │ │ │ │ │ │ -00285 │ │ │ │ │ │ return 1; │ │ │ │ │ │ +00285 │ │ │ │ │ │ 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){ │ │ │ │ │ │ -00292 │ │ │ │ │ │ // update cone │ │ │ │ │ │ +00292 │ │ │ │ │ │ 00293 │ │ │ │ │ │ cone += (*child); │ │ │ │ │ │ 00294 │ │ │ │ │ │ -00295 │ │ │ │ │ │ // 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); │ │ │ │ │ │ @@ -14691,42 +16677,42 @@ │ │ │ │ │ │ 00302 │ │ │ │ │ │ // update centre and child to correspond to the new position │ │ │ │ │ │ 00303 │ │ │ │ │ │ centre = vicinity[centre_idx]; │ │ │ │ │ │ 00304 │ │ │ │ │ │ child = centre->v; │ │ │ │ │ │ 00305 │ │ │ │ │ │ -00306 │ │ │ │ │ │ // check cocircularity │ │ │ │ │ │ +00306 │ │ │ │ │ │ 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()) │ │ │ │ │ │ -return update_cone(); │ │ │ │ │ │ 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 │ │ │ │ │ │ +00320 │ │ │ │ │ │ 00321 │ │ │ │ │ │ cone -= (*child); │ │ │ │ │ │ 00322 │ │ │ │ │ │ // update info on particles inside │ │ │ │ │ │ 00323 │ │ │ │ │ │ 00324 │ │ │ │ │ │ centre->is_inside->cone = false; │ │ │ │ │ │ @@ -14734,29 +16720,33 @@ │ │ │ │ │ │ // 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 │ │ │ │ │ │ +// 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| │ │ │ │ │ │ 00333 │ │ │ │ │ │ // since last recomputation and once the ratio overpasses a threshold │ │ │ │ │ │ +00334 │ │ │ │ │ │ +// we recompute vicinity. │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 5.20 protocones.cpp │ │ │ │ │ │ +223 │ │ │ │ │ │ + │ │ │ │ │ │ + 224 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ │ │ │ │ │ │ -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 │ │ │ │ │ │ @@ -14775,38 +16765,38 @@ │ │ │ │ │ │ 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; │ │ │ │ │ │ +00353 │ │ │ │ │ │ 00354 │ │ │ │ │ │ hash_element *elm; │ │ │ │ │ │ 00355 │ │ │ │ │ │ -00356 │ │ │ │ │ │ //n=0; │ │ │ │ │ │ +00356 │ │ │ │ │ │ 00357 │ │ │ │ │ │ for (i=0;i<=hc->mask;i++){ │ │ │ │ │ │ -00358 │ │ │ │ │ │ // test ith cell of the hash array │ │ │ │ │ │ +00358 │ │ │ │ │ │ 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 │ │ │ │ │ │ +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 │ │ │ │ │ │ @@ -14828,16 +16818,16 @@ │ │ │ │ │ │ 00378 │ │ │ │ │ │ protocones.push_back(Cmomentum(elm->eta, elm->phi, elm->ref)); │ │ │ │ │ │ 00379 │ │ │ │ │ │ } │ │ │ │ │ │ 00380 │ │ │ │ │ │ } │ │ │ │ │ │ 00381 │ │ │ │ │ │ -00382 │ │ │ │ │ │ // jump to the next one │ │ │ │ │ │ +00382 │ │ │ │ │ │ 00383 │ │ │ │ │ │ elm = elm->next; │ │ │ │ │ │ 00384 │ │ │ │ │ │ } │ │ │ │ │ │ 00385 │ │ │ │ │ │ } │ │ │ │ │ │ 00386 │ │ │ │ │ │ @@ -14850,21 +16840,21 @@ │ │ │ │ │ │ 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 │ │ │ │ │ │ +delete hc; │ │ │ │ │ │ 00396 │ │ │ │ │ │ hc=NULL; │ │ │ │ │ │ 00397 │ │ │ │ │ │ -00398 │ │ │ │ │ │ return protocones.size(); │ │ │ │ │ │ +00398 │ │ │ │ │ │ 00399 } │ │ │ │ │ │ 00400 │ │ │ │ │ │ 00401 │ │ │ │ │ │ 00403 // ALGORITHM MAIN STEPS FOR COCIRCULAR SITUATIONS │ │ │ │ │ │ // │ │ │ │ │ │ 00404 // - cocircular_pt_less(v1, v2) │ │ │ │ │ │ // │ │ │ │ │ │ @@ -14874,36 +16864,32 @@ │ │ │ │ │ │ // │ │ │ │ │ │ 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(); │ │ │ │ │ │ +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... │ │ │ │ │ │ 00423 **********************************************************************/ │ │ │ │ │ │ +00424 void Cstable_cones::prepare_cocircular_lists() { │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -209 │ │ │ │ │ │ - │ │ │ │ │ │ - 210 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ + 5.26 protocones.cpp │ │ │ │ │ │ │ │ │ │ │ │ -00424 void Cstable_cones::prepare_cocircular_lists() { │ │ │ │ │ │ 00425 │ │ │ │ │ │ circulator::iterator > here(vicinity.begin(), │ │ │ │ │ │ 00426 │ │ │ │ │ │ vicinity.begin(), │ │ │ │ │ │ 00427 │ │ │ │ │ │ vicinity.end()); │ │ │ │ │ │ 00428 │ │ │ │ │ │ @@ -14913,59 +16899,59 @@ │ │ │ │ │ │ do { │ │ │ │ │ │ 00431 │ │ │ │ │ │ 00432 │ │ │ │ │ │ Cvicinity_elm* here_pntr = *here(); │ │ │ │ │ │ 00433 │ │ │ │ │ │ search.set_position(here); │ │ │ │ │ │ 00434 │ │ │ │ │ │ -// search forwards for things that should have "here" included in │ │ │ │ │ │ 00435 │ │ │ │ │ │ +// search forwards for things that should have "here" included in │ │ │ │ │ │ 00436 │ │ │ │ │ │ // their cocircularity list │ │ │ │ │ │ 00437 │ │ │ │ │ │ while (true) { │ │ │ │ │ │ 00438 │ │ │ │ │ │ ++search; │ │ │ │ │ │ -00439 │ │ │ │ │ │ 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 { │ │ │ │ │ │ -break; │ │ │ │ │ │ 00444 │ │ │ │ │ │ +break; │ │ │ │ │ │ 00445 │ │ │ │ │ │ } │ │ │ │ │ │ 00446 │ │ │ │ │ │ } │ │ │ │ │ │ 00447 │ │ │ │ │ │ // search backwards │ │ │ │ │ │ 00448 │ │ │ │ │ │ 00449 │ │ │ │ │ │ search.set_position(here); │ │ │ │ │ │ -00450 │ │ │ │ │ │ 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 { │ │ │ │ │ │ -00457 │ │ │ │ │ │ break; │ │ │ │ │ │ +00457 │ │ │ │ │ │ 00458 │ │ │ │ │ │ } │ │ │ │ │ │ 00459 │ │ │ │ │ │ } │ │ │ │ │ │ 00460 │ │ │ │ │ │ 00461 │ │ │ │ │ │ ++here; │ │ │ │ │ │ @@ -14985,84 +16971,86 @@ │ │ │ │ │ │ 00474 │ │ │ │ │ │ list & border_list) { │ │ │ │ │ │ 00475 │ │ │ │ │ │ vector border_vect; │ │ │ │ │ │ 00476 │ │ │ │ │ │ 00477 │ │ │ │ │ │ border_vect.reserve(border_list.size()); │ │ │ │ │ │ -00478 │ │ │ │ │ │ for (list::iterator it = border_list.begin(); │ │ │ │ │ │ +00478 │ │ │ │ │ │ 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 │ │ │ │ │ │ +// set up some circulators, since these will help us go around the │ │ │ │ │ │ 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 │ │ │ │ │ │ -// test the borderless cone │ │ │ │ │ │ 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 { │ │ │ │ │ │ -// reset status wrt inclusion in the cone │ │ │ │ │ │ 00499 │ │ │ │ │ │ +// reset status wrt inclusion in the cone │ │ │ │ │ │ 00500 │ │ │ │ │ │ mid = start; │ │ │ │ │ │ -do { │ │ │ │ │ │ 00501 │ │ │ │ │ │ +do { │ │ │ │ │ │ 00502 │ │ │ │ │ │ mid()->is_in = false; │ │ │ │ │ │ 00503 │ │ │ │ │ │ } while (++mid != start); │ │ │ │ │ │ 00504 │ │ │ │ │ │ -00505 │ │ │ │ │ │ // now run over all inclusion possibilities with this starting point │ │ │ │ │ │ +00505 │ │ │ │ │ │ 00506 │ │ │ │ │ │ candidate = borderless_cone; │ │ │ │ │ │ -00507 │ │ │ │ │ │ while (++mid != start) { │ │ │ │ │ │ -// will begin with start+1 and go up to start-1 │ │ │ │ │ │ +00507 │ │ │ │ │ │ 00508 │ │ │ │ │ │ +// will begin with start+1 and go up to start-1 │ │ │ │ │ │ 00509 │ │ │ │ │ │ mid()->is_in = true; │ │ │ │ │ │ 00510 │ │ │ │ │ │ candidate += *(mid()->mom); │ │ │ │ │ │ +00511 │ │ │ │ │ │ +test_stability(candidate, border_vect); │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 5.20 protocones.cpp │ │ │ │ │ │ +225 │ │ │ │ │ │ │ │ │ │ │ │ -211 │ │ │ │ │ │ + 226 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ │ │ │ │ │ │ -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 │ │ │ │ │ │ @@ -15076,61 +17064,61 @@ │ │ │ │ │ │ 00520 │ │ │ │ │ │ test_stability(candidate, border_vect); │ │ │ │ │ │ 00521 } │ │ │ │ │ │ 00522 │ │ │ │ │ │ 00523 │ │ │ │ │ │ 00530 void Cstable_cones::test_stability(Cmomentum & candidate, const vector & border_vect) { │ │ │ │ │ │ 00531 │ │ │ │ │ │ -00532 │ │ │ │ │ │ // 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++) { │ │ │ │ │ │ -if (is_inside(&candidate, border_vect[i].mom) ^ (border_vect[i].is_in)) { │ │ │ │ │ │ +00536 │ │ │ │ │ │ 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); │ │ │ │ │ │ +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(){ │ │ │ │ │ │ -// check if many configurations have the same centre. │ │ │ │ │ │ 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 │ │ │ │ │ │ -if (centre->cocircular.empty()) return false; │ │ │ │ │ │ 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 │ │ │ │ │ │ @@ -15146,16 +17134,16 @@ │ │ │ │ │ │ 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 │ │ │ │ │ │ +00576 │ │ │ │ │ │ 00577 │ │ │ │ │ │ // first make sure parent and child are in! │ │ │ │ │ │ 00578 │ │ │ │ │ │ 00579 │ │ │ │ │ │ list removed_from_cone; │ │ │ │ │ │ 00580 │ │ │ │ │ │ list put_in_border; │ │ │ │ │ │ @@ -15179,41 +17167,39 @@ │ │ │ │ │ │ 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) { │ │ │ │ │ │ +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 │ │ │ │ │ │ +// if a point appears twice (i.e. with + and - sign) in the list of │ │ │ │ │ │ 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 │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 212 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ + 5.26 protocones.cpp │ │ │ │ │ │ │ │ │ │ │ │ -00604 │ │ │ │ │ │ -// close to 2R from the parent │ │ │ │ │ │ 00605 │ │ │ │ │ │ if (!(*it)->is_inside->cocirc) { │ │ │ │ │ │ 00606 │ │ │ │ │ │ border += *((*it)->v); │ │ │ │ │ │ 00607 │ │ │ │ │ │ (*it)->is_inside->cocirc = true; │ │ │ │ │ │ 00608 │ │ │ │ │ │ @@ -15230,49 +17216,49 @@ │ │ │ │ │ │ // figure out whether this pairing has been observed before │ │ │ │ │ │ 00615 │ │ │ │ │ │ Cmomentum borderless_cone = cone; │ │ │ │ │ │ 00616 │ │ │ │ │ │ borderless_cone -= cone_removal; │ │ │ │ │ │ bool consider = true; │ │ │ │ │ │ 00617 │ │ │ │ │ │ -00618 │ │ │ │ │ │ for (unsigned int i=0;i(borderless_cone.ref, │ │ │ │ │ │ 00628 │ │ │ │ │ │ border.ref)); │ │ │ │ │ │ 00629 │ │ │ │ │ │ -00630 │ │ │ │ │ │ // 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; │ │ │ │ │ │ +00632 │ │ │ │ │ │ 00633 │ │ │ │ │ │ 00634 │ │ │ │ │ │ recompute_cone_contents_if_needed(borderless_cone, total_dpt); │ │ │ │ │ │ 00635 │ │ │ │ │ │ if (total_dpt == 0) { │ │ │ │ │ │ -// a recomputation has taken place -- so take advantage of this │ │ │ │ │ │ 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 │ │ │ │ │ │ @@ -15280,16 +17266,16 @@ │ │ │ │ │ │ 00641 │ │ │ │ │ │ 00642 │ │ │ │ │ │ test_cone_cocircular(borderless_cone, border_list); │ │ │ │ │ │ 00643 │ │ │ │ │ │ } │ │ │ │ │ │ 00644 │ │ │ │ │ │ 00645 │ │ │ │ │ │ -// relabel things that were in the cone but got removed │ │ │ │ │ │ 00646 │ │ │ │ │ │ +// relabel things that were in the cone but got removed │ │ │ │ │ │ 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 │ │ │ │ │ │ @@ -15302,25 +17288,25 @@ │ │ │ │ │ │ 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 │ │ │ │ │ │ +00658 │ │ │ │ │ │ 00659 │ │ │ │ │ │ // been through the co-circularity rigmarole │ │ │ │ │ │ 00660 │ │ │ │ │ │ return true; │ │ │ │ │ │ 00661 } │ │ │ │ │ │ 00662 │ │ │ │ │ │ 00663 │ │ │ │ │ │ -00665 // RECOMPUTATION OF CONE CONTENTS │ │ │ │ │ │ // │ │ │ │ │ │ +00665 // RECOMPUTATION OF CONE CONTENTS │ │ │ │ │ │ 00666 // - compute_cone_contents() │ │ │ │ │ │ // │ │ │ │ │ │ 00667 // - recompute_cone_contents() │ │ │ │ │ │ // │ │ │ │ │ │ 00668 // - recompute_cone_contents_if_needed() │ │ │ │ │ │ // │ │ │ │ │ │ 00670 │ │ │ │ │ │ @@ -15329,83 +17315,87 @@ │ │ │ │ │ │ circulator::iterator > │ │ │ │ │ │ 00681 │ │ │ │ │ │ start(vicinity.begin()+first_cone, vicinity.begin(), vicinity.end()); │ │ │ │ │ │ 00682 │ │ │ │ │ │ 00683 │ │ │ │ │ │ circulator::iterator > here(start); │ │ │ │ │ │ 00684 │ │ │ │ │ │ -00685 │ │ │ │ │ │ // 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 │ │ │ │ │ │ -do { │ │ │ │ │ │ 00691 │ │ │ │ │ │ -00692 │ │ │ │ │ │ +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 │ │ │ │ │ │ // move on to the next position │ │ │ │ │ │ 00697 │ │ │ │ │ │ 00698 │ │ │ │ │ │ ++here; │ │ │ │ │ │ 00699 │ │ │ │ │ │ -00700 │ │ │ │ │ │ // as we arrive at this position a particle leaves if its side is positive │ │ │ │ │ │ +00700 │ │ │ │ │ │ +00701 │ │ │ │ │ │ +if ((*here())->side) ((*here())->is_inside->cone) = 0; │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 5.20 protocones.cpp │ │ │ │ │ │ +227 │ │ │ │ │ │ + │ │ │ │ │ │ + 228 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ │ │ │ │ │ │ -00701 │ │ │ │ │ │ -if ((*here())->side) ((*here())->is_inside->cone) = 0; │ │ │ │ │ │ 00702 │ │ │ │ │ │ } while (here != start); │ │ │ │ │ │ 00703 │ │ │ │ │ │ -00704 │ │ │ │ │ │ // 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(); │ │ │ │ │ │ -00708 │ │ │ │ │ │ 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 │ │ │ │ │ │ +unsigned int i; │ │ │ │ │ │ 00720 │ │ │ │ │ │ // set momentum to 0 │ │ │ │ │ │ 00721 │ │ │ │ │ │ 00722 │ │ │ │ │ │ cone = Cmomentum(); │ │ │ │ │ │ 00723 │ │ │ │ │ │ -// Important note: we can browse only the particles │ │ │ │ │ │ 00724 │ │ │ │ │ │ +// Important note: we can browse only the particles │ │ │ │ │ │ 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 │ │ │ │ │ │ @@ -15417,59 +17407,59 @@ │ │ │ │ │ │ 00731 │ │ │ │ │ │ if ((vicinity[i]->side) && (vicinity[i]->is_inside->cone)) │ │ │ │ │ │ 00732 │ │ │ │ │ │ cone += *vicinity[i]->v; │ │ │ │ │ │ 00733 │ │ │ │ │ │ } │ │ │ │ │ │ 00734 │ │ │ │ │ │ -00735 │ │ │ │ │ │ // 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 │ │ │ │ │ │ -in this version, we use the │ │ │ │ │ │ 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, │ │ │ │ │ │ -double & this_dpt){ │ │ │ │ │ │ 00747 │ │ │ │ │ │ +double & this_dpt){ │ │ │ │ │ │ 00748 │ │ │ │ │ │ -00749 │ │ │ │ │ │ if (this_dpt > PT_TSHOLD*(fabs(this_cone.px)+fabs(this_cone.py))) { │ │ │ │ │ │ -if (cone.ref.is_empty()) { │ │ │ │ │ │ +00749 │ │ │ │ │ │ 00750 │ │ │ │ │ │ +if (cone.ref.is_empty()) { │ │ │ │ │ │ 00751 │ │ │ │ │ │ this_cone = Cmomentum(); │ │ │ │ │ │ 00752 │ │ │ │ │ │ } else { │ │ │ │ │ │ -00753 │ │ │ │ │ │ // set momentum to 0 │ │ │ │ │ │ +00753 │ │ │ │ │ │ 00754 │ │ │ │ │ │ this_cone = Cmomentum(); │ │ │ │ │ │ 00755 │ │ │ │ │ │ -00756 │ │ │ │ │ │ // 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 │ │ │ │ │ │ @@ -15481,55 +17471,53 @@ │ │ │ │ │ │ this_dpt = 0.0; │ │ │ │ │ │ 00770 │ │ │ │ │ │ } │ │ │ │ │ │ 00771 │ │ │ │ │ │ 00772 } │ │ │ │ │ │ 00773 │ │ │ │ │ │ 00774 │ │ │ │ │ │ -00776 // VARIOUS TOOLS │ │ │ │ │ │ // │ │ │ │ │ │ +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 │ │ │ │ │ │ circle centre x coordinate │ │ │ │ │ │ 00787 * - cx │ │ │ │ │ │ -00788 * - cy │ │ │ │ │ │ circle centre y coordinate │ │ │ │ │ │ +00788 * - cy │ │ │ │ │ │ 00789 * return the checkxor for the intersection │ │ │ │ │ │ +00790 ******************************************************************/ │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -213 │ │ │ │ │ │ - │ │ │ │ │ │ - 214 │ │ │ │ │ │ + 5.27 protocones.cpp │ │ │ │ │ │ │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ +229 │ │ │ │ │ │ │ │ │ │ │ │ -00790 ******************************************************************/ │ │ │ │ │ │ 00791 Creference Cstable_cones::circle_intersect(double cx, double cy){ │ │ │ │ │ │ 00792 │ │ │ │ │ │ Creference intersection; │ │ │ │ │ │ -00793 │ │ │ │ │ │ int i; │ │ │ │ │ │ -double dx, dy; │ │ │ │ │ │ +00793 │ │ │ │ │ │ 00794 │ │ │ │ │ │ +double dx, dy; │ │ │ │ │ │ 00795 │ │ │ │ │ │ for (i=0;ieta - v->eta; │ │ │ │ │ │ 00825 │ │ │ │ │ │ dy = fabs(centre_in->phi - v->phi); │ │ │ │ │ │ -00826 │ │ │ │ │ │ if (dy>M_PI) │ │ │ │ │ │ +00826 │ │ │ │ │ │ 00827 │ │ │ │ │ │ dy -= twopi; │ │ │ │ │ │ 00828 │ │ │ │ │ │ return dx*dx+dy*dyM_PI) │ │ │ │ │ │ 00843 │ │ │ │ │ │ 00844 │ │ │ │ │ │ dphi = dphi-twopi; │ │ │ │ │ │ 00845 │ │ │ │ │ │ 00846 │ │ │ │ │ │ return dphi; │ │ │ │ │ │ 00847 } │ │ │ │ │ │ 00848 │ │ │ │ │ │ 00849 } │ │ │ │ │ │ │ │ │ │ │ │ -5.21 protocones.cpp │ │ │ │ │ │ +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. │ │ │ │ │ │ // │ │ │ │ │ │ 00005 // WARNING: this is not the main SISCone trunk but │ │ │ │ │ │ 00006 // │ │ │ │ │ │ @@ -15622,14 +17610,18 @@ │ │ │ │ │ │ 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 by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ @@ -15641,20 +17633,16 @@ │ │ │ │ │ │ // │ │ │ │ │ │ │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.21 protocones.cpp │ │ │ │ │ │ + 230 │ │ │ │ │ │ │ │ │ │ │ │ -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 // │ │ │ │ │ │ @@ -15776,40 +17764,37 @@ │ │ │ │ │ │ 00101 │ │ │ │ │ │ nb_tot = 0; │ │ │ │ │ │ 00102 │ │ │ │ │ │ hc = NULL; │ │ │ │ │ │ 00103 } │ │ │ │ │ │ 00104 │ │ │ │ │ │ 00105 // default dtor │ │ │ │ │ │ -00106 //-------------- │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ +00106 //-------------00107 CSphstable_cones::~CSphstable_cones(){ │ │ │ │ │ │ +00108 │ │ │ │ │ │ +if (hc!=NULL) delete hc; │ │ │ │ │ │ │ │ │ │ │ │ -215 │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ │ │ │ │ │ │ * │ │ │ │ │ │ │ │ │ │ │ │ - 216 │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ + 5.27 protocones.cpp │ │ │ │ │ │ │ │ │ │ │ │ -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 │ │ │ │ │ │ +00117 │ │ │ │ │ │ 00118 │ │ │ │ │ │ if (hc!=NULL){ │ │ │ │ │ │ 00119 │ │ │ │ │ │ delete hc; │ │ │ │ │ │ 00120 │ │ │ │ │ │ } │ │ │ │ │ │ if (protocones.size()!=0) │ │ │ │ │ │ @@ -15823,30 +17808,30 @@ │ │ │ │ │ │ // 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) │ │ │ │ │ │ radius of the cones │ │ │ │ │ │ 00140 * - _radius: │ │ │ │ │ │ 00141 * The number of stable cones found is returned │ │ │ │ │ │ 00142 *********************************************************************/ │ │ │ │ │ │ 00143 int CSphstable_cones::get_stable_cones(double _radius){ │ │ │ │ │ │ -int p_idx; │ │ │ │ │ │ 00144 │ │ │ │ │ │ +int p_idx; │ │ │ │ │ │ 00145 │ │ │ │ │ │ // check if everything is correctly initialised │ │ │ │ │ │ 00146 │ │ │ │ │ │ 00147 │ │ │ │ │ │ if (n_part==0){ │ │ │ │ │ │ return 0; │ │ │ │ │ │ 00148 │ │ │ │ │ │ @@ -15863,16 +17848,16 @@ │ │ │ │ │ │ tan2R *= tan2R; │ │ │ │ │ │ 00155 │ │ │ │ │ │ 00156 │ │ │ │ │ │ // allow hash for cones candidates │ │ │ │ │ │ 00157 │ │ │ │ │ │ hc = new sph_hash_cones(n_part, R); │ │ │ │ │ │ 00158 │ │ │ │ │ │ -// browse all particles │ │ │ │ │ │ 00159 │ │ │ │ │ │ +// browse all particles │ │ │ │ │ │ 00160 │ │ │ │ │ │ for (p_idx=0;p_idxside){ │ │ │ │ │ │ @@ -16085,37 +18074,33 @@ │ │ │ │ │ │ 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 │ │ │ │ │ │ +// 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){ │ │ │ │ │ │ -// test when both particles are not in the cone │ │ │ │ │ │ 00283 │ │ │ │ │ │ +// test when both particles are not in the cone │ │ │ │ │ │ 00284 │ │ │ │ │ │ // Note: for the totally exclusive case, test emptiness before │ │ │ │ │ │ +00285 │ │ │ │ │ │ +cone_candidate = cone; │ │ │ │ │ │ +00286 │ │ │ │ │ │ +if (cone.ref.not_empty()){ │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -217 │ │ │ │ │ │ - │ │ │ │ │ │ - 218 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ + 5.27 protocones.cpp │ │ │ │ │ │ │ │ │ │ │ │ -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 │ │ │ │ │ │ @@ -16168,18 +18153,18 @@ │ │ │ │ │ │ 00322 │ │ │ │ │ │ 00323 │ │ │ │ │ │ centre_idx++; │ │ │ │ │ │ if (centre_idx==vicinity_size) │ │ │ │ │ │ 00324 │ │ │ │ │ │ 00325 │ │ │ │ │ │ centre_idx=0; │ │ │ │ │ │ -00326 │ │ │ │ │ │ if (centre_idx==first_cone) │ │ │ │ │ │ -return 1; │ │ │ │ │ │ +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 │ │ │ │ │ │ @@ -16192,16 +18177,16 @@ │ │ │ │ │ │ cout « " old_enter"; │ │ │ │ │ │ 00336 #endif │ │ │ │ │ │ 00337 │ │ │ │ │ │ // update cone │ │ │ │ │ │ 00338 │ │ │ │ │ │ cone += (*child); │ │ │ │ │ │ 00339 │ │ │ │ │ │ -00340 │ │ │ │ │ │ // update info on particles inside │ │ │ │ │ │ +00340 │ │ │ │ │ │ 00341 │ │ │ │ │ │ centre->is_inside->cone = true; │ │ │ │ │ │ 00342 │ │ │ │ │ │ // update stability check quantities │ │ │ │ │ │ 00343 │ │ │ │ │ │ 00344 │ │ │ │ │ │ dpt += fabs(child->px)+fabs(child->py)+fabs(child->pz); │ │ │ │ │ │ @@ -16247,26 +18232,30 @@ │ │ │ │ │ │ 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); │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 5.21 protocones.cpp │ │ │ │ │ │ +233 │ │ │ │ │ │ + │ │ │ │ │ │ + 234 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ │ │ │ │ │ │ -00372 │ │ │ │ │ │ -// update cone │ │ │ │ │ │ -00373 │ │ │ │ │ │ -cone -= (*child); │ │ │ │ │ │ 00374 │ │ │ │ │ │ -00375 │ │ │ │ │ │ // 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(); │ │ │ │ │ │ @@ -16285,16 +18274,16 @@ │ │ │ │ │ │ // 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 │ │ │ │ │ │ +if (cone.ref.is_empty()){ │ │ │ │ │ │ 00391 │ │ │ │ │ │ cone = CSphmomentum(); │ │ │ │ │ │ 00392 │ │ │ │ │ │ dpt=0.0; │ │ │ │ │ │ 00393 │ │ │ │ │ │ } │ │ │ │ │ │ 00394 │ │ │ │ │ │ @@ -16317,29 +18306,29 @@ │ │ │ │ │ │ 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 │ │ │ │ │ │ +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 │ │ │ │ │ │ +00420 │ │ │ │ │ │ 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 │ │ │ │ │ │ @@ -16357,16 +18346,16 @@ │ │ │ │ │ │ 00432 │ │ │ │ │ │ elm = elm->next; │ │ │ │ │ │ 00433 │ │ │ │ │ │ } │ │ │ │ │ │ 00434 │ │ │ │ │ │ } │ │ │ │ │ │ 00435 │ │ │ │ │ │ -// free hash │ │ │ │ │ │ 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; │ │ │ │ │ │ @@ -16394,25 +18383,21 @@ │ │ │ │ │ │ // │ │ │ │ │ │ 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(); │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -219 │ │ │ │ │ │ - │ │ │ │ │ │ - 220 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ + 5.27 protocones.cpp │ │ │ │ │ │ │ │ │ │ │ │ -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 │ │ │ │ │ │ @@ -16499,16 +18484,16 @@ │ │ │ │ │ │ 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 │ │ │ │ │ │ +// 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 │ │ │ │ │ │ @@ -16534,43 +18519,47 @@ │ │ │ │ │ │ } │ │ │ │ │ │ 00539 │ │ │ │ │ │ 00540 │ │ │ │ │ │ // get them into order of angle │ │ │ │ │ │ 00541 │ │ │ │ │ │ sort(border_vect.begin(), border_vect.end()); │ │ │ │ │ │ 00542 │ │ │ │ │ │ -00543 │ │ │ │ │ │ // 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; │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 5.21 protocones.cpp │ │ │ │ │ │ +235 │ │ │ │ │ │ + │ │ │ │ │ │ + 236 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ │ │ │ │ │ │ -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 │ │ │ │ │ │ -do { │ │ │ │ │ │ 00555 │ │ │ │ │ │ +do { │ │ │ │ │ │ 00556 │ │ │ │ │ │ // reset status wrt inclusion in the cone │ │ │ │ │ │ 00557 │ │ │ │ │ │ mid = start; │ │ │ │ │ │ 00558 │ │ │ │ │ │ do { │ │ │ │ │ │ 00559 │ │ │ │ │ │ @@ -16578,32 +18567,32 @@ │ │ │ │ │ │ 00560 │ │ │ │ │ │ } while (++mid != start); │ │ │ │ │ │ 00561 │ │ │ │ │ │ // now run over all inclusion possibilities with this starting point │ │ │ │ │ │ 00562 │ │ │ │ │ │ 00563 │ │ │ │ │ │ candidate = borderless_cone; │ │ │ │ │ │ -00564 │ │ │ │ │ │ while (++mid != start) { │ │ │ │ │ │ -// will begin with start+1 and go up to start-1 │ │ │ │ │ │ +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 │ │ │ │ │ │ -// mid corresponds to momentum that we need to include to get the │ │ │ │ │ │ 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 │ │ │ │ │ │ @@ -16623,16 +18612,16 @@ │ │ │ │ │ │ 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; │ │ │ │ │ │ -break; // it’s unstable so there’s no point continuing │ │ │ │ │ │ 00596 │ │ │ │ │ │ +break; // it’s unstable so there’s no point continuing │ │ │ │ │ │ 00597 │ │ │ │ │ │ } │ │ │ │ │ │ 00598 │ │ │ │ │ │ } │ │ │ │ │ │ 00599 │ │ │ │ │ │ if (stable) hc->insert(&candidate); │ │ │ │ │ │ 00600 │ │ │ │ │ │ @@ -16662,26 +18651,26 @@ │ │ │ │ │ │ 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())){ │ │ │ │ │ │ -// update cone │ │ │ │ │ │ 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 │ │ │ │ │ │ +00628 │ │ │ │ │ │ 00629 │ │ │ │ │ │ dpt += fabs(child->px)+fabs(child->py)+fabs(child->pz); //child->perp2(); │ │ │ │ │ │ 00630 │ │ │ │ │ │ } │ │ │ │ │ │ 00631 │ │ │ │ │ │ 00632 │ │ │ │ │ │ // now establish the list of unique children in the list │ │ │ │ │ │ @@ -16694,23 +18683,23 @@ │ │ │ │ │ │ 00637 │ │ │ │ │ │ list put_in_border; │ │ │ │ │ │ 00638 │ │ │ │ │ │ list border_list; │ │ │ │ │ │ 00639 │ │ │ │ │ │ 00640 │ │ │ │ │ │ CSphmomentum cone_removal; │ │ │ │ │ │ +00641 │ │ │ │ │ │ +CSphmomentum border = *parent; │ │ │ │ │ │ +00642 │ │ │ │ │ │ +border_list.push_back(parent); │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -221 │ │ │ │ │ │ - │ │ │ │ │ │ - 222 │ │ │ │ │ │ + 5.27 protocones.cpp │ │ │ │ │ │ │ │ │ │ │ │ -00641 │ │ │ │ │ │ -00642 │ │ │ │ │ │ 00643 │ │ │ │ │ │ 00644 │ │ │ │ │ │ 00645 │ │ │ │ │ │ 00646 │ │ │ │ │ │ 00647 │ │ │ │ │ │ 00648 │ │ │ │ │ │ 00649 │ │ │ │ │ │ @@ -16729,18 +18718,16 @@ │ │ │ │ │ │ 00662 │ │ │ │ │ │ 00663 │ │ │ │ │ │ 00664 │ │ │ │ │ │ 00665 │ │ │ │ │ │ 00666 │ │ │ │ │ │ 00667 │ │ │ │ │ │ │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ +237 │ │ │ │ │ │ │ │ │ │ │ │ -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) { │ │ │ │ │ │ @@ -16793,16 +18780,16 @@ │ │ │ │ │ │ // record the fact that we’ve now seen this combination │ │ │ │ │ │ 00684 │ │ │ │ │ │ 00685 │ │ │ │ │ │ multiple_centre_done.push_back(pair(borderless_cone.ref, │ │ │ │ │ │ 00686 │ │ │ │ │ │ border.ref)); │ │ │ │ │ │ 00687 │ │ │ │ │ │ -00688 │ │ │ │ │ │ // 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); │ │ │ │ │ │ @@ -16821,27 +18808,27 @@ │ │ │ │ │ │ 00699 │ │ │ │ │ │ 00700 │ │ │ │ │ │ test_cone_cocircular(borderless_cone, border_list); │ │ │ │ │ │ 00701 │ │ │ │ │ │ } │ │ │ │ │ │ 00702 │ │ │ │ │ │ 00703 │ │ │ │ │ │ -00704 │ │ │ │ │ │ // 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 │ │ │ │ │ │ -// relabel things that got put into the border │ │ │ │ │ │ 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 │ │ │ │ │ │ @@ -16852,39 +18839,41 @@ │ │ │ │ │ │ 00717 │ │ │ │ │ │ // been through the co-circularity rigmarole │ │ │ │ │ │ 00718 │ │ │ │ │ │ return true; │ │ │ │ │ │ 00719 } │ │ │ │ │ │ 00720 │ │ │ │ │ │ 00721 │ │ │ │ │ │ -00723 // RECOMPUTATION OF CONE CONTENTS │ │ │ │ │ │ // │ │ │ │ │ │ +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 > │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 5.21 protocones.cpp │ │ │ │ │ │ + 238 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ │ │ │ │ │ │ -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 │ │ │ │ │ │ +// note that in the following algorithm, the cone contents never includes │ │ │ │ │ │ 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 │ │ │ │ │ │ @@ -16917,16 +18906,16 @@ │ │ │ │ │ │ 00762 │ │ │ │ │ │ 00763 │ │ │ │ │ │ // 100% complete, so we can use it to calculate the cone contents │ │ │ │ │ │ 00764 │ │ │ │ │ │ // and then exit │ │ │ │ │ │ 00765 │ │ │ │ │ │ recompute_cone_contents(); │ │ │ │ │ │ -00766 │ │ │ │ │ │ return; │ │ │ │ │ │ +00766 │ │ │ │ │ │ 00767 │ │ │ │ │ │ 00768 } │ │ │ │ │ │ 00769 │ │ │ │ │ │ 00770 │ │ │ │ │ │ 00771 /* │ │ │ │ │ │ 00772 * compute the cone momentum from particle list. │ │ │ │ │ │ 00773 * in this version, we use the ’pincluded’ information │ │ │ │ │ │ @@ -16973,32 +18962,32 @@ │ │ │ │ │ │ 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 │ │ │ │ │ │ +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 │ │ │ │ │ │ +00811 │ │ │ │ │ │ 00812 │ │ │ │ │ │ this_cone = CSphmomentum(); │ │ │ │ │ │ 00813 │ │ │ │ │ │ -// Important note: we can browse only the particles │ │ │ │ │ │ 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 │ │ │ │ │ │ @@ -17009,28 +18998,24 @@ │ │ │ │ │ │ // to avoid double-counting, only use particles with + angle │ │ │ │ │ │ 00821 │ │ │ │ │ │ if ((vicinity[i]->side) && (vicinity[i]->is_inside->cone)) │ │ │ │ │ │ 00822 │ │ │ │ │ │ this_cone += *vicinity[i]->v; │ │ │ │ │ │ 00823 │ │ │ │ │ │ } │ │ │ │ │ │ +00824 │ │ │ │ │ │ +00825 │ │ │ │ │ │ +} │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -223 │ │ │ │ │ │ - │ │ │ │ │ │ - 224 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ + 5.28 protocones.h │ │ │ │ │ │ │ │ │ │ │ │ -00824 │ │ │ │ │ │ -00825 │ │ │ │ │ │ -} │ │ │ │ │ │ -// set check variables back to 0 │ │ │ │ │ │ 00826 │ │ │ │ │ │ +// set check variables back to 0 │ │ │ │ │ │ 00827 │ │ │ │ │ │ this_dpt = 0.0; │ │ │ │ │ │ 00828 │ │ │ │ │ │ } │ │ │ │ │ │ 00829 │ │ │ │ │ │ 00830 } │ │ │ │ │ │ 00831 │ │ │ │ │ │ @@ -17074,15 +19059,15 @@ │ │ │ │ │ │ 00858 │ │ │ │ │ │ return intersection; │ │ │ │ │ │ 00859 │ │ │ │ │ │ 00860 } │ │ │ │ │ │ 00861 │ │ │ │ │ │ 00862 } │ │ │ │ │ │ │ │ │ │ │ │ -5.22 protocones.h │ │ │ │ │ │ +5.28 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 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ @@ -17136,33 +19121,37 @@ │ │ │ │ │ │ 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) : │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 5.22 protocones.h │ │ │ │ │ │ +239 │ │ │ │ │ │ + │ │ │ │ │ │ + 240 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ │ │ │ │ │ │ -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; │ │ │ │ │ │ -00062 │ │ │ │ │ │ double angle; │ │ │ │ │ │ +00062 │ │ │ │ │ │ bool │ │ │ │ │ │ is_in; │ │ │ │ │ │ 00063 │ │ │ │ │ │ 00064 }; │ │ │ │ │ │ 00065 │ │ │ │ │ │ 00066 │ │ │ │ │ │ 00069 inline bool operator<(const Cborder_store & a, const Cborder_store & b) { │ │ │ │ │ │ @@ -17178,39 +19167,39 @@ │ │ │ │ │ │ 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 │ │ │ │ │ │ 00107 │ │ │ │ │ │ 00109 │ │ │ │ │ │ std::vector protocones; │ │ │ │ │ │ 00110 │ │ │ │ │ │ 00112 │ │ │ │ │ │ hash_cones *hc; │ │ │ │ │ │ 00113 │ │ │ │ │ │ -int nb_tot; │ │ │ │ │ │ 00115 │ │ │ │ │ │ +int nb_tot; │ │ │ │ │ │ 00116 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ 00117 │ │ │ │ │ │ int nb_hash_cones, nb_hash_occupied; │ │ │ │ │ │ 00118 #endif │ │ │ │ │ │ 00119 │ │ │ │ │ │ 00120 protected: │ │ │ │ │ │ double R; │ │ │ │ │ │ 00122 │ │ │ │ │ │ 00123 │ │ │ │ │ │ -00125 │ │ │ │ │ │ double R2; │ │ │ │ │ │ +00125 │ │ │ │ │ │ 00126 │ │ │ │ │ │ 00127 private: │ │ │ │ │ │ 00130 │ │ │ │ │ │ Cmomentum cone; │ │ │ │ │ │ 00131 │ │ │ │ │ │ 00133 │ │ │ │ │ │ Cmomentum *child; │ │ │ │ │ │ @@ -17229,16 +19218,16 @@ │ │ │ │ │ │ 00150 │ │ │ │ │ │ int test_cone(); │ │ │ │ │ │ 00157 │ │ │ │ │ │ 00158 │ │ │ │ │ │ int update_cone(); │ │ │ │ │ │ 00164 │ │ │ │ │ │ 00165 │ │ │ │ │ │ -00166 │ │ │ │ │ │ /* │ │ │ │ │ │ +00166 │ │ │ │ │ │ 00167 * run through the vicinity of the current parent and for each child │ │ │ │ │ │ 00168 * indicate which members are cocircular... │ │ │ │ │ │ 00169 */ │ │ │ │ │ │ 00170 │ │ │ │ │ │ void prepare_cocircular_lists(); │ │ │ │ │ │ 00171 │ │ │ │ │ │ bool cocircular_check(); │ │ │ │ │ │ @@ -17250,45 +19239,43 @@ │ │ │ │ │ │ std::list & border_list); │ │ │ │ │ │ 00187 │ │ │ │ │ │ 00194 │ │ │ │ │ │ void test_stability(Cmomentum & candidate, │ │ │ │ │ │ const std::vector & border_vect); │ │ │ │ │ │ 00195 │ │ │ │ │ │ 00196 │ │ │ │ │ │ -00203 │ │ │ │ │ │ void compute_cone_contents(); │ │ │ │ │ │ +00203 │ │ │ │ │ │ 00204 │ │ │ │ │ │ -void recompute_cone_contents(); │ │ │ │ │ │ 00210 │ │ │ │ │ │ +void recompute_cone_contents(); │ │ │ │ │ │ 00211 │ │ │ │ │ │ /* │ │ │ │ │ │ 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 │ │ │ │ │ │ +00214 * the cone momentum from particle list. │ │ │ │ │ │ 00215 * ’pincluded’ information from the Cvicinity class, but we don’t │ │ │ │ │ │ 00216 * change the member cone, only the locally supplied one │ │ │ │ │ │ 00217 */ │ │ │ │ │ │ 00218 │ │ │ │ │ │ void recompute_cone_contents_if_needed(Cmomentum & this_cone, double & this_dpt); │ │ │ │ │ │ 00219 │ │ │ │ │ │ 00225 │ │ │ │ │ │ int proceed_with_stability(); │ │ │ │ │ │ +00226 │ │ │ │ │ │ +00227 │ │ │ │ │ │ +/* │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -225 │ │ │ │ │ │ - │ │ │ │ │ │ - 226 │ │ │ │ │ │ + 5.29 protocones.h │ │ │ │ │ │ │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ +241 │ │ │ │ │ │ │ │ │ │ │ │ -00226 │ │ │ │ │ │ -/* │ │ │ │ │ │ -00227 │ │ │ │ │ │ 00228 * circle intersection. │ │ │ │ │ │ 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 │ │ │ │ │ │ 00232 * - cy │ │ │ │ │ │ circle centre y coordinate │ │ │ │ │ │ @@ -17325,15 +19312,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 │ │ │ │ │ │ @@ -17342,14 +19329,15 @@ │ │ │ │ │ │ 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 │ │ │ │ │ │ @@ -17392,27 +19380,24 @@ │ │ │ │ │ │ 00039 │ │ │ │ │ │ 00040 #include │ │ │ │ │ │ 00041 │ │ │ │ │ │ 00042 namespace siscone_spherical{ │ │ │ │ │ │ 00043 │ │ │ │ │ │ 00055 class CSphborder_store{ │ │ │ │ │ │ 00056 public: │ │ │ │ │ │ - │ │ │ │ │ │ -// │ │ │ │ │ │ +00058 │ │ │ │ │ │ +CSphborder_store(CSphmomentum * momentum, CSph3vector ¢re, CSph3vector &angl_dir1, CSph3vector │ │ │ │ │ │ +&angl_dir2) : │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 5.23 protocones.h │ │ │ │ │ │ - │ │ │ │ │ │ -00058 │ │ │ │ │ │ + 242 │ │ │ │ │ │ │ │ │ │ │ │ -227 │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ │ │ │ │ │ │ -CSphborder_store(CSphmomentum * momentum, CSph3vector ¢re, CSph3vector &angl_dir1, CSph3vector │ │ │ │ │ │ -&angl_dir2) : │ │ │ │ │ │ 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 │ │ │ │ │ │ @@ -17473,16 +19458,16 @@ │ │ │ │ │ │ 00127 protected: │ │ │ │ │ │ double R; │ │ │ │ │ │ 00129 │ │ │ │ │ │ 00130 │ │ │ │ │ │ double R2; │ │ │ │ │ │ 00132 │ │ │ │ │ │ 00133 │ │ │ │ │ │ -00135 │ │ │ │ │ │ double tan2R; │ │ │ │ │ │ +00135 │ │ │ │ │ │ 00136 │ │ │ │ │ │ 00137 private: │ │ │ │ │ │ 00140 │ │ │ │ │ │ CSphmomentum cone; │ │ │ │ │ │ 00141 │ │ │ │ │ │ 00143 │ │ │ │ │ │ CSphmomentum *child; │ │ │ │ │ │ @@ -17501,16 +19486,16 @@ │ │ │ │ │ │ 00160 │ │ │ │ │ │ int test_cone(); │ │ │ │ │ │ 00167 │ │ │ │ │ │ 00168 │ │ │ │ │ │ int update_cone(); │ │ │ │ │ │ 00174 │ │ │ │ │ │ 00175 │ │ │ │ │ │ -00176 │ │ │ │ │ │ /* │ │ │ │ │ │ +00176 │ │ │ │ │ │ 00177 * run through the vicinity of the current parent and for each child │ │ │ │ │ │ 00178 * indicate which members are cocircular... │ │ │ │ │ │ 00179 */ │ │ │ │ │ │ 00180 │ │ │ │ │ │ void prepare_cocircular_lists(); │ │ │ │ │ │ 00181 │ │ │ │ │ │ bool cocircular_check(); │ │ │ │ │ │ @@ -17522,33 +19507,33 @@ │ │ │ │ │ │ std::list & border_list); │ │ │ │ │ │ 00197 │ │ │ │ │ │ 00204 │ │ │ │ │ │ void test_stability(CSphmomentum & candidate, │ │ │ │ │ │ const std::vector & border_vect); │ │ │ │ │ │ 00205 │ │ │ │ │ │ 00206 │ │ │ │ │ │ -00213 │ │ │ │ │ │ void compute_cone_contents(); │ │ │ │ │ │ +00213 │ │ │ │ │ │ 00214 │ │ │ │ │ │ -void recompute_cone_contents(); │ │ │ │ │ │ 00220 │ │ │ │ │ │ +void recompute_cone_contents(); │ │ │ │ │ │ 00221 │ │ │ │ │ │ /* │ │ │ │ │ │ 00222 │ │ │ │ │ │ 00223 * if we have gone beyond the acceptable threshold of change, compute │ │ │ │ │ │ +00224 * the cone momentum from particle list. │ │ │ │ │ │ +in this version, we use the │ │ │ │ │ │ +00225 * ’pincluded’ information from the CSphvicinity class, but we don’t │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 228 │ │ │ │ │ │ + 5.30 quadtree.cpp │ │ │ │ │ │ │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ +243 │ │ │ │ │ │ │ │ │ │ │ │ -in this version, we use the │ │ │ │ │ │ -00224 * the cone momentum from particle list. │ │ │ │ │ │ -00225 * ’pincluded’ information from the CSphvicinity class, but we don’t │ │ │ │ │ │ 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 │ │ │ │ │ │ int proceed_with_stability(); │ │ │ │ │ │ 00235 │ │ │ │ │ │ @@ -17581,15 +19566,15 @@ │ │ │ │ │ │ 00258 │ │ │ │ │ │ double dpt; │ │ │ │ │ │ 00259 }; │ │ │ │ │ │ 00260 │ │ │ │ │ │ 00261 } │ │ │ │ │ │ 00262 #endif │ │ │ │ │ │ │ │ │ │ │ │ -5.24 quadtree.cpp │ │ │ │ │ │ +5.30 quadtree.cpp │ │ │ │ │ │ 00001 │ │ │ │ │ │ // │ │ │ │ │ │ 00002 // File: quadtree.cpp │ │ │ │ │ │ 00003 // Description: source file for quadtree management (Cquadtree class) │ │ │ │ │ │ // │ │ │ │ │ │ 00004 // This file is part of the SISCone project. │ │ │ │ │ │ // │ │ │ │ │ │ @@ -17654,24 +19639,26 @@ │ │ │ │ │ │ 00043 // default ctor │ │ │ │ │ │ 00044 //-------------00045 Cquadtree::Cquadtree(){ │ │ │ │ │ │ 00046 │ │ │ │ │ │ v = NULL; │ │ │ │ │ │ 00047 │ │ │ │ │ │ 00048 │ │ │ │ │ │ children[0][0] = children[0][1] = children[1][0] = children[1][1] = NULL; │ │ │ │ │ │ +00049 │ │ │ │ │ │ +has_child = false; │ │ │ │ │ │ +00050 } │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ * │ │ │ │ │ │ │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ + 244 │ │ │ │ │ │ │ │ │ │ │ │ - 5.24 quadtree.cpp │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ │ │ │ │ │ │ -00049 │ │ │ │ │ │ -has_child = false; │ │ │ │ │ │ -00050 } │ │ │ │ │ │ 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 │ │ │ │ │ │ @@ -17687,18 +19674,18 @@ │ │ │ │ │ │ 00064 │ │ │ │ │ │ 00065 // default destructor │ │ │ │ │ │ 00066 // at destruction, everything is destroyed except │ │ │ │ │ │ 00067 // physical values at the leaves │ │ │ │ │ │ 00068 //-----------------------------------------------00069 Cquadtree::~Cquadtree(){ │ │ │ │ │ │ 00070 │ │ │ │ │ │ if (has_child){ │ │ │ │ │ │ -00071 │ │ │ │ │ │ if (v!=NULL) delete v; │ │ │ │ │ │ -delete children[0][0]; │ │ │ │ │ │ +00071 │ │ │ │ │ │ 00072 │ │ │ │ │ │ +delete children[0][0]; │ │ │ │ │ │ 00073 │ │ │ │ │ │ delete children[0][1]; │ │ │ │ │ │ delete children[1][0]; │ │ │ │ │ │ 00074 │ │ │ │ │ │ 00075 │ │ │ │ │ │ delete children[1][1]; │ │ │ │ │ │ 00076 │ │ │ │ │ │ @@ -17706,23 +19693,23 @@ │ │ │ │ │ │ 00077 } │ │ │ │ │ │ 00078 │ │ │ │ │ │ 00079 │ │ │ │ │ │ 00080 /* │ │ │ │ │ │ 00081 * init the tree. │ │ │ │ │ │ 00082 * By initializing the tree, we mean setting the cell parameters │ │ │ │ │ │ 00083 * and preparing the object to act as a seed for a new tree. │ │ │ │ │ │ -00084 * - _x │ │ │ │ │ │ x-position of the center │ │ │ │ │ │ +00084 * - _x │ │ │ │ │ │ y-position of the center │ │ │ │ │ │ 00085 * - _y │ │ │ │ │ │ 00086 * - half_size_x half x-size of the cell │ │ │ │ │ │ 00087 * - half_size_y half y-size of the cell │ │ │ │ │ │ 00088 * return 0 on success, 1 on error. Note that if the cell │ │ │ │ │ │ -00089 * │ │ │ │ │ │ is already filled, we return an error. │ │ │ │ │ │ +00089 * │ │ │ │ │ │ 00090 ******************************************************************/ │ │ │ │ │ │ 00091 int Cquadtree::init(double _x, double _y, double _half_size_x, double _half_size_y){ │ │ │ │ │ │ 00092 │ │ │ │ │ │ if (v!=NULL) │ │ │ │ │ │ return 1; │ │ │ │ │ │ 00093 │ │ │ │ │ │ 00094 │ │ │ │ │ │ @@ -17740,16 +19727,16 @@ │ │ │ │ │ │ 00101 } │ │ │ │ │ │ 00102 │ │ │ │ │ │ 00103 │ │ │ │ │ │ 00104 /* │ │ │ │ │ │ 00105 * adding a particle to the tree. │ │ │ │ │ │ 00106 * This method adds one vector to the quadtree structure which │ │ │ │ │ │ 00107 * is updated consequently. │ │ │ │ │ │ -00108 * - v │ │ │ │ │ │ vector to add │ │ │ │ │ │ +00108 * - v │ │ │ │ │ │ 00109 * return 0 on success 1 on error │ │ │ │ │ │ 00110 ******************************************************************/ │ │ │ │ │ │ 00111 int Cquadtree::add(Cmomentum *v_add){ │ │ │ │ │ │ // Description of the method: │ │ │ │ │ │ 00112 │ │ │ │ │ │ 00113 │ │ │ │ │ │ // -------------------------00114 │ │ │ │ │ │ @@ -17792,31 +19779,27 @@ │ │ │ │ │ │ 00131 │ │ │ │ │ │ // step 2: additional work if 1! particle already present │ │ │ │ │ │ 00132 │ │ │ │ │ │ // │ │ │ │ │ │ we use the fact that only 1-particle systems have no child │ │ │ │ │ │ 00133 │ │ │ │ │ │ if (!has_child){ │ │ │ │ │ │ -double new_half_size_x = 0.5*half_size_x; │ │ │ │ │ │ 00134 │ │ │ │ │ │ -00135 │ │ │ │ │ │ +double new_half_size_x = 0.5*half_size_x; │ │ │ │ │ │ double new_half_size_y = 0.5*half_size_y; │ │ │ │ │ │ +00135 │ │ │ │ │ │ +// create children │ │ │ │ │ │ +00136 │ │ │ │ │ │ +00137 │ │ │ │ │ │ +children[0][0] = new Cquadtree(centre_x-new_half_size_x, centre_y-new_half_size_y, │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -229 │ │ │ │ │ │ - │ │ │ │ │ │ - 230 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ + 5.30 quadtree.cpp │ │ │ │ │ │ │ │ │ │ │ │ -00136 │ │ │ │ │ │ -// create children │ │ │ │ │ │ -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 │ │ │ │ │ │ new_half_size_x, new_half_size_y); │ │ │ │ │ │ 00141 │ │ │ │ │ │ @@ -17827,25 +19810,25 @@ │ │ │ │ │ │ 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); │ │ │ │ │ │ 00145 │ │ │ │ │ │ 00146 │ │ │ │ │ │ has_child = true; │ │ │ │ │ │ 00147 │ │ │ │ │ │ -// forward to child │ │ │ │ │ │ 00148 │ │ │ │ │ │ +// forward to child │ │ │ │ │ │ 00149 │ │ │ │ │ │ //? The following line assumes ’true’==1 and ’false’==0 │ │ │ │ │ │ 00150 │ │ │ │ │ │ // Note: v being a single particle, eta and phi are correct │ │ │ │ │ │ 00151 │ │ │ │ │ │ children[v->eta>centre_x][v->phi>centre_y]->add(v); │ │ │ │ │ │ 00152 │ │ │ │ │ │ -// copy physical params │ │ │ │ │ │ 00153 │ │ │ │ │ │ +// copy physical params │ │ │ │ │ │ 00154 │ │ │ │ │ │ v = new Cmomentum(*v); │ │ │ │ │ │ 00155 │ │ │ │ │ │ } │ │ │ │ │ │ 00156 │ │ │ │ │ │ 00157 │ │ │ │ │ │ // step 3: add new particle │ │ │ │ │ │ @@ -17862,25 +19845,25 @@ │ │ │ │ │ │ 00164 │ │ │ │ │ │ 00165 │ │ │ │ │ │ 00166 /* │ │ │ │ │ │ 00167 * circle intersection. │ │ │ │ │ │ 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. │ │ │ │ │ │ -00171 * - cx │ │ │ │ │ │ circle centre x coordinate │ │ │ │ │ │ +00171 * - cx │ │ │ │ │ │ circle centre y coordinate │ │ │ │ │ │ 00172 * - cy │ │ │ │ │ │ 00173 * - cR2 │ │ │ │ │ │ circle radius SQUARED │ │ │ │ │ │ 00174 * return the checksum for the intersection │ │ │ │ │ │ 00175 ******************************************************************/ │ │ │ │ │ │ 00176 Creference Cquadtree::circle_intersect(double cx, double cy, double cR2){ │ │ │ │ │ │ -00177 │ │ │ │ │ │ // Description of the method: │ │ │ │ │ │ +00177 │ │ │ │ │ │ 00178 │ │ │ │ │ │ // -------------------------00179 │ │ │ │ │ │ // 1. check if cell is empty => no intersection │ │ │ │ │ │ 00180 │ │ │ │ │ │ // 2. if cell has 1! particle, check if it is inside the circle. │ │ │ │ │ │ 00181 │ │ │ │ │ │ // │ │ │ │ │ │ @@ -17898,39 +19881,39 @@ │ │ │ │ │ │ // step 1: if there is no particle inside te square, no reason to go further │ │ │ │ │ │ 00187 │ │ │ │ │ │ 00188 │ │ │ │ │ │ if (v==NULL) │ │ │ │ │ │ return Creference(); │ │ │ │ │ │ 00189 │ │ │ │ │ │ 00190 │ │ │ │ │ │ -00191 │ │ │ │ │ │ double dx, dy; │ │ │ │ │ │ +00191 │ │ │ │ │ │ 00192 │ │ │ │ │ │ -// step 2: if there is only one particle inside the square, test if it is in │ │ │ │ │ │ 00193 │ │ │ │ │ │ +// step 2: if there is only one particle inside the square, test if it is in │ │ │ │ │ │ 00194 │ │ │ │ │ │ // │ │ │ │ │ │ the circle, in which case return associated reference │ │ │ │ │ │ 00195 │ │ │ │ │ │ if (!has_child){ │ │ │ │ │ │ -00196 │ │ │ │ │ │ // compute the distance │ │ │ │ │ │ +00196 │ │ │ │ │ │ 00197 │ │ │ │ │ │ // Note: v has only one particle => eta and phi are defined │ │ │ │ │ │ 00198 │ │ │ │ │ │ dx = cx - v->eta; │ │ │ │ │ │ 00199 │ │ │ │ │ │ dy = fabs(cy - v->phi); │ │ │ │ │ │ if (dy>M_PI) │ │ │ │ │ │ 00200 │ │ │ │ │ │ 00201 │ │ │ │ │ │ dy -= 2.0*M_PI; │ │ │ │ │ │ 00202 │ │ │ │ │ │ -00203 │ │ │ │ │ │ // test distance │ │ │ │ │ │ +00203 │ │ │ │ │ │ 00204 │ │ │ │ │ │ if (dx*dx+dy*dyref; │ │ │ │ │ │ 00206 │ │ │ │ │ │ } │ │ │ │ │ │ 00207 │ │ │ │ │ │ @@ -17948,49 +19931,53 @@ │ │ │ │ │ │ 00214 │ │ │ │ │ │ // store distance with the centre of the square │ │ │ │ │ │ 00215 │ │ │ │ │ │ 00216 │ │ │ │ │ │ dx_c = fabs(cx-centre_x); │ │ │ │ │ │ 00217 │ │ │ │ │ │ dy_c = fabs(cy-centre_y); │ │ │ │ │ │ -00218 │ │ │ │ │ │ if (dy_c>M_PI) dy_c = 2.0*M_PI-dy_c; │ │ │ │ │ │ +00218 │ │ │ │ │ │ 00219 │ │ │ │ │ │ -00220 │ │ │ │ │ │ // compute (minimal) the distance (pay attention to the periodicity in phi). │ │ │ │ │ │ +00220 │ │ │ │ │ │ 00221 │ │ │ │ │ │ dx = dx_c-half_size_x; │ │ │ │ │ │ -00222 │ │ │ │ │ │ if (dx<0) dx=0; │ │ │ │ │ │ +00222 │ │ │ │ │ │ +00223 │ │ │ │ │ │ +dy = dy_c-half_size_y; │ │ │ │ │ │ +00224 │ │ │ │ │ │ +if (dy<0) dy=0; │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 5.24 quadtree.cpp │ │ │ │ │ │ +245 │ │ │ │ │ │ + │ │ │ │ │ │ + 246 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ │ │ │ │ │ │ -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 │ │ │ │ │ │ 00229 │ │ │ │ │ │ return Creference(); │ │ │ │ │ │ 00230 │ │ │ │ │ │ } │ │ │ │ │ │ 00231 │ │ │ │ │ │ 00232 │ │ │ │ │ │ // step 4: check if included │ │ │ │ │ │ 00233 │ │ │ │ │ │ -// compute the (maximal) distance │ │ │ │ │ │ 00234 │ │ │ │ │ │ +// compute the (maximal) distance │ │ │ │ │ │ 00235 │ │ │ │ │ │ dx = dx_c+half_size_x; │ │ │ │ │ │ 00236 │ │ │ │ │ │ dy = dy_c+half_size_y; │ │ │ │ │ │ if (dy>M_PI) dy = M_PI; │ │ │ │ │ │ 00237 │ │ │ │ │ │ 00238 │ │ │ │ │ │ @@ -18025,19 +20012,19 @@ │ │ │ │ │ │ 00258 * - flux opened stream to write to │ │ │ │ │ │ 00259 * return 0 on success, 1 on error │ │ │ │ │ │ 00260 ******************************************************************/ │ │ │ │ │ │ 00261 int Cquadtree::save(FILE *flux){ │ │ │ │ │ │ 00262 │ │ │ │ │ │ if (flux==NULL) │ │ │ │ │ │ 00263 │ │ │ │ │ │ -00264 │ │ │ │ │ │ return 1; │ │ │ │ │ │ +00264 │ │ │ │ │ │ 00265 │ │ │ │ │ │ -if (has_child){ │ │ │ │ │ │ 00266 │ │ │ │ │ │ +if (has_child){ │ │ │ │ │ │ 00267 │ │ │ │ │ │ fprintf(flux, "%e\t%e\t%e\t%e\n", centre_x, centre_y, half_size_x, half_size_y); │ │ │ │ │ │ 00268 │ │ │ │ │ │ children[0][0]->save(flux); │ │ │ │ │ │ 00269 │ │ │ │ │ │ children[0][1]->save(flux); │ │ │ │ │ │ 00270 │ │ │ │ │ │ @@ -18061,19 +20048,19 @@ │ │ │ │ │ │ 00284 * - flux opened stream to write to │ │ │ │ │ │ 00285 * return 0 on success, 1 on error │ │ │ │ │ │ 00286 ******************************************************************/ │ │ │ │ │ │ 00287 int Cquadtree::save_leaves(FILE *flux){ │ │ │ │ │ │ 00288 │ │ │ │ │ │ if (flux==NULL) │ │ │ │ │ │ 00289 │ │ │ │ │ │ -00290 │ │ │ │ │ │ return 1; │ │ │ │ │ │ +00290 │ │ │ │ │ │ 00291 │ │ │ │ │ │ -if (has_child){ │ │ │ │ │ │ 00292 │ │ │ │ │ │ +if (has_child){ │ │ │ │ │ │ if (children[0][0]!=NULL) children[0][0]->save_leaves(flux); │ │ │ │ │ │ 00293 │ │ │ │ │ │ 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 │ │ │ │ │ │ @@ -18087,24 +20074,22 @@ │ │ │ │ │ │ 00300 │ │ │ │ │ │ 00301 │ │ │ │ │ │ return 0; │ │ │ │ │ │ 00302 } │ │ │ │ │ │ 00303 │ │ │ │ │ │ 00304 } │ │ │ │ │ │ │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -231 │ │ │ │ │ │ +5.31 quadtree.h │ │ │ │ │ │ +00001 // -*- C++ -*- │ │ │ │ │ │ │ │ │ │ │ │ - 232 │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ + 5.32 ranlux.cpp │ │ │ │ │ │ │ │ │ │ │ │ -5.25 quadtree.h │ │ │ │ │ │ -00001 // -*- C++ -*00003 // File: quadtree.h │ │ │ │ │ │ +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 │ │ │ │ │ │ // │ │ │ │ │ │ @@ -18161,70 +20146,74 @@ │ │ │ │ │ │ 00047 │ │ │ │ │ │ 00049 │ │ │ │ │ │ Cquadtree(double _x, double _y, double _half_size_x, double _half_size_y); │ │ │ │ │ │ 00050 │ │ │ │ │ │ 00054 │ │ │ │ │ │ ~Cquadtree(); │ │ │ │ │ │ 00055 │ │ │ │ │ │ -int init(double _x, double _y, double _half_size_x, double _half_size_y); │ │ │ │ │ │ 00067 │ │ │ │ │ │ +int init(double _x, double _y, double _half_size_x, double _half_size_y); │ │ │ │ │ │ 00068 │ │ │ │ │ │ int add(Cmomentum *v_add); │ │ │ │ │ │ 00076 │ │ │ │ │ │ 00077 │ │ │ │ │ │ 00088 │ │ │ │ │ │ Creference circle_intersect(double cx, double cy, double cR2); │ │ │ │ │ │ 00089 │ │ │ │ │ │ int save(FILE *flux); │ │ │ │ │ │ 00099 │ │ │ │ │ │ 00100 │ │ │ │ │ │ -00110 │ │ │ │ │ │ int save_leaves(FILE *flux); │ │ │ │ │ │ +00110 │ │ │ │ │ │ 00111 │ │ │ │ │ │ double centre_x; │ │ │ │ │ │ 00112 │ │ │ │ │ │ -double centre_y; │ │ │ │ │ │ 00113 │ │ │ │ │ │ +double centre_y; │ │ │ │ │ │ 00114 │ │ │ │ │ │ double half_size_x; │ │ │ │ │ │ double half_size_y; │ │ │ │ │ │ 00115 │ │ │ │ │ │ 00116 │ │ │ │ │ │ 00117 │ │ │ │ │ │ Cmomentum *v; │ │ │ │ │ │ 00118 │ │ │ │ │ │ 00119 │ │ │ │ │ │ Cquadtree* children[2][2]; │ │ │ │ │ │ -00120 │ │ │ │ │ │ bool has_child; │ │ │ │ │ │ +00120 │ │ │ │ │ │ 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 │ │ │ │ │ │ 00010 │ │ │ │ │ │ 00011 where d_n = x_{n-10} - x_{n-24} - c_{n-1}, b_n = 0 if d_n >= 0 and │ │ │ │ │ │ +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 by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 5.26 ranlux.cpp │ │ │ │ │ │ +247 │ │ │ │ │ │ + │ │ │ │ │ │ + 248 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ │ │ │ │ │ │ -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 │ │ │ │ │ │ 00017 The period of the generator is around 10^171. │ │ │ │ │ │ 00018 │ │ │ │ │ │ 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. │ │ │ │ │ │ @@ -18253,37 +20242,37 @@ │ │ │ │ │ │ 00043 │ │ │ │ │ │ 00044 // internal generator structure │ │ │ │ │ │ 00045 //-----------------------------00046 typedef struct { │ │ │ │ │ │ unsigned int i; │ │ │ │ │ │ 00047 │ │ │ │ │ │ 00048 │ │ │ │ │ │ unsigned int j; │ │ │ │ │ │ -unsigned int n; │ │ │ │ │ │ 00049 │ │ │ │ │ │ -00050 │ │ │ │ │ │ +unsigned int n; │ │ │ │ │ │ unsigned int skip; │ │ │ │ │ │ -unsigned int carry; │ │ │ │ │ │ +00050 │ │ │ │ │ │ 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; │ │ │ │ │ │ -unsigned int j = local_ranlux_state.j; │ │ │ │ │ │ +00064 │ │ │ │ │ │ 00065 │ │ │ │ │ │ -00066 │ │ │ │ │ │ +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 │ │ │ │ │ │ 00069 │ │ │ │ │ │ if (delta & mask_hi){ │ │ │ │ │ │ 00070 │ │ │ │ │ │ local_ranlux_state.carry = 1; │ │ │ │ │ │ @@ -18295,59 +20284,57 @@ │ │ │ │ │ │ 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 │ │ │ │ │ │ 00083 │ │ │ │ │ │ local_ranlux_state.i = i; │ │ │ │ │ │ 00084 │ │ │ │ │ │ -if (j == 0) │ │ │ │ │ │ 00085 │ │ │ │ │ │ +if (j == 0) │ │ │ │ │ │ 00086 │ │ │ │ │ │ j = 23; │ │ │ │ │ │ else │ │ │ │ │ │ 00087 │ │ │ │ │ │ 00088 │ │ │ │ │ │ j--; │ │ │ │ │ │ 00089 │ │ │ │ │ │ 00090 │ │ │ │ │ │ local_ranlux_state.j = j; │ │ │ │ │ │ 00091 │ │ │ │ │ │ -return delta; │ │ │ │ │ │ 00092 │ │ │ │ │ │ +return delta; │ │ │ │ │ │ 00093 } │ │ │ │ │ │ 00094 │ │ │ │ │ │ 00095 │ │ │ │ │ │ 00096 // set generator state │ │ │ │ │ │ 00097 //--------------------00098 static void ranlux_set(unsigned long int s){ │ │ │ │ │ │ +int i; │ │ │ │ │ │ +00099 │ │ │ │ │ │ +long int seed; │ │ │ │ │ │ +00100 │ │ │ │ │ │ +00101 │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -233 │ │ │ │ │ │ - │ │ │ │ │ │ - 234 │ │ │ │ │ │ + 5.33 siscone/ranlux.h File Reference │ │ │ │ │ │ │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ +249 │ │ │ │ │ │ │ │ │ │ │ │ -00099 │ │ │ │ │ │ -int i; │ │ │ │ │ │ -long int seed; │ │ │ │ │ │ -00100 │ │ │ │ │ │ -00101 │ │ │ │ │ │ 00102 │ │ │ │ │ │ if (s==0) │ │ │ │ │ │ /* default seed is 314159265 */ │ │ │ │ │ │ 00103 │ │ │ │ │ │ s = 314159265; │ │ │ │ │ │ 00104 │ │ │ │ │ │ 00105 │ │ │ │ │ │ @@ -18379,16 +20366,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 │ │ │ │ │ │ @@ -18403,18 +20390,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 │ │ │ │ │ │ @@ -18432,85 +20419,87 @@ │ │ │ │ │ │ 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 │ │ │ │ │ │ -const size_t n = sizeof (ranlux_state_t); │ │ │ │ │ │ +unsigned char *p = (unsigned char *) (&local_ranlux_state); │ │ │ │ │ │ 00163 │ │ │ │ │ │ +const size_t n = sizeof (ranlux_state_t); │ │ │ │ │ │ 00164 │ │ │ │ │ │ for (i=0;i │ │ │ │ │ │ 00030 │ │ │ │ │ │ 00031 namespace siscone{ │ │ │ │ │ │ 00032 │ │ │ │ │ │ 00033 /******************************************************* │ │ │ │ │ │ @@ -18718,34 +20709,32 @@ │ │ │ │ │ │ 00113 │ │ │ │ │ │ ref[0] ^= r.ref[0]; │ │ │ │ │ │ 00114 │ │ │ │ │ │ ref[1] ^= r.ref[1]; │ │ │ │ │ │ 00115 │ │ │ │ │ │ ref[2] ^= r.ref[2]; │ │ │ │ │ │ │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -237 │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ │ │ │ │ │ │ * │ │ │ │ │ │ │ │ │ │ │ │ * │ │ │ │ │ │ │ │ │ │ │ │ - 238 │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ + 5.36 reference.h │ │ │ │ │ │ │ │ │ │ │ │ 00116 │ │ │ │ │ │ return *this; │ │ │ │ │ │ 00117 } │ │ │ │ │ │ 00118 │ │ │ │ │ │ 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 │ │ │ │ │ │ @@ -18844,17 +20833,19 @@ │ │ │ │ │ │ 00094 } │ │ │ │ │ │ 00095 │ │ │ │ │ │ 00096 // difference test for two references │ │ │ │ │ │ 00097 //---------------------------------- │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 5.31 siscone.cpp │ │ │ │ │ │ +253 │ │ │ │ │ │ │ │ │ │ │ │ -239 │ │ │ │ │ │ + 254 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ │ │ │ │ │ │ 00098 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]); │ │ │ │ │ │ 00099 │ │ │ │ │ │ 00100 } │ │ │ │ │ │ 00101 │ │ │ │ │ │ 00102 // difference test for two references │ │ │ │ │ │ @@ -18867,15 +20858,15 @@ │ │ │ │ │ │ 00107 │ │ │ │ │ │ )); │ │ │ │ │ │ 00108 } │ │ │ │ │ │ 00109 │ │ │ │ │ │ 00110 } │ │ │ │ │ │ 00111 #endif │ │ │ │ │ │ │ │ │ │ │ │ -5.31 siscone.cpp │ │ │ │ │ │ +5.37 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. │ │ │ │ │ │ // │ │ │ │ │ │ @@ -18957,21 +20948,19 @@ │ │ │ │ │ │ rerun_allowed = false; │ │ │ │ │ │ 00059 } │ │ │ │ │ │ 00060 │ │ │ │ │ │ 00061 bool Csiscone::init_done=false; │ │ │ │ │ │ 00062 std::ostream* Csiscone::_banner_ostr = &cout; │ │ │ │ │ │ 00063 │ │ │ │ │ │ │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ * │ │ │ │ │ │ │ │ │ │ │ │ - 240 │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ + 5.37 siscone.cpp │ │ │ │ │ │ │ │ │ │ │ │ 00064 /* │ │ │ │ │ │ 00065 * compute the jets from a given particle set doing multiple passes │ │ │ │ │ │ 00066 * such pass N looks for jets among all particles not put into jets │ │ │ │ │ │ 00067 * during previous passes. │ │ │ │ │ │ 00068 * - _particles │ │ │ │ │ │ list of particles │ │ │ │ │ │ @@ -19109,15 +21098,19 @@ │ │ │ │ │ │ 00148 * - _particles │ │ │ │ │ │ 00149 * - _radius │ │ │ │ │ │ cone radius │ │ │ │ │ │ 00150 * - _n_pass_max maximum number of runs │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 5.31 siscone.cpp │ │ │ │ │ │ +255 │ │ │ │ │ │ + │ │ │ │ │ │ + 256 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ │ │ │ │ │ │ minimum pT of the protojets │ │ │ │ │ │ 00151 * - _ptmin │ │ │ │ │ │ 00152 * - _ordering_scale │ │ │ │ │ │ the ordering scale to decide which stable │ │ │ │ │ │ 00153 * │ │ │ │ │ │ cone is removed │ │ │ │ │ │ @@ -19258,17 +21251,15 @@ │ │ │ │ │ │ 00234 } │ │ │ │ │ │ 00235 │ │ │ │ │ │ 00236 // ensure things are initialised │ │ │ │ │ │ 00237 void Csiscone::_initialise_if_needed(){ │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -241 │ │ │ │ │ │ - │ │ │ │ │ │ - 242 │ │ │ │ │ │ + 5.38 siscone.cpp │ │ │ │ │ │ │ │ │ │ │ │ 00238 │ │ │ │ │ │ 00239 │ │ │ │ │ │ 00240 │ │ │ │ │ │ 00241 │ │ │ │ │ │ 00242 │ │ │ │ │ │ 00243 │ │ │ │ │ │ @@ -19278,15 +21269,15 @@ │ │ │ │ │ │ 00247 │ │ │ │ │ │ 00248 │ │ │ │ │ │ 00249 │ │ │ │ │ │ 00250 │ │ │ │ │ │ 00251 │ │ │ │ │ │ 00252 │ │ │ │ │ │ │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ +257 │ │ │ │ │ │ │ │ │ │ │ │ // initialise random number generator │ │ │ │ │ │ if (init_done) return; │ │ │ │ │ │ // initialise random number generator │ │ │ │ │ │ ranlux_init(); │ │ │ │ │ │ // do not do this again │ │ │ │ │ │ init_done=true; │ │ │ │ │ │ @@ -19363,15 +21354,15 @@ │ │ │ │ │ │ 00290 string siscone_version(){ │ │ │ │ │ │ return SISCONE_VERSION; │ │ │ │ │ │ 00291 │ │ │ │ │ │ 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. │ │ │ │ │ │ // │ │ │ │ │ │ 00005 // WARNING: this is not the main SISCone trunk but │ │ │ │ │ │ 00006 // │ │ │ │ │ │ @@ -19386,14 +21377,16 @@ │ │ │ │ │ │ 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 │ │ │ │ │ │ │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ @@ -19404,17 +21397,17 @@ │ │ │ │ │ │ // │ │ │ │ │ │ │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ + 258 │ │ │ │ │ │ │ │ │ │ │ │ - 5.32 siscone.cpp │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ │ │ │ │ │ │ 00019 // GNU General Public License for more details. │ │ │ │ │ │ // │ │ │ │ │ │ 00020 // │ │ │ │ │ │ // │ │ │ │ │ │ 00021 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ // │ │ │ │ │ │ @@ -19534,19 +21527,17 @@ │ │ │ │ │ │ 00103 │ │ │ │ │ │ bool finished = false; │ │ │ │ │ │ 00104 │ │ │ │ │ │ 00105 │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -243 │ │ │ │ │ │ - │ │ │ │ │ │ - 244 │ │ │ │ │ │ + 5.38 siscone.cpp │ │ │ │ │ │ │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ +259 │ │ │ │ │ │ │ │ │ │ │ │ 00106 │ │ │ │ │ │ rerun_allowed = false; │ │ │ │ │ │ 00107 │ │ │ │ │ │ protocones_list.clear(); │ │ │ │ │ │ 00108 │ │ │ │ │ │ 00109 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ @@ -19690,17 +21681,17 @@ │ │ │ │ │ │ CSphstable_cones::init(p_uncol_hard); │ │ │ │ │ │ 00191 │ │ │ │ │ │ 00192 │ │ │ │ │ │ // get stable cones (stored in ’protocones’) │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 5.32 siscone.cpp │ │ │ │ │ │ + 260 │ │ │ │ │ │ │ │ │ │ │ │ -245 │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ │ │ │ │ │ │ 00193 │ │ │ │ │ │ unclustered_left = get_stable_cones(_radius); │ │ │ │ │ │ 00194 │ │ │ │ │ │ // add the hardest stable cone to the list of jets │ │ │ │ │ │ 00195 │ │ │ │ │ │ 00196 │ │ │ │ │ │ @@ -19853,17 +21844,15 @@ │ │ │ │ │ │ 00272 │ │ │ │ │ │ 00273 // finally, a bunch of functions to access to │ │ │ │ │ │ 00274 // basic information (package name, version) │ │ │ │ │ │ 00275 //--------------------------------------------- │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 246 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ + 5.39 siscone.h │ │ │ │ │ │ │ │ │ │ │ │ 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. │ │ │ │ │ │ @@ -19883,15 +21872,15 @@ │ │ │ │ │ │ 00293 string siscone_version(){ │ │ │ │ │ │ return SISCONE_VERSION; │ │ │ │ │ │ 00294 │ │ │ │ │ │ 00295 } │ │ │ │ │ │ 00296 │ │ │ │ │ │ 00297 } │ │ │ │ │ │ │ │ │ │ │ │ -5.33 siscone.h │ │ │ │ │ │ +5.39 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 │ │ │ │ │ │ @@ -19976,15 +21965,19 @@ │ │ │ │ │ │ 00119 │ │ │ │ │ │ 00120 │ │ │ │ │ │ static bool init_done; │ │ │ │ │ │ 00121 │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 5.34 siscone.h │ │ │ │ │ │ +261 │ │ │ │ │ │ + │ │ │ │ │ │ + 262 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ │ │ │ │ │ │ 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;} │ │ │ │ │ │ @@ -20011,15 +22004,15 @@ │ │ │ │ │ │ 00166 std::string siscone_package_name(); │ │ │ │ │ │ 00167 │ │ │ │ │ │ 00173 std::string siscone_version(); │ │ │ │ │ │ 00174 │ │ │ │ │ │ 00175 } │ │ │ │ │ │ 00176 #endif │ │ │ │ │ │ │ │ │ │ │ │ -5.34 siscone.h │ │ │ │ │ │ +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 │ │ │ │ │ │ @@ -20098,19 +22091,17 @@ │ │ │ │ │ │ Esplit_merge_scale _ordering_scale=SM_Etilde); │ │ │ │ │ │ 00097 │ │ │ │ │ │ int recompute_jets(double _f, double _Emin = 0.0, │ │ │ │ │ │ 00110 │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -247 │ │ │ │ │ │ - │ │ │ │ │ │ - 248 │ │ │ │ │ │ + 5.41 siscone_error.cpp │ │ │ │ │ │ │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ +263 │ │ │ │ │ │ │ │ │ │ │ │ 00111 │ │ │ │ │ │ Esplit_merge_scale _split_merge_scale=SM_Etilde); │ │ │ │ │ │ 00112 │ │ │ │ │ │ 00114 │ │ │ │ │ │ std::vector > protocones_list; │ │ │ │ │ │ 00115 │ │ │ │ │ │ @@ -20148,15 +22139,15 @@ │ │ │ │ │ │ 00163 std::string siscone_package_name(); │ │ │ │ │ │ 00164 │ │ │ │ │ │ 00170 std::string siscone_version(); │ │ │ │ │ │ 00171 │ │ │ │ │ │ 00172 } │ │ │ │ │ │ 00173 #endif │ │ │ │ │ │ │ │ │ │ │ │ -5.35 siscone_error.cpp │ │ │ │ │ │ +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. │ │ │ │ │ │ // │ │ │ │ │ │ @@ -20204,24 +22195,26 @@ │ │ │ │ │ │ 00028 │ │ │ │ │ │ 00029 namespace siscone{ │ │ │ │ │ │ 00030 │ │ │ │ │ │ 00031 bool Csiscone_error::m_print_errors = true; │ │ │ │ │ │ 00032 │ │ │ │ │ │ 00033 } │ │ │ │ │ │ │ │ │ │ │ │ -5.36 siscone_error.h │ │ │ │ │ │ +5.42 siscone_error.h │ │ │ │ │ │ 00001 // -*- C++ -*00003 // File: siscone_error.h │ │ │ │ │ │ 00004 // Description: header file for SISCone error messages (Csiscone_error) │ │ │ │ │ │ │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ // │ │ │ │ │ │ // │ │ │ │ │ │ │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ + 264 │ │ │ │ │ │ │ │ │ │ │ │ - 5.37 geom_2d.h │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ │ │ │ │ │ │ 00005 // This file is part of the SISCone project. │ │ │ │ │ │ // │ │ │ │ │ │ 00006 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ // │ │ │ │ │ │ 00007 // │ │ │ │ │ │ // │ │ │ │ │ │ @@ -20297,18 +22290,18 @@ │ │ │ │ │ │ static bool m_print_errors; │ │ │ │ │ │ 00060 │ │ │ │ │ │ 00061 }; │ │ │ │ │ │ 00062 │ │ │ │ │ │ 00063 } │ │ │ │ │ │ 00064 #endif │ │ │ │ │ │ │ │ │ │ │ │ -5.37 geom_2d.h │ │ │ │ │ │ -00001 // -*- C++ -*00003 // File: geom_2d.h │ │ │ │ │ │ +5.43 hash.h │ │ │ │ │ │ +00001 // -*- C++ -*00003 // File: hash.h │ │ │ │ │ │ // │ │ │ │ │ │ -00004 // Description: header file for two-dimensional geometry tools │ │ │ │ │ │ +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 // │ │ │ │ │ │ // │ │ │ │ │ │ @@ -20339,173 +22332,220 @@ │ │ │ │ │ │ 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 │ │ │ │ │ │ +00024 // $Revision:: 224 │ │ │ │ │ │ $// │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -249 │ │ │ │ │ │ - │ │ │ │ │ │ - 250 │ │ │ │ │ │ + 5.44 hash.h │ │ │ │ │ │ │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ +265 │ │ │ │ │ │ │ │ │ │ │ │ -00025 // $Date:: 2020-04-22 11:51:09 +0200 (Wed, 22 Apr 2020) │ │ │ │ │ │ +00025 // $Date:: 2008-05-16 19:58:30 +0200 (Fri, 16 May 2008) │ │ │ │ │ │ $// │ │ │ │ │ │ 00027 │ │ │ │ │ │ -00028 #ifndef __GEOM_2D_H__ │ │ │ │ │ │ -00029 #define __GEOM_2D_H__ │ │ │ │ │ │ +00028 #ifndef __HASH_H__ │ │ │ │ │ │ +00029 #define __HASH_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; │ │ │ │ │ │ -return phi; │ │ │ │ │ │ -00046 │ │ │ │ │ │ -00047 } │ │ │ │ │ │ +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 │ │ │ │ │ │ -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) { │ │ │ │ │ │ -double delta = fabs(phi1-phi2); │ │ │ │ │ │ -00061 │ │ │ │ │ │ -00062 │ │ │ │ │ │ -return delta > M_PI ? twopi-delta : delta; │ │ │ │ │ │ -00063 } │ │ │ │ │ │ -00064 │ │ │ │ │ │ -00066 inline double pow2(double x) {return x*x;} │ │ │ │ │ │ +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 │ │ │ │ │ │ -00073 class Ctwovect { │ │ │ │ │ │ -00074 public: │ │ │ │ │ │ -00076 │ │ │ │ │ │ -Ctwovect() : x(0.0), y(0.0) {} │ │ │ │ │ │ -00077 │ │ │ │ │ │ +00070 │ │ │ │ │ │ +~hash_cones(); │ │ │ │ │ │ +00071 │ │ │ │ │ │ +int insert(Cmomentum *v, Cmomentum *parent, Cmomentum *child, bool p_io, bool c_io); │ │ │ │ │ │ 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());} │ │ │ │ │ │ +int insert(Cmomentum *v); │ │ │ │ │ │ 00090 │ │ │ │ │ │ -00091 }; │ │ │ │ │ │ -00092 │ │ │ │ │ │ +00091 │ │ │ │ │ │ 00093 │ │ │ │ │ │ -00098 inline double dot_product(const Ctwovect & a, const Ctwovect & b) { │ │ │ │ │ │ -return a.x*b.x + a.y*b.y; │ │ │ │ │ │ -00099 │ │ │ │ │ │ -00100 } │ │ │ │ │ │ -00101 │ │ │ │ │ │ +hash_element **hash_array; │ │ │ │ │ │ +00094 │ │ │ │ │ │ +int n_cones; │ │ │ │ │ │ +00096 │ │ │ │ │ │ +00097 │ │ │ │ │ │ +00099 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ +00100 │ │ │ │ │ │ +int n_occupied_cells; │ │ │ │ │ │ +00101 #endif │ │ │ │ │ │ 00102 │ │ │ │ │ │ -00107 inline double cross_product(const Ctwovect & a, const Ctwovect & b) { │ │ │ │ │ │ +00104 │ │ │ │ │ │ +int mask; │ │ │ │ │ │ +00105 │ │ │ │ │ │ +double R2; │ │ │ │ │ │ 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 │ │ │ │ │ │ -} │ │ │ │ │ │ -00157 │ │ │ │ │ │ -00159 │ │ │ │ │ │ -inline unsigned int get_phi_cell(double phi){ │ │ │ │ │ │ -return (unsigned int) (1u « ((int) (32*phi/twopi+16)%32)); │ │ │ │ │ │ -00160 │ │ │ │ │ │ -00161 │ │ │ │ │ │ -} │ │ │ │ │ │ -00162 }; │ │ │ │ │ │ -00163 │ │ │ │ │ │ -00168 bool is_range_overlap(const Ceta_phi_range &r1, const Ceta_phi_range &r2); │ │ │ │ │ │ +00109 │ │ │ │ │ │ +inline bool is_inside(Cmomentum *centre, Cmomentum *v); │ │ │ │ │ │ +00118 │ │ │ │ │ │ +00119 }; │ │ │ │ │ │ +00120 │ │ │ │ │ │ +00121 } │ │ │ │ │ │ +00122 #endif │ │ │ │ │ │ + │ │ │ │ │ │ +5.44 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 │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 5.38 geom_2d.h │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ + 266 │ │ │ │ │ │ │ │ │ │ │ │ -00169 │ │ │ │ │ │ -00175 const Ceta_phi_range range_union(const Ceta_phi_range &r1, const Ceta_phi_range &r2); │ │ │ │ │ │ -00176 │ │ │ │ │ │ -00177 } │ │ │ │ │ │ -00178 │ │ │ │ │ │ -00179 #endif │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ │ │ │ │ │ │ -5.38 geom_2d.h │ │ │ │ │ │ -00001 // -*- C++ -*00003 // File: geom_2d.h │ │ │ │ │ │ +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 │ │ │ │ │ │ +00109 │ │ │ │ │ │ +double tan2R; │ │ │ │ │ │ +00110 }; │ │ │ │ │ │ +00111 │ │ │ │ │ │ +00112 } │ │ │ │ │ │ +00113 #endif │ │ │ │ │ │ + │ │ │ │ │ │ +5.45 vicinity.h │ │ │ │ │ │ +00001 // -*- C++ -*00003 // File: vicinity.h │ │ │ │ │ │ // │ │ │ │ │ │ -00004 // Description: header file for two-dimensional geometry tools │ │ │ │ │ │ +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 │ │ │ │ │ │ @@ -20527,509 +22567,355 @@ │ │ │ │ │ │ 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:: 255 │ │ │ │ │ │ $// │ │ │ │ │ │ -00027 // $Date:: 2020-04-22 11:51:09 +0200 (Wed, 22 Apr 2020) │ │ │ │ │ │ +00027 // $Date:: 2008-07-12 17:40:35 +0200 (Sat, 12 Jul 2008) │ │ │ │ │ │ $// │ │ │ │ │ │ 00029 │ │ │ │ │ │ -00030 #ifndef __SPH_GEOM_2D_H__ │ │ │ │ │ │ -00031 #define __SPH_GEOM_2D_H__ │ │ │ │ │ │ +00030 #ifndef __SPH_VICINITY_H__ │ │ │ │ │ │ +00031 #define __SPH_VICINITY_H__ │ │ │ │ │ │ 00032 │ │ │ │ │ │ -00033 #include │ │ │ │ │ │ -00034 #include │ │ │ │ │ │ -00035 #include │ │ │ │ │ │ -00036 #include │ │ │ │ │ │ -00037 │ │ │ │ │ │ -00038 #ifndef M_PI │ │ │ │ │ │ -00039 #define M_PI 3.141592653589793238462643383279502884197 │ │ │ │ │ │ +00033 #include │ │ │ │ │ │ +00034 #include │ │ │ │ │ │ +00035 #include │ │ │ │ │ │ +00036 #include "momentum.h" │ │ │ │ │ │ +00037 #include │ │ │ │ │ │ +00038 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ +00039 #include │ │ │ │ │ │ 00040 #endif │ │ │ │ │ │ + │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.46 vicinity.h │ │ │ │ │ │ + │ │ │ │ │ │ +267 │ │ │ │ │ │ + │ │ │ │ │ │ 00041 │ │ │ │ │ │ 00042 namespace siscone_spherical{ │ │ │ │ │ │ 00043 │ │ │ │ │ │ -00052 class CSphtheta_phi_range{ │ │ │ │ │ │ +00044 │ │ │ │ │ │ +00052 class CSphvicinity_elm{ │ │ │ │ │ │ 00053 public: │ │ │ │ │ │ 00055 │ │ │ │ │ │ -CSphtheta_phi_range(); │ │ │ │ │ │ +CSphmomentum *v; │ │ │ │ │ │ 00056 │ │ │ │ │ │ +00058 │ │ │ │ │ │ +siscone::Cvicinity_inclusion *is_inside; │ │ │ │ │ │ +00059 │ │ │ │ │ │ +// centre variables │ │ │ │ │ │ +00060 │ │ │ │ │ │ +00061 │ │ │ │ │ │ +CSph3vector centre; │ │ │ │ │ │ 00062 │ │ │ │ │ │ -CSphtheta_phi_range(double c_theta, double c_phi, double R); │ │ │ │ │ │ +double angle; │ │ │ │ │ │ +bool side; │ │ │ │ │ │ 00063 │ │ │ │ │ │ +00064 │ │ │ │ │ │ +double cocircular_range; │ │ │ │ │ │ 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; │ │ │ │ │ │ +00069 │ │ │ │ │ │ +std::list cocircular; │ │ │ │ │ │ +00070 }; │ │ │ │ │ │ +00071 │ │ │ │ │ │ +00073 bool ve_less(CSphvicinity_elm *ve1, CSphvicinity_elm *ve2); │ │ │ │ │ │ +00074 │ │ │ │ │ │ 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){ │ │ │ │ │ │ +00083 class CSphvicinity{ │ │ │ │ │ │ +00084 public: │ │ │ │ │ │ 00086 │ │ │ │ │ │ +CSphvicinity(); │ │ │ │ │ │ 00087 │ │ │ │ │ │ -if (theta>=theta_max) return 1u«31; │ │ │ │ │ │ -00088 │ │ │ │ │ │ -return (unsigned int) (1u « ((int) (32*((theta-theta_min)/(theta_max-theta_min))))); │ │ │ │ │ │ 00089 │ │ │ │ │ │ -} │ │ │ │ │ │ +CSphvicinity(std::vector &_particle_list); │ │ │ │ │ │ 00090 │ │ │ │ │ │ -inline unsigned int get_phi_cell(double phi){ │ │ │ │ │ │ 00092 │ │ │ │ │ │ +~CSphvicinity(); │ │ │ │ │ │ 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 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -251 │ │ │ │ │ │ - │ │ │ │ │ │ - 252 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00108 const CSphtheta_phi_range range_union(const CSphtheta_phi_range &r1, const CSphtheta_phi_range &r2); │ │ │ │ │ │ +void set_particle_list(std::vector &_particle_list); │ │ │ │ │ │ +00098 │ │ │ │ │ │ +00099 │ │ │ │ │ │ +void build(CSphmomentum *_parent, double _VR); │ │ │ │ │ │ +00105 │ │ │ │ │ │ +00106 │ │ │ │ │ │ +00107 │ │ │ │ │ │ +// cone kinematical information │ │ │ │ │ │ +00108 │ │ │ │ │ │ +CSphmomentum *parent; │ │ │ │ │ │ 00109 │ │ │ │ │ │ -00110 } │ │ │ │ │ │ +double VR; │ │ │ │ │ │ +double VR2; │ │ │ │ │ │ +00110 │ │ │ │ │ │ 00111 │ │ │ │ │ │ -00112 #endif │ │ │ │ │ │ +double cosVR; │ │ │ │ │ │ +double R; │ │ │ │ │ │ +00112 │ │ │ │ │ │ +00113 │ │ │ │ │ │ +double R2; │ │ │ │ │ │ +00114 │ │ │ │ │ │ +double tan2R; │ │ │ │ │ │ +double D2_R; │ │ │ │ │ │ +00115 │ │ │ │ │ │ +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 │ │ │ │ │ │ +00129 │ │ │ │ │ │ +// vicinity information │ │ │ │ │ │ +00130 │ │ │ │ │ │ +std::vector vicinity; │ │ │ │ │ │ +00131 │ │ │ │ │ │ +unsigned int vicinity_size; │ │ │ │ │ │ +00132 │ │ │ │ │ │ +00133 protected: │ │ │ │ │ │ +00139 │ │ │ │ │ │ +void append_to_vicinity(CSphmomentum *v); │ │ │ │ │ │ +00140 │ │ │ │ │ │ +// internal variables │ │ │ │ │ │ +00141 │ │ │ │ │ │ +00142 │ │ │ │ │ │ +CSph3vector parent_centre; │ │ │ │ │ │ +00143 │ │ │ │ │ │ +CSph3vector angular_dir1; │ │ │ │ │ │ +00144 │ │ │ │ │ │ +CSph3vector angular_dir2; │ │ │ │ │ │ +00145 }; │ │ │ │ │ │ +00146 │ │ │ │ │ │ +00147 } │ │ │ │ │ │ +00148 │ │ │ │ │ │ +00149 #endif │ │ │ │ │ │ │ │ │ │ │ │ -5.39 hash.cpp │ │ │ │ │ │ -00001 │ │ │ │ │ │ -00002 // File: hash.cpp │ │ │ │ │ │ +5.46 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. │ │ │ │ │ │ // │ │ │ │ │ │ -00003 // Description: source file for classes hash_element and hash_cones │ │ │ │ │ │ +00006 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ +00007 // │ │ │ │ │ │ +00008 // Copyright (c) 2006 Gavin Salam and Gregory Soyez │ │ │ │ │ │ +00009 // │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ // │ │ │ │ │ │ -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 │ │ │ │ │ │ + │ │ │ │ │ │ + 268 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +00010 // 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 // 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 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ // │ │ │ │ │ │ -00012 // (at your option) any later version. │ │ │ │ │ │ +00013 // (at your option) any later version. │ │ │ │ │ │ // │ │ │ │ │ │ -00013 // │ │ │ │ │ │ +00014 // │ │ │ │ │ │ // │ │ │ │ │ │ -00014 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ +00015 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ // │ │ │ │ │ │ -00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ +00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ // │ │ │ │ │ │ -00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ +00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ // │ │ │ │ │ │ -00017 // GNU General Public License for more details. │ │ │ │ │ │ +00018 // GNU General Public License for more details. │ │ │ │ │ │ // │ │ │ │ │ │ -00018 // │ │ │ │ │ │ +00019 // │ │ │ │ │ │ // │ │ │ │ │ │ -00019 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ +00020 // 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 // 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 // │ │ │ │ │ │ +00022 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ +00023 // │ │ │ │ │ │ // │ │ │ │ │ │ -00023 // $Revision:: 225 │ │ │ │ │ │ +00024 // $Revision:: 123 │ │ │ │ │ │ $// │ │ │ │ │ │ -00024 // $Date:: 2008-05-20 16:59:47 +0200 (Tue, 20 May 2008) │ │ │ │ │ │ +00025 // $Date:: 2007-03-01 02:52:16 +0100 (Thu, 01 Mar 2007) │ │ │ │ │ │ $// │ │ │ │ │ │ -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){ │ │ │ │ │ │ -int i; │ │ │ │ │ │ -00048 │ │ │ │ │ │ +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 │ │ │ │ │ │ -n_cones = 0; │ │ │ │ │ │ -00051 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ +00051 │ │ │ │ │ │ +bool cone; │ │ │ │ │ │ +bool cocirc; │ │ │ │ │ │ 00052 │ │ │ │ │ │ -n_occupied_cells = 0; │ │ │ │ │ │ -00053 #endif │ │ │ │ │ │ +00053 }; │ │ │ │ │ │ 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)); │ │ │ │ │ │ -if (nbits<1) nbits=1; │ │ │ │ │ │ -00060 │ │ │ │ │ │ -00061 │ │ │ │ │ │ -mask = 1 « nbits; │ │ │ │ │ │ -00062 │ │ │ │ │ │ -00063 │ │ │ │ │ │ -// create hash │ │ │ │ │ │ -00064 │ │ │ │ │ │ -hash_array = new hash_element*[mask]; │ │ │ │ │ │ -00065 │ │ │ │ │ │ -mask--; │ │ │ │ │ │ +00063 class Cvicinity_elm{ │ │ │ │ │ │ +00064 public: │ │ │ │ │ │ 00066 │ │ │ │ │ │ -// set the array to 0 │ │ │ │ │ │ +Cmomentum *v; │ │ │ │ │ │ 00067 │ │ │ │ │ │ -00068 │ │ │ │ │ │ -//? needed ? │ │ │ │ │ │ 00069 │ │ │ │ │ │ -for (i=0;i cocircular; │ │ │ │ │ │ +00082 }; │ │ │ │ │ │ 00083 │ │ │ │ │ │ -elm = hash_array[i]; │ │ │ │ │ │ -00084 │ │ │ │ │ │ -hash_array[i] = hash_array[i]->next; │ │ │ │ │ │ -00085 │ │ │ │ │ │ -delete elm; │ │ │ │ │ │ +00085 bool ve_less(Cvicinity_elm *ve1, Cvicinity_elm *ve2); │ │ │ │ │ │ 00086 │ │ │ │ │ │ -} │ │ │ │ │ │ 00087 │ │ │ │ │ │ -} │ │ │ │ │ │ -00088 │ │ │ │ │ │ -00089 │ │ │ │ │ │ -delete[] hash_array; │ │ │ │ │ │ -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 │ │ │ │ │ │ -00097 * - child │ │ │ │ │ │ -child particle defining the cone │ │ │ │ │ │ -whether the parent has to belong to the cone or not │ │ │ │ │ │ -00098 * - p_io │ │ │ │ │ │ -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; │ │ │ │ │ │ +00095 class Cvicinity{ │ │ │ │ │ │ +00096 public: │ │ │ │ │ │ +00098 │ │ │ │ │ │ +Cvicinity(); │ │ │ │ │ │ +00099 │ │ │ │ │ │ +00101 │ │ │ │ │ │ +Cvicinity(std::vector &_particle_list); │ │ │ │ │ │ +00102 │ │ │ │ │ │ 00104 │ │ │ │ │ │ +~Cvicinity(); │ │ │ │ │ │ 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) │ │ │ │ │ │ +void set_particle_list(std::vector &_particle_list); │ │ │ │ │ │ 00111 │ │ │ │ │ │ -n_occupied_cells++; │ │ │ │ │ │ -00112 #endif │ │ │ │ │ │ -00113 │ │ │ │ │ │ -00114 │ │ │ │ │ │ -do{ │ │ │ │ │ │ -00115 │ │ │ │ │ │ -// if it is not present, add it │ │ │ │ │ │ -00116 │ │ │ │ │ │ -if (elm==NULL){ │ │ │ │ │ │ +void build(Cmomentum *_parent, double _VR); │ │ │ │ │ │ 00117 │ │ │ │ │ │ -// create element │ │ │ │ │ │ 00118 │ │ │ │ │ │ -elm = new hash_element; │ │ │ │ │ │ +// cone kinematical information │ │ │ │ │ │ 00119 │ │ │ │ │ │ -// set its varibles │ │ │ │ │ │ 00120 │ │ │ │ │ │ +Cmomentum *parent; │ │ │ │ │ │ 00121 │ │ │ │ │ │ -// Note: at this level, eta and phi have already been computed │ │ │ │ │ │ +double VR; │ │ │ │ │ │ +double VR2; │ │ │ │ │ │ 00122 │ │ │ │ │ │ -// │ │ │ │ │ │ -through Cmomentum::build_etaphi. │ │ │ │ │ │ 00123 │ │ │ │ │ │ -elm->ref = v->ref; │ │ │ │ │ │ +double R; │ │ │ │ │ │ +double R2; │ │ │ │ │ │ 00124 │ │ │ │ │ │ -//compute vectors centre │ │ │ │ │ │ 00125 │ │ │ │ │ │ +double inv_R_EPS_COCIRC; │ │ │ │ │ │ +double inv_R_2EPS_COCIRC; │ │ │ │ │ │ 00126 │ │ │ │ │ │ -v->build_etaphi(); │ │ │ │ │ │ 00127 │ │ │ │ │ │ -elm->eta = v->eta; │ │ │ │ │ │ 00128 │ │ │ │ │ │ -elm->phi = v->phi; │ │ │ │ │ │ +// particle list information │ │ │ │ │ │ 00129 │ │ │ │ │ │ -// if at least one of the two is_inside tests gives a result != from the expected, │ │ │ │ │ │ +int n_part; │ │ │ │ │ │ 00130 │ │ │ │ │ │ -// the || will be true hence !(...) false as wanted │ │ │ │ │ │ +std::vector plist; │ │ │ │ │ │ 00131 │ │ │ │ │ │ -elm->is_stable = !((is_inside(v, parent)^p_io)||(is_inside(v, child)^c_io)); │ │ │ │ │ │ -//cout « "-- new status of " « v->ref[0] « ":" « elm->is_stable « endl; │ │ │ │ │ │ +std::vector pincluded; │ │ │ │ │ │ 00132 │ │ │ │ │ │ -00133 │ │ │ │ │ │ +Cvicinity_elm *ve_list; │ │ │ │ │ │ +00133 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.47 split_merge.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +269 │ │ │ │ │ │ + │ │ │ │ │ │ 00134 │ │ │ │ │ │ -// update hash │ │ │ │ │ │ -00135 │ │ │ │ │ │ -elm->next = hash_array[index]; │ │ │ │ │ │ +Cquadtree *quadtree; │ │ │ │ │ │ +00135 #endif │ │ │ │ │ │ 00136 │ │ │ │ │ │ -hash_array[index] = elm; │ │ │ │ │ │ 00137 │ │ │ │ │ │ +// vicinity information │ │ │ │ │ │ 00138 │ │ │ │ │ │ -n_cones++; │ │ │ │ │ │ -return 0; │ │ │ │ │ │ +std::vector vicinity; │ │ │ │ │ │ 00139 │ │ │ │ │ │ +unsigned int vicinity_size; │ │ │ │ │ │ 00140 │ │ │ │ │ │ -} │ │ │ │ │ │ -00141 │ │ │ │ │ │ -00142 │ │ │ │ │ │ -// if the cone is already there, simply update stability status │ │ │ │ │ │ -00143 │ │ │ │ │ │ -if (v->ref == elm->ref){ │ │ │ │ │ │ -// there is only an update to perform to see if the cone is still stable │ │ │ │ │ │ -00144 │ │ │ │ │ │ -00145 │ │ │ │ │ │ -if (elm->is_stable){ │ │ │ │ │ │ -00146 │ │ │ │ │ │ -v->build_etaphi(); │ │ │ │ │ │ +00141 protected: │ │ │ │ │ │ +void append_to_vicinity(Cmomentum *v); │ │ │ │ │ │ 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 « " " │ │ │ │ │ │ +// internal variables │ │ │ │ │ │ 00150 │ │ │ │ │ │ -// │ │ │ │ │ │ -« child->ref[0] « ":" « is_inside(v, child) « ":" « c_io « endl; │ │ │ │ │ │ +double pcx; │ │ │ │ │ │ 00151 │ │ │ │ │ │ -//cout « "-- rep status of " « v->ref[0] « ":" « elm->is_stable « endl; │ │ │ │ │ │ -00152 │ │ │ │ │ │ -//cout « v->eta « " " « v->phi « endl; │ │ │ │ │ │ +double pcy; │ │ │ │ │ │ +00152 }; │ │ │ │ │ │ 00153 │ │ │ │ │ │ -//cout « (child->eta) « " " « child->phi « endl; │ │ │ │ │ │ -00154 │ │ │ │ │ │ -} │ │ │ │ │ │ +00154 } │ │ │ │ │ │ 00155 │ │ │ │ │ │ -return 0; │ │ │ │ │ │ -00156 │ │ │ │ │ │ -} │ │ │ │ │ │ -00157 │ │ │ │ │ │ -00158 │ │ │ │ │ │ -elm = elm->next; │ │ │ │ │ │ -00159 │ │ │ │ │ │ -} while (1); │ │ │ │ │ │ -00160 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -253 │ │ │ │ │ │ - │ │ │ │ │ │ - 254 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00161 │ │ │ │ │ │ -return 1; │ │ │ │ │ │ -00162 } │ │ │ │ │ │ -00163 │ │ │ │ │ │ -00164 /* │ │ │ │ │ │ -00165 * insert a new candidate into the hash. │ │ │ │ │ │ -4-momentum of te cone to add │ │ │ │ │ │ -00166 * - v │ │ │ │ │ │ -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; │ │ │ │ │ │ -int index = (v->ref.ref[0]) & mask; │ │ │ │ │ │ -00173 │ │ │ │ │ │ -//cout « "-- stable candidate: " « v->ref[0] « ":" « endl; │ │ │ │ │ │ -00174 │ │ │ │ │ │ -00175 │ │ │ │ │ │ -00176 │ │ │ │ │ │ -// check the array cell corresponding to our reference │ │ │ │ │ │ -00177 │ │ │ │ │ │ -elm = hash_array[index]; │ │ │ │ │ │ -00178 │ │ │ │ │ │ -do{ │ │ │ │ │ │ -// if it is not present, add it │ │ │ │ │ │ -00179 │ │ │ │ │ │ -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 │ │ │ │ │ │ -// update hash │ │ │ │ │ │ -00192 │ │ │ │ │ │ -00193 │ │ │ │ │ │ -elm->next = hash_array[index]; │ │ │ │ │ │ -00194 │ │ │ │ │ │ -hash_array[index] = elm; │ │ │ │ │ │ -00195 │ │ │ │ │ │ -00196 │ │ │ │ │ │ -n_cones++; │ │ │ │ │ │ -00197 │ │ │ │ │ │ -return 0; │ │ │ │ │ │ -00198 │ │ │ │ │ │ -} │ │ │ │ │ │ -00199 │ │ │ │ │ │ -// if the cone is already there, we have nothing to do │ │ │ │ │ │ -00200 │ │ │ │ │ │ -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’. │ │ │ │ │ │ -00215 * - centre │ │ │ │ │ │ -centre of the circle │ │ │ │ │ │ -particle to test │ │ │ │ │ │ -00216 * - v │ │ │ │ │ │ -00217 * return true if inside, false if outside │ │ │ │ │ │ -00218 ******************************************************************************/ │ │ │ │ │ │ -00219 inline bool hash_cones::is_inside(Cmomentum *centre, Cmomentum *v){ │ │ │ │ │ │ -00220 │ │ │ │ │ │ -double dx, dy; │ │ │ │ │ │ -00221 │ │ │ │ │ │ -00222 │ │ │ │ │ │ -dx = centre->eta - v->eta; │ │ │ │ │ │ -00223 │ │ │ │ │ │ -dy = fabs(centre->phi - v->phi); │ │ │ │ │ │ -if (dy>M_PI) │ │ │ │ │ │ -00224 │ │ │ │ │ │ -00225 │ │ │ │ │ │ -dy -= 2.0*M_PI; │ │ │ │ │ │ -00226 │ │ │ │ │ │ -00227 │ │ │ │ │ │ -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 │ │ │ │ │ │ +00029 #include │ │ │ │ │ │ +00030 #include "split_merge.h" │ │ │ │ │ │ +00031 #include "momentum.h" │ │ │ │ │ │ +00032 #include │ │ │ │ │ │ +// for max │ │ │ │ │ │ +00033 #include │ │ │ │ │ │ +00034 #include │ │ │ │ │ │ +00035 #include │ │ │ │ │ │ +00036 #include │ │ │ │ │ │ +00037 #include │ │ │ │ │ │ +00038 │ │ │ │ │ │ +00039 namespace siscone_spherical{ │ │ │ │ │ │ +00040 │ │ │ │ │ │ +00041 using namespace std; │ │ │ │ │ │ +00042 │ │ │ │ │ │ +00043 /******************************************************** │ │ │ │ │ │ +00044 * class CSphjet implementation │ │ │ │ │ │ * │ │ │ │ │ │ -00040 * list of cones candidates. │ │ │ │ │ │ -00041 * We store in this class all the sph_hash_element and give │ │ │ │ │ │ +00045 * real Jet information. │ │ │ │ │ │ +00046 * This class contains information for one single jet. │ │ │ │ │ │ * │ │ │ │ │ │ -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 │ │ │ │ │ │ +00047 * That is, first, its momentum carrying information │ │ │ │ │ │ +* │ │ │ │ │ │ +00048 * about its centre and pT, and second, its particle │ │ │ │ │ │ +* │ │ │ │ │ │ +00049 * contents │ │ │ │ │ │ +* │ │ │ │ │ │ +00050 ********************************************************/ │ │ │ │ │ │ +00051 // default ctor │ │ │ │ │ │ +00052 //-------------00053 CSphjet::CSphjet(){ │ │ │ │ │ │ 00054 │ │ │ │ │ │ -n_occupied_cells = 0; │ │ │ │ │ │ -00055 #endif │ │ │ │ │ │ +n = 0; │ │ │ │ │ │ +00055 │ │ │ │ │ │ +v = CSphmomentum(); │ │ │ │ │ │ 00056 │ │ │ │ │ │ +E_tilde = 0.0; │ │ │ │ │ │ 00057 │ │ │ │ │ │ -// determine hash size │ │ │ │ │ │ +sm_var2 = 0.0; │ │ │ │ │ │ 00058 │ │ │ │ │ │ -// for a ymax=5 and R=0.7, we observed an occupancy around 1/8 N^2 ~ N2 R2/4 │ │ │ │ │ │ +pass = CJET_INEXISTENT_PASS; // initialised to a value that should │ │ │ │ │ │ 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 │ │ │ │ │ │ -00069 │ │ │ │ │ │ -// set the array to 0 │ │ │ │ │ │ -00070 │ │ │ │ │ │ -//? needed ? │ │ │ │ │ │ -00071 │ │ │ │ │ │ -for (i=0;inext; │ │ │ │ │ │ -delete elm; │ │ │ │ │ │ -00088 │ │ │ │ │ │ -00089 │ │ │ │ │ │ -} │ │ │ │ │ │ -00090 │ │ │ │ │ │ -} │ │ │ │ │ │ -00091 │ │ │ │ │ │ -00092 │ │ │ │ │ │ -delete[] hash_array; │ │ │ │ │ │ -00093 } │ │ │ │ │ │ -00094 │ │ │ │ │ │ -00095 │ │ │ │ │ │ +// notappear in the end (after clustering) │ │ │ │ │ │ +00060 } │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -255 │ │ │ │ │ │ - │ │ │ │ │ │ -* │ │ │ │ │ │ * │ │ │ │ │ │ │ │ │ │ │ │ - 256 │ │ │ │ │ │ + 270 │ │ │ │ │ │ │ │ │ │ │ │ File Documentation │ │ │ │ │ │ │ │ │ │ │ │ -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){ │ │ │ │ │ │ +00061 │ │ │ │ │ │ +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){ │ │ │ │ │ │ +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 * │ │ │ │ │ │ +00078 ********************************************************/ │ │ │ │ │ │ +00079 │ │ │ │ │ │ +00080 // odering of two jets │ │ │ │ │ │ +00081 // The variable of the ordering is pt or mt │ │ │ │ │ │ +00082 // depending on ’split_merge_scale’ choice │ │ │ │ │ │ +00083 // │ │ │ │ │ │ +00084 // with EPSILON_SPLITMERGE defined, this attempts to identify │ │ │ │ │ │ +00085 // delicate cases where two jets have identical momenta except for │ │ │ │ │ │ +00086 // softish particles -- the difference of pt’s may not be correctly │ │ │ │ │ │ +00087 // identified normally and so lead to problems for the fate of the │ │ │ │ │ │ +00088 // softish particle. │ │ │ │ │ │ +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{ │ │ │ │ │ │ +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; │ │ │ │ │ │ +00102 │ │ │ │ │ │ +q2 = jet2.sm_var2; │ │ │ │ │ │ +00103 │ │ │ │ │ │ +00104 │ │ │ │ │ │ +bool res = q1 > q2; │ │ │ │ │ │ +00105 │ │ │ │ │ │ +// if we enable the refined version of the comparison (see defines.h), │ │ │ │ │ │ 00106 │ │ │ │ │ │ -sph_hash_element *elm; │ │ │ │ │ │ -int index = (v->ref.ref[0]) & mask; │ │ │ │ │ │ 00107 │ │ │ │ │ │ +// we compute the difference more precisely when the two jets are very │ │ │ │ │ │ 00108 │ │ │ │ │ │ -// check the array cell corresponding to our reference │ │ │ │ │ │ -00109 │ │ │ │ │ │ +// close in the ordering variable. │ │ │ │ │ │ +00109 #ifdef EPSILON_SPLITMERGE │ │ │ │ │ │ 00110 │ │ │ │ │ │ -elm = hash_array[index]; │ │ │ │ │ │ +if ( (fabs(q1-q2) < EPSILON_SPLITMERGE*max(q1,q2)) && │ │ │ │ │ │ 00111 │ │ │ │ │ │ -00112 #ifdef DEBUG_STABLE_CONES │ │ │ │ │ │ +(jet1.v.ref != jet2.v.ref) ) { │ │ │ │ │ │ +00112 #ifdef DEBUG_SPLIT_MERGE │ │ │ │ │ │ 00113 │ │ │ │ │ │ -if (elm==NULL) │ │ │ │ │ │ -00114 │ │ │ │ │ │ -n_occupied_cells++; │ │ │ │ │ │ -00115 #endif │ │ │ │ │ │ +cout « "Using high-precision ordering tests" « endl; │ │ │ │ │ │ +00114 #endif │ │ │ │ │ │ +00115 │ │ │ │ │ │ +// get the momentum of the difference │ │ │ │ │ │ 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 │ │ │ │ │ │ -00156 │ │ │ │ │ │ -elm = elm->next; │ │ │ │ │ │ -00157 │ │ │ │ │ │ -} while (1); │ │ │ │ │ │ -00158 │ │ │ │ │ │ -return 1; │ │ │ │ │ │ -00159 │ │ │ │ │ │ -00160 } │ │ │ │ │ │ -00161 │ │ │ │ │ │ -00162 /* │ │ │ │ │ │ -00163 * insert a new candidate into the hash. │ │ │ │ │ │ -4-momentum of te cone to add │ │ │ │ │ │ -00164 * - v │ │ │ │ │ │ -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 │ │ │ │ │ │ -//cout « "-- stable candidate: " « v->ref[0] « ":" « endl; │ │ │ │ │ │ -00172 │ │ │ │ │ │ -00173 │ │ │ │ │ │ -// check the array cell corresponding to our reference │ │ │ │ │ │ -00174 │ │ │ │ │ │ -00175 │ │ │ │ │ │ -elm = hash_array[index]; │ │ │ │ │ │ -00176 │ │ │ │ │ │ -do{ │ │ │ │ │ │ -// if it is not present, add it │ │ │ │ │ │ -00177 │ │ │ │ │ │ -00178 │ │ │ │ │ │ -if (elm==NULL){ │ │ │ │ │ │ -// create element │ │ │ │ │ │ -00179 │ │ │ │ │ │ -00180 │ │ │ │ │ │ -elm = new sph_hash_element; │ │ │ │ │ │ -00181 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.41 momentum.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -00182 │ │ │ │ │ │ -// set its varibles │ │ │ │ │ │ -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.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 │ │ │ │ │ │ -// │ │ │ │ │ │ -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 //-------------------------- │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -257 │ │ │ │ │ │ - │ │ │ │ │ │ - 258 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -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; │ │ │ │ │ │ -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(){ │ │ │ │ │ │ -00135 │ │ │ │ │ │ -// note: the factor n (ref.nb) cancels in all expressions !! │ │ │ │ │ │ -00136 │ │ │ │ │ │ -eta = 0.5*log((E+pz)/(E-pz)); │ │ │ │ │ │ -00137 │ │ │ │ │ │ -phi = atan2(py,px); │ │ │ │ │ │ -00138 } │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.42 momentum.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -259 │ │ │ │ │ │ - │ │ │ │ │ │ -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){ │ │ │ │ │ │ -return v1.ref < v2.ref; │ │ │ │ │ │ -00145 │ │ │ │ │ │ -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){ │ │ │ │ │ │ -00151 │ │ │ │ │ │ -return v1.eta < v2.eta; │ │ │ │ │ │ -00152 } │ │ │ │ │ │ -00153 │ │ │ │ │ │ -00154 // ordering of vectors in pt │ │ │ │ │ │ -00155 //--------------------------00156 bool momentum_pt_less(const Cmomentum &v1, const Cmomentum &v2){ │ │ │ │ │ │ -return v1.perp2() < v2.perp2(); │ │ │ │ │ │ -00157 │ │ │ │ │ │ -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, │ │ │ │ │ │ -// │ │ │ │ │ │ -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; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -// │ │ │ │ │ │ - │ │ │ │ │ │ - 260 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -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; │ │ │ │ │ │ -return *this; │ │ │ │ │ │ -00081 │ │ │ │ │ │ -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; │ │ │ │ │ │ -00102 │ │ │ │ │ │ -return tmp/=r; │ │ │ │ │ │ -00103 } │ │ │ │ │ │ -00104 │ │ │ │ │ │ -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 │ │ │ │ │ │ -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 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.42 momentum.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -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){ │ │ │ │ │ │ -if (px < py){ │ │ │ │ │ │ -00162 │ │ │ │ │ │ -00163 │ │ │ │ │ │ -if (pz < px){ │ │ │ │ │ │ -00164 │ │ │ │ │ │ -// z smallest │ │ │ │ │ │ -00165 │ │ │ │ │ │ -angular_dir1 = CSph3vector(-py, px, 0.0); │ │ │ │ │ │ -00166 │ │ │ │ │ │ -} else { │ │ │ │ │ │ -// x smallest │ │ │ │ │ │ -00167 │ │ │ │ │ │ -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 { │ │ │ │ │ │ -00175 │ │ │ │ │ │ -// y smallest │ │ │ │ │ │ -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 │ │ │ │ │ │ -// 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; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -261 │ │ │ │ │ │ - │ │ │ │ │ │ - 262 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -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 │ │ │ │ │ │ -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){ │ │ │ │ │ │ -00278 │ │ │ │ │ │ -return v1.ref < v2.ref; │ │ │ │ │ │ -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){ │ │ │ │ │ │ -return v1._theta < v2._theta; │ │ │ │ │ │ -00284 │ │ │ │ │ │ -00285 } │ │ │ │ │ │ -00286 │ │ │ │ │ │ -00287 // ordering of vectors in pt │ │ │ │ │ │ -00288 //--------------------------00289 bool momentum_pt_less(const CSphmomentum &v1, const CSphmomentum &v2){ │ │ │ │ │ │ -00290 │ │ │ │ │ │ -return v1.perp2() < v2.perp2(); │ │ │ │ │ │ -00291 } │ │ │ │ │ │ -00292 │ │ │ │ │ │ -00293 } │ │ │ │ │ │ -00294 │ │ │ │ │ │ - │ │ │ │ │ │ -5.43 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. │ │ │ │ │ │ -// │ │ │ │ │ │ - │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ - │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ -// │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.43 momentum.h │ │ │ │ │ │ - │ │ │ │ │ │ -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:: 163 │ │ │ │ │ │ -$// │ │ │ │ │ │ -00025 // $Date:: 2007-04-26 22:31:02 +0200 (Thu, 26 Apr 2007) │ │ │ │ │ │ -$// │ │ │ │ │ │ -00027 │ │ │ │ │ │ -00028 #ifndef __VECTOR_H__ │ │ │ │ │ │ -00029 #define __VECTOR_H__ │ │ │ │ │ │ -00030 │ │ │ │ │ │ -00031 #include │ │ │ │ │ │ -00032 #include │ │ │ │ │ │ -00033 #include "reference.h" │ │ │ │ │ │ -00034 #include "geom_2d.h" │ │ │ │ │ │ -00035 #include "defines.h" │ │ │ │ │ │ -00036 │ │ │ │ │ │ -00037 namespace siscone{ │ │ │ │ │ │ -00038 │ │ │ │ │ │ -00049 class Cmomentum{ │ │ │ │ │ │ -00050 public: │ │ │ │ │ │ -00052 │ │ │ │ │ │ -Cmomentum(); │ │ │ │ │ │ -00053 │ │ │ │ │ │ -00055 │ │ │ │ │ │ -Cmomentum(double _px, double _py, double _pz, double _E); │ │ │ │ │ │ -00056 │ │ │ │ │ │ -00058 │ │ │ │ │ │ -Cmomentum(double _eta, double _phi, Creference _ref); │ │ │ │ │ │ -00059 │ │ │ │ │ │ -00061 │ │ │ │ │ │ -~Cmomentum(); │ │ │ │ │ │ -00062 │ │ │ │ │ │ -inline double perp()const {return sqrt(perp2());} │ │ │ │ │ │ -00064 │ │ │ │ │ │ -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();} │ │ │ │ │ │ -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 │ │ │ │ │ │ -00083 │ │ │ │ │ │ -inline double Et2()const {return E*E/(1.0+pz*pz/perp2());} │ │ │ │ │ │ -00085 │ │ │ │ │ │ -00086 │ │ │ │ │ │ -00088 │ │ │ │ │ │ -Cmomentum& operator = (const Cmomentum &v); │ │ │ │ │ │ -00089 │ │ │ │ │ │ -const Cmomentum operator + (const Cmomentum &v); │ │ │ │ │ │ -00092 │ │ │ │ │ │ -00093 │ │ │ │ │ │ -00096 │ │ │ │ │ │ -Cmomentum& operator += (const Cmomentum &v); │ │ │ │ │ │ -00097 │ │ │ │ │ │ -00100 │ │ │ │ │ │ -Cmomentum& operator -= (const Cmomentum &v); │ │ │ │ │ │ -00101 │ │ │ │ │ │ -void build_etaphi(); │ │ │ │ │ │ -00107 │ │ │ │ │ │ -00108 │ │ │ │ │ │ -double px; │ │ │ │ │ │ -00109 │ │ │ │ │ │ -00110 │ │ │ │ │ │ -double py; │ │ │ │ │ │ -double pz; │ │ │ │ │ │ -00111 │ │ │ │ │ │ -00112 │ │ │ │ │ │ -double E; │ │ │ │ │ │ -00113 │ │ │ │ │ │ -double eta; │ │ │ │ │ │ -00114 │ │ │ │ │ │ -00115 │ │ │ │ │ │ -double phi; │ │ │ │ │ │ -int parent_index; │ │ │ │ │ │ -00116 │ │ │ │ │ │ -00117 │ │ │ │ │ │ -int index; │ │ │ │ │ │ -00118 │ │ │ │ │ │ -// the following part is used for checksums // │ │ │ │ │ │ -00120 │ │ │ │ │ │ -00122 │ │ │ │ │ │ -Creference ref; │ │ │ │ │ │ -00123 }; │ │ │ │ │ │ -00124 │ │ │ │ │ │ -00127 bool operator < (const Cmomentum &v1, const Cmomentum &v2); │ │ │ │ │ │ -00128 │ │ │ │ │ │ -00130 bool momentum_eta_less(const Cmomentum &v1, const Cmomentum &v2); │ │ │ │ │ │ -00131 │ │ │ │ │ │ -00133 bool momentum_pt_less(const Cmomentum &v1, const Cmomentum &v2); │ │ │ │ │ │ -00134 │ │ │ │ │ │ -00135 │ │ │ │ │ │ -00137 // some handy utilities // │ │ │ │ │ │ -00139 │ │ │ │ │ │ -00144 inline double get_distance(double eta, double phi, Cmomentum *v){ │ │ │ │ │ │ -double dx, dy; │ │ │ │ │ │ -00145 │ │ │ │ │ │ -00146 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -263 │ │ │ │ │ │ - │ │ │ │ │ │ - 264 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00147 │ │ │ │ │ │ -dx = eta - v->eta; │ │ │ │ │ │ -00148 │ │ │ │ │ │ -dy = fabs(phi - v->phi); │ │ │ │ │ │ -if (dy>M_PI) │ │ │ │ │ │ -00149 │ │ │ │ │ │ -00150 │ │ │ │ │ │ -dy -= twopi; │ │ │ │ │ │ -00151 │ │ │ │ │ │ -00152 │ │ │ │ │ │ -return dx*dx+dy*dy; │ │ │ │ │ │ -00153 } │ │ │ │ │ │ -00154 │ │ │ │ │ │ -00155 } │ │ │ │ │ │ -00156 │ │ │ │ │ │ -00157 #endif │ │ │ │ │ │ - │ │ │ │ │ │ -5.44 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 │ │ │ │ │ │ -// │ │ │ │ │ │ -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:: 256 │ │ │ │ │ │ -$// │ │ │ │ │ │ -00027 // $Date:: 2008-07-14 13:52:16 +0200 (Mon, 14 Jul 2008) │ │ │ │ │ │ -$// │ │ │ │ │ │ -00029 │ │ │ │ │ │ -00030 #ifndef __SPH_VECTOR_H__ │ │ │ │ │ │ -00031 #define __SPH_VECTOR_H__ │ │ │ │ │ │ -00032 │ │ │ │ │ │ -00033 #include │ │ │ │ │ │ -00034 #include │ │ │ │ │ │ -00035 #include │ │ │ │ │ │ -00036 #include "geom_2d.h" │ │ │ │ │ │ -00037 #include │ │ │ │ │ │ -00038 │ │ │ │ │ │ -00039 namespace siscone_spherical{ │ │ │ │ │ │ -00040 │ │ │ │ │ │ -00054 class CSph3vector{ │ │ │ │ │ │ -00055 public: │ │ │ │ │ │ -00057 │ │ │ │ │ │ -CSph3vector(); │ │ │ │ │ │ -00058 │ │ │ │ │ │ -00060 │ │ │ │ │ │ -CSph3vector(double _px, double _py, double _pz); │ │ │ │ │ │ -00061 │ │ │ │ │ │ -00063 │ │ │ │ │ │ -~CSph3vector(); │ │ │ │ │ │ -00064 │ │ │ │ │ │ -00066 │ │ │ │ │ │ -CSph3vector& operator = (const CSph3vector &v); │ │ │ │ │ │ -00067 │ │ │ │ │ │ -const CSph3vector operator + (const CSph3vector &v); │ │ │ │ │ │ -00070 │ │ │ │ │ │ -00071 │ │ │ │ │ │ -const CSph3vector operator - (const CSph3vector &v); │ │ │ │ │ │ -00074 │ │ │ │ │ │ -00075 │ │ │ │ │ │ -const CSph3vector operator / (const double &r); │ │ │ │ │ │ -00078 │ │ │ │ │ │ -00079 │ │ │ │ │ │ -00082 │ │ │ │ │ │ -CSph3vector& operator += (const CSph3vector &v); │ │ │ │ │ │ -00083 │ │ │ │ │ │ -00086 │ │ │ │ │ │ -CSph3vector& operator -= (const CSph3vector &v); │ │ │ │ │ │ -00087 │ │ │ │ │ │ -00090 │ │ │ │ │ │ -CSph3vector& operator *= (const double &r); │ │ │ │ │ │ -00091 │ │ │ │ │ │ -00094 │ │ │ │ │ │ -CSph3vector& operator /= (const double &r); │ │ │ │ │ │ -00095 │ │ │ │ │ │ -inline double perp()const {return sqrt(perp2());} │ │ │ │ │ │ -00097 │ │ │ │ │ │ -00098 │ │ │ │ │ │ -inline double perp2()const {return px*px+py*py;} │ │ │ │ │ │ -00100 │ │ │ │ │ │ -00101 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.44 momentum.h │ │ │ │ │ │ - │ │ │ │ │ │ -265 │ │ │ │ │ │ - │ │ │ │ │ │ -00103 │ │ │ │ │ │ -inline double norm()const {return sqrt(px*px+py*py+pz*pz);} │ │ │ │ │ │ -00104 │ │ │ │ │ │ -inline double norm2()const {return px*px+py*py+pz*pz;} │ │ │ │ │ │ -00106 │ │ │ │ │ │ -00107 │ │ │ │ │ │ -inline double phi()const {return atan2(py, px);} │ │ │ │ │ │ -00109 │ │ │ │ │ │ -00110 │ │ │ │ │ │ -inline double theta()const {return atan2(perp(),pz);} │ │ │ │ │ │ -00112 │ │ │ │ │ │ -00113 │ │ │ │ │ │ -void build_norm(); │ │ │ │ │ │ -00120 │ │ │ │ │ │ -00121 │ │ │ │ │ │ -00125 │ │ │ │ │ │ -void build_thetaphi(); │ │ │ │ │ │ -00126 │ │ │ │ │ │ -void get_angular_directions(CSph3vector &angular_dir1, CSph3vector &angular_dir2); │ │ │ │ │ │ -00129 │ │ │ │ │ │ -00130 │ │ │ │ │ │ -double px; │ │ │ │ │ │ -00131 │ │ │ │ │ │ -00132 │ │ │ │ │ │ -double py; │ │ │ │ │ │ -double pz; │ │ │ │ │ │ -00133 │ │ │ │ │ │ -00134 │ │ │ │ │ │ -double _norm; │ │ │ │ │ │ -00135 │ │ │ │ │ │ -00136 │ │ │ │ │ │ -double _theta; │ │ │ │ │ │ -double _phi; │ │ │ │ │ │ -00137 │ │ │ │ │ │ -00138 │ │ │ │ │ │ -00140 │ │ │ │ │ │ -// the following part is used for checksums // │ │ │ │ │ │ -00142 │ │ │ │ │ │ -siscone::Creference ref; │ │ │ │ │ │ -00143 }; │ │ │ │ │ │ -00144 │ │ │ │ │ │ -00158 class CSphmomentum : public CSph3vector{ │ │ │ │ │ │ -00159 public: │ │ │ │ │ │ -00161 │ │ │ │ │ │ -CSphmomentum(); │ │ │ │ │ │ -00162 │ │ │ │ │ │ -00164 │ │ │ │ │ │ -CSphmomentum(CSph3vector &init, double E=0.0); │ │ │ │ │ │ -00165 │ │ │ │ │ │ -00167 │ │ │ │ │ │ -CSphmomentum(double _px, double _py, double _pz, double _E); │ │ │ │ │ │ -00168 │ │ │ │ │ │ -00170 │ │ │ │ │ │ -//CSphmomentum(double _eta, double _phi, siscone::Creference _ref); │ │ │ │ │ │ -00171 │ │ │ │ │ │ -00173 │ │ │ │ │ │ -~CSphmomentum(); │ │ │ │ │ │ -00174 │ │ │ │ │ │ -inline double mass()const {return sqrt(mass2());} │ │ │ │ │ │ -00176 │ │ │ │ │ │ -00177 │ │ │ │ │ │ -inline double mass2()const {return perpmass2()-perp2();} │ │ │ │ │ │ -00179 │ │ │ │ │ │ -00180 │ │ │ │ │ │ -inline double perpmass()const {return sqrt((E-pz)*(E+pz));} │ │ │ │ │ │ -00182 │ │ │ │ │ │ -00183 │ │ │ │ │ │ -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 │ │ │ │ │ │ -00191 │ │ │ │ │ │ -inline double Et2()const {return E*E/(1.0+pz*pz/perp2());} │ │ │ │ │ │ -00192 │ │ │ │ │ │ -00194 │ │ │ │ │ │ -CSphmomentum& operator = (const CSphmomentum &v); │ │ │ │ │ │ -00195 │ │ │ │ │ │ -const CSphmomentum operator + (const CSphmomentum &v); │ │ │ │ │ │ -00198 │ │ │ │ │ │ -00199 │ │ │ │ │ │ -00202 │ │ │ │ │ │ -CSphmomentum& operator += (const CSphmomentum &v); │ │ │ │ │ │ -00203 │ │ │ │ │ │ -00206 │ │ │ │ │ │ -CSphmomentum& operator -= (const CSphmomentum &v); │ │ │ │ │ │ -00207 │ │ │ │ │ │ -double E; │ │ │ │ │ │ -00208 │ │ │ │ │ │ -00209 │ │ │ │ │ │ -00210 │ │ │ │ │ │ -int parent_index; │ │ │ │ │ │ -int index; │ │ │ │ │ │ -00211 │ │ │ │ │ │ -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); │ │ │ │ │ │ -00223 │ │ │ │ │ │ -00224 │ │ │ │ │ │ -00226 // some handy utilities // │ │ │ │ │ │ -00228 │ │ │ │ │ │ -00230 inline double sqr(double x){return x*x;} │ │ │ │ │ │ -00231 │ │ │ │ │ │ -00235 inline double dot_product3(const CSph3vector &v1, const CSph3vector &v2){ │ │ │ │ │ │ -00236 │ │ │ │ │ │ -//double tmp = v1.px*v2.px + v1.py*v2.py + v1.pz*v2.pz; │ │ │ │ │ │ -00237 │ │ │ │ │ │ -//if (!isfinite(tmp)){ │ │ │ │ │ │ -00238 │ │ │ │ │ │ -// std::cout « "dot_product inf: " « std::endl; │ │ │ │ │ │ -00239 │ │ │ │ │ │ -// std::cout « " angles: " « v1._theta « " " « v1._phi « " and " « v2._theta « " " « v2._phi « │ │ │ │ │ │ -std::endl; │ │ │ │ │ │ -00240 │ │ │ │ │ │ -// std::cout « " moms : " « v1.px « " " « v1.py « " " « v1.pz │ │ │ │ │ │ -00241 │ │ │ │ │ │ -// │ │ │ │ │ │ -« " and " │ │ │ │ │ │ -« v2.px « " " « v2.py « " " « v2.pz « std::endl; │ │ │ │ │ │ -00242 │ │ │ │ │ │ -//} │ │ │ │ │ │ -00243 │ │ │ │ │ │ -return v1.px*v2.px + v1.py*v2.py + v1.pz*v2.pz; │ │ │ │ │ │ -00244 } │ │ │ │ │ │ -00245 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 266 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -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; │ │ │ │ │ │ -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); │ │ │ │ │ │ -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); │ │ │ │ │ │ -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 │ │ │ │ │ │ -00272 } │ │ │ │ │ │ -00273 │ │ │ │ │ │ -00277 inline double get_distance(const CSph3vector *v1, const CSph3vector *v2){ │ │ │ │ │ │ -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); │ │ │ │ │ │ -return (dot>=0) && (norm2_cross_product3(*v1,*v2)<=tan2R*dot*dot); │ │ │ │ │ │ -00291 │ │ │ │ │ │ -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); │ │ │ │ │ │ -00301 │ │ │ │ │ │ -00302 │ │ │ │ │ │ -//return (dot>=0) && (norm2_cross_product3(*v1,*v2) │ │ │ │ │ │ -00031 #include │ │ │ │ │ │ -00032 #include │ │ │ │ │ │ -00033 │ │ │ │ │ │ -00034 namespace siscone_spherical{ │ │ │ │ │ │ -00035 │ │ │ │ │ │ -00036 using namespace std; │ │ │ │ │ │ -00037 │ │ │ │ │ │ -00038 /************************************************************* │ │ │ │ │ │ - │ │ │ │ │ │ -// │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.45 vicinity.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -00039 * CSphvicinity_elm implementation │ │ │ │ │ │ -* │ │ │ │ │ │ -00040 * element in the vicinity of a parent. │ │ │ │ │ │ -00041 * class used to manage one points in the vicinity │ │ │ │ │ │ -* │ │ │ │ │ │ -00042 * of a parent point. │ │ │ │ │ │ -00043 *************************************************************/ │ │ │ │ │ │ -00044 │ │ │ │ │ │ -00045 // ordering pointers to CSphvicinity_elm │ │ │ │ │ │ -00046 //--------------------------------------00047 bool ve_less(CSphvicinity_elm *ve1, CSphvicinity_elm *ve2){ │ │ │ │ │ │ -00048 │ │ │ │ │ │ -return ve1->angle < ve2->angle; │ │ │ │ │ │ -00049 } │ │ │ │ │ │ -00050 │ │ │ │ │ │ -00051 │ │ │ │ │ │ -00052 /************************************************************* │ │ │ │ │ │ -00053 * CSphvicinity implementation │ │ │ │ │ │ -* │ │ │ │ │ │ -00054 * list of element in the vicinity of a parent. │ │ │ │ │ │ -* │ │ │ │ │ │ -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 *************************************************************/ │ │ │ │ │ │ -00059 │ │ │ │ │ │ -00060 // default constructor │ │ │ │ │ │ -00061 //--------------------00062 CSphvicinity::CSphvicinity(){ │ │ │ │ │ │ -00063 │ │ │ │ │ │ -n_part = 0; │ │ │ │ │ │ -00064 │ │ │ │ │ │ -00065 │ │ │ │ │ │ -ve_list = NULL; │ │ │ │ │ │ -00066 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ -00067 │ │ │ │ │ │ -quadtree = NULL; │ │ │ │ │ │ -00068 #endif │ │ │ │ │ │ -00069 │ │ │ │ │ │ -00070 │ │ │ │ │ │ -parent = NULL; │ │ │ │ │ │ -00071 │ │ │ │ │ │ -VR2 = VR = 0.0; │ │ │ │ │ │ -00072 │ │ │ │ │ │ -00073 } │ │ │ │ │ │ -00074 │ │ │ │ │ │ -00075 // constructor with initialisation │ │ │ │ │ │ -00076 //--------------------------------00077 CSphvicinity::CSphvicinity(vector &_particle_list){ │ │ │ │ │ │ -00078 │ │ │ │ │ │ -parent = NULL; │ │ │ │ │ │ -00079 │ │ │ │ │ │ -ve_list = NULL; │ │ │ │ │ │ -00080 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ -00081 │ │ │ │ │ │ -quadtree = NULL; │ │ │ │ │ │ -00082 #endif │ │ │ │ │ │ -00083 │ │ │ │ │ │ -cosVR = VR2 = tan2R = VR = 0.0; │ │ │ │ │ │ -00084 │ │ │ │ │ │ -00085 │ │ │ │ │ │ -set_particle_list(_particle_list); │ │ │ │ │ │ -00086 } │ │ │ │ │ │ -00087 │ │ │ │ │ │ -00088 // default destructor │ │ │ │ │ │ -00089 //-------------------00090 CSphvicinity::~CSphvicinity(){ │ │ │ │ │ │ -00091 │ │ │ │ │ │ -if (ve_list!=NULL) │ │ │ │ │ │ -delete[] ve_list; │ │ │ │ │ │ -00092 │ │ │ │ │ │ -00093 │ │ │ │ │ │ -00094 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ -00095 │ │ │ │ │ │ -if (quadtree!=NULL) │ │ │ │ │ │ -00096 │ │ │ │ │ │ -delete quadtree; │ │ │ │ │ │ -00097 #endif │ │ │ │ │ │ -00098 } │ │ │ │ │ │ -00099 │ │ │ │ │ │ -00100 /* │ │ │ │ │ │ -00101 * set the particle_list │ │ │ │ │ │ -00102 * - particle_list │ │ │ │ │ │ -list of particles (type CSphmomentum) │ │ │ │ │ │ -number of particles in the list │ │ │ │ │ │ -00103 * - n │ │ │ │ │ │ -00104 ************************************************************/ │ │ │ │ │ │ -00105 void CSphvicinity::set_particle_list(vector &_particle_list){ │ │ │ │ │ │ -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 │ │ │ │ │ │ -00112 │ │ │ │ │ │ -if (ve_list!=NULL){ │ │ │ │ │ │ -00113 │ │ │ │ │ │ -delete[] ve_list; │ │ │ │ │ │ -00114 │ │ │ │ │ │ -} │ │ │ │ │ │ -00115 │ │ │ │ │ │ -vicinity.clear(); │ │ │ │ │ │ -00116 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ -00117 │ │ │ │ │ │ -if (quadtree!=NULL) │ │ │ │ │ │ -delete quadtree; │ │ │ │ │ │ -00118 │ │ │ │ │ │ -00119 #endif │ │ │ │ │ │ -00120 │ │ │ │ │ │ -// allocate memory array for particles │ │ │ │ │ │ -00121 │ │ │ │ │ │ -00122 │ │ │ │ │ │ -// Note: - we compute max for |eta| │ │ │ │ │ │ -00123 │ │ │ │ │ │ -// │ │ │ │ │ │ -- we allocate indices to particles │ │ │ │ │ │ -00124 │ │ │ │ │ │ -n_part = 0; │ │ │ │ │ │ -00125 │ │ │ │ │ │ -plist.clear(); │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -267 │ │ │ │ │ │ - │ │ │ │ │ │ -* │ │ │ │ │ │ -* │ │ │ │ │ │ - │ │ │ │ │ │ - 268 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00126 │ │ │ │ │ │ -pincluded.clear(); │ │ │ │ │ │ -for (i=0;i<(int) _particle_list.size();i++){ │ │ │ │ │ │ -00127 │ │ │ │ │ │ -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 │ │ │ │ │ │ -plist.push_back(_particle_list[i]); │ │ │ │ │ │ -00132 │ │ │ │ │ │ -pincluded.push_back(siscone::Cvicinity_inclusion()); // zero inclusion status │ │ │ │ │ │ -00133 │ │ │ │ │ │ -// the parent_index is handled in the split_merge because │ │ │ │ │ │ -00134 │ │ │ │ │ │ -00135 │ │ │ │ │ │ -// of our multiple-pass procedure. │ │ │ │ │ │ -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 │ │ │ │ │ │ -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 │ │ │ │ │ │ -00146 │ │ │ │ │ │ -n_part++; │ │ │ │ │ │ -00147 │ │ │ │ │ │ -//} │ │ │ │ │ │ -00148 │ │ │ │ │ │ -} │ │ │ │ │ │ -00149 │ │ │ │ │ │ -// 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 │ │ │ │ │ │ -00159 │ │ │ │ │ │ -j = 0; │ │ │ │ │ │ -00160 │ │ │ │ │ │ -for (i=0;iadd(&plist[i]); │ │ │ │ │ │ -00163 #endif │ │ │ │ │ │ -00164 │ │ │ │ │ │ -ve_list[j].v = ve_list[j+1].v = &plist[i]; │ │ │ │ │ │ -00165 │ │ │ │ │ │ -ve_list[j].is_inside = ve_list[j+1].is_inside = &(pincluded[i]); │ │ │ │ │ │ -00166 │ │ │ │ │ │ -j+=2; │ │ │ │ │ │ -00167 │ │ │ │ │ │ -} │ │ │ │ │ │ -00168 │ │ │ │ │ │ -00169 } │ │ │ │ │ │ -00170 │ │ │ │ │ │ -00171 │ │ │ │ │ │ -00172 /* │ │ │ │ │ │ -00173 * build the vicinity list from a list of points. │ │ │ │ │ │ -reference particle │ │ │ │ │ │ -00174 * - _parent │ │ │ │ │ │ -00175 * - _VR │ │ │ │ │ │ -vicinity radius │ │ │ │ │ │ -00176 ************************************************************/ │ │ │ │ │ │ -00177 void CSphvicinity::build(CSphmomentum *_parent, double _VR){ │ │ │ │ │ │ -00178 │ │ │ │ │ │ -int i; │ │ │ │ │ │ -00179 │ │ │ │ │ │ -// set parent and radius │ │ │ │ │ │ -00180 │ │ │ │ │ │ -00181 │ │ │ │ │ │ -parent = _parent; │ │ │ │ │ │ -00182 │ │ │ │ │ │ -00183 │ │ │ │ │ │ -VR = _VR; │ │ │ │ │ │ -00184 │ │ │ │ │ │ -VR2 = VR*VR; │ │ │ │ │ │ -00185 │ │ │ │ │ │ -cosVR = cos(VR); │ │ │ │ │ │ -00186 │ │ │ │ │ │ -R2 = 0.25*VR2; │ │ │ │ │ │ -00187 │ │ │ │ │ │ -R │ │ │ │ │ │ -= 0.5*VR; │ │ │ │ │ │ -double tmp = tan(R); │ │ │ │ │ │ -00188 │ │ │ │ │ │ -00189 │ │ │ │ │ │ -tan2R = tmp*tmp; │ │ │ │ │ │ -00190 │ │ │ │ │ │ -00191 │ │ │ │ │ │ -D2_R = 2.0*(1-cos(R)); │ │ │ │ │ │ -//tmp = sqrt(D2_R); │ │ │ │ │ │ -00192 │ │ │ │ │ │ -00193 │ │ │ │ │ │ -inv_R_EPS_COCIRC = 1.0 / R / EPSILON_COCIRCULAR; │ │ │ │ │ │ -00194 │ │ │ │ │ │ -inv_R_2EPS_COCIRC = 0.5 / R / EPSILON_COCIRCULAR; │ │ │ │ │ │ -00195 │ │ │ │ │ │ -// clear vicinity │ │ │ │ │ │ -00196 │ │ │ │ │ │ -00197 │ │ │ │ │ │ -vicinity.clear(); │ │ │ │ │ │ -00198 │ │ │ │ │ │ -// init parent variables │ │ │ │ │ │ -00199 │ │ │ │ │ │ -00200 │ │ │ │ │ │ -// we cpte the direction of the centre and two orthogonal ones │ │ │ │ │ │ -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 │ │ │ │ │ │ -parent_centre.get_angular_directions(angular_dir1, angular_dir2); │ │ │ │ │ │ -00205 │ │ │ │ │ │ -angular_dir1 /= angular_dir1._norm; │ │ │ │ │ │ -00206 │ │ │ │ │ │ -angular_dir2 /= angular_dir2._norm; │ │ │ │ │ │ -00207 │ │ │ │ │ │ -00208 │ │ │ │ │ │ -// really browse the particle list │ │ │ │ │ │ -00209 │ │ │ │ │ │ -for (i=0;i0) ? 0.0 : 2.0; │ │ │ │ │ │ -00224 │ │ │ │ │ │ -double t=c/s; │ │ │ │ │ │ -return (s>0) ? 1-t/(1+fabs(t)) : 3-t/(1+fabs(t)); │ │ │ │ │ │ -00225 │ │ │ │ │ │ -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 **********************************************************/ │ │ │ │ │ │ -00234 void CSphvicinity::append_to_vicinity(CSphmomentum *v){ │ │ │ │ │ │ -00235 │ │ │ │ │ │ -// skip the particle itself) │ │ │ │ │ │ -00236 │ │ │ │ │ │ -if (v==parent) │ │ │ │ │ │ -return; │ │ │ │ │ │ -00237 │ │ │ │ │ │ -00238 │ │ │ │ │ │ -int i=2*(v->index); │ │ │ │ │ │ -00239 │ │ │ │ │ │ -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 │ │ │ │ │ │ -00247 │ │ │ │ │ │ -// really check if the distance is less than VR │ │ │ │ │ │ -00248 │ │ │ │ │ │ -if (dot>cosVR){ │ │ │ │ │ │ -00249 │ │ │ │ │ │ -CSph3vector cross = cross_product3(parent_centre,vnormal); │ │ │ │ │ │ -00250 │ │ │ │ │ │ -// for the centres │ │ │ │ │ │ -00251 │ │ │ │ │ │ -00252 │ │ │ │ │ │ -CSph3vector median = (parent_centre+vnormal); │ │ │ │ │ │ -double amplT = sqrt((tan2R*(1+dot)+(dot-1))*(1+dot)); │ │ │ │ │ │ -00253 │ │ │ │ │ │ -00254 │ │ │ │ │ │ -CSph3vector transverse = amplT*cross/cross._norm; │ │ │ │ │ │ -00255 │ │ │ │ │ │ -00256 │ │ │ │ │ │ -// first angle (+) │ │ │ │ │ │ -00257 │ │ │ │ │ │ -ve_list[i].centre = median + transverse; │ │ │ │ │ │ -00258 │ │ │ │ │ │ -ve_list[i].centre.build_norm(); │ │ │ │ │ │ -00259 │ │ │ │ │ │ -ve_list[i].centre/=ve_list[i].centre._norm; │ │ │ │ │ │ -00260 │ │ │ │ │ │ -CSph3vector diff = ve_list[i].centre - parent_centre; │ │ │ │ │ │ -//ve_list[i].angle = atan2(dot_product3(angular_dir2, diff),dot_product3(angular_dir1, diff)); │ │ │ │ │ │ -00261 │ │ │ │ │ │ -00262 │ │ │ │ │ │ -ve_list[i].angle = sort_angle(dot_product3(angular_dir2, diff),dot_product3(angular_dir1, diff)); │ │ │ │ │ │ -00263 │ │ │ │ │ │ -ve_list[i].side = true; │ │ │ │ │ │ -00264 │ │ │ │ │ │ -ve_list[i].cocircular.clear(); │ │ │ │ │ │ -00265 │ │ │ │ │ │ -vicinity.push_back(&(ve_list[i])); │ │ │ │ │ │ -00266 │ │ │ │ │ │ -// second angle (-) │ │ │ │ │ │ -00267 │ │ │ │ │ │ -00268 │ │ │ │ │ │ -ve_list[i+1].centre = median - transverse; │ │ │ │ │ │ -00269 │ │ │ │ │ │ -ve_list[i+1].centre.build_norm(); │ │ │ │ │ │ -00270 │ │ │ │ │ │ -ve_list[i+1].centre/=ve_list[i+1].centre._norm; │ │ │ │ │ │ -00271 │ │ │ │ │ │ -diff = ve_list[i+1].centre - parent_centre; │ │ │ │ │ │ -00272 │ │ │ │ │ │ -ve_list[i+1].angle = sort_angle(dot_product3(angular_dir2, diff),dot_product3(angular_dir1, │ │ │ │ │ │ -diff)); │ │ │ │ │ │ -00273 │ │ │ │ │ │ -ve_list[i+1].side = false; │ │ │ │ │ │ -00274 │ │ │ │ │ │ -ve_list[i+1].cocircular.clear(); │ │ │ │ │ │ -00275 │ │ │ │ │ │ -vicinity.push_back(&(ve_list[i+1])); │ │ │ │ │ │ -00276 │ │ │ │ │ │ -// 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) │ │ │ │ │ │ -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 │ │ │ │ │ │ -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 │ │ │ │ │ │ -double inv_err1 = cross_product3(OP,OC)._norm * inv_R_EPS_COCIRC; │ │ │ │ │ │ -double inv_err2_sq = (D2_R-dot_product3(OP,OC)) * inv_R_2EPS_COCIRC; │ │ │ │ │ │ -00292 │ │ │ │ │ │ -00293 │ │ │ │ │ │ -ve_list[i].cocircular_range = siscone::pow2(inv_err1) > inv_err2_sq ? │ │ │ │ │ │ -00294 │ │ │ │ │ │ -1.0/inv_err1 : │ │ │ │ │ │ -00295 │ │ │ │ │ │ -sqrt(1.0/inv_err2_sq); │ │ │ │ │ │ -00296 │ │ │ │ │ │ -ve_list[i+1].cocircular_range = ve_list[i].cocircular_range; │ │ │ │ │ │ -00297 │ │ │ │ │ │ -} │ │ │ │ │ │ -00298 } │ │ │ │ │ │ -00299 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 270 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00300 } │ │ │ │ │ │ - │ │ │ │ │ │ -5.46 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. │ │ │ │ │ │ -// │ │ │ │ │ │ -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:: 388 │ │ │ │ │ │ -$// │ │ │ │ │ │ -00024 // $Date:: 2016-03-03 10:42:25 +0100 (Thu, 03 Mar 2016) │ │ │ │ │ │ -$// │ │ │ │ │ │ -00026 │ │ │ │ │ │ -00027 #include "vicinity.h" │ │ │ │ │ │ -00028 #include │ │ │ │ │ │ -00029 #include │ │ │ │ │ │ -00030 #include │ │ │ │ │ │ -00031 │ │ │ │ │ │ -00032 namespace siscone{ │ │ │ │ │ │ -00033 │ │ │ │ │ │ -00034 using namespace std; │ │ │ │ │ │ -00035 │ │ │ │ │ │ -00036 /************************************************************* │ │ │ │ │ │ -00037 * Cvicinity_elm implementation │ │ │ │ │ │ -* │ │ │ │ │ │ -00038 * element in the vicinity of a parent. │ │ │ │ │ │ -00039 * class used to manage one points in the vicinity │ │ │ │ │ │ -* │ │ │ │ │ │ -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; │ │ │ │ │ │ -00047 } │ │ │ │ │ │ -00048 │ │ │ │ │ │ -00049 │ │ │ │ │ │ -00050 /************************************************************* │ │ │ │ │ │ -00051 * Cvicinity implementation │ │ │ │ │ │ -* │ │ │ │ │ │ -00052 * list of element in the vicinity of a parent. │ │ │ │ │ │ -* │ │ │ │ │ │ -00053 * class used to manage the points which are in the vicinity * │ │ │ │ │ │ -00054 * of a parent point. The construction of the list can be │ │ │ │ │ │ -* │ │ │ │ │ │ -00055 * made from a list of points or from a quadtree. │ │ │ │ │ │ -* │ │ │ │ │ │ -00056 *************************************************************/ │ │ │ │ │ │ -00057 │ │ │ │ │ │ -00058 // default constructor │ │ │ │ │ │ -00059 //--------------------00060 Cvicinity::Cvicinity(){ │ │ │ │ │ │ -00061 │ │ │ │ │ │ -n_part = 0; │ │ │ │ │ │ -00062 │ │ │ │ │ │ -00063 │ │ │ │ │ │ -ve_list = NULL; │ │ │ │ │ │ -00064 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ -00065 │ │ │ │ │ │ -quadtree = NULL; │ │ │ │ │ │ -00066 #endif │ │ │ │ │ │ -00067 │ │ │ │ │ │ -00068 │ │ │ │ │ │ -parent = NULL; │ │ │ │ │ │ -00069 │ │ │ │ │ │ -VR2 = VR = 0.0; │ │ │ │ │ │ -00070 │ │ │ │ │ │ -00071 } │ │ │ │ │ │ -00072 │ │ │ │ │ │ -00073 // constructor with initialisation │ │ │ │ │ │ -00074 //--------------------------------00075 Cvicinity::Cvicinity(vector &_particle_list){ │ │ │ │ │ │ -00076 │ │ │ │ │ │ -parent = NULL; │ │ │ │ │ │ -00077 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ - │ │ │ │ │ │ -* │ │ │ │ │ │ -* │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.46 vicinity.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -00078 │ │ │ │ │ │ -quadtree = NULL; │ │ │ │ │ │ -00079 #endif │ │ │ │ │ │ -00080 │ │ │ │ │ │ -VR2 = VR = 0.0; │ │ │ │ │ │ -00081 │ │ │ │ │ │ -00082 │ │ │ │ │ │ -ve_list = NULL; │ │ │ │ │ │ -00083 │ │ │ │ │ │ -set_particle_list(_particle_list); │ │ │ │ │ │ -00084 } │ │ │ │ │ │ -00085 │ │ │ │ │ │ -00086 // default destructor │ │ │ │ │ │ -00087 //-------------------00088 Cvicinity::~Cvicinity(){ │ │ │ │ │ │ -if (ve_list!=NULL) │ │ │ │ │ │ -00089 │ │ │ │ │ │ -00090 │ │ │ │ │ │ -delete[] ve_list; │ │ │ │ │ │ -00091 │ │ │ │ │ │ -00092 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ -00093 │ │ │ │ │ │ -if (quadtree!=NULL) │ │ │ │ │ │ -delete quadtree; │ │ │ │ │ │ -00094 │ │ │ │ │ │ -00095 #endif │ │ │ │ │ │ -00096 } │ │ │ │ │ │ -00097 │ │ │ │ │ │ -00098 /* │ │ │ │ │ │ -00099 * set the particle_list │ │ │ │ │ │ -list of particles (type Cmomentum) │ │ │ │ │ │ -00100 * - particle_list │ │ │ │ │ │ -00101 * - n │ │ │ │ │ │ -number of particles in the list │ │ │ │ │ │ -00102 ************************************************************/ │ │ │ │ │ │ -00103 void Cvicinity::set_particle_list(vector &_particle_list){ │ │ │ │ │ │ -00104 │ │ │ │ │ │ -int i,j; │ │ │ │ │ │ -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 ! │ │ │ │ │ │ -00110 │ │ │ │ │ │ -if (ve_list!=NULL){ │ │ │ │ │ │ -00111 │ │ │ │ │ │ -delete[] ve_list; │ │ │ │ │ │ -00112 │ │ │ │ │ │ -} │ │ │ │ │ │ -00113 │ │ │ │ │ │ -vicinity.clear(); │ │ │ │ │ │ -00114 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ -00115 │ │ │ │ │ │ -if (quadtree!=NULL) │ │ │ │ │ │ -00116 │ │ │ │ │ │ -delete quadtree; │ │ │ │ │ │ -00117 #endif │ │ │ │ │ │ -00118 │ │ │ │ │ │ -00119 │ │ │ │ │ │ -// allocate memory array for particles │ │ │ │ │ │ -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 │ │ │ │ │ │ -// if a particle is colinear with the beam (infinite rapidity) │ │ │ │ │ │ -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 │ │ │ │ │ │ -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 │ │ │ │ │ │ -plist[n_part].index = n_part; │ │ │ │ │ │ -00137 │ │ │ │ │ │ -00138 │ │ │ │ │ │ -// make sure the reference is randomly created │ │ │ │ │ │ -00139 │ │ │ │ │ │ -plist[n_part].ref.randomize(); │ │ │ │ │ │ -00140 │ │ │ │ │ │ -00141 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ -00142 │ │ │ │ │ │ -if (fabs(plist[n_part].eta)>eta_max) eta_max=fabs(plist[n_part].eta); │ │ │ │ │ │ -00143 #endif │ │ │ │ │ │ -00144 │ │ │ │ │ │ -00145 │ │ │ │ │ │ -n_part++; │ │ │ │ │ │ -00146 │ │ │ │ │ │ -} │ │ │ │ │ │ -00147 │ │ │ │ │ │ -} │ │ │ │ │ │ -00148 │ │ │ │ │ │ -00149 │ │ │ │ │ │ -// allocate quadtree and vicinity_elm list │ │ │ │ │ │ -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 │ │ │ │ │ │ -00156 │ │ │ │ │ │ -// append particle to the vicinity_elm list │ │ │ │ │ │ -00157 │ │ │ │ │ │ -00158 │ │ │ │ │ │ -j = 0; │ │ │ │ │ │ -00159 │ │ │ │ │ │ -for (i=0;iadd(&plist[i]); │ │ │ │ │ │ -00162 #endif │ │ │ │ │ │ -00163 │ │ │ │ │ │ -ve_list[j].v = ve_list[j+1].v = &plist[i]; │ │ │ │ │ │ -00164 │ │ │ │ │ │ -ve_list[j].is_inside = ve_list[j+1].is_inside = &(pincluded[i]); │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -271 │ │ │ │ │ │ - │ │ │ │ │ │ - 272 │ │ │ │ │ │ - │ │ │ │ │ │ -00165 │ │ │ │ │ │ -j+=2; │ │ │ │ │ │ -00166 │ │ │ │ │ │ -} │ │ │ │ │ │ -00167 │ │ │ │ │ │ -00168 } │ │ │ │ │ │ -00169 │ │ │ │ │ │ -00170 │ │ │ │ │ │ -00171 /* │ │ │ │ │ │ -00172 * build the vicinity list from a list of points. │ │ │ │ │ │ -00173 * - _parent │ │ │ │ │ │ -reference particle │ │ │ │ │ │ -00174 * - _VR │ │ │ │ │ │ -vicinity radius │ │ │ │ │ │ -00175 ************************************************************/ │ │ │ │ │ │ -00176 void Cvicinity::build(Cmomentum *_parent, double _VR){ │ │ │ │ │ │ -00177 │ │ │ │ │ │ -int i; │ │ │ │ │ │ -00178 │ │ │ │ │ │ -// set parent and radius │ │ │ │ │ │ -00179 │ │ │ │ │ │ -00180 │ │ │ │ │ │ -parent = _parent; │ │ │ │ │ │ -00181 │ │ │ │ │ │ -VR = _VR; │ │ │ │ │ │ -00182 │ │ │ │ │ │ -VR2 = VR*VR; │ │ │ │ │ │ -00183 │ │ │ │ │ │ -R2 = 0.25*VR2; │ │ │ │ │ │ -00184 │ │ │ │ │ │ -R │ │ │ │ │ │ -= 0.5*VR; │ │ │ │ │ │ -00185 │ │ │ │ │ │ -inv_R_EPS_COCIRC = 1.0 / R / EPSILON_COCIRCULAR; │ │ │ │ │ │ -00186 │ │ │ │ │ │ -inv_R_2EPS_COCIRC = 0.5 / R / EPSILON_COCIRCULAR; │ │ │ │ │ │ -00187 │ │ │ │ │ │ -// clear vicinity │ │ │ │ │ │ -00188 │ │ │ │ │ │ -00189 │ │ │ │ │ │ -vicinity.clear(); │ │ │ │ │ │ -00190 │ │ │ │ │ │ -// init parent variables │ │ │ │ │ │ -00191 │ │ │ │ │ │ -00192 │ │ │ │ │ │ -pcx = parent->eta; │ │ │ │ │ │ -00193 │ │ │ │ │ │ -pcy = parent->phi; │ │ │ │ │ │ -00194 │ │ │ │ │ │ -00195 │ │ │ │ │ │ -// really browse the particle list │ │ │ │ │ │ -00196 │ │ │ │ │ │ -for (i=0;i0) ? 0.0 : 2.0; │ │ │ │ │ │ -double t=c/s; │ │ │ │ │ │ -00210 │ │ │ │ │ │ -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 │ │ │ │ │ │ -vector to test │ │ │ │ │ │ -00218 * - v │ │ │ │ │ │ -00219 **********************************************************/ │ │ │ │ │ │ -00220 void Cvicinity::append_to_vicinity(Cmomentum *v){ │ │ │ │ │ │ -00221 │ │ │ │ │ │ -double dx, dy, d2; │ │ │ │ │ │ -00222 │ │ │ │ │ │ -// skip the particle itself) │ │ │ │ │ │ -00223 │ │ │ │ │ │ -00224 │ │ │ │ │ │ -if (v==parent) │ │ │ │ │ │ -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 ! │ │ │ │ │ │ -00234 │ │ │ │ │ │ -if (dy>M_PI) │ │ │ │ │ │ -00235 │ │ │ │ │ │ -dy -= twopi; │ │ │ │ │ │ -else if (dy<-M_PI) │ │ │ │ │ │ -00236 │ │ │ │ │ │ -00237 │ │ │ │ │ │ -dy += twopi; │ │ │ │ │ │ -00238 │ │ │ │ │ │ -00239 │ │ │ │ │ │ -d2 = dx*dx+dy*dy; │ │ │ │ │ │ -00240 │ │ │ │ │ │ -00241 │ │ │ │ │ │ -// really check if the distance is less than VR │ │ │ │ │ │ -00242 │ │ │ │ │ │ -if (d2eta - ve_list[i+1].eta, │ │ │ │ │ │ -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 │ │ │ │ │ │ -00280 │ │ │ │ │ │ -// out, it is the _smaller_ of the two that is relevant [NB have │ │ │ │ │ │ -00281 │ │ │ │ │ │ -// changed definition of theta here relative to that used in │ │ │ │ │ │ -00282 │ │ │ │ │ │ -// CCN29] [NB2: write things so as to avoid zero denominators and │ │ │ │ │ │ -00283 │ │ │ │ │ │ -// to minimize the multiplications, divisions and above all sqrts │ │ │ │ │ │ -00284 │ │ │ │ │ │ -// -- 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)); │ │ │ │ │ │ -00287 │ │ │ │ │ │ -double inv_err1 = s * inv_R_EPS_COCIRC; │ │ │ │ │ │ -double inv_err2_sq = (R2-c) * inv_R_2EPS_COCIRC; │ │ │ │ │ │ -00288 │ │ │ │ │ │ -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.47 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. │ │ │ │ │ │ -// │ │ │ │ │ │ -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:: 390 │ │ │ │ │ │ -$// │ │ │ │ │ │ -00026 // $Date:: 2016-03-03 11:06:52 +0100 (Thu, 03 Mar 2016) │ │ │ │ │ │ -$// │ │ │ │ │ │ -00028 │ │ │ │ │ │ -00029 #include │ │ │ │ │ │ -00030 #include "split_merge.h" │ │ │ │ │ │ -00031 #include "momentum.h" │ │ │ │ │ │ -00032 #include │ │ │ │ │ │ -// for max │ │ │ │ │ │ -00033 #include │ │ │ │ │ │ -00034 #include │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -273 │ │ │ │ │ │ - │ │ │ │ │ │ - 274 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -00035 #include │ │ │ │ │ │ -00036 #include │ │ │ │ │ │ -00037 #include │ │ │ │ │ │ -00038 │ │ │ │ │ │ -00039 namespace siscone_spherical{ │ │ │ │ │ │ -00040 │ │ │ │ │ │ -00041 using namespace std; │ │ │ │ │ │ -00042 │ │ │ │ │ │ -00043 /******************************************************** │ │ │ │ │ │ -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 │ │ │ │ │ │ -* │ │ │ │ │ │ -00048 * about its centre and pT, and second, its particle │ │ │ │ │ │ -* │ │ │ │ │ │ -00049 * contents │ │ │ │ │ │ -* │ │ │ │ │ │ -00050 ********************************************************/ │ │ │ │ │ │ -00051 // default ctor │ │ │ │ │ │ -00052 //-------------00053 CSphjet::CSphjet(){ │ │ │ │ │ │ -00054 │ │ │ │ │ │ -n = 0; │ │ │ │ │ │ -00055 │ │ │ │ │ │ -v = CSphmomentum(); │ │ │ │ │ │ -00056 │ │ │ │ │ │ -E_tilde = 0.0; │ │ │ │ │ │ -00057 │ │ │ │ │ │ -sm_var2 = 0.0; │ │ │ │ │ │ -00058 │ │ │ │ │ │ -pass = CJET_INEXISTENT_PASS; // initialised to a value that should │ │ │ │ │ │ -00059 │ │ │ │ │ │ -// notappear in the end (after clustering) │ │ │ │ │ │ -00060 } │ │ │ │ │ │ -00061 │ │ │ │ │ │ -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){ │ │ │ │ │ │ -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 * │ │ │ │ │ │ -00078 ********************************************************/ │ │ │ │ │ │ -00079 │ │ │ │ │ │ -00080 // odering of two jets │ │ │ │ │ │ -00081 // The variable of the ordering is pt or mt │ │ │ │ │ │ -00082 // depending on ’split_merge_scale’ choice │ │ │ │ │ │ -00083 // │ │ │ │ │ │ -00084 // with EPSILON_SPLITMERGE defined, this attempts to identify │ │ │ │ │ │ -00085 // delicate cases where two jets have identical momenta except for │ │ │ │ │ │ -00086 // softish particles -- the difference of pt’s may not be correctly │ │ │ │ │ │ -00087 // identified normally and so lead to problems for the fate of the │ │ │ │ │ │ -00088 // softish particle. │ │ │ │ │ │ -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{ │ │ │ │ │ │ -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; │ │ │ │ │ │ -00102 │ │ │ │ │ │ -q2 = jet2.sm_var2; │ │ │ │ │ │ -00103 │ │ │ │ │ │ -00104 │ │ │ │ │ │ -bool res = q1 > q2; │ │ │ │ │ │ -00105 │ │ │ │ │ │ -// if we enable the refined version of the comparison (see defines.h), │ │ │ │ │ │ -00106 │ │ │ │ │ │ -00107 │ │ │ │ │ │ -// we compute the difference more precisely when the two jets are very │ │ │ │ │ │ -00108 │ │ │ │ │ │ -// 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 │ │ │ │ │ │ -00113 │ │ │ │ │ │ -cout « "Using high-precision ordering tests" « endl; │ │ │ │ │ │ -00114 #endif │ │ │ │ │ │ -00115 │ │ │ │ │ │ -// get the momentum of the difference │ │ │ │ │ │ -00116 │ │ │ │ │ │ -CSphmomentum difference; │ │ │ │ │ │ -double E_tilde_difference; │ │ │ │ │ │ +CSphmomentum difference; │ │ │ │ │ │ +double E_tilde_difference; │ │ │ │ │ │ 00117 │ │ │ │ │ │ 00118 │ │ │ │ │ │ get_difference(jet1,jet2,&difference,&E_tilde_difference); │ │ │ │ │ │ 00119 │ │ │ │ │ │ 00120 │ │ │ │ │ │ // use the following relation: pt1^2 - pt2^2 = (pt1+pt2)*(pt1-pt2) │ │ │ │ │ │ 00121 │ │ │ │ │ │ double qdiff; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.47 split_merge.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -275 │ │ │ │ │ │ - │ │ │ │ │ │ 00122 │ │ │ │ │ │ CSphmomentum sum = jet1.v ; │ │ │ │ │ │ 00123 │ │ │ │ │ │ sum += jet2.v; │ │ │ │ │ │ double E_tilde_sum = jet1.E_tilde + jet2.E_tilde; │ │ │ │ │ │ 00124 │ │ │ │ │ │ 00125 │ │ │ │ │ │ // depending on the choice of ordering variable, set the result │ │ │ │ │ │ 00126 │ │ │ │ │ │ 00127 │ │ │ │ │ │ switch (split_merge_scale){ │ │ │ │ │ │ -case SM_Etilde: │ │ │ │ │ │ 00128 │ │ │ │ │ │ +case SM_Etilde: │ │ │ │ │ │ 00129 │ │ │ │ │ │ qdiff = E_tilde_sum*E_tilde_difference; │ │ │ │ │ │ break; │ │ │ │ │ │ 00130 │ │ │ │ │ │ -00131 │ │ │ │ │ │ case SM_E: │ │ │ │ │ │ +00131 │ │ │ │ │ │ 00132 │ │ │ │ │ │ qdiff = sum.E*difference.E; │ │ │ │ │ │ break; │ │ │ │ │ │ 00133 │ │ │ │ │ │ 00134 │ │ │ │ │ │ default: │ │ │ │ │ │ -throw siscone::Csiscone_error("Unsupported split-merge scale choice: " │ │ │ │ │ │ 00135 │ │ │ │ │ │ +throw siscone::Csiscone_error("Unsupported split-merge scale choice: " │ │ │ │ │ │ 00136 │ │ │ │ │ │ + SM_scale_name()); │ │ │ │ │ │ 00137 │ │ │ │ │ │ } │ │ │ │ │ │ 00138 │ │ │ │ │ │ res = qdiff > 0; │ │ │ │ │ │ 00139 │ │ │ │ │ │ } │ │ │ │ │ │ 00140 #endif // EPSILON_SPLITMERGE │ │ │ │ │ │ 00141 │ │ │ │ │ │ -return res; │ │ │ │ │ │ 00142 │ │ │ │ │ │ +return res; │ │ │ │ │ │ 00143 } │ │ │ │ │ │ 00144 │ │ │ │ │ │ 00145 │ │ │ │ │ │ 00148 std::string split_merge_scale_name(Esplit_merge_scale sms) { │ │ │ │ │ │ switch(sms) { │ │ │ │ │ │ 00149 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.47 split_merge.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +271 │ │ │ │ │ │ + │ │ │ │ │ │ 00150 │ │ │ │ │ │ case SM_E: │ │ │ │ │ │ return "E (IR unsafe for pairs of identical decayed heavy particles)"; │ │ │ │ │ │ 00151 │ │ │ │ │ │ 00152 │ │ │ │ │ │ case SM_Etilde: │ │ │ │ │ │ 00153 │ │ │ │ │ │ @@ -23870,27 +23227,20 @@ │ │ │ │ │ │ 00203 │ │ │ │ │ │ throw siscone::Csiscone_error("get_non_overlap reached part it should never have seen..."); │ │ │ │ │ │ 00204 │ │ │ │ │ │ } │ │ │ │ │ │ 00205 │ │ │ │ │ │ } while ((i1 p_sorted; │ │ │ │ │ │ -bool collinear; │ │ │ │ │ │ 00406 │ │ │ │ │ │ -00407 │ │ │ │ │ │ +bool collinear; │ │ │ │ │ │ double dphi; │ │ │ │ │ │ +00407 │ │ │ │ │ │ 00408 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +273 │ │ │ │ │ │ + │ │ │ │ │ │ + 274 │ │ │ │ │ │ + │ │ │ │ │ │ 00409 │ │ │ │ │ │ -p_uncol_hard.clear(); │ │ │ │ │ │ 00410 │ │ │ │ │ │ -// we first sort the particles according to their theta angle │ │ │ │ │ │ 00411 │ │ │ │ │ │ 00412 │ │ │ │ │ │ -for (i=0;iM_PI) dphi = twopi-dphi; │ │ │ │ │ │ 00433 │ │ │ │ │ │ 00434 │ │ │ │ │ │ @@ -24288,16 +23647,16 @@ │ │ │ │ │ │ 00449 │ │ │ │ │ │ p_uncol_hard.push_back(p_sorted[i]); │ │ │ │ │ │ 00450 │ │ │ │ │ │ i++; │ │ │ │ │ │ 00451 │ │ │ │ │ │ } │ │ │ │ │ │ 00452 │ │ │ │ │ │ -00453 │ │ │ │ │ │ return 0; │ │ │ │ │ │ +00453 │ │ │ │ │ │ 00454 } │ │ │ │ │ │ 00455 │ │ │ │ │ │ 00456 │ │ │ │ │ │ 00457 // add a list of protocones │ │ │ │ │ │ 00458 // - protocones list of protocones (initial jet candidates) │ │ │ │ │ │ 00459 // - R2 │ │ │ │ │ │ cone radius (squared) │ │ │ │ │ │ @@ -24311,30 +23670,23 @@ │ │ │ │ │ │ 00465 │ │ │ │ │ │ CSphmomentum *v; │ │ │ │ │ │ double tan2R; │ │ │ │ │ │ 00466 │ │ │ │ │ │ 00467 │ │ │ │ │ │ CSphjet jet; │ │ │ │ │ │ 00468 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.47 split_merge.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -279 │ │ │ │ │ │ - │ │ │ │ │ │ 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 │ │ │ │ │ │ @@ -24353,25 +23705,32 @@ │ │ │ │ │ │ 00485 │ │ │ │ │ │ 00486 │ │ │ │ │ │ // browse protocones │ │ │ │ │ │ 00487 │ │ │ │ │ │ // for each of them, build the list of particles in them │ │ │ │ │ │ 00488 │ │ │ │ │ │ for (vector::iterator p_it = protocones->begin();p_it != protocones->end();p_it++){ │ │ │ │ │ │ -// initialise variables │ │ │ │ │ │ 00489 │ │ │ │ │ │ +// initialise variables │ │ │ │ │ │ 00490 │ │ │ │ │ │ c = &(*p_it); │ │ │ │ │ │ 00491 │ │ │ │ │ │ -// browse particles to create cone contents │ │ │ │ │ │ 00492 │ │ │ │ │ │ +// browse particles to create cone contents │ │ │ │ │ │ 00493 │ │ │ │ │ │ // note that jet is always initialised with default values at this level │ │ │ │ │ │ 00494 │ │ │ │ │ │ jet.v = CSphmomentum(); │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.47 split_merge.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +275 │ │ │ │ │ │ + │ │ │ │ │ │ 00495 │ │ │ │ │ │ jet.contents.clear(); │ │ │ │ │ │ for (i=0;i *protocones, double R2, │ │ │ │ │ │ double Emin){ │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 276 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00581 │ │ │ │ │ │ int i; │ │ │ │ │ │ 00582 │ │ │ │ │ │ 00583 │ │ │ │ │ │ CSphmomentum *c; │ │ │ │ │ │ 00584 │ │ │ │ │ │ CSphmomentum *v; │ │ │ │ │ │ 00585 │ │ │ │ │ │ double R, tan2R; │ │ │ │ │ │ 00586 │ │ │ │ │ │ CSphjet jet, jet_candidate; │ │ │ │ │ │ bool found_jet = false; │ │ │ │ │ │ 00587 │ │ │ │ │ │ 00588 │ │ │ │ │ │ -00589 │ │ │ │ │ │ if (protocones->size()==0) │ │ │ │ │ │ -return 1; │ │ │ │ │ │ +00589 │ │ │ │ │ │ 00590 │ │ │ │ │ │ +return 1; │ │ │ │ │ │ 00591 │ │ │ │ │ │ 00592 │ │ │ │ │ │ E_min = Emin; │ │ │ │ │ │ 00593 │ │ │ │ │ │ R = sqrt(R2); │ │ │ │ │ │ 00594 │ │ │ │ │ │ tan2R = tan(R); │ │ │ │ │ │ 00595 │ │ │ │ │ │ tan2R *= tan2R; │ │ │ │ │ │ 00596 │ │ │ │ │ │ -// browse protocones │ │ │ │ │ │ 00597 │ │ │ │ │ │ +// browse protocones │ │ │ │ │ │ 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++){ │ │ │ │ │ │ 00600 │ │ │ │ │ │ // initialise variables │ │ │ │ │ │ 00601 │ │ │ │ │ │ @@ -24626,19 +23985,14 @@ │ │ │ │ │ │ jet_candidate.sm_var2 = (*_user_scale)(jet_candidate); │ │ │ │ │ │ 00639 │ │ │ │ │ │ jet_candidate.sm_var2 *= abs(jet_candidate.sm_var2); │ │ │ │ │ │ 00640 │ │ │ │ │ │ } else { │ │ │ │ │ │ 00641 │ │ │ │ │ │ jet_candidate.sm_var2 = get_sm_var2(jet_candidate.v, jet_candidate.E_tilde); │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.47 split_merge.cpp │ │ │ │ │ │ - │ │ │ │ │ │ 00642 │ │ │ │ │ │ } │ │ │ │ │ │ 00643 │ │ │ │ │ │ // now check if it is possibly the hardest │ │ │ │ │ │ 00644 │ │ │ │ │ │ 00645 │ │ │ │ │ │ if ((! found_jet) || │ │ │ │ │ │ @@ -24674,16 +24028,21 @@ │ │ │ │ │ │ cout « "PR-Jet " « jets.size() « " [size " « jet.contents.size() « "]:"; │ │ │ │ │ │ 00663 #endif │ │ │ │ │ │ 00664 │ │ │ │ │ │ // update the list of what particles are left │ │ │ │ │ │ 00665 │ │ │ │ │ │ 00666 │ │ │ │ │ │ int p_remain_index = 0; │ │ │ │ │ │ -int contents_index = 0; │ │ │ │ │ │ 00667 │ │ │ │ │ │ +int contents_index = 0; │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.47 split_merge.cpp │ │ │ │ │ │ + │ │ │ │ │ │ 00668 │ │ │ │ │ │ //sort(next_jet.contents.begin(),next_jet.contents.end()); │ │ │ │ │ │ 00669 │ │ │ │ │ │ for (int index=0;indexsize()==0) │ │ │ │ │ │ +00722 │ │ │ │ │ │ 00723 │ │ │ │ │ │ return 0; │ │ │ │ │ │ 00724 │ │ │ │ │ │ if (overlap_tshold>=1.0 || overlap_tshold <= 0) { │ │ │ │ │ │ 00725 │ │ │ │ │ │ 00726 │ │ │ │ │ │ ostringstream message; │ │ │ │ │ │ 00727 │ │ │ │ │ │ message « "Illegal value for overlap_tshold, f = " « overlap_tshold; │ │ │ │ │ │ 00728 │ │ │ │ │ │ message « " (legal values are 0size()>0){ │ │ │ │ │ │ -// browse for the first jet │ │ │ │ │ │ 00742 │ │ │ │ │ │ +// browse for the first jet │ │ │ │ │ │ 00743 │ │ │ │ │ │ j1 = candidates->begin(); │ │ │ │ │ │ 00744 │ │ │ │ │ │ // if hardest jet does not pass threshold then nothing else will │ │ │ │ │ │ 00745 │ │ │ │ │ │ 00746 │ │ │ │ │ │ // either so one stops the split merge. │ │ │ │ │ │ @@ -24832,14 +24182,23 @@ │ │ │ │ │ │ 00751 │ │ │ │ │ │ j2 = j1; │ │ │ │ │ │ 00752 │ │ │ │ │ │ j2++; │ │ │ │ │ │ int j2_relindex = 1; // used only in ifdef, but costs little so keep it outside │ │ │ │ │ │ 00753 │ │ │ │ │ │ 00754 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +277 │ │ │ │ │ │ + │ │ │ │ │ │ + 278 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 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; │ │ │ │ │ │ @@ -24941,33 +24300,28 @@ │ │ │ │ │ │ 00812 #endif │ │ │ │ │ │ 00813 │ │ │ │ │ │ candidates->erase(j1); │ │ │ │ │ │ 00814 │ │ │ │ │ │ } │ │ │ │ │ │ 00815 │ │ │ │ │ │ } │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.47 split_merge.cpp │ │ │ │ │ │ - │ │ │ │ │ │ 00816 │ │ │ │ │ │ } while (candidates->size()>0); │ │ │ │ │ │ 00817 │ │ │ │ │ │ // sort jets by Energy │ │ │ │ │ │ 00818 │ │ │ │ │ │ 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 │ │ │ │ │ │ 00829 // save the event on disk │ │ │ │ │ │ 00830 // - flux │ │ │ │ │ │ stream used to save jet contents │ │ │ │ │ │ @@ -24985,14 +24339,19 @@ │ │ │ │ │ │ fprintf(flux, "# columns are: px, py, pz, E and number of particles for each jet\n"); │ │ │ │ │ │ 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", │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.47 split_merge.cpp │ │ │ │ │ │ + │ │ │ │ │ │ 00842 │ │ │ │ │ │ j1->v.px, j1->v.py, j1->v.pz, j1->v.E, j1->n); │ │ │ │ │ │ 00843 │ │ │ │ │ │ } │ │ │ │ │ │ 00844 │ │ │ │ │ │ 00845 │ │ │ │ │ │ fprintf(flux, "# jet contents\n"); │ │ │ │ │ │ @@ -25011,16 +24370,16 @@ │ │ │ │ │ │ 00852 │ │ │ │ │ │ particles[j1->contents[i2]].pz, particles[j1->contents[i2]].E, │ │ │ │ │ │ 00853 │ │ │ │ │ │ j1->contents[i2], i1); │ │ │ │ │ │ 00854 │ │ │ │ │ │ } │ │ │ │ │ │ 00855 │ │ │ │ │ │ -return 0; │ │ │ │ │ │ 00856 │ │ │ │ │ │ +return 0; │ │ │ │ │ │ 00857 } │ │ │ │ │ │ 00858 │ │ │ │ │ │ 00859 │ │ │ │ │ │ 00860 // show current jets/candidate status │ │ │ │ │ │ 00861 //-----------------------------------00862 int CSphsplit_merge::show(){ │ │ │ │ │ │ 00863 │ │ │ │ │ │ jet_iterator it_j; │ │ │ │ │ │ @@ -25091,44 +24450,35 @@ │ │ │ │ │ │ 00899 │ │ │ │ │ │ fprintf(stdout, "%d ", c->contents[i2]); │ │ │ │ │ │ 00900 │ │ │ │ │ │ fprintf(stdout, "\n"); │ │ │ │ │ │ 00901 │ │ │ │ │ │ } │ │ │ │ │ │ 00902 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -283 │ │ │ │ │ │ - │ │ │ │ │ │ - 284 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 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 │ │ │ │ │ │ +00915 │ │ │ │ │ │ 00916 │ │ │ │ │ │ if (!is_range_overlap(j1.range,j2.range)) │ │ │ │ │ │ -00917 │ │ │ │ │ │ return false; │ │ │ │ │ │ +00917 │ │ │ │ │ │ 00918 │ │ │ │ │ │ int i1,i2; │ │ │ │ │ │ 00919 │ │ │ │ │ │ 00920 │ │ │ │ │ │ bool is_overlap; │ │ │ │ │ │ 00921 │ │ │ │ │ │ // initialise │ │ │ │ │ │ @@ -25136,18 +24486,27 @@ │ │ │ │ │ │ 00923 │ │ │ │ │ │ i1=i2=idx_size=0; │ │ │ │ │ │ 00924 │ │ │ │ │ │ is_overlap = false; │ │ │ │ │ │ 00925 │ │ │ │ │ │ CSphmomentum v; │ │ │ │ │ │ 00926 │ │ │ │ │ │ -// compute overlap │ │ │ │ │ │ 00927 │ │ │ │ │ │ +// compute overlap │ │ │ │ │ │ 00928 │ │ │ │ │ │ // at the same time, we store union in indices │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +279 │ │ │ │ │ │ + │ │ │ │ │ │ + 280 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00929 │ │ │ │ │ │ do{ │ │ │ │ │ │ if (j1.contents[i1]" all over the place │ │ │ │ │ │ 00986 │ │ │ │ │ │ +// shorthand to avoid having "->" all over the place │ │ │ │ │ │ 00987 │ │ │ │ │ │ const CSphjet & j1 = * it_j1; │ │ │ │ │ │ const CSphjet & j2 = * it_j2; │ │ │ │ │ │ 00988 │ │ │ │ │ │ 00989 │ │ │ │ │ │ 00990 │ │ │ │ │ │ i1=i2=0; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.47 split_merge.cpp │ │ │ │ │ │ - │ │ │ │ │ │ 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 │ │ │ │ │ │ 01001 │ │ │ │ │ │ +// compute jet splitting │ │ │ │ │ │ 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]]; │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.47 split_merge.cpp │ │ │ │ │ │ + │ │ │ │ │ │ 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 │ │ │ │ │ │ +//? what when == ? │ │ │ │ │ │ 01025 │ │ │ │ │ │ 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; │ │ │ │ │ │ +double d2 = get_distance(&(j2.v), v)*E2_weight; │ │ │ │ │ │ 01030 │ │ │ │ │ │ 01031 │ │ │ │ │ │ +// do bookkeeping on most ambiguous split │ │ │ │ │ │ 01032 │ │ │ │ │ │ +if (fabs(d1-d2) < most_ambiguous_split) │ │ │ │ │ │ 01033 │ │ │ │ │ │ +most_ambiguous_split = fabs(d1-d2); │ │ │ │ │ │ 01034 │ │ │ │ │ │ +if (d1_theta,v->_phi); │ │ │ │ │ │ 01041 │ │ │ │ │ │ +} else { │ │ │ │ │ │ +// particle i2 belong only to jet 2 │ │ │ │ │ │ 01042 │ │ │ │ │ │ 01043 │ │ │ │ │ │ +jet2.contents.push_back(j2.contents[i2]); │ │ │ │ │ │ 01044 │ │ │ │ │ │ +jet2.v += *v; │ │ │ │ │ │ +//jet2.pt_tilde += pt[j2.contents[i2]]; │ │ │ │ │ │ 01045 │ │ │ │ │ │ 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_theta,v->_phi); │ │ │ │ │ │ 01069 │ │ │ │ │ │ +} │ │ │ │ │ │ 01070 │ │ │ │ │ │ +// finalise jets │ │ │ │ │ │ 01071 │ │ │ │ │ │ 01072 │ │ │ │ │ │ +jet1.n = jet1.contents.size(); │ │ │ │ │ │ 01073 │ │ │ │ │ │ +jet2.n = jet2.contents.size(); │ │ │ │ │ │ 01074 │ │ │ │ │ │ +// now the jet axis is known, we can compute Etilde │ │ │ │ │ │ 01075 │ │ │ │ │ │ 01076 │ │ │ │ │ │ -01077 │ │ │ │ │ │ - │ │ │ │ │ │ -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); │ │ │ │ │ │ -} │ │ │ │ │ │ -// finalise jets │ │ │ │ │ │ -jet1.n = jet1.contents.size(); │ │ │ │ │ │ -jet2.n = jet2.contents.size(); │ │ │ │ │ │ -// now the jet axis is known, we can compute Etilde │ │ │ │ │ │ compute_Etilde(jet1); │ │ │ │ │ │ +01077 │ │ │ │ │ │ compute_Etilde(jet2); │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -285 │ │ │ │ │ │ - │ │ │ │ │ │ - 286 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 01078 │ │ │ │ │ │ -// remove previous jets │ │ │ │ │ │ 01079 │ │ │ │ │ │ +// remove previous jets │ │ │ │ │ │ 01080 #ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES │ │ │ │ │ │ 01081 │ │ │ │ │ │ cand_refs.erase(j1.v.ref); │ │ │ │ │ │ 01082 │ │ │ │ │ │ cand_refs.erase(j2.v.ref); │ │ │ │ │ │ 01083 #endif │ │ │ │ │ │ 01084 │ │ │ │ │ │ candidates->erase(it_j1); │ │ │ │ │ │ 01085 │ │ │ │ │ │ candidates->erase(it_j2); │ │ │ │ │ │ 01086 │ │ │ │ │ │ -01087 │ │ │ │ │ │ // reinsert new ones │ │ │ │ │ │ +01087 │ │ │ │ │ │ 01088 │ │ │ │ │ │ insert(jet1); │ │ │ │ │ │ 01089 │ │ │ │ │ │ insert(jet2); │ │ │ │ │ │ 01090 │ │ │ │ │ │ -return true; │ │ │ │ │ │ 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. │ │ │ │ │ │ 01097 // - it_j1 iterator of the first jet in ’candidates’ │ │ │ │ │ │ 01098 // - it_j2 iterator of the second jet in ’candidates’ │ │ │ │ │ │ 01099 // return true on success, false on error │ │ │ │ │ │ 01101 bool CSphsplit_merge::merge(cjet_iterator &it_j1, cjet_iterator &it_j2){ │ │ │ │ │ │ 01102 │ │ │ │ │ │ CSphjet jet; │ │ │ │ │ │ int i; │ │ │ │ │ │ 01103 │ │ │ │ │ │ 01104 │ │ │ │ │ │ -// build new jet │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +281 │ │ │ │ │ │ + │ │ │ │ │ │ + 282 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 01105 │ │ │ │ │ │ +// build new jet │ │ │ │ │ │ 01106 │ │ │ │ │ │ // note: particles within j1 & j2 have already been stored in indices │ │ │ │ │ │ 01107 │ │ │ │ │ │ for (i=0;ierase(it_j1); │ │ │ │ │ │ 01127 │ │ │ │ │ │ candidates->erase(it_j2); │ │ │ │ │ │ 01128 │ │ │ │ │ │ -01129 │ │ │ │ │ │ // reinsert new candidate │ │ │ │ │ │ +01129 │ │ │ │ │ │ 01130 │ │ │ │ │ │ insert(jet); │ │ │ │ │ │ 01131 │ │ │ │ │ │ return true; │ │ │ │ │ │ 01132 │ │ │ │ │ │ 01133 } │ │ │ │ │ │ 01134 │ │ │ │ │ │ @@ -25566,45 +24924,38 @@ │ │ │ │ │ │ default: │ │ │ │ │ │ throw siscone::Csiscone_error("Unsupported split-merge scale choice: " │ │ │ │ │ │ 01174 │ │ │ │ │ │ 01175 │ │ │ │ │ │ + ptcomparison.SM_scale_name()); │ │ │ │ │ │ 01176 │ │ │ │ │ │ } │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.48 split_merge.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -287 │ │ │ │ │ │ - │ │ │ │ │ │ 01177 │ │ │ │ │ │ -//return 0.0; │ │ │ │ │ │ 01178 │ │ │ │ │ │ +//return 0.0; │ │ │ │ │ │ 01179 } │ │ │ │ │ │ 01180 │ │ │ │ │ │ 01181 │ │ │ │ │ │ 01182 │ │ │ │ │ │ 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; │ │ │ │ │ │ -01188 │ │ │ │ │ │ //if (jet.v._norm==0){ │ │ │ │ │ │ +01188 │ │ │ │ │ │ 01189 │ │ │ │ │ │ // jet_axis = CSph3vector(0.0,0.0,0.0); │ │ │ │ │ │ 01190 │ │ │ │ │ │ //} else { │ │ │ │ │ │ 01191 │ │ │ │ │ │ jet_axis/=jet.v.E; │ │ │ │ │ │ -01192 │ │ │ │ │ │ //} │ │ │ │ │ │ +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++){ │ │ │ │ │ │ const CSphmomentum &p = particles[*cont_it]; │ │ │ │ │ │ @@ -25613,18 +24964,24 @@ │ │ │ │ │ │ jet.E_tilde+=p.E*(1.0+norm2_cross_product3(p,jet_axis)/particles_norm2[*cont_it]); │ │ │ │ │ │ 01198 │ │ │ │ │ │ } │ │ │ │ │ │ 01199 } │ │ │ │ │ │ 01200 │ │ │ │ │ │ 01201 } │ │ │ │ │ │ │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.48 split_merge.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +283 │ │ │ │ │ │ + │ │ │ │ │ │ 5.48 split_merge.cpp │ │ │ │ │ │ 00001 │ │ │ │ │ │ -00002 // File: split_merge.cpp │ │ │ │ │ │ // │ │ │ │ │ │ +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. │ │ │ │ │ │ // │ │ │ │ │ │ 00005 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ // │ │ │ │ │ │ 00006 // │ │ │ │ │ │ // │ │ │ │ │ │ @@ -25696,23 +25053,14 @@ │ │ │ │ │ │ 00050 //-------------00051 Cjet::Cjet(){ │ │ │ │ │ │ 00052 │ │ │ │ │ │ n = 0; │ │ │ │ │ │ 00053 │ │ │ │ │ │ v = Cmomentum(); │ │ │ │ │ │ 00054 │ │ │ │ │ │ pt_tilde = 0.0; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -* │ │ │ │ │ │ - │ │ │ │ │ │ - 288 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00055 │ │ │ │ │ │ sm_var2 = 0.0; │ │ │ │ │ │ 00056 │ │ │ │ │ │ pass = CJET_INEXISTENT_PASS; // initialised to a value that should │ │ │ │ │ │ 00057 │ │ │ │ │ │ // notappear in the end (after clustering) │ │ │ │ │ │ 00058 } │ │ │ │ │ │ @@ -25737,52 +25085,61 @@ │ │ │ │ │ │ 00077 │ │ │ │ │ │ 00078 // odering of two jets │ │ │ │ │ │ 00079 // The variable of the ordering is pt or mt │ │ │ │ │ │ 00080 // depending on ’split_merge_scale’ choice │ │ │ │ │ │ 00081 // │ │ │ │ │ │ 00082 // with EPSILON_SPLITMERGE defined, this attempts to identify │ │ │ │ │ │ 00083 // delicate cases where two jets have identical momenta except for │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +* │ │ │ │ │ │ + │ │ │ │ │ │ + 284 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00084 // softish particles -- the difference of pt’s may not be correctly │ │ │ │ │ │ 00085 // identified normally and so lead to problems for the fate of the │ │ │ │ │ │ 00086 // softish particle. │ │ │ │ │ │ 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 │ │ │ │ │ │ 00098 │ │ │ │ │ │ // This depends on the choice of variable (mt is the default) │ │ │ │ │ │ 00099 │ │ │ │ │ │ q1 = jet1.sm_var2; │ │ │ │ │ │ 00100 │ │ │ │ │ │ q2 = jet2.sm_var2; │ │ │ │ │ │ 00101 │ │ │ │ │ │ -00102 │ │ │ │ │ │ bool res = q1 > q2; │ │ │ │ │ │ +00102 │ │ │ │ │ │ 00103 │ │ │ │ │ │ // if we enable the refined version of the comparison (see defines.h), │ │ │ │ │ │ 00104 │ │ │ │ │ │ 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) ) { │ │ │ │ │ │ -00110 │ │ │ │ │ │ // get the momentum of the difference │ │ │ │ │ │ +00110 │ │ │ │ │ │ 00111 │ │ │ │ │ │ Cmomentum difference; │ │ │ │ │ │ 00112 │ │ │ │ │ │ double pt_tilde_difference; │ │ │ │ │ │ 00113 │ │ │ │ │ │ get_difference(jet1,jet2,&difference,&pt_tilde_difference); │ │ │ │ │ │ 00114 │ │ │ │ │ │ @@ -25801,32 +25158,32 @@ │ │ │ │ │ │ 00121 │ │ │ │ │ │ 00122 │ │ │ │ │ │ switch (split_merge_scale){ │ │ │ │ │ │ case SM_mt: │ │ │ │ │ │ 00123 │ │ │ │ │ │ 00124 │ │ │ │ │ │ qdiff = sum.E*difference.E - sum.pz*difference.pz; │ │ │ │ │ │ -break; │ │ │ │ │ │ 00125 │ │ │ │ │ │ -00126 │ │ │ │ │ │ +break; │ │ │ │ │ │ case SM_pt: │ │ │ │ │ │ +00126 │ │ │ │ │ │ 00127 │ │ │ │ │ │ qdiff = sum.px*difference.px + sum.py*difference.py; │ │ │ │ │ │ break; │ │ │ │ │ │ 00128 │ │ │ │ │ │ 00129 │ │ │ │ │ │ case SM_pttilde: │ │ │ │ │ │ 00130 │ │ │ │ │ │ qdiff = pt_tilde_sum*pt_tilde_difference; │ │ │ │ │ │ break; │ │ │ │ │ │ 00131 │ │ │ │ │ │ -case SM_Et: │ │ │ │ │ │ 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 │ │ │ │ │ │ 00136 │ │ │ │ │ │ // refer to the first jet or differences jet1-jet2. │ │ │ │ │ │ @@ -25836,100 +25193,100 @@ │ │ │ │ │ │ ((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(); │ │ │ │ │ │ 00141 │ │ │ │ │ │ break; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.48 split_merge.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -289 │ │ │ │ │ │ - │ │ │ │ │ │ -00142 │ │ │ │ │ │ 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) { │ │ │ │ │ │ -00158 │ │ │ │ │ │ case SM_pt: │ │ │ │ │ │ +00158 │ │ │ │ │ │ 00159 │ │ │ │ │ │ return "pt (IR unsafe)"; │ │ │ │ │ │ -case SM_Et: │ │ │ │ │ │ 00160 │ │ │ │ │ │ -00161 │ │ │ │ │ │ +case SM_Et: │ │ │ │ │ │ return "Et (boost dep.)"; │ │ │ │ │ │ -case SM_mt: │ │ │ │ │ │ +00161 │ │ │ │ │ │ 00162 │ │ │ │ │ │ -00163 │ │ │ │ │ │ +case SM_mt: │ │ │ │ │ │ return "mt (IR safe except for pairs of identical decayed heavy particles)"; │ │ │ │ │ │ -case SM_pttilde: │ │ │ │ │ │ +00163 │ │ │ │ │ │ 00164 │ │ │ │ │ │ -00165 │ │ │ │ │ │ +case SM_pttilde: │ │ │ │ │ │ return "pttilde (scalar sum of pt’s)"; │ │ │ │ │ │ +00165 │ │ │ │ │ │ 00166 │ │ │ │ │ │ default: │ │ │ │ │ │ -return "[SM scale without a name]"; │ │ │ │ │ │ 00167 │ │ │ │ │ │ +return "[SM scale without a name]"; │ │ │ │ │ │ 00168 │ │ │ │ │ │ } │ │ │ │ │ │ 00169 } │ │ │ │ │ │ 00170 │ │ │ │ │ │ 00171 │ │ │ │ │ │ 00172 // get the difference between 2 jets │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.48 split_merge.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +285 │ │ │ │ │ │ + │ │ │ │ │ │ 00173 // - j1 │ │ │ │ │ │ first jet │ │ │ │ │ │ 00174 // - j2 │ │ │ │ │ │ second jet │ │ │ │ │ │ 00175 // - v │ │ │ │ │ │ jet1-jet2 │ │ │ │ │ │ 00176 // - pt_tilde │ │ │ │ │ │ jet1-jet2 pt_tilde │ │ │ │ │ │ 00177 // return true if overlapping, false if disjoint │ │ │ │ │ │ 00178 //----------------------------------------------00179 void Csplit_merge_ptcomparison::get_difference(const Cjet &j1, const Cjet &j2, Cmomentum *v, double │ │ │ │ │ │ *pt_tilde)const { │ │ │ │ │ │ int i1,i2; │ │ │ │ │ │ 00180 │ │ │ │ │ │ 00181 │ │ │ │ │ │ -// initialise │ │ │ │ │ │ 00182 │ │ │ │ │ │ +// initialise │ │ │ │ │ │ 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 │ │ │ │ │ │ @@ -26023,28 +25373,35 @@ │ │ │ │ │ │ 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; │ │ │ │ │ │ 00246 │ │ │ │ │ │ -// no pt-weighted splitting │ │ │ │ │ │ 00247 │ │ │ │ │ │ +// no pt-weighted splitting │ │ │ │ │ │ 00248 │ │ │ │ │ │ use_pt_weighted_splitting = false; │ │ │ │ │ │ 00249 } │ │ │ │ │ │ 00250 │ │ │ │ │ │ 00251 │ │ │ │ │ │ 00252 // default dtor │ │ │ │ │ │ 00253 //-------------00254 Csplit_merge::~Csplit_merge(){ │ │ │ │ │ │ 00255 │ │ │ │ │ │ full_clear(); │ │ │ │ │ │ 00256 } │ │ │ │ │ │ 00257 │ │ │ │ │ │ 00258 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 286 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00259 // initialisation function │ │ │ │ │ │ 00260 // - _particles list of particles │ │ │ │ │ │ 00261 // - protocones list of protocones (initial jet candidates) │ │ │ │ │ │ 00262 // - R2 │ │ │ │ │ │ cone radius (squared) │ │ │ │ │ │ 00263 // - ptmin │ │ │ │ │ │ minimal pT allowed for jets │ │ │ │ │ │ @@ -26070,32 +25427,32 @@ │ │ │ │ │ │ 00279 │ │ │ │ │ │ // with infinite rapidity (colinear with the beam) │ │ │ │ │ │ 00280 │ │ │ │ │ │ particles = _particles; │ │ │ │ │ │ 00281 │ │ │ │ │ │ n = particles.size(); │ │ │ │ │ │ 00282 │ │ │ │ │ │ -00283 │ │ │ │ │ │ // build the vector of particles’ pt │ │ │ │ │ │ +00283 │ │ │ │ │ │ 00284 │ │ │ │ │ │ pt.resize(n); │ │ │ │ │ │ for (int i=0;i(ptcomparison)); │ │ │ │ │ │ 00371 │ │ │ │ │ │ @@ -26245,99 +25602,99 @@ │ │ │ │ │ │ 00378 │ │ │ │ │ │ cand_refs.clear(); │ │ │ │ │ │ 00379 #endif │ │ │ │ │ │ 00380 │ │ │ │ │ │ 00381 │ │ │ │ │ │ p_remain.clear(); │ │ │ │ │ │ 00382 │ │ │ │ │ │ -00383 │ │ │ │ │ │ return 0; │ │ │ │ │ │ +00383 │ │ │ │ │ │ 00384 } │ │ │ │ │ │ 00385 │ │ │ │ │ │ 00386 │ │ │ │ │ │ 00387 // full clearance │ │ │ │ │ │ 00388 //---------------00389 int Csplit_merge::full_clear(){ │ │ │ │ │ │ 00390 │ │ │ │ │ │ partial_clear(); │ │ │ │ │ │ 00391 │ │ │ │ │ │ 00392 │ │ │ │ │ │ // clear previously allocated memory │ │ │ │ │ │ 00393 │ │ │ │ │ │ if (indices != NULL){ │ │ │ │ │ │ -00394 │ │ │ │ │ │ delete[] indices; │ │ │ │ │ │ +00394 │ │ │ │ │ │ 00395 │ │ │ │ │ │ } │ │ │ │ │ │ 00396 │ │ │ │ │ │ particles.clear(); │ │ │ │ │ │ 00397 │ │ │ │ │ │ -00398 │ │ │ │ │ │ return 0; │ │ │ │ │ │ +00398 │ │ │ │ │ │ 00399 } │ │ │ │ │ │ 00400 │ │ │ │ │ │ 00401 │ │ │ │ │ │ 00402 // build the list ’p_uncol_hard’ from p_remain by clustering collinear particles │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -291 │ │ │ │ │ │ - │ │ │ │ │ │ - 292 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00403 // note that thins in only used for stable-cone detection │ │ │ │ │ │ 00404 // so the parent_index field is unnecessary │ │ │ │ │ │ 00405 //------------------------------------------------------------------------00406 int Csplit_merge::merge_collinear_and_remove_soft(){ │ │ │ │ │ │ -int i,j; │ │ │ │ │ │ 00407 │ │ │ │ │ │ +int i,j; │ │ │ │ │ │ 00408 │ │ │ │ │ │ vector p_sorted; │ │ │ │ │ │ bool collinear; │ │ │ │ │ │ 00409 │ │ │ │ │ │ -00410 │ │ │ │ │ │ double dphi; │ │ │ │ │ │ +00410 │ │ │ │ │ │ 00411 │ │ │ │ │ │ 00412 │ │ │ │ │ │ p_uncol_hard.clear(); │ │ │ │ │ │ 00413 │ │ │ │ │ │ -// we first sort the particles according to their rapidity │ │ │ │ │ │ 00414 │ │ │ │ │ │ +// we first sort the particles according to their rapidity │ │ │ │ │ │ 00415 │ │ │ │ │ │ for (i=0;i *protocones, double R2, double ptmin){ │ │ │ │ │ │ -int i; │ │ │ │ │ │ 00461 │ │ │ │ │ │ +int i; │ │ │ │ │ │ 00462 │ │ │ │ │ │ Cmomentum *c; │ │ │ │ │ │ 00463 │ │ │ │ │ │ Cmomentum *v; │ │ │ │ │ │ -00464 │ │ │ │ │ │ double eta, phi; │ │ │ │ │ │ +00464 │ │ │ │ │ │ 00465 │ │ │ │ │ │ double dx, dy; │ │ │ │ │ │ -double R; │ │ │ │ │ │ 00466 │ │ │ │ │ │ +double R; │ │ │ │ │ │ 00467 │ │ │ │ │ │ Cjet jet; │ │ │ │ │ │ 00468 │ │ │ │ │ │ -00469 │ │ │ │ │ │ if (protocones->size()==0) │ │ │ │ │ │ +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++){ │ │ │ │ │ │ // initialise variables │ │ │ │ │ │ 00478 │ │ │ │ │ │ 00479 │ │ │ │ │ │ @@ -26422,51 +25779,44 @@ │ │ │ │ │ │ // note: cones have been tested => their (eta,phi) coordinates are computed │ │ │ │ │ │ 00481 │ │ │ │ │ │ 00482 │ │ │ │ │ │ eta = c->eta; │ │ │ │ │ │ 00483 │ │ │ │ │ │ phi = c->phi; │ │ │ │ │ │ 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 │ │ │ │ │ │ jet.contents.clear(); │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.48 split_merge.cpp │ │ │ │ │ │ - │ │ │ │ │ │ -293 │ │ │ │ │ │ - │ │ │ │ │ │ -00490 │ │ │ │ │ │ for (i=0;ipz)!=v->E){ │ │ │ │ │ │ 00495 │ │ │ │ │ │ dx = eta - v->eta; │ │ │ │ │ │ 00496 │ │ │ │ │ │ dy = fabs(phi - v->phi); │ │ │ │ │ │ if (dy>M_PI) │ │ │ │ │ │ 00497 │ │ │ │ │ │ 00498 │ │ │ │ │ │ dy -= twopi; │ │ │ │ │ │ -if (dx*dx+dy*dyparent_index); │ │ │ │ │ │ 00501 │ │ │ │ │ │ jet.v+= *v; │ │ │ │ │ │ 00502 │ │ │ │ │ │ jet.pt_tilde+= pt[v->parent_index]; │ │ │ │ │ │ 00503 │ │ │ │ │ │ @@ -26474,33 +25824,40 @@ │ │ │ │ │ │ 00504 │ │ │ │ │ │ } │ │ │ │ │ │ 00505 │ │ │ │ │ │ } │ │ │ │ │ │ 00506 │ │ │ │ │ │ jet.n=jet.contents.size(); │ │ │ │ │ │ 00507 │ │ │ │ │ │ -// set the momentum in protocones │ │ │ │ │ │ 00508 │ │ │ │ │ │ +// set the momentum in protocones │ │ │ │ │ │ 00509 │ │ │ │ │ │ // (it was only known through eta and phi up to now) │ │ │ │ │ │ 00510 │ │ │ │ │ │ *c = jet.v; │ │ │ │ │ │ 00511 │ │ │ │ │ │ c->eta = eta; // restore exact original coords │ │ │ │ │ │ 00512 │ │ │ │ │ │ c->phi = phi; // to avoid rounding error inconsistencies │ │ │ │ │ │ 00513 │ │ │ │ │ │ -00514 │ │ │ │ │ │ // set the jet range │ │ │ │ │ │ +00514 │ │ │ │ │ │ 00515 │ │ │ │ │ │ jet.range=Ceta_phi_range(eta,phi,R); │ │ │ │ │ │ 00516 │ │ │ │ │ │ 00517 #ifdef DEBUG_SPLIT_MERGE │ │ │ │ │ │ 00518 │ │ │ │ │ │ cout « "adding jet: "; │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.48 split_merge.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +289 │ │ │ │ │ │ + │ │ │ │ │ │ 00519 │ │ │ │ │ │ for (int i2=0;i2size()==0) │ │ │ │ │ │ 00582 │ │ │ │ │ │ -00583 │ │ │ │ │ │ return 1; │ │ │ │ │ │ +00583 │ │ │ │ │ │ 00584 │ │ │ │ │ │ 00585 │ │ │ │ │ │ pt_min2 = ptmin*ptmin; │ │ │ │ │ │ 00586 │ │ │ │ │ │ R = sqrt(R2); │ │ │ │ │ │ 00587 │ │ │ │ │ │ 00588 │ │ │ │ │ │ @@ -26643,14 +25993,21 @@ │ │ │ │ │ │ // browse particles to create cone contents │ │ │ │ │ │ 00602 │ │ │ │ │ │ jet_candidate.v = Cmomentum(); │ │ │ │ │ │ 00603 │ │ │ │ │ │ jet_candidate.pt_tilde=0; │ │ │ │ │ │ 00604 │ │ │ │ │ │ jet_candidate.contents.clear(); │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 290 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00605 │ │ │ │ │ │ for (i=0;ieta = 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 │ │ │ │ │ │ @@ -26737,66 +26094,61 @@ │ │ │ │ │ │ 00651 │ │ │ │ │ │ found_jet = true; │ │ │ │ │ │ 00652 │ │ │ │ │ │ } │ │ │ │ │ │ 00653 │ │ │ │ │ │ } │ │ │ │ │ │ 00654 │ │ │ │ │ │ -// make sure at least one of the jets has passed the selection │ │ │ │ │ │ 00655 │ │ │ │ │ │ +// make sure at least one of the jets has passed the selection │ │ │ │ │ │ 00656 │ │ │ │ │ │ if (!found_jet) return 1; │ │ │ │ │ │ 00657 │ │ │ │ │ │ // add the jet to the list of jets │ │ │ │ │ │ 00658 │ │ │ │ │ │ 00659 │ │ │ │ │ │ jets.push_back(jet); │ │ │ │ │ │ 00660 │ │ │ │ │ │ jets[jets.size()-1].v.build_etaphi(); │ │ │ │ │ │ 00661 │ │ │ │ │ │ 00662 #ifdef DEBUG_SPLIT_MERGE │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.48 split_merge.cpp │ │ │ │ │ │ - │ │ │ │ │ │ 00663 │ │ │ │ │ │ cout « "PR-Jet " « jets.size() « " [size " « jet.contents.size() « "]:"; │ │ │ │ │ │ 00664 #endif │ │ │ │ │ │ 00665 │ │ │ │ │ │ -00666 │ │ │ │ │ │ // update the list of what particles are left │ │ │ │ │ │ +00666 │ │ │ │ │ │ 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) │ │ │ │ │ │ 00723 │ │ │ │ │ │ +if (candidates->size()==0) │ │ │ │ │ │ return 0; │ │ │ │ │ │ 00724 │ │ │ │ │ │ 00725 │ │ │ │ │ │ -if (overlap_tshold>=1.0 || overlap_tshold <= 0) { │ │ │ │ │ │ 00726 │ │ │ │ │ │ +if (overlap_tshold>=1.0 || overlap_tshold <= 0) { │ │ │ │ │ │ 00727 │ │ │ │ │ │ ostringstream message; │ │ │ │ │ │ 00728 │ │ │ │ │ │ message « "Illegal value for overlap_tshold, f = " « overlap_tshold; │ │ │ │ │ │ 00729 │ │ │ │ │ │ message « " (legal values are 0size()>0){ │ │ │ │ │ │ 00742 │ │ │ │ │ │ -00743 │ │ │ │ │ │ +if (candidates->size()>0){ │ │ │ │ │ │ // browse for the first jet │ │ │ │ │ │ +00743 │ │ │ │ │ │ 00744 │ │ │ │ │ │ j1 = candidates->begin(); │ │ │ │ │ │ 00745 │ │ │ │ │ │ // 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; │ │ │ │ │ │ 00766 #endif │ │ │ │ │ │ 00767 │ │ │ │ │ │ if (overlap2sm_var2){ │ │ │ │ │ │ -// split jets │ │ │ │ │ │ 00768 │ │ │ │ │ │ +// split jets │ │ │ │ │ │ 00769 │ │ │ │ │ │ split(j1, j2); │ │ │ │ │ │ 00770 │ │ │ │ │ │ // update iterators │ │ │ │ │ │ 00771 │ │ │ │ │ │ 00772 │ │ │ │ │ │ j2 = j1 = candidates->begin(); │ │ │ │ │ │ 00773 │ │ │ │ │ │ j2_relindex = 0; │ │ │ │ │ │ 00774 │ │ │ │ │ │ } else { │ │ │ │ │ │ -// merge jets │ │ │ │ │ │ 00775 │ │ │ │ │ │ +// merge jets │ │ │ │ │ │ 00776 │ │ │ │ │ │ merge(j1, j2); │ │ │ │ │ │ 00777 │ │ │ │ │ │ -// update iterators │ │ │ │ │ │ 00778 │ │ │ │ │ │ +// update iterators │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +291 │ │ │ │ │ │ + │ │ │ │ │ │ + 292 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00779 │ │ │ │ │ │ j2 = j1 = candidates->begin(); │ │ │ │ │ │ 00780 │ │ │ │ │ │ j2_relindex = 0; │ │ │ │ │ │ 00781 │ │ │ │ │ │ } │ │ │ │ │ │ 00782 │ │ │ │ │ │ @@ -27036,16 +26393,16 @@ │ │ │ │ │ │ 00816 │ │ │ │ │ │ sort(jets.begin(), jets.end(), jets_pt_less); │ │ │ │ │ │ 00817 #ifdef DEBUG_SPLIT_MERGE │ │ │ │ │ │ 00818 │ │ │ │ │ │ show(); │ │ │ │ │ │ 00819 #endif │ │ │ │ │ │ 00820 │ │ │ │ │ │ -return jets.size(); │ │ │ │ │ │ 00821 │ │ │ │ │ │ +return jets.size(); │ │ │ │ │ │ 00822 } │ │ │ │ │ │ 00823 │ │ │ │ │ │ 00824 │ │ │ │ │ │ 00825 │ │ │ │ │ │ 00826 // save the event on disk │ │ │ │ │ │ 00827 // - flux │ │ │ │ │ │ stream used to save jet contents │ │ │ │ │ │ @@ -27061,38 +26418,33 @@ │ │ │ │ │ │ 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"); │ │ │ │ │ │ for (it_j = jets.begin(), i1=0 ; it_j != jets.end() ; it_j++, i1++){ │ │ │ │ │ │ 00836 │ │ │ │ │ │ 00837 │ │ │ │ │ │ j1 = &(*it_j); │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.48 split_merge.cpp │ │ │ │ │ │ - │ │ │ │ │ │ 00838 │ │ │ │ │ │ j1->v.build_etaphi(); │ │ │ │ │ │ 00839 │ │ │ │ │ │ fprintf(flux, "%f\t%f\t%e\t%d\n", │ │ │ │ │ │ 00840 │ │ │ │ │ │ j1->v.eta, j1->v.phi, j1->v.perp(), j1->n); │ │ │ │ │ │ 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 │ │ │ │ │ │ +for (i2=0;i2n;i2++) │ │ │ │ │ │ 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 │ │ │ │ │ │ @@ -27107,79 +26459,84 @@ │ │ │ │ │ │ 00858 //-----------------------------------00859 int Csplit_merge::show(){ │ │ │ │ │ │ 00860 │ │ │ │ │ │ jet_iterator it_j; │ │ │ │ │ │ 00861 │ │ │ │ │ │ cjet_iterator it_c; │ │ │ │ │ │ 00862 │ │ │ │ │ │ Cjet *j; │ │ │ │ │ │ -const Cjet *c; │ │ │ │ │ │ 00863 │ │ │ │ │ │ -00864 │ │ │ │ │ │ +const Cjet *c; │ │ │ │ │ │ int i1, i2; │ │ │ │ │ │ +00864 │ │ │ │ │ │ 00865 │ │ │ │ │ │ -for (it_j = jets.begin(), i1=0 ; it_j != jets.end() ; it_j++, i1++){ │ │ │ │ │ │ 00866 │ │ │ │ │ │ +for (it_j = jets.begin(), i1=0 ; it_j != jets.end() ; it_j++, i1++){ │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.48 split_merge.cpp │ │ │ │ │ │ + │ │ │ │ │ │ 00867 │ │ │ │ │ │ j = &(*it_j); │ │ │ │ │ │ 00868 │ │ │ │ │ │ fprintf(stdout, "jet %2d: %e\t%e\t%e\t%e\t", i1+1, │ │ │ │ │ │ 00869 │ │ │ │ │ │ j->v.px, j->v.py, j->v.pz, j->v.E); │ │ │ │ │ │ -for (i2=0;i2n;i2++) │ │ │ │ │ │ 00870 │ │ │ │ │ │ +for (i2=0;i2n;i2++) │ │ │ │ │ │ 00871 │ │ │ │ │ │ fprintf(stdout, "%d ", j->contents[i2]); │ │ │ │ │ │ 00872 │ │ │ │ │ │ fprintf(stdout, "\n"); │ │ │ │ │ │ 00873 │ │ │ │ │ │ } │ │ │ │ │ │ 00874 │ │ │ │ │ │ -for (it_c = candidates->begin(), i1=0 ; it_c != candidates->end() ; it_c++, i1++){ │ │ │ │ │ │ 00875 │ │ │ │ │ │ +for (it_c = candidates->begin(), i1=0 ; it_c != candidates->end() ; it_c++, i1++){ │ │ │ │ │ │ 00876 │ │ │ │ │ │ c = &(*it_c); │ │ │ │ │ │ 00877 │ │ │ │ │ │ fprintf(stdout, "cdt %2d: %e\t%e\t%e\t%e\t%e\t", i1+1, │ │ │ │ │ │ 00878 │ │ │ │ │ │ c->v.px, c->v.py, c->v.pz, c->v.E, sqrt(c->sm_var2)); │ │ │ │ │ │ -00879 │ │ │ │ │ │ for (i2=0;i2n;i2++) │ │ │ │ │ │ +00879 │ │ │ │ │ │ 00880 │ │ │ │ │ │ fprintf(stdout, "%d ", c->contents[i2]); │ │ │ │ │ │ 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)) │ │ │ │ │ │ 00898 │ │ │ │ │ │ return false; │ │ │ │ │ │ 00899 │ │ │ │ │ │ int i1,i2; │ │ │ │ │ │ 00900 │ │ │ │ │ │ -bool is_overlap; │ │ │ │ │ │ 00901 │ │ │ │ │ │ +bool is_overlap; │ │ │ │ │ │ 00902 │ │ │ │ │ │ // initialise │ │ │ │ │ │ 00903 │ │ │ │ │ │ 00904 │ │ │ │ │ │ i1=i2=idx_size=0; │ │ │ │ │ │ 00905 │ │ │ │ │ │ is_overlap = false; │ │ │ │ │ │ @@ -27216,38 +26573,29 @@ │ │ │ │ │ │ indices[idx_size] = j1.contents[i1]; │ │ │ │ │ │ 00922 │ │ │ │ │ │ i1++; │ │ │ │ │ │ 00923 │ │ │ │ │ │ i2++; │ │ │ │ │ │ 00924 │ │ │ │ │ │ is_overlap = true; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -297 │ │ │ │ │ │ - │ │ │ │ │ │ - 298 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00925 │ │ │ │ │ │ } │ │ │ │ │ │ 00926 │ │ │ │ │ │ idx_size++; │ │ │ │ │ │ 00927 │ │ │ │ │ │ } while ((i1" all over the place │ │ │ │ │ │ 00970 │ │ │ │ │ │ 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; │ │ │ │ │ │ @@ -27346,20 +26703,20 @@ │ │ │ │ │ │ phi2 = tmp.phi; │ │ │ │ │ │ 00993 │ │ │ │ │ │ pt2_weight = (use_pt_weighted_splitting) ? 1.0/tmp.perp2() : 1.0; │ │ │ │ │ │ 00994 │ │ │ │ │ │ 00995 │ │ │ │ │ │ jet1.v = jet2.v = Cmomentum(); │ │ │ │ │ │ 00996 │ │ │ │ │ │ -00997 │ │ │ │ │ │ // compute jet splitting │ │ │ │ │ │ +00997 │ │ │ │ │ │ 00998 │ │ │ │ │ │ do{ │ │ │ │ │ │ -00999 │ │ │ │ │ │ if (j1.contents[i1]eta,v->phi); │ │ │ │ │ │ 01015 │ │ │ │ │ │ } else { // (j1.contents[i1]==j2.contents[i2]) │ │ │ │ │ │ 01016 │ │ │ │ │ │ @@ -27400,51 +26752,56 @@ │ │ │ │ │ │ 01018 │ │ │ │ │ │ // distance w.r.t. centroid 1 │ │ │ │ │ │ 01019 │ │ │ │ │ │ 01020 │ │ │ │ │ │ dx1 = eta1 - v->eta; │ │ │ │ │ │ 01021 │ │ │ │ │ │ dy1 = fabs(phi1 - v->phi); │ │ │ │ │ │ -if (dy1>M_PI) │ │ │ │ │ │ 01022 │ │ │ │ │ │ +if (dy1>M_PI) │ │ │ │ │ │ 01023 │ │ │ │ │ │ dy1 -= twopi; │ │ │ │ │ │ 01024 │ │ │ │ │ │ -01025 │ │ │ │ │ │ // distance w.r.t. centroid 2 │ │ │ │ │ │ +01025 │ │ │ │ │ │ 01026 │ │ │ │ │ │ dx2 = eta2 - v->eta; │ │ │ │ │ │ 01027 │ │ │ │ │ │ dy2 = fabs(phi2 - v->phi); │ │ │ │ │ │ -01028 │ │ │ │ │ │ if (dy2>M_PI) │ │ │ │ │ │ +01028 │ │ │ │ │ │ 01029 │ │ │ │ │ │ dy2 -= twopi; │ │ │ │ │ │ 01030 │ │ │ │ │ │ -//? what when == ? │ │ │ │ │ │ 01031 │ │ │ │ │ │ +//? what when == ? │ │ │ │ │ │ 01032 │ │ │ │ │ │ // When use_pt_weighted_splitting is activated, the │ │ │ │ │ │ 01033 │ │ │ │ │ │ // "geometrical" distance is weighted by the inverse │ │ │ │ │ │ 01034 │ │ │ │ │ │ // of the pt of the protojet │ │ │ │ │ │ 01035 │ │ │ │ │ │ double d1sq = (dx1*dx1+dy1*dy1)*pt1_weight; │ │ │ │ │ │ -double d2sq = (dx2*dx2+dy2*dy2)*pt2_weight; │ │ │ │ │ │ 01036 │ │ │ │ │ │ -01037 │ │ │ │ │ │ +double d2sq = (dx2*dx2+dy2*dy2)*pt2_weight; │ │ │ │ │ │ // 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 (d1sqerase(it_j1); │ │ │ │ │ │ 01090 │ │ │ │ │ │ candidates->erase(it_j2); │ │ │ │ │ │ 01091 │ │ │ │ │ │ -// reinsert new ones │ │ │ │ │ │ 01092 │ │ │ │ │ │ +// reinsert new ones │ │ │ │ │ │ 01093 │ │ │ │ │ │ insert(jet1); │ │ │ │ │ │ 01094 │ │ │ │ │ │ insert(jet2); │ │ │ │ │ │ 01095 │ │ │ │ │ │ 01096 │ │ │ │ │ │ return true; │ │ │ │ │ │ 01097 } │ │ │ │ │ │ 01098 │ │ │ │ │ │ 01099 // merge the two given jet. │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -299 │ │ │ │ │ │ - │ │ │ │ │ │ - 300 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 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’ │ │ │ │ │ │ 01104 // return true on success, false on error │ │ │ │ │ │ 01106 bool Csplit_merge::merge(cjet_iterator &it_j1, cjet_iterator &it_j2){ │ │ │ │ │ │ 01107 │ │ │ │ │ │ Cjet jet; │ │ │ │ │ │ int i; │ │ │ │ │ │ 01108 │ │ │ │ │ │ 01109 │ │ │ │ │ │ -// build new jet │ │ │ │ │ │ 01110 │ │ │ │ │ │ +// build new jet │ │ │ │ │ │ 01111 │ │ │ │ │ │ // note: particles within j1 & j2 have already been stored in indices │ │ │ │ │ │ 01112 │ │ │ │ │ │ for (i=0;irange, it_j2->range); │ │ │ │ │ │ 01121 │ │ │ │ │ │ // remove old candidates │ │ │ │ │ │ 01122 │ │ │ │ │ │ 01123 #ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES │ │ │ │ │ │ 01124 │ │ │ │ │ │ @@ -27597,50 +26945,59 @@ │ │ │ │ │ │ 01126 │ │ │ │ │ │ cand_refs.erase(it_j2->v.ref); │ │ │ │ │ │ 01127 │ │ │ │ │ │ } │ │ │ │ │ │ 01128 #endif │ │ │ │ │ │ 01129 │ │ │ │ │ │ candidates->erase(it_j1); │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +295 │ │ │ │ │ │ + │ │ │ │ │ │ + 296 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 01130 │ │ │ │ │ │ candidates->erase(it_j2); │ │ │ │ │ │ 01131 │ │ │ │ │ │ // reinsert new candidate │ │ │ │ │ │ 01132 │ │ │ │ │ │ 01133 │ │ │ │ │ │ insert(jet); │ │ │ │ │ │ 01134 │ │ │ │ │ │ -01135 │ │ │ │ │ │ return true; │ │ │ │ │ │ +01135 │ │ │ │ │ │ 01136 } │ │ │ │ │ │ 01137 │ │ │ │ │ │ 01143 bool Csplit_merge::insert(Cjet &jet){ │ │ │ │ │ │ 01144 │ │ │ │ │ │ -// eventually check that no other candidate are present with the │ │ │ │ │ │ 01145 │ │ │ │ │ │ +// eventually check that no other candidate are present with the │ │ │ │ │ │ 01146 │ │ │ │ │ │ // same cone contents. We recall that this automatic merging of │ │ │ │ │ │ 01147 │ │ │ │ │ │ // identical protocones can lead to infrared-unsafe situations. │ │ │ │ │ │ 01148 #ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES │ │ │ │ │ │ 01149 │ │ │ │ │ │ if ((merge_identical_protocones) && (!cand_refs.insert(jet.v.ref).second)) │ │ │ │ │ │ -return false; │ │ │ │ │ │ 01150 │ │ │ │ │ │ +return false; │ │ │ │ │ │ 01151 #endif │ │ │ │ │ │ 01152 │ │ │ │ │ │ -01153 │ │ │ │ │ │ // check that the protojet has large enough pt │ │ │ │ │ │ +01153 │ │ │ │ │ │ 01154 │ │ │ │ │ │ if (jet.v.perp2()insert(jet); │ │ │ │ │ │ @@ -27651,24 +27008,24 @@ │ │ │ │ │ │ 01165 │ │ │ │ │ │ 01172 double Csplit_merge::get_sm_var2(Cmomentum &v, double &pt_tilde){ │ │ │ │ │ │ switch(ptcomparison.split_merge_scale) { │ │ │ │ │ │ 01173 │ │ │ │ │ │ 01174 │ │ │ │ │ │ case SM_pt: │ │ │ │ │ │ return v.perp2(); │ │ │ │ │ │ +01175 │ │ │ │ │ │ case SM_mt: │ │ │ │ │ │ return v.perpmass2(); │ │ │ │ │ │ -01175 │ │ │ │ │ │ -01176 │ │ │ │ │ │ case SM_pttilde: return pt_tilde*pt_tilde; │ │ │ │ │ │ +01176 │ │ │ │ │ │ +01177 │ │ │ │ │ │ case SM_Et: │ │ │ │ │ │ return v.Et2(); │ │ │ │ │ │ -01177 │ │ │ │ │ │ -01178 │ │ │ │ │ │ default: │ │ │ │ │ │ +01178 │ │ │ │ │ │ 01179 │ │ │ │ │ │ throw Csiscone_error("Unsupported split-merge scale choice: " │ │ │ │ │ │ 01180 │ │ │ │ │ │ + ptcomparison.SM_scale_name()); │ │ │ │ │ │ 01181 │ │ │ │ │ │ } │ │ │ │ │ │ 01182 │ │ │ │ │ │ @@ -27676,38 +27033,28 @@ │ │ │ │ │ │ //return 0.0; │ │ │ │ │ │ 01184 } │ │ │ │ │ │ 01185 │ │ │ │ │ │ 01186 } │ │ │ │ │ │ │ │ │ │ │ │ 5.49 split_merge.h │ │ │ │ │ │ 00001 // -*- C++ -*00003 // File: split_merge.h │ │ │ │ │ │ -00004 // Description: header file for splitting/merging (contains the CJet class) │ │ │ │ │ │ -00005 // This file is part of the SISCone project. │ │ │ │ │ │ -// │ │ │ │ │ │ - │ │ │ │ │ │ // │ │ │ │ │ │ +00004 // Description: header file for splitting/merging (contains the CJet class) // │ │ │ │ │ │ +00005 // This file is part of the SISCone project. │ │ │ │ │ │ // │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.49 split_merge.h │ │ │ │ │ │ - │ │ │ │ │ │ -301 │ │ │ │ │ │ - │ │ │ │ │ │ 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 │ │ │ │ │ │ @@ -27738,14 +27085,23 @@ │ │ │ │ │ │ 00027 // $Date:: 2016-05-22 12:14:42 +0200 (Sun, 22 May 2016) │ │ │ │ │ │ $// │ │ │ │ │ │ 00029 │ │ │ │ │ │ 00030 #ifndef __SPH_SPLIT_MERGE_H__ │ │ │ │ │ │ 00031 #define __SPH_SPLIT_MERGE_H__ │ │ │ │ │ │ 00032 │ │ │ │ │ │ 00033 #include │ │ │ │ │ │ + │ │ │ │ │ │ +// │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.49 split_merge.h │ │ │ │ │ │ + │ │ │ │ │ │ +297 │ │ │ │ │ │ + │ │ │ │ │ │ 00034 #include │ │ │ │ │ │ 00035 #include "geom_2d.h" │ │ │ │ │ │ 00036 #include "momentum.h" │ │ │ │ │ │ 00037 #include │ │ │ │ │ │ 00038 #include │ │ │ │ │ │ 00039 #include │ │ │ │ │ │ 00040 #include │ │ │ │ │ │ @@ -27774,16 +27130,16 @@ │ │ │ │ │ │ 00068 │ │ │ │ │ │ double sm_var2; │ │ │ │ │ │ 00080 │ │ │ │ │ │ 00081 │ │ │ │ │ │ 00083 │ │ │ │ │ │ CSphtheta_phi_range range; │ │ │ │ │ │ 00084 │ │ │ │ │ │ -00089 │ │ │ │ │ │ int pass; │ │ │ │ │ │ +00089 │ │ │ │ │ │ 00090 }; │ │ │ │ │ │ 00091 │ │ │ │ │ │ 00094 │ │ │ │ │ │ 00096 bool jets_E_less(const CSphjet &j1, const CSphjet &j2); │ │ │ │ │ │ 00097 │ │ │ │ │ │ 00098 │ │ │ │ │ │ 00106 enum Esplit_merge_scale { │ │ │ │ │ │ @@ -27800,37 +27156,30 @@ │ │ │ │ │ │ 00122 │ │ │ │ │ │ CSphsplit_merge_ptcomparison() : │ │ │ │ │ │ 00123 │ │ │ │ │ │ particles(0), split_merge_scale(SM_Etilde){}; │ │ │ │ │ │ 00124 │ │ │ │ │ │ 00126 │ │ │ │ │ │ std::string SM_scale_name()const { │ │ │ │ │ │ -return split_merge_scale_name(split_merge_scale);} │ │ │ │ │ │ 00127 │ │ │ │ │ │ +return split_merge_scale_name(split_merge_scale);} │ │ │ │ │ │ 00128 │ │ │ │ │ │ 00129 │ │ │ │ │ │ std::vector * particles; │ │ │ │ │ │ 00130 │ │ │ │ │ │ std::vector * particles_norm2; │ │ │ │ │ │ 00131 │ │ │ │ │ │ 00133 │ │ │ │ │ │ bool operator()(const CSphjet &jet1, const CSphjet &jet2) const; │ │ │ │ │ │ 00134 │ │ │ │ │ │ 00146 │ │ │ │ │ │ void get_difference(const CSphjet &j1, const CSphjet &j2, CSphmomentum *v, double *E_tilde) const; │ │ │ │ │ │ 00147 │ │ │ │ │ │ 00158 │ │ │ │ │ │ Esplit_merge_scale split_merge_scale; │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 302 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00159 }; │ │ │ │ │ │ 00160 │ │ │ │ │ │ 00161 │ │ │ │ │ │ 00162 // iterator types │ │ │ │ │ │ 00164 typedef std::multiset::iterator │ │ │ │ │ │ cjet_iterator; │ │ │ │ │ │ 00165 │ │ │ │ │ │ @@ -27843,173 +27192,183 @@ │ │ │ │ │ │ 00178 │ │ │ │ │ │ CSphsplit_merge(); │ │ │ │ │ │ 00179 │ │ │ │ │ │ 00181 │ │ │ │ │ │ ~CSphsplit_merge(); │ │ │ │ │ │ 00182 │ │ │ │ │ │ 00183 │ │ │ │ │ │ -// initialisation functions // │ │ │ │ │ │ 00185 │ │ │ │ │ │ +// initialisation functions // │ │ │ │ │ │ 00187 │ │ │ │ │ │ -int init(std::vector &_particles, std::vector *protocones, double R2, │ │ │ │ │ │ 00196 │ │ │ │ │ │ +int init(std::vector &_particles, std::vector *protocones, double R2, │ │ │ │ │ │ double Emin=0.0); │ │ │ │ │ │ 00197 │ │ │ │ │ │ -int init_particles(std::vector &_particles); │ │ │ │ │ │ 00203 │ │ │ │ │ │ +int init_particles(std::vector &_particles); │ │ │ │ │ │ 00204 │ │ │ │ │ │ int init_pleft(); │ │ │ │ │ │ 00208 │ │ │ │ │ │ 00209 │ │ │ │ │ │ inline int set_E_weighted_splitting(bool _use_E_weighted_splitting){ │ │ │ │ │ │ 00221 │ │ │ │ │ │ 00222 │ │ │ │ │ │ use_E_weighted_splitting = _use_E_weighted_splitting; │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 298 │ │ │ │ │ │ + │ │ │ │ │ │ 00223 │ │ │ │ │ │ -return 0; │ │ │ │ │ │ 00224 │ │ │ │ │ │ -} │ │ │ │ │ │ 00225 │ │ │ │ │ │ -// cleaning functions // │ │ │ │ │ │ 00227 │ │ │ │ │ │ 00229 │ │ │ │ │ │ 00231 │ │ │ │ │ │ -int partial_clear(); │ │ │ │ │ │ 00232 │ │ │ │ │ │ -int full_clear(); │ │ │ │ │ │ 00234 │ │ │ │ │ │ 00235 │ │ │ │ │ │ -// user-defined stable-cone ordering // │ │ │ │ │ │ 00237 │ │ │ │ │ │ 00239 │ │ │ │ │ │ 00245 │ │ │ │ │ │ -class Cuser_scale_base{ │ │ │ │ │ │ 00246 │ │ │ │ │ │ -public: │ │ │ │ │ │ -virtual ~Cuser_scale_base(){} │ │ │ │ │ │ 00248 │ │ │ │ │ │ 00249 │ │ │ │ │ │ -virtual double operator()(const CSphjet & jet) const = 0; │ │ │ │ │ │ 00254 │ │ │ │ │ │ 00255 │ │ │ │ │ │ -virtual bool is_larger(const CSphjet & a, const CSphjet & b)const{ │ │ │ │ │ │ 00266 │ │ │ │ │ │ 00267 │ │ │ │ │ │ -return (a.sm_var2 > b.sm_var2); │ │ │ │ │ │ 00268 │ │ │ │ │ │ -} │ │ │ │ │ │ 00269 │ │ │ │ │ │ -}; │ │ │ │ │ │ 00270 │ │ │ │ │ │ -void set_user_scale(const Cuser_scale_base * user_scale_in){ │ │ │ │ │ │ 00275 │ │ │ │ │ │ 00276 │ │ │ │ │ │ -_user_scale = user_scale_in; │ │ │ │ │ │ 00277 │ │ │ │ │ │ -} │ │ │ │ │ │ 00278 │ │ │ │ │ │ 00280 │ │ │ │ │ │ -const Cuser_scale_base * user_scale()const { return _user_scale; } │ │ │ │ │ │ 00281 │ │ │ │ │ │ 00282 │ │ │ │ │ │ -// main parts of the algorithm // │ │ │ │ │ │ 00284 │ │ │ │ │ │ 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 │ │ │ │ │ │ 00328 │ │ │ │ │ │ -int perform(double overlap_tshold, double Emin=0.0); │ │ │ │ │ │ 00329 │ │ │ │ │ │ 00330 │ │ │ │ │ │ -// save and debug functions // │ │ │ │ │ │ 00332 │ │ │ │ │ │ 00334 │ │ │ │ │ │ -int save_contents(FILE *flux); │ │ │ │ │ │ 00337 │ │ │ │ │ │ 00338 │ │ │ │ │ │ 00340 │ │ │ │ │ │ -int show(); │ │ │ │ │ │ 00341 │ │ │ │ │ │ -// particle information │ │ │ │ │ │ 00342 │ │ │ │ │ │ 00343 │ │ │ │ │ │ -int n; │ │ │ │ │ │ 00344 │ │ │ │ │ │ -std::vector particles; │ │ │ │ │ │ 00345 │ │ │ │ │ │ -std::vector particles_norm2; │ │ │ │ │ │ 00346 │ │ │ │ │ │ -int n_left; │ │ │ │ │ │ 00347 │ │ │ │ │ │ -std::vector p_remain; │ │ │ │ │ │ 00348 │ │ │ │ │ │ -std::vector p_uncol_hard; │ │ │ │ │ │ 00349 │ │ │ │ │ │ -int n_pass; │ │ │ │ │ │ 00350 │ │ │ │ │ │ -double most_ambiguous_split; │ │ │ │ │ │ 00354 │ │ │ │ │ │ 00355 │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.50 split_merge.h │ │ │ │ │ │ - │ │ │ │ │ │ 00356 │ │ │ │ │ │ -// jets information │ │ │ │ │ │ 00357 │ │ │ │ │ │ -std::vector jets; │ │ │ │ │ │ 00358 │ │ │ │ │ │ 00359 │ │ │ │ │ │ -// working entries │ │ │ │ │ │ 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 │ │ │ │ │ │ -double stable_cone_soft_E2_cutoff; │ │ │ │ │ │ 00391 │ │ │ │ │ │ 00392 │ │ │ │ │ │ -00393 private: │ │ │ │ │ │ -bool get_overlap(const CSphjet &j1, const CSphjet &j2, double *v); │ │ │ │ │ │ +00393 │ │ │ │ │ │ 00401 │ │ │ │ │ │ 00402 │ │ │ │ │ │ 00403 │ │ │ │ │ │ -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 │ │ │ │ │ │ 00442 │ │ │ │ │ │ -void compute_Etilde(CSphjet &j); │ │ │ │ │ │ 00444 │ │ │ │ │ │ 00445 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +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); │ │ │ │ │ │ +bool split(cjet_iterator &it_j1, cjet_iterator &it_j2); │ │ │ │ │ │ +bool merge(cjet_iterator &it_j1, cjet_iterator &it_j2); │ │ │ │ │ │ +bool insert(CSphjet &jet); │ │ │ │ │ │ +double get_sm_var2(CSphmomentum &v, double &E_tilde); │ │ │ │ │ │ +void compute_Etilde(CSphjet &j); │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.50 split_merge.h │ │ │ │ │ │ + │ │ │ │ │ │ 00446 │ │ │ │ │ │ // jet information │ │ │ │ │ │ 00448 #ifdef SISCONE_USES_UNIQUE_PTR_AS_AUTO_PTR │ │ │ │ │ │ 00449 │ │ │ │ │ │ std::unique_ptr > candidates; │ │ │ │ │ │ 00450 #else │ │ │ │ │ │ 00451 │ │ │ │ │ │ @@ -28079,23 +27438,14 @@ │ │ │ │ │ │ // │ │ │ │ │ │ 00024 // $Revision:: 405 │ │ │ │ │ │ $// │ │ │ │ │ │ 00025 // $Date:: 2016-05-23 20:15:02 +0200 (Mon, 23 May 2016) │ │ │ │ │ │ $// │ │ │ │ │ │ 00027 │ │ │ │ │ │ 00028 #ifndef __SPLIT_MERGE_H__ │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ -303 │ │ │ │ │ │ - │ │ │ │ │ │ - 304 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ 00029 #define __SPLIT_MERGE_H__ │ │ │ │ │ │ 00030 │ │ │ │ │ │ 00031 #include │ │ │ │ │ │ 00032 #include "defines.h" │ │ │ │ │ │ 00033 #include "geom_2d.h" │ │ │ │ │ │ 00034 #include "momentum.h" │ │ │ │ │ │ 00035 #include │ │ │ │ │ │ @@ -28114,24 +27464,33 @@ │ │ │ │ │ │ Cjet(); │ │ │ │ │ │ 00058 │ │ │ │ │ │ 00060 │ │ │ │ │ │ ~Cjet(); │ │ │ │ │ │ 00061 │ │ │ │ │ │ 00062 │ │ │ │ │ │ Cmomentum v; │ │ │ │ │ │ -double pt_tilde; │ │ │ │ │ │ 00063 │ │ │ │ │ │ -00064 │ │ │ │ │ │ +double pt_tilde; │ │ │ │ │ │ int n; │ │ │ │ │ │ +00064 │ │ │ │ │ │ 00065 │ │ │ │ │ │ std::vector contents; │ │ │ │ │ │ 00066 │ │ │ │ │ │ -double sm_var2; │ │ │ │ │ │ 00073 │ │ │ │ │ │ +double sm_var2; │ │ │ │ │ │ 00074 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +299 │ │ │ │ │ │ + │ │ │ │ │ │ + 300 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ 00076 │ │ │ │ │ │ Ceta_phi_range range; │ │ │ │ │ │ 00077 │ │ │ │ │ │ int pass; │ │ │ │ │ │ 00082 │ │ │ │ │ │ 00083 }; │ │ │ │ │ │ 00084 │ │ │ │ │ │ @@ -28156,16 +27515,16 @@ │ │ │ │ │ │ 00119 │ │ │ │ │ │ Csplit_merge_ptcomparison() : │ │ │ │ │ │ 00120 │ │ │ │ │ │ particles(0), split_merge_scale(SM_pttilde){}; │ │ │ │ │ │ 00121 │ │ │ │ │ │ 00123 │ │ │ │ │ │ std::string SM_scale_name()const { │ │ │ │ │ │ -00124 │ │ │ │ │ │ return split_merge_scale_name(split_merge_scale);} │ │ │ │ │ │ +00124 │ │ │ │ │ │ 00125 │ │ │ │ │ │ 00126 │ │ │ │ │ │ std::vector * particles; │ │ │ │ │ │ 00127 │ │ │ │ │ │ std::vector * pt; │ │ │ │ │ │ 00128 │ │ │ │ │ │ 00130 │ │ │ │ │ │ @@ -28191,196 +27550,186 @@ │ │ │ │ │ │ 00183 │ │ │ │ │ │ Csplit_merge(); │ │ │ │ │ │ 00184 │ │ │ │ │ │ 00186 │ │ │ │ │ │ ~Csplit_merge(); │ │ │ │ │ │ 00187 │ │ │ │ │ │ 00188 │ │ │ │ │ │ -// initialisation functions // │ │ │ │ │ │ 00190 │ │ │ │ │ │ +// initialisation functions // │ │ │ │ │ │ 00192 │ │ │ │ │ │ 00201 │ │ │ │ │ │ int init(std::vector &_particles, std::vector *protocones, double R2, double │ │ │ │ │ │ ptmin=0.0); │ │ │ │ │ │ 00202 │ │ │ │ │ │ 00208 │ │ │ │ │ │ int init_particles(std::vector &_particles); │ │ │ │ │ │ 00209 │ │ │ │ │ │ -00213 │ │ │ │ │ │ int init_pleft(); │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.50 split_merge.h │ │ │ │ │ │ - │ │ │ │ │ │ +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 │ │ │ │ │ │ +return (a.sm_var2 > b.sm_var2); │ │ │ │ │ │ 00272 │ │ │ │ │ │ 00273 │ │ │ │ │ │ +} │ │ │ │ │ │ 00274 │ │ │ │ │ │ +}; │ │ │ │ │ │ 00275 │ │ │ │ │ │ 00280 │ │ │ │ │ │ +void set_user_scale(const Cuser_scale_base * user_scale_in){ │ │ │ │ │ │ 00281 │ │ │ │ │ │ +_user_scale = user_scale_in; │ │ │ │ │ │ 00282 │ │ │ │ │ │ +} │ │ │ │ │ │ 00283 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.51 vicinity.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +301 │ │ │ │ │ │ + │ │ │ │ │ │ 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 │ │ │ │ │ │ +00396 private: │ │ │ │ │ │ 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 │ │ │ │ │ │ 00445 │ │ │ │ │ │ - │ │ │ │ │ │ -305 │ │ │ │ │ │ - │ │ │ │ │ │ -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 by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 306 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -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 │ │ │ │ │ │ 00453 │ │ │ │ │ │ -00455 │ │ │ │ │ │ double pt_min2; │ │ │ │ │ │ +00455 │ │ │ │ │ │ 00456 │ │ │ │ │ │ -bool use_pt_weighted_splitting; │ │ │ │ │ │ 00462 │ │ │ │ │ │ +bool use_pt_weighted_splitting; │ │ │ │ │ │ 00463 │ │ │ │ │ │ const Cuser_scale_base *_user_scale; │ │ │ │ │ │ 00466 │ │ │ │ │ │ 00467 │ │ │ │ │ │ 00468 #ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES │ │ │ │ │ │ 00470 │ │ │ │ │ │ std::set cand_refs; │ │ │ │ │ │ @@ -28388,388 +27737,1035 @@ │ │ │ │ │ │ 00472 }; │ │ │ │ │ │ 00473 │ │ │ │ │ │ 00474 } │ │ │ │ │ │ 00475 │ │ │ │ │ │ 00476 │ │ │ │ │ │ 00477 #endif │ │ │ │ │ │ │ │ │ │ │ │ -5.51 vicinity.h │ │ │ │ │ │ -00001 // -*- C++ -*00003 // File: vicinity.h │ │ │ │ │ │ +5.51 vicinity.cpp │ │ │ │ │ │ +00001 │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 302 │ │ │ │ │ │ + │ │ │ │ │ │ +00002 // File: vicinity.cpp │ │ │ │ │ │ // │ │ │ │ │ │ -00004 // Description: header file for particle vicinity (Cvicinity class) │ │ │ │ │ │ +00003 // Description: source file for particle vicinity (Cvicinity class) │ │ │ │ │ │ // │ │ │ │ │ │ -00005 // This file is part of the SISCone project. │ │ │ │ │ │ +00004 // This file is part of the SISCone project. │ │ │ │ │ │ // │ │ │ │ │ │ -00006 // WARNING: this is not the main SISCone trunk but │ │ │ │ │ │ +00005 // WARNING: this is not the main SISCone trunk but │ │ │ │ │ │ // │ │ │ │ │ │ -00007 // │ │ │ │ │ │ +00006 // │ │ │ │ │ │ an adaptation to spherical coordinates │ │ │ │ │ │ // │ │ │ │ │ │ -00008 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ +00007 // For more details, see http://projects.hepforge.org/siscone │ │ │ │ │ │ // │ │ │ │ │ │ -00009 // │ │ │ │ │ │ +00008 // │ │ │ │ │ │ // │ │ │ │ │ │ -00010 // Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez │ │ │ │ │ │ -00011 // │ │ │ │ │ │ +00009 // Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez │ │ │ │ │ │ +00010 // │ │ │ │ │ │ // │ │ │ │ │ │ -00012 // This program is free software; you can redistribute it and/or modify │ │ │ │ │ │ +00011 // 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 │ │ │ │ │ │ +00012 // 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 │ │ │ │ │ │ +00013 // the Free Software Foundation; either version 2 of the License, or │ │ │ │ │ │ // │ │ │ │ │ │ -00015 // (at your option) any later version. │ │ │ │ │ │ +00014 // (at your option) any later version. │ │ │ │ │ │ // │ │ │ │ │ │ -00016 // │ │ │ │ │ │ +00015 // │ │ │ │ │ │ // │ │ │ │ │ │ -00017 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ +00016 // This program is distributed in the hope that it will be useful, │ │ │ │ │ │ // │ │ │ │ │ │ -00018 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ +00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of │ │ │ │ │ │ // │ │ │ │ │ │ -00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ +00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the │ │ │ │ │ │ // │ │ │ │ │ │ -00020 // GNU General Public License for more details. │ │ │ │ │ │ +00019 // GNU General Public License for more details. │ │ │ │ │ │ // │ │ │ │ │ │ -00021 // │ │ │ │ │ │ +00020 // │ │ │ │ │ │ // │ │ │ │ │ │ -00022 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ +00021 // You should have received a copy of the GNU General Public License │ │ │ │ │ │ // │ │ │ │ │ │ -00023 // along with this program; if not, write to the Free Software │ │ │ │ │ │ +00022 // 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 // │ │ │ │ │ │ +00023 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // │ │ │ │ │ │ +00024 // │ │ │ │ │ │ // │ │ │ │ │ │ -00026 // $Revision:: 255 │ │ │ │ │ │ +00025 // $Revision:: 255 │ │ │ │ │ │ $// │ │ │ │ │ │ -00027 // $Date:: 2008-07-12 17:40:35 +0200 (Sat, 12 Jul 2008) │ │ │ │ │ │ +00026 // $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 │ │ │ │ │ │ +00028 │ │ │ │ │ │ +00029 #include "vicinity.h" │ │ │ │ │ │ +00030 #include │ │ │ │ │ │ +00031 #include │ │ │ │ │ │ +00032 #include │ │ │ │ │ │ +00033 │ │ │ │ │ │ +00034 namespace siscone_spherical{ │ │ │ │ │ │ +00035 │ │ │ │ │ │ +00036 using namespace std; │ │ │ │ │ │ +00037 │ │ │ │ │ │ +00038 /************************************************************* │ │ │ │ │ │ +00039 * CSphvicinity_elm implementation │ │ │ │ │ │ +* │ │ │ │ │ │ +00040 * element in the vicinity of a parent. │ │ │ │ │ │ +00041 * class used to manage one points in the vicinity │ │ │ │ │ │ +* │ │ │ │ │ │ +00042 * of a parent point. │ │ │ │ │ │ +00043 *************************************************************/ │ │ │ │ │ │ 00044 │ │ │ │ │ │ -00052 class CSphvicinity_elm{ │ │ │ │ │ │ -00053 public: │ │ │ │ │ │ -00055 │ │ │ │ │ │ -CSphmomentum *v; │ │ │ │ │ │ -00056 │ │ │ │ │ │ -00058 │ │ │ │ │ │ -siscone::Cvicinity_inclusion *is_inside; │ │ │ │ │ │ +00045 // ordering pointers to CSphvicinity_elm │ │ │ │ │ │ +00046 //--------------------------------------00047 bool ve_less(CSphvicinity_elm *ve1, CSphvicinity_elm *ve2){ │ │ │ │ │ │ +00048 │ │ │ │ │ │ +return ve1->angle < ve2->angle; │ │ │ │ │ │ +00049 } │ │ │ │ │ │ +00050 │ │ │ │ │ │ +00051 │ │ │ │ │ │ +00052 /************************************************************* │ │ │ │ │ │ +00053 * CSphvicinity implementation │ │ │ │ │ │ +* │ │ │ │ │ │ +00054 * list of element in the vicinity of a parent. │ │ │ │ │ │ +* │ │ │ │ │ │ +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 *************************************************************/ │ │ │ │ │ │ 00059 │ │ │ │ │ │ -00060 │ │ │ │ │ │ -// centre variables │ │ │ │ │ │ -00061 │ │ │ │ │ │ -CSph3vector centre; │ │ │ │ │ │ -double angle; │ │ │ │ │ │ -00062 │ │ │ │ │ │ +00060 // default constructor │ │ │ │ │ │ +00061 //--------------------00062 CSphvicinity::CSphvicinity(){ │ │ │ │ │ │ 00063 │ │ │ │ │ │ -bool side; │ │ │ │ │ │ -double cocircular_range; │ │ │ │ │ │ +n_part = 0; │ │ │ │ │ │ 00064 │ │ │ │ │ │ -00066 │ │ │ │ │ │ +00065 │ │ │ │ │ │ +ve_list = NULL; │ │ │ │ │ │ +00066 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ +00067 │ │ │ │ │ │ +quadtree = NULL; │ │ │ │ │ │ +00068 #endif │ │ │ │ │ │ 00069 │ │ │ │ │ │ -std::list cocircular; │ │ │ │ │ │ +00070 │ │ │ │ │ │ +parent = NULL; │ │ │ │ │ │ +00071 │ │ │ │ │ │ +VR2 = VR = 0.0; │ │ │ │ │ │ +00072 │ │ │ │ │ │ +00073 } │ │ │ │ │ │ +00074 │ │ │ │ │ │ +00075 // constructor with initialisation │ │ │ │ │ │ +00076 //--------------------------------00077 CSphvicinity::CSphvicinity(vector &_particle_list){ │ │ │ │ │ │ +00078 │ │ │ │ │ │ +parent = NULL; │ │ │ │ │ │ +00079 │ │ │ │ │ │ +ve_list = NULL; │ │ │ │ │ │ +00080 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ +00081 │ │ │ │ │ │ +quadtree = NULL; │ │ │ │ │ │ +00082 #endif │ │ │ │ │ │ +00083 │ │ │ │ │ │ +cosVR = VR2 = tan2R = VR = 0.0; │ │ │ │ │ │ +00084 │ │ │ │ │ │ +00085 │ │ │ │ │ │ +set_particle_list(_particle_list); │ │ │ │ │ │ +00086 } │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ │ │ │ │ │ │ // │ │ │ │ │ │ │ │ │ │ │ │ +* │ │ │ │ │ │ +* │ │ │ │ │ │ + │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 5.52 vicinity.h │ │ │ │ │ │ + 5.51 vicinity.cpp │ │ │ │ │ │ │ │ │ │ │ │ -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 │ │ │ │ │ │ +00088 // default destructor │ │ │ │ │ │ +00089 //-------------------00090 CSphvicinity::~CSphvicinity(){ │ │ │ │ │ │ +if (ve_list!=NULL) │ │ │ │ │ │ +00091 │ │ │ │ │ │ 00092 │ │ │ │ │ │ -~CSphvicinity(); │ │ │ │ │ │ +delete[] ve_list; │ │ │ │ │ │ 00093 │ │ │ │ │ │ -00098 │ │ │ │ │ │ -void set_particle_list(std::vector &_particle_list); │ │ │ │ │ │ +00094 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ +00095 │ │ │ │ │ │ +if (quadtree!=NULL) │ │ │ │ │ │ +00096 │ │ │ │ │ │ +delete quadtree; │ │ │ │ │ │ +00097 #endif │ │ │ │ │ │ +00098 } │ │ │ │ │ │ 00099 │ │ │ │ │ │ -00105 │ │ │ │ │ │ -void build(CSphmomentum *_parent, double _VR); │ │ │ │ │ │ +00100 /* │ │ │ │ │ │ +00101 * set the particle_list │ │ │ │ │ │ +list of particles (type CSphmomentum) │ │ │ │ │ │ +00102 * - particle_list │ │ │ │ │ │ +00103 * - n │ │ │ │ │ │ +number of particles in the list │ │ │ │ │ │ +00104 ************************************************************/ │ │ │ │ │ │ +00105 void CSphvicinity::set_particle_list(vector &_particle_list){ │ │ │ │ │ │ 00106 │ │ │ │ │ │ -// cone kinematical information │ │ │ │ │ │ -00107 │ │ │ │ │ │ +int i,j; │ │ │ │ │ │ +00107 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ 00108 │ │ │ │ │ │ -CSphmomentum *parent; │ │ │ │ │ │ -00109 │ │ │ │ │ │ -double VR; │ │ │ │ │ │ -double VR2; │ │ │ │ │ │ +double eta_max=0.0; │ │ │ │ │ │ +00109 #endif │ │ │ │ │ │ 00110 │ │ │ │ │ │ 00111 │ │ │ │ │ │ -double cosVR; │ │ │ │ │ │ +// if the particle list is not empty, destroy it ! │ │ │ │ │ │ 00112 │ │ │ │ │ │ -double R; │ │ │ │ │ │ -double R2; │ │ │ │ │ │ +if (ve_list!=NULL){ │ │ │ │ │ │ 00113 │ │ │ │ │ │ +delete[] ve_list; │ │ │ │ │ │ 00114 │ │ │ │ │ │ -double tan2R; │ │ │ │ │ │ -double D2_R; │ │ │ │ │ │ +} │ │ │ │ │ │ 00115 │ │ │ │ │ │ -00116 │ │ │ │ │ │ -double inv_R_EPS_COCIRC; │ │ │ │ │ │ -double inv_R_2EPS_COCIRC; │ │ │ │ │ │ +vicinity.clear(); │ │ │ │ │ │ +00116 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ 00117 │ │ │ │ │ │ +if (quadtree!=NULL) │ │ │ │ │ │ 00118 │ │ │ │ │ │ -00119 │ │ │ │ │ │ -// particle list information │ │ │ │ │ │ +delete quadtree; │ │ │ │ │ │ +00119 #endif │ │ │ │ │ │ 00120 │ │ │ │ │ │ -int n_part; │ │ │ │ │ │ 00121 │ │ │ │ │ │ -std::vector plist; │ │ │ │ │ │ +// allocate memory array for particles │ │ │ │ │ │ +00122 │ │ │ │ │ │ +// Note: - we compute max for |eta| │ │ │ │ │ │ 00123 │ │ │ │ │ │ -std::vector pincluded; │ │ │ │ │ │ +// │ │ │ │ │ │ +- we allocate indices to particles │ │ │ │ │ │ 00124 │ │ │ │ │ │ -CSphvicinity_elm *ve_list; │ │ │ │ │ │ -00125 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ +n_part = 0; │ │ │ │ │ │ +00125 │ │ │ │ │ │ +plist.clear(); │ │ │ │ │ │ 00126 │ │ │ │ │ │ -siscone::Cquadtree *quadtree; │ │ │ │ │ │ -00127 #endif │ │ │ │ │ │ +pincluded.clear(); │ │ │ │ │ │ +00127 │ │ │ │ │ │ +for (i=0;i<(int) _particle_list.size();i++){ │ │ │ │ │ │ 00128 │ │ │ │ │ │ +// if a particle is colinear with the beam (infinite rapidity) │ │ │ │ │ │ 00129 │ │ │ │ │ │ -// vicinity information │ │ │ │ │ │ +// we do not take it into account │ │ │ │ │ │ 00130 │ │ │ │ │ │ -std::vector vicinity; │ │ │ │ │ │ +//if (fabs(_particle_list[i].pz)!=_particle_list[i].E){ │ │ │ │ │ │ 00131 │ │ │ │ │ │ -unsigned int vicinity_size; │ │ │ │ │ │ +plist.push_back(_particle_list[i]); │ │ │ │ │ │ 00132 │ │ │ │ │ │ -00133 protected: │ │ │ │ │ │ +pincluded.push_back(siscone::Cvicinity_inclusion()); // zero inclusion status │ │ │ │ │ │ +00133 │ │ │ │ │ │ +00134 │ │ │ │ │ │ +// the parent_index is handled in the split_merge because │ │ │ │ │ │ +00135 │ │ │ │ │ │ +// of our multiple-pass procedure. │ │ │ │ │ │ +00136 │ │ │ │ │ │ +// Hence, it is not required here any longer. │ │ │ │ │ │ +00137 │ │ │ │ │ │ +// plist[n_part].parent_index = i; │ │ │ │ │ │ +00138 │ │ │ │ │ │ +plist[n_part].index = n_part; │ │ │ │ │ │ 00139 │ │ │ │ │ │ -void append_to_vicinity(CSphmomentum *v); │ │ │ │ │ │ +// make sure the reference is randomly created │ │ │ │ │ │ 00140 │ │ │ │ │ │ -// internal variables │ │ │ │ │ │ 00141 │ │ │ │ │ │ +plist[n_part].ref.randomize(); │ │ │ │ │ │ 00142 │ │ │ │ │ │ -CSph3vector parent_centre; │ │ │ │ │ │ -00143 │ │ │ │ │ │ -CSph3vector angular_dir1; │ │ │ │ │ │ +00143 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ 00144 │ │ │ │ │ │ -CSph3vector angular_dir2; │ │ │ │ │ │ -00145 }; │ │ │ │ │ │ +if (fabs(plist[n_part].eta)>eta_max) eta_max=fabs(plist[n_part].eta); │ │ │ │ │ │ +00145 #endif │ │ │ │ │ │ 00146 │ │ │ │ │ │ -00147 } │ │ │ │ │ │ +n_part++; │ │ │ │ │ │ +00147 │ │ │ │ │ │ +//} │ │ │ │ │ │ 00148 │ │ │ │ │ │ -00149 #endif │ │ │ │ │ │ +} │ │ │ │ │ │ +00149 │ │ │ │ │ │ +// 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 │ │ │ │ │ │ +00158 │ │ │ │ │ │ +// append particle to the vicinity_elm list │ │ │ │ │ │ +00159 │ │ │ │ │ │ +j = 0; │ │ │ │ │ │ +00160 │ │ │ │ │ │ +for (i=0;iadd(&plist[i]); │ │ │ │ │ │ +00163 #endif │ │ │ │ │ │ +00164 │ │ │ │ │ │ +ve_list[j].v = ve_list[j+1].v = &plist[i]; │ │ │ │ │ │ +00165 │ │ │ │ │ │ +ve_list[j].is_inside = ve_list[j+1].is_inside = &(pincluded[i]); │ │ │ │ │ │ +00166 │ │ │ │ │ │ +j+=2; │ │ │ │ │ │ +00167 │ │ │ │ │ │ +} │ │ │ │ │ │ +00168 │ │ │ │ │ │ +00169 } │ │ │ │ │ │ +00170 │ │ │ │ │ │ +00171 │ │ │ │ │ │ +00172 /* │ │ │ │ │ │ +00173 * build the vicinity list from a list of points. │ │ │ │ │ │ │ │ │ │ │ │ -5.52 vicinity.h │ │ │ │ │ │ -00001 // -*- C++ -*00003 // File: vicinity.h │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ +303 │ │ │ │ │ │ + │ │ │ │ │ │ + 304 │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +reference particle │ │ │ │ │ │ +00174 * - _parent │ │ │ │ │ │ +00175 * - _VR │ │ │ │ │ │ +vicinity radius │ │ │ │ │ │ +00176 ************************************************************/ │ │ │ │ │ │ +00177 void CSphvicinity::build(CSphmomentum *_parent, double _VR){ │ │ │ │ │ │ +int i; │ │ │ │ │ │ +00178 │ │ │ │ │ │ +00179 │ │ │ │ │ │ +// set parent and radius │ │ │ │ │ │ +00180 │ │ │ │ │ │ +00181 │ │ │ │ │ │ +parent = _parent; │ │ │ │ │ │ +00182 │ │ │ │ │ │ +00183 │ │ │ │ │ │ +VR = _VR; │ │ │ │ │ │ +00184 │ │ │ │ │ │ +VR2 = VR*VR; │ │ │ │ │ │ +00185 │ │ │ │ │ │ +cosVR = cos(VR); │ │ │ │ │ │ +00186 │ │ │ │ │ │ +R2 = 0.25*VR2; │ │ │ │ │ │ +00187 │ │ │ │ │ │ +R │ │ │ │ │ │ += 0.5*VR; │ │ │ │ │ │ +double tmp = tan(R); │ │ │ │ │ │ +00188 │ │ │ │ │ │ +00189 │ │ │ │ │ │ +tan2R = tmp*tmp; │ │ │ │ │ │ +00190 │ │ │ │ │ │ +00191 │ │ │ │ │ │ +D2_R = 2.0*(1-cos(R)); │ │ │ │ │ │ +//tmp = sqrt(D2_R); │ │ │ │ │ │ +00192 │ │ │ │ │ │ +00193 │ │ │ │ │ │ +inv_R_EPS_COCIRC = 1.0 / R / EPSILON_COCIRCULAR; │ │ │ │ │ │ +00194 │ │ │ │ │ │ +inv_R_2EPS_COCIRC = 0.5 / R / EPSILON_COCIRCULAR; │ │ │ │ │ │ +00195 │ │ │ │ │ │ +00196 │ │ │ │ │ │ +// clear vicinity │ │ │ │ │ │ +00197 │ │ │ │ │ │ +vicinity.clear(); │ │ │ │ │ │ +00198 │ │ │ │ │ │ +// init parent variables │ │ │ │ │ │ +00199 │ │ │ │ │ │ +00200 │ │ │ │ │ │ +// we cpte the direction of the centre and two orthogonal ones │ │ │ │ │ │ +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 │ │ │ │ │ │ +parent_centre.get_angular_directions(angular_dir1, angular_dir2); │ │ │ │ │ │ +00205 │ │ │ │ │ │ +angular_dir1 /= angular_dir1._norm; │ │ │ │ │ │ +00206 │ │ │ │ │ │ +angular_dir2 /= angular_dir2._norm; │ │ │ │ │ │ +00207 │ │ │ │ │ │ +00208 │ │ │ │ │ │ +// really browse the particle list │ │ │ │ │ │ +00209 │ │ │ │ │ │ +for (i=0;i0) ? 0.0 : 2.0; │ │ │ │ │ │ +double t=c/s; │ │ │ │ │ │ +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 │ │ │ │ │ │ +vector to test │ │ │ │ │ │ +00232 * - v │ │ │ │ │ │ +00233 **********************************************************/ │ │ │ │ │ │ +00234 void CSphvicinity::append_to_vicinity(CSphmomentum *v){ │ │ │ │ │ │ +00235 │ │ │ │ │ │ +// skip the particle itself) │ │ │ │ │ │ +00236 │ │ │ │ │ │ +if (v==parent) │ │ │ │ │ │ +00237 │ │ │ │ │ │ +return; │ │ │ │ │ │ +00238 │ │ │ │ │ │ +int i=2*(v->index); │ │ │ │ │ │ +00239 │ │ │ │ │ │ +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 │ │ │ │ │ │ +00248 │ │ │ │ │ │ +if (dot>cosVR){ │ │ │ │ │ │ +00249 │ │ │ │ │ │ +CSph3vector cross = cross_product3(parent_centre,vnormal); │ │ │ │ │ │ +00250 │ │ │ │ │ │ +00251 │ │ │ │ │ │ +// for the centres │ │ │ │ │ │ +00252 │ │ │ │ │ │ +CSph3vector median = (parent_centre+vnormal); │ │ │ │ │ │ +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; │ │ │ │ │ │ +00258 │ │ │ │ │ │ +ve_list[i].centre.build_norm(); │ │ │ │ │ │ +00259 │ │ │ │ │ │ +ve_list[i].centre/=ve_list[i].centre._norm; │ │ │ │ │ │ +00260 │ │ │ │ │ │ +CSph3vector diff = ve_list[i].centre - parent_centre; │ │ │ │ │ │ +00261 │ │ │ │ │ │ +//ve_list[i].angle = atan2(dot_product3(angular_dir2, diff),dot_product3(angular_dir1, diff)); │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.52 vicinity.cpp │ │ │ │ │ │ + │ │ │ │ │ │ +00262 │ │ │ │ │ │ +00263 │ │ │ │ │ │ +00264 │ │ │ │ │ │ +00265 │ │ │ │ │ │ +00266 │ │ │ │ │ │ +00267 │ │ │ │ │ │ +00268 │ │ │ │ │ │ +00269 │ │ │ │ │ │ +00270 │ │ │ │ │ │ +00271 │ │ │ │ │ │ +00272 │ │ │ │ │ │ + │ │ │ │ │ │ +305 │ │ │ │ │ │ + │ │ │ │ │ │ +ve_list[i].angle = sort_angle(dot_product3(angular_dir2, diff),dot_product3(angular_dir1, diff)); │ │ │ │ │ │ +ve_list[i].side = true; │ │ │ │ │ │ +ve_list[i].cocircular.clear(); │ │ │ │ │ │ +vicinity.push_back(&(ve_list[i])); │ │ │ │ │ │ + │ │ │ │ │ │ +// second angle (-) │ │ │ │ │ │ +ve_list[i+1].centre = median - transverse; │ │ │ │ │ │ +ve_list[i+1].centre.build_norm(); │ │ │ │ │ │ +ve_list[i+1].centre/=ve_list[i+1].centre._norm; │ │ │ │ │ │ +diff = ve_list[i+1].centre - parent_centre; │ │ │ │ │ │ +ve_list[i+1].angle = sort_angle(dot_product3(angular_dir2, diff),dot_product3(angular_dir1, │ │ │ │ │ │ +diff)); │ │ │ │ │ │ +00273 │ │ │ │ │ │ +ve_list[i+1].side = false; │ │ │ │ │ │ +00274 │ │ │ │ │ │ +ve_list[i+1].cocircular.clear(); │ │ │ │ │ │ +00275 │ │ │ │ │ │ +vicinity.push_back(&(ve_list[i+1])); │ │ │ │ │ │ +00276 │ │ │ │ │ │ +// 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) │ │ │ │ │ │ +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 │ │ │ │ │ │ +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 │ │ │ │ │ │ +double inv_err1 = cross_product3(OP,OC)._norm * inv_R_EPS_COCIRC; │ │ │ │ │ │ +00292 │ │ │ │ │ │ +double inv_err2_sq = (D2_R-dot_product3(OP,OC)) * inv_R_2EPS_COCIRC; │ │ │ │ │ │ +00293 │ │ │ │ │ │ +ve_list[i].cocircular_range = siscone::pow2(inv_err1) > inv_err2_sq ? │ │ │ │ │ │ +00294 │ │ │ │ │ │ +1.0/inv_err1 : │ │ │ │ │ │ +00295 │ │ │ │ │ │ +sqrt(1.0/inv_err2_sq); │ │ │ │ │ │ +00296 │ │ │ │ │ │ +ve_list[i+1].cocircular_range = ve_list[i].cocircular_range; │ │ │ │ │ │ +00297 │ │ │ │ │ │ +} │ │ │ │ │ │ +00298 } │ │ │ │ │ │ +00299 │ │ │ │ │ │ +00300 } │ │ │ │ │ │ + │ │ │ │ │ │ +5.52 vicinity.cpp │ │ │ │ │ │ +00001 │ │ │ │ │ │ // │ │ │ │ │ │ -00004 // Description: header file for particle vicinity (Cvicinity class) │ │ │ │ │ │ +00002 // File: vicinity.cpp │ │ │ │ │ │ +00003 // Description: source file for particle vicinity (Cvicinity class) │ │ │ │ │ │ // │ │ │ │ │ │ -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:: 123 │ │ │ │ │ │ +00023 // $Revision:: 388 │ │ │ │ │ │ +$// │ │ │ │ │ │ +00024 // $Date:: 2016-03-03 10:42:25 +0100 (Thu, 03 Mar 2016) │ │ │ │ │ │ $// │ │ │ │ │ │ +00026 │ │ │ │ │ │ +00027 #include "vicinity.h" │ │ │ │ │ │ +00028 #include │ │ │ │ │ │ +00029 #include │ │ │ │ │ │ +00030 #include │ │ │ │ │ │ +00031 │ │ │ │ │ │ +00032 namespace siscone{ │ │ │ │ │ │ +00033 │ │ │ │ │ │ +00034 using namespace std; │ │ │ │ │ │ +00035 │ │ │ │ │ │ +00036 /************************************************************* │ │ │ │ │ │ +00037 * Cvicinity_elm implementation │ │ │ │ │ │ +* │ │ │ │ │ │ +00038 * element in the vicinity of a parent. │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -307 │ │ │ │ │ │ +* │ │ │ │ │ │ │ │ │ │ │ │ - 308 │ │ │ │ │ │ + 306 │ │ │ │ │ │ │ │ │ │ │ │ -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: │ │ │ │ │ │ +00039 * class used to manage one points in the vicinity │ │ │ │ │ │ +* │ │ │ │ │ │ +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; │ │ │ │ │ │ +00047 } │ │ │ │ │ │ +00048 │ │ │ │ │ │ 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; │ │ │ │ │ │ +00050 /************************************************************* │ │ │ │ │ │ +00051 * Cvicinity implementation │ │ │ │ │ │ +* │ │ │ │ │ │ +00052 * list of element in the vicinity of a parent. │ │ │ │ │ │ +00053 * class used to manage the points which are in the vicinity * │ │ │ │ │ │ +00054 * of a parent point. The construction of the list can be │ │ │ │ │ │ +* │ │ │ │ │ │ +00055 * made from a list of points or from a quadtree. │ │ │ │ │ │ +00056 *************************************************************/ │ │ │ │ │ │ +00057 │ │ │ │ │ │ +00058 // default constructor │ │ │ │ │ │ +00059 //--------------------00060 Cvicinity::Cvicinity(){ │ │ │ │ │ │ +00061 │ │ │ │ │ │ +n_part = 0; │ │ │ │ │ │ +00062 │ │ │ │ │ │ +00063 │ │ │ │ │ │ +ve_list = NULL; │ │ │ │ │ │ +00064 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ +00065 │ │ │ │ │ │ +quadtree = NULL; │ │ │ │ │ │ +00066 #endif │ │ │ │ │ │ 00067 │ │ │ │ │ │ +00068 │ │ │ │ │ │ +parent = NULL; │ │ │ │ │ │ 00069 │ │ │ │ │ │ -Cvicinity_inclusion *is_inside; │ │ │ │ │ │ +VR2 = VR = 0.0; │ │ │ │ │ │ 00070 │ │ │ │ │ │ -00071 │ │ │ │ │ │ -// centre variables │ │ │ │ │ │ +00071 } │ │ │ │ │ │ 00072 │ │ │ │ │ │ -double eta; │ │ │ │ │ │ -double phi; │ │ │ │ │ │ -00073 │ │ │ │ │ │ -00074 │ │ │ │ │ │ -double angle; │ │ │ │ │ │ -00075 │ │ │ │ │ │ -bool side; │ │ │ │ │ │ -double cocircular_range; │ │ │ │ │ │ +00073 // constructor with initialisation │ │ │ │ │ │ +00074 //--------------------------------00075 Cvicinity::Cvicinity(vector &_particle_list){ │ │ │ │ │ │ 00076 │ │ │ │ │ │ +parent = NULL; │ │ │ │ │ │ +00077 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ 00078 │ │ │ │ │ │ +quadtree = NULL; │ │ │ │ │ │ +00079 #endif │ │ │ │ │ │ +00080 │ │ │ │ │ │ +VR2 = VR = 0.0; │ │ │ │ │ │ 00081 │ │ │ │ │ │ -std::list cocircular; │ │ │ │ │ │ -00082 }; │ │ │ │ │ │ +00082 │ │ │ │ │ │ +ve_list = NULL; │ │ │ │ │ │ 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 │ │ │ │ │ │ +set_particle_list(_particle_list); │ │ │ │ │ │ +00084 } │ │ │ │ │ │ +00085 │ │ │ │ │ │ +00086 // default destructor │ │ │ │ │ │ +00087 //-------------------00088 Cvicinity::~Cvicinity(){ │ │ │ │ │ │ +00089 │ │ │ │ │ │ +if (ve_list!=NULL) │ │ │ │ │ │ +delete[] ve_list; │ │ │ │ │ │ +00090 │ │ │ │ │ │ +00091 │ │ │ │ │ │ +00092 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ +00093 │ │ │ │ │ │ +if (quadtree!=NULL) │ │ │ │ │ │ +00094 │ │ │ │ │ │ +delete quadtree; │ │ │ │ │ │ +00095 #endif │ │ │ │ │ │ +00096 } │ │ │ │ │ │ +00097 │ │ │ │ │ │ +00098 /* │ │ │ │ │ │ +00099 * set the particle_list │ │ │ │ │ │ +00100 * - particle_list │ │ │ │ │ │ +list of particles (type Cmomentum) │ │ │ │ │ │ +number of particles in the list │ │ │ │ │ │ +00101 * - n │ │ │ │ │ │ +00102 ************************************************************/ │ │ │ │ │ │ +00103 void Cvicinity::set_particle_list(vector &_particle_list){ │ │ │ │ │ │ +int i,j; │ │ │ │ │ │ 00104 │ │ │ │ │ │ -~Cvicinity(); │ │ │ │ │ │ -00105 │ │ │ │ │ │ +00105 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ +00106 │ │ │ │ │ │ +double eta_max=0.0; │ │ │ │ │ │ +00107 #endif │ │ │ │ │ │ +00108 │ │ │ │ │ │ +// if the particle list is not empty, destroy it ! │ │ │ │ │ │ +00109 │ │ │ │ │ │ 00110 │ │ │ │ │ │ -void set_particle_list(std::vector &_particle_list); │ │ │ │ │ │ +if (ve_list!=NULL){ │ │ │ │ │ │ +delete[] ve_list; │ │ │ │ │ │ 00111 │ │ │ │ │ │ -void build(Cmomentum *_parent, double _VR); │ │ │ │ │ │ -00117 │ │ │ │ │ │ +00112 │ │ │ │ │ │ +} │ │ │ │ │ │ +00113 │ │ │ │ │ │ +vicinity.clear(); │ │ │ │ │ │ +00114 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ +00115 │ │ │ │ │ │ +if (quadtree!=NULL) │ │ │ │ │ │ +delete quadtree; │ │ │ │ │ │ +00116 │ │ │ │ │ │ +00117 #endif │ │ │ │ │ │ 00118 │ │ │ │ │ │ 00119 │ │ │ │ │ │ -// cone kinematical information │ │ │ │ │ │ +// allocate memory array for particles │ │ │ │ │ │ 00120 │ │ │ │ │ │ -Cmomentum *parent; │ │ │ │ │ │ +// Note: - we compute max for |eta| │ │ │ │ │ │ 00121 │ │ │ │ │ │ -double VR; │ │ │ │ │ │ -double VR2; │ │ │ │ │ │ +// │ │ │ │ │ │ +- we allocate indices to particles │ │ │ │ │ │ 00122 │ │ │ │ │ │ +n_part = 0; │ │ │ │ │ │ 00123 │ │ │ │ │ │ -double R; │ │ │ │ │ │ +plist.clear(); │ │ │ │ │ │ 00124 │ │ │ │ │ │ -double R2; │ │ │ │ │ │ -double inv_R_EPS_COCIRC; │ │ │ │ │ │ +pincluded.clear(); │ │ │ │ │ │ 00125 │ │ │ │ │ │ +for (i=0;i<(int) _particle_list.size();i++){ │ │ │ │ │ │ + │ │ │ │ │ │ +File Documentation │ │ │ │ │ │ + │ │ │ │ │ │ +* │ │ │ │ │ │ + │ │ │ │ │ │ +* │ │ │ │ │ │ + │ │ │ │ │ │ +* │ │ │ │ │ │ + │ │ │ │ │ │ +Generated by Doxygen │ │ │ │ │ │ + │ │ │ │ │ │ + 5.52 vicinity.cpp │ │ │ │ │ │ + │ │ │ │ │ │ 00126 │ │ │ │ │ │ -double inv_R_2EPS_COCIRC; │ │ │ │ │ │ +// if a particle is colinear with the beam (infinite rapidity) │ │ │ │ │ │ 00127 │ │ │ │ │ │ -// particle list information │ │ │ │ │ │ +// we do not take it into account │ │ │ │ │ │ 00128 │ │ │ │ │ │ +if (fabs(_particle_list[i].pz)!=_particle_list[i].E){ │ │ │ │ │ │ 00129 │ │ │ │ │ │ -int n_part; │ │ │ │ │ │ +plist.push_back(_particle_list[i]); │ │ │ │ │ │ 00130 │ │ │ │ │ │ -std::vector plist; │ │ │ │ │ │ +pincluded.push_back(Cvicinity_inclusion()); // zero inclusion status │ │ │ │ │ │ 00131 │ │ │ │ │ │ -std::vector pincluded; │ │ │ │ │ │ +// the parent_index is handled in the split_merge because │ │ │ │ │ │ 00132 │ │ │ │ │ │ -Cvicinity_elm *ve_list; │ │ │ │ │ │ -00133 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ +00133 │ │ │ │ │ │ +// of our multiple-pass procedure. │ │ │ │ │ │ 00134 │ │ │ │ │ │ -Cquadtree *quadtree; │ │ │ │ │ │ -00135 #endif │ │ │ │ │ │ +// Hence, it is not required here any longer. │ │ │ │ │ │ +00135 │ │ │ │ │ │ +// plist[n_part].parent_index = i; │ │ │ │ │ │ 00136 │ │ │ │ │ │ +plist[n_part].index = n_part; │ │ │ │ │ │ 00137 │ │ │ │ │ │ -// vicinity information │ │ │ │ │ │ +// make sure the reference is randomly created │ │ │ │ │ │ 00138 │ │ │ │ │ │ -std::vector vicinity; │ │ │ │ │ │ -unsigned int vicinity_size; │ │ │ │ │ │ 00139 │ │ │ │ │ │ +plist[n_part].ref.randomize(); │ │ │ │ │ │ 00140 │ │ │ │ │ │ -00141 protected: │ │ │ │ │ │ +00141 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ +00142 │ │ │ │ │ │ +if (fabs(plist[n_part].eta)>eta_max) eta_max=fabs(plist[n_part].eta); │ │ │ │ │ │ +00143 #endif │ │ │ │ │ │ +00144 │ │ │ │ │ │ +00145 │ │ │ │ │ │ +n_part++; │ │ │ │ │ │ +00146 │ │ │ │ │ │ +} │ │ │ │ │ │ 00147 │ │ │ │ │ │ -void append_to_vicinity(Cmomentum *v); │ │ │ │ │ │ +} │ │ │ │ │ │ 00148 │ │ │ │ │ │ -// internal variables │ │ │ │ │ │ 00149 │ │ │ │ │ │ +// allocate quadtree and vicinity_elm list │ │ │ │ │ │ 00150 │ │ │ │ │ │ -double pcx; │ │ │ │ │ │ -double pcy; │ │ │ │ │ │ +// note: we set phi in [-pi:pi] as it is the natural range for atan2! │ │ │ │ │ │ 00151 │ │ │ │ │ │ -00152 }; │ │ │ │ │ │ +ve_list = new Cvicinity_elm[2*n_part]; │ │ │ │ │ │ +00152 #ifdef USE_QUADTREE_FOR_STABILITY_TEST │ │ │ │ │ │ 00153 │ │ │ │ │ │ -00154 } │ │ │ │ │ │ -00155 │ │ │ │ │ │ - │ │ │ │ │ │ -File Documentation │ │ │ │ │ │ - │ │ │ │ │ │ -$// │ │ │ │ │ │ - │ │ │ │ │ │ -Generated by Doxygen │ │ │ │ │ │ - │ │ │ │ │ │ - 5.52 vicinity.h │ │ │ │ │ │ - │ │ │ │ │ │ -00156 #endif │ │ │ │ │ │ +eta_max+=0.1; │ │ │ │ │ │ +00154 │ │ │ │ │ │ +quadtree = new Cquadtree(0.0, 0.0, eta_max, M_PI); │ │ │ │ │ │ +00155 #endif │ │ │ │ │ │ +00156 │ │ │ │ │ │ +00157 │ │ │ │ │ │ +// append particle to the vicinity_elm list │ │ │ │ │ │ +00158 │ │ │ │ │ │ +j = 0; │ │ │ │ │ │ +00159 │ │ │ │ │ │ +for (i=0;iadd(&plist[i]); │ │ │ │ │ │ +00162 #endif │ │ │ │ │ │ +00163 │ │ │ │ │ │ +ve_list[j].v = ve_list[j+1].v = &plist[i]; │ │ │ │ │ │ +00164 │ │ │ │ │ │ +ve_list[j].is_inside = ve_list[j+1].is_inside = &(pincluded[i]); │ │ │ │ │ │ +00165 │ │ │ │ │ │ +j+=2; │ │ │ │ │ │ +00166 │ │ │ │ │ │ +} │ │ │ │ │ │ +00167 │ │ │ │ │ │ +00168 } │ │ │ │ │ │ +00169 │ │ │ │ │ │ +00170 │ │ │ │ │ │ +00171 /* │ │ │ │ │ │ +00172 * build the vicinity list from a list of points. │ │ │ │ │ │ +00173 * - _parent │ │ │ │ │ │ +reference particle │ │ │ │ │ │ +vicinity radius │ │ │ │ │ │ +00174 * - _VR │ │ │ │ │ │ +00175 ************************************************************/ │ │ │ │ │ │ +00176 void Cvicinity::build(Cmomentum *_parent, double _VR){ │ │ │ │ │ │ +int i; │ │ │ │ │ │ +00177 │ │ │ │ │ │ +00178 │ │ │ │ │ │ +// set parent and radius │ │ │ │ │ │ +00179 │ │ │ │ │ │ +00180 │ │ │ │ │ │ +parent = _parent; │ │ │ │ │ │ +00181 │ │ │ │ │ │ +VR = _VR; │ │ │ │ │ │ +00182 │ │ │ │ │ │ +VR2 = VR*VR; │ │ │ │ │ │ +00183 │ │ │ │ │ │ +R2 = 0.25*VR2; │ │ │ │ │ │ +00184 │ │ │ │ │ │ +R │ │ │ │ │ │ += 0.5*VR; │ │ │ │ │ │ +00185 │ │ │ │ │ │ +inv_R_EPS_COCIRC = 1.0 / R / EPSILON_COCIRCULAR; │ │ │ │ │ │ +00186 │ │ │ │ │ │ +inv_R_2EPS_COCIRC = 0.5 / R / EPSILON_COCIRCULAR; │ │ │ │ │ │ +00187 │ │ │ │ │ │ +// clear vicinity │ │ │ │ │ │ +00188 │ │ │ │ │ │ +00189 │ │ │ │ │ │ +vicinity.clear(); │ │ │ │ │ │ +00190 │ │ │ │ │ │ +// init parent variables │ │ │ │ │ │ +00191 │ │ │ │ │ │ +00192 │ │ │ │ │ │ +pcx = parent->eta; │ │ │ │ │ │ +00193 │ │ │ │ │ │ +pcy = parent->phi; │ │ │ │ │ │ +00194 │ │ │ │ │ │ +00195 │ │ │ │ │ │ +// really browse the particle list │ │ │ │ │ │ +00196 │ │ │ │ │ │ +for (i=0;i0) ? 0.0 : 2.0; │ │ │ │ │ │ +00209 │ │ │ │ │ │ +00210 │ │ │ │ │ │ +double t=c/s; │ │ │ │ │ │ +return (s>0) ? 1-t/(1+fabs(t)) : 3-t/(1+fabs(t)); │ │ │ │ │ │ +00211 │ │ │ │ │ │ +00212 } │ │ │ │ │ │ +00213 │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -309 │ │ │ │ │ │ +307 │ │ │ │ │ │ │ │ │ │ │ │ - 310 │ │ │ │ │ │ + 308 │ │ │ │ │ │ │ │ │ │ │ │ File Documentation │ │ │ │ │ │ │ │ │ │ │ │ +00214 │ │ │ │ │ │ +00215 /* │ │ │ │ │ │ +00216 * append a particle to the ’vicinity’ list after │ │ │ │ │ │ +00217 * having computed the angular-ordering quantities │ │ │ │ │ │ +00218 * - v │ │ │ │ │ │ +vector to test │ │ │ │ │ │ +00219 **********************************************************/ │ │ │ │ │ │ +00220 void Cvicinity::append_to_vicinity(Cmomentum *v){ │ │ │ │ │ │ +00221 │ │ │ │ │ │ +double dx, dy, d2; │ │ │ │ │ │ +00222 │ │ │ │ │ │ +// skip the particle itself) │ │ │ │ │ │ +00223 │ │ │ │ │ │ +00224 │ │ │ │ │ │ +if (v==parent) │ │ │ │ │ │ +return; │ │ │ │ │ │ +00225 │ │ │ │ │ │ +00226 │ │ │ │ │ │ +int i=2*(v->index); │ │ │ │ │ │ +00227 │ │ │ │ │ │ +00228 │ │ │ │ │ │ +00229 │ │ │ │ │ │ +// compute the distance of the i-th particle with the parent │ │ │ │ │ │ +00230 │ │ │ │ │ │ +dx = v->eta - pcx; │ │ │ │ │ │ +00231 │ │ │ │ │ │ +dy = v->phi - pcy; │ │ │ │ │ │ +00232 │ │ │ │ │ │ +00233 │ │ │ │ │ │ +// pay attention to the periodicity in phi ! │ │ │ │ │ │ +00234 │ │ │ │ │ │ +if (dy>M_PI) │ │ │ │ │ │ +00235 │ │ │ │ │ │ +dy -= twopi; │ │ │ │ │ │ +00236 │ │ │ │ │ │ +else if (dy<-M_PI) │ │ │ │ │ │ +00237 │ │ │ │ │ │ +dy += twopi; │ │ │ │ │ │ +00238 │ │ │ │ │ │ +00239 │ │ │ │ │ │ +d2 = dx*dx+dy*dy; │ │ │ │ │ │ +00240 │ │ │ │ │ │ +// really check if the distance is less than VR │ │ │ │ │ │ +00241 │ │ │ │ │ │ +00242 │ │ │ │ │ │ +if (d2eta - ve_list[i+1].eta, │ │ │ │ │ │ +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 │ │ │ │ │ │ +00280 │ │ │ │ │ │ +// out, it is the _smaller_ of the two that is relevant [NB have │ │ │ │ │ │ +00281 │ │ │ │ │ │ +// changed definition of theta here relative to that used in │ │ │ │ │ │ +00282 │ │ │ │ │ │ +// CCN29] [NB2: write things so as to avoid zero denominators and │ │ │ │ │ │ +00283 │ │ │ │ │ │ +// to minimize the multiplications, divisions and above all sqrts │ │ │ │ │ │ +00284 │ │ │ │ │ │ +// -- 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 │ │ │ │ │ │ +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 } │ │ │ │ │ │ + │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ Index │ │ │ │ │ │ _norm │ │ │ │ │ │ siscone::Cjet_area, 28 │ │ │ │ │ │ siscone_spherical::CSph3vector, 67 │ │ │ │ │ │ add │ │ │ │ │ │ @@ -28867,15 +28863,15 @@ │ │ │ │ │ │ centre_x │ │ │ │ │ │ siscone_spherical::sph_hash_cones, 170 │ │ │ │ │ │ siscone::Cquadtree, 47 │ │ │ │ │ │ centre_y │ │ │ │ │ │ active_area │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 312 │ │ │ │ │ │ + 310 │ │ │ │ │ │ │ │ │ │ │ │ siscone::Cquadtree, 47 │ │ │ │ │ │ Ceta_phi_range │ │ │ │ │ │ siscone::Ceta_phi_range, 16 │ │ │ │ │ │ children │ │ │ │ │ │ siscone::Cquadtree, 48 │ │ │ │ │ │ circle_intersect │ │ │ │ │ │ @@ -29021,15 +29017,15 @@ │ │ │ │ │ │ examples/options.cpp, 182 │ │ │ │ │ │ examples/options.h, 185 │ │ │ │ │ │ examples/sample.cpp, 186 │ │ │ │ │ │ examples/spherical.cpp, 187 │ │ │ │ │ │ examples/test.cpp, 188 │ │ │ │ │ │ examples/times.cpp, 190 │ │ │ │ │ │ │ │ │ │ │ │ -313 │ │ │ │ │ │ +311 │ │ │ │ │ │ │ │ │ │ │ │ siscone::hash_cones, 164 │ │ │ │ │ │ siscone_spherical::sph_hash_cones, 172 │ │ │ │ │ │ hash_cones │ │ │ │ │ │ siscone::hash_cones, 162 │ │ │ │ │ │ hc │ │ │ │ │ │ siscone::Cstable_cones, 141 │ │ │ │ │ │ @@ -29111,15 +29107,15 @@ │ │ │ │ │ │ siscone_spherical::CSphsplit_merge::Cuser_scale_base, │ │ │ │ │ │ siscone::Cquadtree, 48 │ │ │ │ │ │ 147 │ │ │ │ │ │ hash_array │ │ │ │ │ │ is_stable │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ - 314 │ │ │ │ │ │ + 312 │ │ │ │ │ │ │ │ │ │ │ │ INDEX │ │ │ │ │ │ │ │ │ │ │ │ siscone::hash_element, 166 │ │ │ │ │ │ siscone_spherical::sph_hash_element, 174 │ │ │ │ │ │ j │ │ │ │ │ │ siscone::ranlux_state_t, 168 │ │ │ │ │ │ @@ -29349,38 +29345,38 @@ │ │ │ │ │ │ siscone::Cmomentum, 34 │ │ │ │ │ │ siscone_spherical::CSphmomentum, 81 │ │ │ │ │ │ R2 │ │ │ │ │ │ siscone::Cstable_cones, 142 │ │ │ │ │ │ phi │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -315 │ │ │ │ │ │ +313 │ │ │ │ │ │ │ │ │ │ │ │ - 316 │ │ │ │ │ │ + 314 │ │ │ │ │ │ │ │ │ │ │ │ siscone::Cvicinity, 155 │ │ │ │ │ │ siscone::hash_cones, 165 │ │ │ │ │ │ siscone_spherical::CSphstable_cones, 107 │ │ │ │ │ │ siscone_spherical::CSphvicinity, 118 │ │ │ │ │ │ siscone_spherical::sph_hash_cones, 172 │ │ │ │ │ │ randomize │ │ │ │ │ │ siscone::Creference, 52 │ │ │ │ │ │ range │ │ │ │ │ │ siscone::Cjet, 25 │ │ │ │ │ │ siscone_spherical::CSphjet, 74 │ │ │ │ │ │ ranlux.h │ │ │ │ │ │ -ranlux_get, 235 │ │ │ │ │ │ -ranlux_init, 235 │ │ │ │ │ │ -ranlux_print_state, 235 │ │ │ │ │ │ +ranlux_get, 250 │ │ │ │ │ │ +ranlux_init, 250 │ │ │ │ │ │ +ranlux_print_state, 250 │ │ │ │ │ │ ranlux_get │ │ │ │ │ │ -ranlux.h, 235 │ │ │ │ │ │ +ranlux.h, 250 │ │ │ │ │ │ ranlux_init │ │ │ │ │ │ -ranlux.h, 235 │ │ │ │ │ │ +ranlux.h, 250 │ │ │ │ │ │ ranlux_print_state │ │ │ │ │ │ -ranlux.h, 235 │ │ │ │ │ │ +ranlux.h, 250 │ │ │ │ │ │ recompute_jets │ │ │ │ │ │ siscone::Csiscone, 57 │ │ │ │ │ │ siscone_spherical::CSphsiscone, 86 │ │ │ │ │ │ ref │ │ │ │ │ │ siscone::Cmomentum, 37 │ │ │ │ │ │ siscone::Creference, 52 │ │ │ │ │ │ siscone::hash_element, 167 │ │ │ │ │ │ @@ -29421,49 +29417,49 @@ │ │ │ │ │ │ siscone/area.cpp, 176 │ │ │ │ │ │ siscone/area.h, 191 │ │ │ │ │ │ siscone/circulator.h, 192 │ │ │ │ │ │ siscone/config.h, 193 │ │ │ │ │ │ siscone/config_raw.h, 194 │ │ │ │ │ │ siscone/defines.h, 196, 198 │ │ │ │ │ │ siscone/geom_2d.cpp, 199 │ │ │ │ │ │ -siscone/geom_2d.h, 249 │ │ │ │ │ │ -siscone/hash.cpp, 252 │ │ │ │ │ │ -siscone/hash.h, 203 │ │ │ │ │ │ -siscone/momentum.cpp, 257 │ │ │ │ │ │ -siscone/momentum.h, 262 │ │ │ │ │ │ -siscone/protocones.cpp, 205 │ │ │ │ │ │ -siscone/protocones.h, 224 │ │ │ │ │ │ -siscone/quadtree.cpp, 228 │ │ │ │ │ │ -siscone/quadtree.h, 232 │ │ │ │ │ │ -siscone/ranlux.cpp, 232 │ │ │ │ │ │ -siscone/ranlux.h, 235, 236 │ │ │ │ │ │ -siscone/reference.cpp, 236 │ │ │ │ │ │ -siscone/reference.h, 238 │ │ │ │ │ │ -siscone/siscone.cpp, 239 │ │ │ │ │ │ -siscone/siscone.h, 246 │ │ │ │ │ │ -siscone/siscone_error.cpp, 248 │ │ │ │ │ │ -siscone/siscone_error.h, 248 │ │ │ │ │ │ +siscone/geom_2d.h, 203 │ │ │ │ │ │ +siscone/hash.cpp, 205 │ │ │ │ │ │ +siscone/hash.h, 264 │ │ │ │ │ │ +siscone/momentum.cpp, 211 │ │ │ │ │ │ +siscone/momentum.h, 216 │ │ │ │ │ │ +siscone/protocones.cpp, 220 │ │ │ │ │ │ +siscone/protocones.h, 239 │ │ │ │ │ │ +siscone/quadtree.cpp, 243 │ │ │ │ │ │ +siscone/quadtree.h, 246 │ │ │ │ │ │ +siscone/ranlux.cpp, 247 │ │ │ │ │ │ +siscone/ranlux.h, 249, 251 │ │ │ │ │ │ +siscone/reference.cpp, 251 │ │ │ │ │ │ +siscone/reference.h, 253 │ │ │ │ │ │ +siscone/siscone.cpp, 254 │ │ │ │ │ │ +siscone/siscone.h, 261 │ │ │ │ │ │ +siscone/siscone_error.cpp, 263 │ │ │ │ │ │ +siscone/siscone_error.h, 263 │ │ │ │ │ │ siscone/spherical/geom_2d.cpp, 201 │ │ │ │ │ │ -siscone/spherical/geom_2d.h, 251 │ │ │ │ │ │ -siscone/spherical/hash.cpp, 254 │ │ │ │ │ │ -siscone/spherical/hash.h, 204 │ │ │ │ │ │ -siscone/spherical/momentum.cpp, 259 │ │ │ │ │ │ -siscone/spherical/momentum.h, 264 │ │ │ │ │ │ -siscone/spherical/protocones.cpp, 214 │ │ │ │ │ │ -siscone/spherical/protocones.h, 226 │ │ │ │ │ │ -siscone/spherical/siscone.cpp, 242 │ │ │ │ │ │ -siscone/spherical/siscone.h, 247 │ │ │ │ │ │ -siscone/spherical/split_merge.cpp, 273 │ │ │ │ │ │ -siscone/spherical/split_merge.h, 300 │ │ │ │ │ │ -siscone/spherical/vicinity.cpp, 266 │ │ │ │ │ │ -siscone/spherical/vicinity.h, 306 │ │ │ │ │ │ -siscone/split_merge.cpp, 287 │ │ │ │ │ │ -siscone/split_merge.h, 303 │ │ │ │ │ │ -siscone/vicinity.cpp, 270 │ │ │ │ │ │ -siscone/vicinity.h, 307 │ │ │ │ │ │ +siscone/spherical/geom_2d.h, 204 │ │ │ │ │ │ +siscone/spherical/hash.cpp, 208 │ │ │ │ │ │ +siscone/spherical/hash.h, 265 │ │ │ │ │ │ +siscone/spherical/momentum.cpp, 212 │ │ │ │ │ │ +siscone/spherical/momentum.h, 217 │ │ │ │ │ │ +siscone/spherical/protocones.cpp, 229 │ │ │ │ │ │ +siscone/spherical/protocones.h, 241 │ │ │ │ │ │ +siscone/spherical/siscone.cpp, 257 │ │ │ │ │ │ +siscone/spherical/siscone.h, 262 │ │ │ │ │ │ +siscone/spherical/split_merge.cpp, 269 │ │ │ │ │ │ +siscone/spherical/split_merge.h, 296 │ │ │ │ │ │ +siscone/spherical/vicinity.cpp, 301 │ │ │ │ │ │ +siscone/spherical/vicinity.h, 266 │ │ │ │ │ │ +siscone/split_merge.cpp, 283 │ │ │ │ │ │ +siscone/split_merge.h, 299 │ │ │ │ │ │ +siscone/vicinity.cpp, 305 │ │ │ │ │ │ +siscone/vicinity.h, 267 │ │ │ │ │ │ siscone::Carea, 7 │ │ │ │ │ │ ∼Carea, 9 │ │ │ │ │ │ Carea, 9 │ │ │ │ │ │ compute_active_areas, 9 │ │ │ │ │ │ compute_areas, 10 │ │ │ │ │ │ compute_passive_areas, 11 │ │ │ │ │ │ grid_eta_max, 11 │ │ │ │ │ │ @@ -29538,15 +29534,15 @@ │ │ │ │ │ │ px, 36 │ │ │ │ │ │ py, 36 │ │ │ │ │ │ pz, 36 │ │ │ │ │ │ ref, 37 │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -317 │ │ │ │ │ │ +315 │ │ │ │ │ │ │ │ │ │ │ │ siscone::Cquadtree, 42 │ │ │ │ │ │ ∼Cquadtree, 44 │ │ │ │ │ │ add, 44 │ │ │ │ │ │ centre_x, 47 │ │ │ │ │ │ centre_y, 47 │ │ │ │ │ │ children, 48 │ │ │ │ │ │ @@ -29599,15 +29595,15 @@ │ │ │ │ │ │ merge_collinear_and_remove_soft, 128 │ │ │ │ │ │ merge_identical_protocones, 131 │ │ │ │ │ │ most_ambiguous_split, 132 │ │ │ │ │ │ n, 132 │ │ │ │ │ │ n_left, 132 │ │ │ │ │ │ n_pass, 132 │ │ │ │ │ │ │ │ │ │ │ │ - 318 │ │ │ │ │ │ + 316 │ │ │ │ │ │ │ │ │ │ │ │ p_remain, 133 │ │ │ │ │ │ p_uncol_hard, 133 │ │ │ │ │ │ partial_clear, 128 │ │ │ │ │ │ particles, 133 │ │ │ │ │ │ perform, 129 │ │ │ │ │ │ pt, 133 │ │ │ │ │ │ @@ -29786,15 +29782,15 @@ │ │ │ │ │ │ CSphsplit_merge, 90 │ │ │ │ │ │ full_clear, 91 │ │ │ │ │ │ idx_size, 95 │ │ │ │ │ │ indices, 95 │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -319 │ │ │ │ │ │ +317 │ │ │ │ │ │ │ │ │ │ │ │ init, 92 │ │ │ │ │ │ init_particles, 92 │ │ │ │ │ │ init_pleft, 93 │ │ │ │ │ │ jets, 96 │ │ │ │ │ │ merge_collinear_and_remove_soft, 93 │ │ │ │ │ │ merge_identical_protocones, 96 │ │ │ │ │ │ @@ -29847,15 +29843,15 @@ │ │ │ │ │ │ phi_range, 110 │ │ │ │ │ │ theta_max, 110 │ │ │ │ │ │ theta_min, 110 │ │ │ │ │ │ theta_range, 110 │ │ │ │ │ │ siscone_spherical::CSphvicinity, 111 │ │ │ │ │ │ ∼CSphvicinity, 113 │ │ │ │ │ │ │ │ │ │ │ │ - 320 │ │ │ │ │ │ + 318 │ │ │ │ │ │ │ │ │ │ │ │ INDEX │ │ │ │ │ │ │ │ │ │ │ │ angular_dir1, 115 │ │ │ │ │ │ sph_hash_cones │ │ │ │ │ │ angular_dir2, 115 │ │ │ │ │ │ siscone_spherical::sph_hash_cones, 170 │ │ │ │ │ │ @@ -29978,10 +29974,10 @@ │ │ │ │ │ │ │ │ │ │ │ │ siscone::Ctwovect, 144 │ │ │ │ │ │ y │ │ │ │ │ │ siscone::Ctwovect, 145 │ │ │ │ │ │ │ │ │ │ │ │ Generated by Doxygen │ │ │ │ │ │ │ │ │ │ │ │ -321 │ │ │ │ │ │ +319