xcoll 0.5.11__py3-none-any.whl → 0.6.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of xcoll might be problematic. Click here for more details.

Files changed (333) hide show
  1. xcoll/__init__.py +5 -18
  2. xcoll/beam_elements/__init__.py +1 -0
  3. xcoll/beam_elements/absorber.py +12 -2
  4. xcoll/beam_elements/base.py +162 -62
  5. xcoll/beam_elements/blowup.py +1 -0
  6. xcoll/beam_elements/elements_src/black_absorber.h +57 -58
  7. xcoll/beam_elements/elements_src/black_crystal.h +49 -50
  8. xcoll/beam_elements/elements_src/everest_block.h +21 -11
  9. xcoll/beam_elements/elements_src/everest_collimator.h +100 -91
  10. xcoll/beam_elements/elements_src/everest_crystal.h +145 -140
  11. xcoll/beam_elements/elements_src/transparent_collimator.h +126 -0
  12. xcoll/beam_elements/elements_src/transparent_crystal.h +118 -0
  13. xcoll/beam_elements/everest.py +16 -5
  14. xcoll/beam_elements/monitor.py +1 -0
  15. xcoll/beam_elements/transparent.py +83 -0
  16. xcoll/colldb.py +15 -6
  17. xcoll/general.py +1 -1
  18. xcoll/headers/particle_states.py +51 -0
  19. xcoll/initial_distribution.py +129 -103
  20. xcoll/interaction_record/interaction_record.py +2 -1
  21. xcoll/interaction_record/interaction_types.py +2 -2
  22. xcoll/line_tools.py +163 -74
  23. xcoll/lossmap.py +519 -127
  24. xcoll/plot.py +109 -0
  25. xcoll/rf_sweep.py +6 -0
  26. xcoll/scattering_routines/engine.py +600 -0
  27. xcoll/scattering_routines/environment.py +297 -0
  28. xcoll/scattering_routines/everest/amorphous.h +95 -71
  29. xcoll/scattering_routines/everest/{channeling.h → channelling.h} +121 -112
  30. xcoll/scattering_routines/everest/constants.h +1 -1
  31. xcoll/scattering_routines/everest/crystal_parameters.h +9 -9
  32. xcoll/scattering_routines/everest/everest.h +8 -3
  33. xcoll/scattering_routines/everest/everest.py +2 -1
  34. xcoll/scattering_routines/everest/ionisation_loss.h +141 -0
  35. xcoll/scattering_routines/everest/jaw.h +19 -24
  36. xcoll/scattering_routines/everest/materials.py +2 -0
  37. xcoll/scattering_routines/everest/multiple_coulomb_scattering.h +2 -2
  38. xcoll/scattering_routines/everest/nuclear_interaction.h +35 -19
  39. xcoll/scattering_routines/everest/properties.h +4 -73
  40. xcoll/xaux.py +73 -0
  41. {xcoll-0.5.11.dist-info → xcoll-0.6.0.dist-info}/METADATA +5 -5
  42. xcoll-0.6.0.dist-info/RECORD +135 -0
  43. xcoll/_manager.py +0 -22
  44. xcoll/headers/particle_states.h +0 -25
  45. xcoll/install.py +0 -35
  46. xcoll/scattering_routines/geant4/collimasim/.git +0 -1
  47. xcoll/scattering_routines/geant4/collimasim/.gitignore +0 -12
  48. xcoll/scattering_routines/geant4/collimasim/.gitmodules +0 -3
  49. xcoll/scattering_routines/geant4/collimasim/CMakeLists.txt +0 -26
  50. xcoll/scattering_routines/geant4/collimasim/README.md +0 -21
  51. xcoll/scattering_routines/geant4/collimasim/docs/Makefile +0 -20
  52. xcoll/scattering_routines/geant4/collimasim/docs/make.bat +0 -35
  53. xcoll/scattering_routines/geant4/collimasim/docs/source/collimasim.rst +0 -10
  54. xcoll/scattering_routines/geant4/collimasim/docs/source/conf.py +0 -59
  55. xcoll/scattering_routines/geant4/collimasim/docs/source/index.rst +0 -26
  56. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.appveyor.yml +0 -37
  57. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.clang-format +0 -19
  58. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.clang-tidy +0 -65
  59. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.cmake-format.yaml +0 -73
  60. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.git +0 -1
  61. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/CODEOWNERS +0 -9
  62. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/CONTRIBUTING.md +0 -386
  63. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/ISSUE_TEMPLATE/bug-report.yml +0 -45
  64. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/ISSUE_TEMPLATE/config.yml +0 -8
  65. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/dependabot.yml +0 -16
  66. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/labeler.yml +0 -8
  67. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/labeler_merged.yml +0 -3
  68. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/pull_request_template.md +0 -19
  69. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/ci.yml +0 -969
  70. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/configure.yml +0 -84
  71. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/format.yml +0 -48
  72. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/labeler.yml +0 -16
  73. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/pip.yml +0 -103
  74. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.gitignore +0 -45
  75. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.pre-commit-config.yaml +0 -151
  76. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.readthedocs.yml +0 -3
  77. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/CMakeLists.txt +0 -297
  78. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/LICENSE +0 -29
  79. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/MANIFEST.in +0 -6
  80. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/README.rst +0 -180
  81. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/Doxyfile +0 -23
  82. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/Makefile +0 -192
  83. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/_static/theme_overrides.css +0 -11
  84. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/chrono.rst +0 -81
  85. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/custom.rst +0 -93
  86. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/eigen.rst +0 -310
  87. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/functional.rst +0 -109
  88. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/index.rst +0 -43
  89. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/overview.rst +0 -171
  90. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/stl.rst +0 -251
  91. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/strings.rst +0 -305
  92. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/classes.rst +0 -1297
  93. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/embedding.rst +0 -262
  94. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/exceptions.rst +0 -396
  95. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/functions.rst +0 -568
  96. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/misc.rst +0 -337
  97. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/index.rst +0 -13
  98. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/numpy.rst +0 -463
  99. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/object.rst +0 -286
  100. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/utilities.rst +0 -155
  101. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/smart_ptrs.rst +0 -174
  102. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/basics.rst +0 -308
  103. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/benchmark.py +0 -91
  104. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/benchmark.rst +0 -95
  105. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/changelog.rst +0 -2050
  106. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/classes.rst +0 -542
  107. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/cmake/index.rst +0 -8
  108. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/compiling.rst +0 -648
  109. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/conf.py +0 -381
  110. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/faq.rst +0 -343
  111. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/index.rst +0 -48
  112. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/installing.rst +0 -105
  113. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/limitations.rst +0 -72
  114. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11-logo.png +0 -0
  115. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python1.png +0 -0
  116. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python1.svg +0 -427
  117. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python2.png +0 -0
  118. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python2.svg +0 -427
  119. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/reference.rst +0 -130
  120. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/release.rst +0 -96
  121. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/requirements.txt +0 -8
  122. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/upgrade.rst +0 -548
  123. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/attr.h +0 -605
  124. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/buffer_info.h +0 -144
  125. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/cast.h +0 -1432
  126. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/chrono.h +0 -213
  127. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/common.h +0 -2
  128. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/complex.h +0 -65
  129. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/class.h +0 -709
  130. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/common.h +0 -1021
  131. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/descr.h +0 -104
  132. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/init.h +0 -346
  133. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/internals.h +0 -467
  134. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/type_caster_base.h +0 -978
  135. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/typeid.h +0 -55
  136. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/eigen.h +0 -606
  137. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/embed.h +0 -284
  138. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/eval.h +0 -163
  139. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/functional.h +0 -121
  140. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/gil.h +0 -193
  141. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/iostream.h +0 -275
  142. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/numpy.h +0 -1741
  143. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/operators.h +0 -163
  144. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/options.h +0 -65
  145. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/pybind11.h +0 -2497
  146. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/pytypes.h +0 -1879
  147. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl/filesystem.h +0 -103
  148. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl.h +0 -375
  149. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl_bind.h +0 -747
  150. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/noxfile.py +0 -88
  151. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/__init__.py +0 -11
  152. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/__main__.py +0 -52
  153. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/_version.py +0 -12
  154. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/_version.pyi +0 -6
  155. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/commands.py +0 -21
  156. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/py.typed +0 -0
  157. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/setup_helpers.py +0 -482
  158. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/setup_helpers.pyi +0 -63
  159. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pyproject.toml +0 -41
  160. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/setup.cfg +0 -56
  161. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/setup.py +0 -155
  162. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/CMakeLists.txt +0 -503
  163. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/conftest.py +0 -208
  164. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/constructor_stats.h +0 -275
  165. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/cross_module_gil_utils.cpp +0 -73
  166. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/env.py +0 -33
  167. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_python_package/pytest.ini +0 -0
  168. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_python_package/test_files.py +0 -279
  169. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_setuptools/pytest.ini +0 -0
  170. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_setuptools/test_setuphelper.py +0 -143
  171. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/local_bindings.h +0 -85
  172. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/object.h +0 -179
  173. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_cross_module_tests.cpp +0 -151
  174. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_tests.cpp +0 -91
  175. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_tests.h +0 -85
  176. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pytest.ini +0 -19
  177. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/requirements.txt +0 -12
  178. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_async.cpp +0 -26
  179. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_async.py +0 -25
  180. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_buffers.cpp +0 -216
  181. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_buffers.py +0 -163
  182. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_builtin_casters.cpp +0 -286
  183. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_builtin_casters.py +0 -536
  184. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_call_policies.cpp +0 -107
  185. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_call_policies.py +0 -248
  186. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_callbacks.cpp +0 -227
  187. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_callbacks.py +0 -202
  188. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_chrono.cpp +0 -84
  189. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_chrono.py +0 -210
  190. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_class.cpp +0 -550
  191. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_class.py +0 -473
  192. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/CMakeLists.txt +0 -84
  193. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/embed.cpp +0 -21
  194. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_embed/CMakeLists.txt +0 -28
  195. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_function/CMakeLists.txt +0 -39
  196. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_target/CMakeLists.txt +0 -46
  197. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/main.cpp +0 -6
  198. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt +0 -41
  199. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_function/CMakeLists.txt +0 -35
  200. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_target/CMakeLists.txt +0 -41
  201. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/test.py +0 -10
  202. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_constants_and_functions.cpp +0 -165
  203. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_constants_and_functions.py +0 -53
  204. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_copy_move.cpp +0 -238
  205. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_copy_move.py +0 -126
  206. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_casters.cpp +0 -141
  207. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_casters.py +0 -117
  208. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_setup.cpp +0 -41
  209. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_setup.py +0 -50
  210. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_docstring_options.cpp +0 -69
  211. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_docstring_options.py +0 -42
  212. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eigen.cpp +0 -348
  213. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eigen.py +0 -771
  214. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/CMakeLists.txt +0 -47
  215. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/catch.cpp +0 -22
  216. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/external_module.cpp +0 -23
  217. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/test_interpreter.cpp +0 -326
  218. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/test_interpreter.py +0 -15
  219. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_enum.cpp +0 -148
  220. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_enum.py +0 -272
  221. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval.cpp +0 -119
  222. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval.py +0 -51
  223. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval_call.py +0 -5
  224. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.cpp +0 -285
  225. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.h +0 -12
  226. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.py +0 -265
  227. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_factory_constructors.cpp +0 -397
  228. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_factory_constructors.py +0 -520
  229. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_gil_scoped.cpp +0 -49
  230. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_gil_scoped.py +0 -94
  231. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_iostream.cpp +0 -125
  232. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_iostream.py +0 -331
  233. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_kwargs_and_defaults.cpp +0 -153
  234. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_kwargs_and_defaults.py +0 -284
  235. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_local_bindings.cpp +0 -107
  236. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_local_bindings.py +0 -257
  237. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_methods_and_attributes.cpp +0 -412
  238. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_methods_and_attributes.py +0 -517
  239. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_modules.cpp +0 -102
  240. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_modules.py +0 -92
  241. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_multiple_inheritance.cpp +0 -233
  242. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_multiple_inheritance.py +0 -360
  243. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_array.cpp +0 -472
  244. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_array.py +0 -593
  245. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_dtypes.cpp +0 -524
  246. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_dtypes.py +0 -441
  247. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_vectorize.cpp +0 -103
  248. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_vectorize.py +0 -267
  249. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_opaque_types.cpp +0 -73
  250. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_opaque_types.py +0 -59
  251. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_operator_overloading.cpp +0 -235
  252. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_operator_overloading.py +0 -146
  253. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pickling.cpp +0 -189
  254. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pickling.py +0 -82
  255. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pytypes.cpp +0 -560
  256. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pytypes.py +0 -651
  257. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_sequences_and_iterators.cpp +0 -500
  258. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_sequences_and_iterators.py +0 -253
  259. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_smart_ptr.cpp +0 -452
  260. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_smart_ptr.py +0 -318
  261. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl.cpp +0 -342
  262. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl.py +0 -291
  263. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl_binders.cpp +0 -131
  264. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl_binders.py +0 -318
  265. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_tagbased_polymorphic.cpp +0 -144
  266. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_tagbased_polymorphic.py +0 -29
  267. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_thread.cpp +0 -66
  268. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_thread.py +0 -44
  269. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_union.cpp +0 -22
  270. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_union.py +0 -9
  271. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_virtual_functions.cpp +0 -510
  272. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_virtual_functions.py +0 -408
  273. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/valgrind-numpy-scipy.supp +0 -140
  274. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/valgrind-python.supp +0 -117
  275. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindCatch.cmake +0 -70
  276. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindEigen3.cmake +0 -86
  277. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindPythonLibsNew.cmake +0 -257
  278. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/check-style.sh +0 -44
  279. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/cmake_uninstall.cmake.in +0 -23
  280. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/libsize.py +0 -39
  281. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/make_changelog.py +0 -64
  282. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Common.cmake +0 -402
  283. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Config.cmake.in +0 -233
  284. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11NewTools.cmake +0 -276
  285. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Tools.cmake +0 -214
  286. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pyproject.toml +0 -3
  287. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/setup_global.py.in +0 -65
  288. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/setup_main.py.in +0 -41
  289. xcoll/scattering_routines/geant4/collimasim/pyproject.toml +0 -8
  290. xcoll/scattering_routines/geant4/collimasim/setup.py +0 -144
  291. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSPyATInterface.cpp +0 -403
  292. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSPyATInterface.hh +0 -100
  293. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSXtrackInterface.cpp +0 -763
  294. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSXtrackInterface.hh +0 -118
  295. xcoll/scattering_routines/geant4/collimasim/src/collimasim/__init__.py +0 -8
  296. xcoll/scattering_routines/geant4/collimasim/src/collimasim/bindings.cpp +0 -63
  297. xcoll/scattering_routines/geant4/collimasim/src/collimasim/pyCollimatorPass.py +0 -142
  298. xcoll/scattering_routines/geant4/collimasim/src/collimasim/xtrack_collimator.py +0 -556
  299. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/PKG-INFO +0 -6
  300. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/SOURCES.txt +0 -24
  301. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/dependency_links.txt +0 -1
  302. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/not-zip-safe +0 -1
  303. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/top_level.txt +0 -1
  304. xcoll/scattering_routines/geant4/collimasim/tests/README.md +0 -25
  305. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_forions.dat +0 -25
  306. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_new_example.dat +0 -18
  307. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_old_example.dat +0 -68
  308. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_testing.dat +0 -15
  309. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_yaml_example.yaml +0 -110
  310. xcoll/scattering_routines/geant4/collimasim/tests/resources/collgaps.dat +0 -7
  311. xcoll/scattering_routines/geant4/collimasim/tests/resources/collgaps_pyat_test.dat +0 -3
  312. xcoll/scattering_routines/geant4/collimasim/tests/resources/collonly_twiss_file_example.tfs +0 -54
  313. xcoll/scattering_routines/geant4/collimasim/tests/resources/settings.gmad +0 -3
  314. xcoll/scattering_routines/geant4/collimasim/tests/resources/settings_black_absorber.gmad +0 -3
  315. xcoll/scattering_routines/geant4/collimasim/tests/resources/settings_ions.gmad +0 -5
  316. xcoll/scattering_routines/geant4/collimasim/tests/resources/twiss_file_testing.tfs +0 -51
  317. xcoll/scattering_routines/geant4/collimasim/tests/test_pyat.py +0 -65
  318. xcoll/scattering_routines/geant4/collimasim/tests/test_pyat_passmethod.py +0 -59
  319. xcoll/scattering_routines/geant4/collimasim/tests/test_pyat_tracking.py +0 -102
  320. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack.py +0 -75
  321. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_angle.py +0 -74
  322. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_colldb_load.py +0 -84
  323. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_interaction.py +0 -159
  324. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_interaction_ion.py +0 -99
  325. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_ions.py +0 -78
  326. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_lost_energy.py +0 -88
  327. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tilt.py +0 -80
  328. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tracking.py +0 -97
  329. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tracking_ions.py +0 -96
  330. xcoll-0.5.11.dist-info/RECORD +0 -413
  331. {xcoll-0.5.11.dist-info → xcoll-0.6.0.dist-info}/LICENSE +0 -0
  332. {xcoll-0.5.11.dist-info → xcoll-0.6.0.dist-info}/NOTICE +0 -0
  333. {xcoll-0.5.11.dist-info → xcoll-0.6.0.dist-info}/WHEEL +0 -0
@@ -24,65 +24,60 @@ int8_t BlackAbsorberData_get_record_scatterings(BlackAbsorberData el){
24
24
 
25
25
 
26
26
  /*gpufun*/
27
- CollimatorGeometry BlackAbsorber_init_geometry(BlackAbsorberData el, LocalParticle* part0, int8_t active){
27
+ CollimatorGeometry BlackAbsorber_init_geometry(BlackAbsorberData el, LocalParticle* part0){
28
28
  CollimatorGeometry cg = (CollimatorGeometry) malloc(sizeof(CollimatorGeometry_));
29
- if (active){ // This is needed in order to avoid that the initialisation is called during a twiss!
30
- // Jaw corners (with tilts)
31
- cg->jaw_LU = BlackAbsorberData_get__jaw_LU(el);
32
- cg->jaw_RU = BlackAbsorberData_get__jaw_RU(el);
33
- // Get angles of jaws
34
- cg->sin_zL = BlackAbsorberData_get__sin_zL(el);
35
- cg->cos_zL = BlackAbsorberData_get__cos_zL(el);
36
- cg->sin_zR = BlackAbsorberData_get__sin_zR(el);
37
- cg->cos_zR = BlackAbsorberData_get__cos_zR(el);
38
- cg->sin_zDiff = BlackAbsorberData_get__sin_zDiff(el);
39
- cg->cos_zDiff = BlackAbsorberData_get__cos_zDiff(el);
40
- cg->jaws_parallel = BlackAbsorberData_get__jaws_parallel(el);
41
- // Tilts
42
- cg->sin_yL = BlackAbsorberData_get__sin_yL(el);
43
- cg->cos_yL = BlackAbsorberData_get__cos_yL(el);
44
- cg->sin_yR = BlackAbsorberData_get__sin_yR(el);
45
- cg->cos_yR = BlackAbsorberData_get__cos_yR(el);
46
- // Length and segments
47
- cg->length = BlackAbsorberData_get_length(el);
48
- cg->side = BlackAbsorberData_get__side(el);
49
- double s_U, s_D, x_D;
50
- if (cg->side != -1){
51
- s_U = cg->length/2 * (1-cg->cos_yL);
52
- s_D = cg->length/2 * (1+cg->cos_yL);
53
- x_D = BlackAbsorberData_get__jaw_LD(el);
54
- cg->segments_L = create_jaw(s_U, cg->jaw_LU, s_D, x_D, cg->sin_yL/cg->cos_yL, 1);
55
- }
56
- if (cg->side != 1){
57
- s_U = cg->length/2 * (1-cg->cos_yR);
58
- s_D = cg->length/2 * (1+cg->cos_yR);
59
- x_D = BlackAbsorberData_get__jaw_RD(el);
60
- cg->segments_R = create_jaw(s_U, cg->jaw_RU, s_D, x_D, cg->sin_yR/cg->cos_yR, -1);
61
- }
62
- // Impact table
63
- cg->record = BlackAbsorberData_getp_internal_record(el, part0);
64
- cg->record_index = NULL;
65
- cg->record_impacts = 0;
66
- cg->record_exits = 0;
67
- if (cg->record){
68
- cg->record_index = InteractionRecordData_getp__index(cg->record);
69
- cg->record_impacts = BlackAbsorberData_get_record_impacts(el);
70
- cg->record_exits = BlackAbsorberData_get_record_exits(el);
71
- }
29
+ // Jaw corners (with tilts)
30
+ cg->jaw_LU = BlackAbsorberData_get__jaw_LU(el);
31
+ cg->jaw_RU = BlackAbsorberData_get__jaw_RU(el);
32
+ // Get angles of jaws
33
+ cg->sin_zL = BlackAbsorberData_get__sin_zL(el);
34
+ cg->cos_zL = BlackAbsorberData_get__cos_zL(el);
35
+ cg->sin_zR = BlackAbsorberData_get__sin_zR(el);
36
+ cg->cos_zR = BlackAbsorberData_get__cos_zR(el);
37
+ cg->sin_zDiff = BlackAbsorberData_get__sin_zDiff(el);
38
+ cg->cos_zDiff = BlackAbsorberData_get__cos_zDiff(el);
39
+ cg->jaws_parallel = BlackAbsorberData_get__jaws_parallel(el);
40
+ // Tilts
41
+ cg->sin_yL = BlackAbsorberData_get__sin_yL(el);
42
+ cg->cos_yL = BlackAbsorberData_get__cos_yL(el);
43
+ cg->sin_yR = BlackAbsorberData_get__sin_yR(el);
44
+ cg->cos_yR = BlackAbsorberData_get__cos_yR(el);
45
+ // Length and segments
46
+ cg->length = BlackAbsorberData_get_length(el);
47
+ cg->side = BlackAbsorberData_get__side(el);
48
+ double s_U, s_D, x_D;
49
+ if (cg->side != -1){
50
+ s_U = cg->length/2 * (1-cg->cos_yL);
51
+ s_D = cg->length/2 * (1+cg->cos_yL);
52
+ x_D = BlackAbsorberData_get__jaw_LD(el);
53
+ cg->segments_L = create_jaw(s_U, cg->jaw_LU, s_D, x_D, cg->sin_yL/cg->cos_yL, 1);
54
+ }
55
+ if (cg->side != 1){
56
+ s_U = cg->length/2 * (1-cg->cos_yR);
57
+ s_D = cg->length/2 * (1+cg->cos_yR);
58
+ x_D = BlackAbsorberData_get__jaw_RD(el);
59
+ cg->segments_R = create_jaw(s_U, cg->jaw_RU, s_D, x_D, cg->sin_yR/cg->cos_yR, -1);
60
+ }
61
+ // Impact table
62
+ cg->record = BlackAbsorberData_getp_internal_record(el, part0);
63
+ cg->record_index = NULL;
64
+ cg->record_impacts = 0;
65
+ cg->record_exits = 0;
66
+ if (cg->record){
67
+ cg->record_index = InteractionRecordData_getp__index(cg->record);
68
+ cg->record_impacts = BlackAbsorberData_get_record_impacts(el);
69
+ cg->record_exits = BlackAbsorberData_get_record_exits(el);
72
70
  }
73
-
74
71
  return cg;
75
72
  }
76
73
 
77
74
  /*gpufun*/
78
- void BlackAbsorber_free(CollimatorGeometry restrict cg, int8_t active){
79
- if (active){
80
- if (cg->side != -1){
81
- destroy_jaw(cg->segments_L);
82
- }
83
- if (cg->side != 1){
84
- destroy_jaw(cg->segments_R);
85
- }
75
+ void BlackAbsorber_free(CollimatorGeometry restrict cg){
76
+ if (cg->side != -1){
77
+ destroy_jaw(cg->segments_L);
78
+ }
79
+ if (cg->side != 1){
80
+ destroy_jaw(cg->segments_R);
86
81
  }
87
82
  free(cg);
88
83
  }
@@ -90,15 +85,17 @@ void BlackAbsorber_free(CollimatorGeometry restrict cg, int8_t active){
90
85
 
91
86
  /*gpufun*/
92
87
  void BlackAbsorber_track_local_particle(BlackAbsorberData el, LocalParticle* part0){
93
-
94
- // Collimator active and length
95
88
  int8_t active = BlackAbsorberData_get_active(el);
96
89
  active *= BlackAbsorberData_get__tracking(el);
97
90
  double const length = BlackAbsorberData_get_length(el);
98
91
 
99
92
  // Get geometry
100
- CollimatorGeometry cg = BlackAbsorber_init_geometry(el, part0, active);
101
- int8_t record_scatterings = BlackAbsorberData_get_record_scatterings(el);
93
+ CollimatorGeometry cg;
94
+ int8_t record_scatterings;
95
+ if (active){
96
+ cg = BlackAbsorber_init_geometry(el, part0);
97
+ record_scatterings = BlackAbsorberData_get_record_scatterings(el);
98
+ }
102
99
 
103
100
  //start_per_particle_block (part0->part)
104
101
  if (!active){
@@ -130,7 +127,9 @@ void BlackAbsorber_track_local_particle(BlackAbsorberData el, LocalParticle* par
130
127
  }
131
128
  }
132
129
  //end_per_particle_block
133
- BlackAbsorber_free(cg, active);
130
+ if (active){
131
+ BlackAbsorber_free(cg);
132
+ }
134
133
  }
135
134
 
136
135
  #endif /* XCOLL_ABSORBER_H */
@@ -24,73 +24,70 @@ int8_t BlackCrystalData_get_record_scatterings(BlackCrystalData el){
24
24
 
25
25
 
26
26
  /*gpufun*/
27
- CrystalGeometry BlackCrystal_init_geometry(BlackCrystalData el, LocalParticle* part0, int8_t active){
27
+ CrystalGeometry BlackCrystal_init_geometry(BlackCrystalData el, LocalParticle* part0){
28
28
  CrystalGeometry cg = (CrystalGeometry) malloc(sizeof(CrystalGeometry_));
29
- if (active){ // This is needed in order to avoid that the initialisation is called during a twiss!
30
- cg->length = BlackCrystalData_get_length(el);
31
- cg->side = BlackCrystalData_get__side(el);
32
- cg->bending_radius = BlackCrystalData_get__bending_radius(el);
33
- cg->bending_angle = BlackCrystalData_get__bending_angle(el);
34
- cg->width = BlackCrystalData_get_width(el);
35
- cg->height = BlackCrystalData_get_height(el);
36
- cg->jaw_U = BlackCrystalData_get__jaw_U(el);
37
- cg->sin_z = BlackCrystalData_get__sin_z(el);
38
- cg->cos_z = BlackCrystalData_get__cos_z(el);
39
- cg->sin_y = BlackCrystalData_get__sin_y(el);
40
- cg->cos_y = BlackCrystalData_get__cos_y(el);
41
- double jaw;
42
- if (cg->side == 1){
43
- jaw = cg->jaw_U;
44
- } else if (cg->side == -1){
45
- jaw = cg->jaw_U - cg->width; // To ensure that jaw_U is the inner corner
46
- } else {
47
- kill_all_particles(part0, XC_ERR_INVALID_XOFIELD);
48
- return cg;
49
- }
50
- cg->segments = create_crystal(cg->bending_radius, cg->width, cg->length, jaw, cg->sin_y, cg->cos_y);
51
- // Impact table
52
- cg->record = BlackCrystalData_getp_internal_record(el, part0);
53
- cg->record_index = NULL;
54
- cg->record_impacts = 0;
55
- cg->record_exits = 0;
56
- if (cg->record){
57
- cg->record_index = InteractionRecordData_getp__index(cg->record);
58
- cg->record_impacts = BlackCrystalData_get_record_impacts(el);
59
- cg->record_exits = BlackCrystalData_get_record_exits(el);
60
- }
61
- // Not needed, set to zero
62
- cg->miscut_angle = 0;
63
- cg->s_P = 0;
64
- cg->x_P = 0;
65
- cg->t_VImax = 0;
29
+ cg->length = BlackCrystalData_get_length(el);
30
+ cg->side = BlackCrystalData_get__side(el);
31
+ cg->bending_radius = BlackCrystalData_get__bending_radius(el);
32
+ cg->bending_angle = BlackCrystalData_get__bending_angle(el);
33
+ cg->width = BlackCrystalData_get__width(el);
34
+ cg->height = BlackCrystalData_get__height(el);
35
+ cg->jaw_U = BlackCrystalData_get__jaw_U(el);
36
+ cg->sin_z = BlackCrystalData_get__sin_z(el);
37
+ cg->cos_z = BlackCrystalData_get__cos_z(el);
38
+ cg->sin_y = BlackCrystalData_get__sin_y(el);
39
+ cg->cos_y = BlackCrystalData_get__cos_y(el);
40
+ double jaw;
41
+ if (cg->side == 1){
42
+ jaw = cg->jaw_U;
43
+ } else if (cg->side == -1){
44
+ jaw = cg->jaw_U - cg->width; // To ensure that jaw_U is the inner corner
45
+ } else {
46
+ kill_all_particles(part0, XC_ERR_INVALID_XOFIELD);
47
+ return cg;
66
48
  }
67
-
49
+ cg->segments = create_crystal(cg->bending_radius, cg->width, cg->length, jaw, cg->sin_y, cg->cos_y);
50
+ // Impact table
51
+ cg->record = BlackCrystalData_getp_internal_record(el, part0);
52
+ cg->record_index = NULL;
53
+ cg->record_impacts = 0;
54
+ cg->record_exits = 0;
55
+ if (cg->record){
56
+ cg->record_index = InteractionRecordData_getp__index(cg->record);
57
+ cg->record_impacts = BlackCrystalData_get_record_impacts(el);
58
+ cg->record_exits = BlackCrystalData_get_record_exits(el);
59
+ }
60
+ // Not needed, set to zero
61
+ cg->miscut_angle = 0;
62
+ cg->s_P = 0;
63
+ cg->x_P = 0;
64
+ cg->t_VImax = 0;
68
65
  return cg;
69
66
  }
70
67
 
71
68
  /*gpufun*/
72
- void BlackCrystal_free(CrystalGeometry restrict cg, int8_t active){
73
- if (active){
74
- destroy_crystal(cg->segments);
75
- }
69
+ void BlackCrystal_free(CrystalGeometry restrict cg){
70
+ destroy_crystal(cg->segments);
76
71
  free(cg);
77
72
  }
78
73
 
79
74
 
80
75
  /*gpufun*/
81
76
  void BlackCrystal_track_local_particle(BlackCrystalData el, LocalParticle* part0){
82
-
83
- // Collimator active and length
84
77
  int8_t active = BlackCrystalData_get_active(el);
85
78
  active *= BlackCrystalData_get__tracking(el);
86
79
  double const length = BlackCrystalData_get_length(el);
87
80
 
88
81
  // Get geometry
89
- CrystalGeometry cg = BlackCrystal_init_geometry(el, part0, active);
90
- int8_t record_scatterings = BlackCrystalData_get_record_scatterings(el);
82
+ CrystalGeometry cg;
83
+ int8_t record_scatterings;
84
+ if (active){
85
+ cg = BlackCrystal_init_geometry(el, part0);
86
+ record_scatterings = BlackCrystalData_get_record_scatterings(el);
91
87
 
92
- if (cg->width==0 || cg->height==0 || cg->bending_radius==0){
93
- kill_all_particles(part0, XC_ERR_INVALID_XOFIELD);
88
+ if (cg->width==0 || cg->height==0 || cg->bending_radius==0){
89
+ kill_all_particles(part0, XC_ERR_INVALID_XOFIELD);
90
+ }
94
91
  }
95
92
 
96
93
  //start_per_particle_block (part0->part)
@@ -123,7 +120,9 @@ void BlackCrystal_track_local_particle(BlackCrystalData el, LocalParticle* part0
123
120
  }
124
121
  }
125
122
  //end_per_particle_block
126
- BlackCrystal_free(cg, active);
123
+ if (active){
124
+ BlackCrystal_free(cg);
125
+ }
127
126
  }
128
127
 
129
128
  #endif /* XCOLL_ABSORBER_CRY_H */
@@ -101,28 +101,38 @@ void EverestBlock_track_local_particle(EverestBlockData el, LocalParticle* part0
101
101
  LocalParticle_set_s(part, 0);
102
102
 
103
103
  // Store initial coordinates for updating later
104
- double const rvv_in = LocalParticle_get_rvv(part);
104
+ double const rvv_in = LocalParticle_get_rvv(part);
105
105
  #ifdef XCOLL_USE_EXACT
106
- double const xp_in = LocalParticle_get_exact_xp(part);
107
- double const yp_in = LocalParticle_get_exact_yp(part);
106
+ double const xp_in = LocalParticle_get_exact_xp(part);
107
+ double const yp_in = LocalParticle_get_exact_yp(part);
108
108
  #else
109
- double const xp_in = LocalParticle_get_xp(part);
110
- double const yp_in = LocalParticle_get_yp(part);
109
+ double const xp_in = LocalParticle_get_xp(part);
110
+ double const yp_in = LocalParticle_get_yp(part);
111
111
  #endif
112
- double const zeta_in = LocalParticle_get_zeta(part);
113
- double const energy_in = LocalParticle_get_energy(part);
114
- double energy_out;
112
+ double const zeta_in = LocalParticle_get_zeta(part);
113
+ double const p0c = LocalParticle_get_p0c(part);
114
+ double const delta = LocalParticle_get_delta(part);
115
+ double const qq0 = LocalParticle_get_charge_ratio(part);
116
+ double const chi = LocalParticle_get_chi(part);
117
+ double const pc_in = (1 + delta)*p0c*qq0/chi;
118
+ double pc_out;
115
119
 
116
120
  EverestData everest = EverestBlock_init_data(part, coll);
117
- energy_out = jaw(everest, part, energy_in, length, 0);
121
+ pc_out = jaw(everest, part, pc_in, length, 0);
118
122
  free(everest);
119
123
  LocalParticle_add_to_s(part, s_block);
120
124
 
121
125
  LocalParticle_set_zeta(part, zeta_in);
126
+
122
127
  // Survived particles need correcting:
123
128
  if (LocalParticle_get_state(part)>0){
124
- // Update energy; the last flag keeps angles constant (even valid for exact angles!)
125
- LocalParticle_add_to_energy(part, energy_out - energy_in, 0);
129
+ double const rpp_old = LocalParticle_get_rpp(part);
130
+ LocalParticle_update_delta(part, pc_out*chi/p0c/qq0 - 1);
131
+ // Keep angles constant (this is also correct for exact angles): px_new = px_old*(1 + δ_new)/(1 + δ_old)
132
+ double const scale = rpp_old / LocalParticle_get_rpp(part);
133
+ LocalParticle_scale_px(part, scale);
134
+ LocalParticle_scale_py(part, scale);
135
+
126
136
  // Update zeta
127
137
  #ifdef XCOLL_USE_EXACT
128
138
  double xp = LocalParticle_get_exact_xp(part);
@@ -32,65 +32,60 @@ void EverestCollimator_set_material(EverestCollimatorData el){
32
32
 
33
33
 
34
34
  /*gpufun*/
35
- CollimatorGeometry EverestCollimator_init_geometry(EverestCollimatorData el, LocalParticle* part0, int8_t active){
35
+ CollimatorGeometry EverestCollimator_init_geometry(EverestCollimatorData el, LocalParticle* part0){
36
36
  CollimatorGeometry cg = (CollimatorGeometry) malloc(sizeof(CollimatorGeometry_));
37
- if (active){ // This is needed in order to avoid that the initialisation is called during a twiss!
38
- // Jaw corners (with tilts)
39
- cg->jaw_LU = EverestCollimatorData_get__jaw_LU(el);
40
- cg->jaw_RU = EverestCollimatorData_get__jaw_RU(el);
41
- // Get angles of jaws
42
- cg->sin_zL = EverestCollimatorData_get__sin_zL(el);
43
- cg->cos_zL = EverestCollimatorData_get__cos_zL(el);
44
- cg->sin_zR = EverestCollimatorData_get__sin_zR(el);
45
- cg->cos_zR = EverestCollimatorData_get__cos_zR(el);
46
- cg->sin_zDiff = EverestCollimatorData_get__sin_zDiff(el);
47
- cg->cos_zDiff = EverestCollimatorData_get__cos_zDiff(el);
48
- cg->jaws_parallel = EverestCollimatorData_get__jaws_parallel(el);
49
- // Tilts
50
- cg->sin_yL = EverestCollimatorData_get__sin_yL(el);
51
- cg->cos_yL = EverestCollimatorData_get__cos_yL(el);
52
- cg->sin_yR = EverestCollimatorData_get__sin_yR(el);
53
- cg->cos_yR = EverestCollimatorData_get__cos_yR(el);
54
- // Length and segments
55
- cg->length = EverestCollimatorData_get_length(el);
56
- cg->side = EverestCollimatorData_get__side(el);
57
- double s_U, s_D, x_D;
58
- if (cg->side != -1){
59
- s_U = cg->length/2 * (1-cg->cos_yL);
60
- s_D = cg->length/2 * (1+cg->cos_yL);
61
- x_D = EverestCollimatorData_get__jaw_LD(el);
62
- cg->segments_L = create_jaw(s_U, cg->jaw_LU, s_D, x_D, cg->sin_yL/cg->cos_yL, 1);
63
- }
64
- if (cg->side != 1){
65
- s_U = cg->length/2 * (1-cg->cos_yR);
66
- s_D = cg->length/2 * (1+cg->cos_yR);
67
- x_D = EverestCollimatorData_get__jaw_RD(el);
68
- cg->segments_R = create_jaw(s_U, cg->jaw_RU, s_D, x_D, cg->sin_yR/cg->cos_yR, -1);
69
- }
70
- // Impact table
71
- cg->record = EverestCollimatorData_getp_internal_record(el, part0);
72
- cg->record_index = NULL;
73
- cg->record_impacts = 0;
74
- cg->record_exits = 0;
75
- if (cg->record){
76
- cg->record_index = InteractionRecordData_getp__index(cg->record);
77
- cg->record_impacts = EverestCollimatorData_get_record_impacts(el);
78
- cg->record_exits = EverestCollimatorData_get_record_exits(el);
79
- }
37
+ // Jaw corners (with tilts)
38
+ cg->jaw_LU = EverestCollimatorData_get__jaw_LU(el);
39
+ cg->jaw_RU = EverestCollimatorData_get__jaw_RU(el);
40
+ // Get angles of jaws
41
+ cg->sin_zL = EverestCollimatorData_get__sin_zL(el);
42
+ cg->cos_zL = EverestCollimatorData_get__cos_zL(el);
43
+ cg->sin_zR = EverestCollimatorData_get__sin_zR(el);
44
+ cg->cos_zR = EverestCollimatorData_get__cos_zR(el);
45
+ cg->sin_zDiff = EverestCollimatorData_get__sin_zDiff(el);
46
+ cg->cos_zDiff = EverestCollimatorData_get__cos_zDiff(el);
47
+ cg->jaws_parallel = EverestCollimatorData_get__jaws_parallel(el);
48
+ // Tilts
49
+ cg->sin_yL = EverestCollimatorData_get__sin_yL(el);
50
+ cg->cos_yL = EverestCollimatorData_get__cos_yL(el);
51
+ cg->sin_yR = EverestCollimatorData_get__sin_yR(el);
52
+ cg->cos_yR = EverestCollimatorData_get__cos_yR(el);
53
+ // Length and segments
54
+ cg->length = EverestCollimatorData_get_length(el);
55
+ cg->side = EverestCollimatorData_get__side(el);
56
+ double s_U, s_D, x_D;
57
+ if (cg->side != -1){
58
+ s_U = cg->length/2 * (1-cg->cos_yL);
59
+ s_D = cg->length/2 * (1+cg->cos_yL);
60
+ x_D = EverestCollimatorData_get__jaw_LD(el);
61
+ cg->segments_L = create_jaw(s_U, cg->jaw_LU, s_D, x_D, cg->sin_yL/cg->cos_yL, 1);
62
+ }
63
+ if (cg->side != 1){
64
+ s_U = cg->length/2 * (1-cg->cos_yR);
65
+ s_D = cg->length/2 * (1+cg->cos_yR);
66
+ x_D = EverestCollimatorData_get__jaw_RD(el);
67
+ cg->segments_R = create_jaw(s_U, cg->jaw_RU, s_D, x_D, cg->sin_yR/cg->cos_yR, -1);
68
+ }
69
+ // Impact table
70
+ cg->record = EverestCollimatorData_getp_internal_record(el, part0);
71
+ cg->record_index = NULL;
72
+ cg->record_impacts = 0;
73
+ cg->record_exits = 0;
74
+ if (cg->record){
75
+ cg->record_index = InteractionRecordData_getp__index(cg->record);
76
+ cg->record_impacts = EverestCollimatorData_get_record_impacts(el);
77
+ cg->record_exits = EverestCollimatorData_get_record_exits(el);
80
78
  }
81
-
82
79
  return cg;
83
80
  }
84
81
 
85
82
  /*gpufun*/
86
- void EverestCollimator_free(CollimatorGeometry restrict cg, int8_t active){
87
- if (active){
88
- if (cg->side != -1){
89
- destroy_jaw(cg->segments_L);
90
- }
91
- if (cg->side != 1){
92
- destroy_jaw(cg->segments_R);
93
- }
83
+ void EverestCollimator_free(CollimatorGeometry restrict cg){
84
+ if (cg->side != -1){
85
+ destroy_jaw(cg->segments_L);
86
+ }
87
+ if (cg->side != 1){
88
+ destroy_jaw(cg->segments_R);
94
89
  }
95
90
  free(cg);
96
91
  }
@@ -100,30 +95,28 @@ void EverestCollimator_free(CollimatorGeometry restrict cg, int8_t active){
100
95
  // run this function at creation of the collimator instead of every turn
101
96
  // Hmmmm this should be called whenever we change an xofield
102
97
  /*gpufun*/
103
- EverestCollData EverestCollimator_init(EverestCollimatorData el, LocalParticle* part0, int8_t active){
98
+ EverestCollData EverestCollimator_init(EverestCollimatorData el, LocalParticle* part0){
104
99
  EverestCollData coll = (EverestCollData) malloc(sizeof(EverestCollData_));
105
- if (active){ // This is needed in order to avoid that the initialisation is called during a twiss!
106
- // Random generator and material
107
- coll->rng = EverestCollimatorData_getp_rutherford_rng(el);
108
- MaterialData material = EverestCollimatorData_getp__material(el);
109
- coll->exenergy = MaterialData_get_excitation_energy(material)*1.0e3; // MeV
110
- coll->rho = MaterialData_get_density(material);
111
- coll->anuc = MaterialData_get_A(material);
112
- coll->zatom = MaterialData_get_Z(material);
113
- coll->bnref = MaterialData_get_nuclear_elastic_slope(material);
114
- coll->radl = MaterialData_get_radiation_length(material);
115
- coll->csref[0] = MaterialData_get_cross_section(material, 0);
116
- coll->csref[1] = MaterialData_get_cross_section(material, 1);
117
- coll->csref[5] = MaterialData_get_cross_section(material, 5);
118
- coll->only_mcs = MaterialData_get__only_mcs(material);
119
- // Impact table: need it here to record interactions
120
- coll->record = EverestCollimatorData_getp_internal_record(el, part0);
121
- coll->record_index = NULL;
122
- coll->record_scatterings = 0;
123
- if (coll->record){
124
- coll->record_index = InteractionRecordData_getp__index(coll->record);
125
- coll->record_scatterings = EverestCollimatorData_get_record_scatterings(el);
126
- }
100
+ // Random generator and material
101
+ coll->rng = EverestCollimatorData_getp_rutherford_rng(el);
102
+ MaterialData material = EverestCollimatorData_getp__material(el);
103
+ coll->exenergy = MaterialData_get_excitation_energy(material)*1.0e3; // MeV
104
+ coll->rho = MaterialData_get_density(material);
105
+ coll->anuc = MaterialData_get_A(material);
106
+ coll->zatom = MaterialData_get_Z(material);
107
+ coll->bnref = MaterialData_get_nuclear_elastic_slope(material);
108
+ coll->radl = MaterialData_get_radiation_length(material);
109
+ coll->csref[0] = MaterialData_get_cross_section(material, 0);
110
+ coll->csref[1] = MaterialData_get_cross_section(material, 1);
111
+ coll->csref[5] = MaterialData_get_cross_section(material, 5);
112
+ coll->only_mcs = MaterialData_get__only_mcs(material);
113
+ // Impact table: need it here to record interactions
114
+ coll->record = EverestCollimatorData_getp_internal_record(el, part0);
115
+ coll->record_index = NULL;
116
+ coll->record_scatterings = 0;
117
+ if (coll->record){
118
+ coll->record_index = InteractionRecordData_getp__index(coll->record);
119
+ coll->record_scatterings = EverestCollimatorData_get_record_scatterings(el);
127
120
  }
128
121
  return coll;
129
122
  }
@@ -150,8 +143,12 @@ void EverestCollimator_track_local_particle(EverestCollimatorData el, LocalParti
150
143
 
151
144
  // Initialise collimator data
152
145
  // TODO: we want this to happen before tracking (instead of every turn), as a separate kernel
153
- EverestCollData coll = EverestCollimator_init(el, part0, active);
154
- CollimatorGeometry cg = EverestCollimator_init_geometry(el, part0, active);
146
+ EverestCollData coll;
147
+ CollimatorGeometry cg;
148
+ if (active){
149
+ coll = EverestCollimator_init(el, part0);
150
+ cg = EverestCollimator_init_geometry(el, part0);
151
+ }
155
152
 
156
153
  //start_per_particle_block (part0->part)
157
154
  if (!active){
@@ -168,17 +165,21 @@ void EverestCollimator_track_local_particle(EverestCollimatorData el, LocalParti
168
165
  LocalParticle_set_s(part, 0);
169
166
 
170
167
  // Store initial coordinates for updating later
171
- double const rvv_in = LocalParticle_get_rvv(part);
168
+ double const rvv_in = LocalParticle_get_rvv(part);
172
169
  #ifdef XCOLL_USE_EXACT
173
- double const xp_in = LocalParticle_get_exact_xp(part);
174
- double const yp_in = LocalParticle_get_exact_yp(part);
170
+ double const xp_in = LocalParticle_get_exact_xp(part);
171
+ double const yp_in = LocalParticle_get_exact_yp(part);
175
172
  #else
176
- double const xp_in = LocalParticle_get_xp(part);
177
- double const yp_in = LocalParticle_get_yp(part);
173
+ double const xp_in = LocalParticle_get_xp(part);
174
+ double const yp_in = LocalParticle_get_yp(part);
178
175
  #endif
179
- double const zeta_in = LocalParticle_get_zeta(part);
180
- double const energy_in = LocalParticle_get_energy(part);
181
- double energy_out;
176
+ double const zeta_in = LocalParticle_get_zeta(part);
177
+ double const p0c = LocalParticle_get_p0c(part);
178
+ double const delta = LocalParticle_get_delta(part);
179
+ double const qq0 = LocalParticle_get_charge_ratio(part);
180
+ double const chi = LocalParticle_get_chi(part);
181
+ double const pc_in = (1 + delta)*p0c*qq0/chi;
182
+ double pc_out;
182
183
 
183
184
  // Check if hit on jaws
184
185
  int8_t is_hit = hit_jaws_check_and_transform(part, cg);
@@ -188,7 +189,7 @@ void EverestCollimator_track_local_particle(EverestCollimatorData el, LocalParti
188
189
  double remaining_length = length - LocalParticle_get_s(part);
189
190
  // Scatter
190
191
  EverestData everest = EverestCollimator_init_data(part, coll);
191
- energy_out = jaw(everest, part, energy_in, remaining_length, 1);
192
+ pc_out = jaw(everest, part, pc_in, remaining_length, 1);
192
193
  free(everest);
193
194
  }
194
195
 
@@ -197,10 +198,16 @@ void EverestCollimator_track_local_particle(EverestCollimatorData el, LocalParti
197
198
  LocalParticle_add_to_s(part, s_coll);
198
199
 
199
200
  LocalParticle_set_zeta(part, zeta_in);
201
+
200
202
  // Hit and survived particles need correcting:
201
203
  if (is_hit!=0 && LocalParticle_get_state(part)>0){
202
- // Update energy; the last flag keeps angles constant (even valid for exact angles!)
203
- LocalParticle_add_to_energy(part, energy_out - energy_in, 0);
204
+ double const rpp_old = LocalParticle_get_rpp(part);
205
+ LocalParticle_update_delta(part, pc_out*chi/p0c/qq0 - 1);
206
+ // Keep angles constant (this is also correct for exact angles): px_new = px_old*(1 + δ_new)/(1 + δ_old)
207
+ double const scale = rpp_old / LocalParticle_get_rpp(part);
208
+ LocalParticle_scale_px(part, scale);
209
+ LocalParticle_scale_py(part, scale);
210
+
204
211
  // Update zeta
205
212
  #ifdef XCOLL_USE_EXACT
206
213
  double xp = LocalParticle_get_exact_xp(part);
@@ -218,8 +225,10 @@ void EverestCollimator_track_local_particle(EverestCollimatorData el, LocalParti
218
225
  }
219
226
  }
220
227
  //end_per_particle_block
221
- EverestCollimator_free(cg, active);
222
- free(coll);
228
+ if (active){
229
+ EverestCollimator_free(cg);
230
+ free(coll);
231
+ }
223
232
  }
224
233
 
225
234