xcoll 0.5.12__py3-none-any.whl → 0.6.1__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 (336) hide show
  1. xcoll/__init__.py +5 -18
  2. xcoll/__init__.py.orig +26 -0
  3. xcoll/beam_elements/__init__.py +1 -0
  4. xcoll/beam_elements/absorber.py +12 -2
  5. xcoll/beam_elements/base.py +162 -62
  6. xcoll/beam_elements/blowup.py +1 -0
  7. xcoll/beam_elements/elements_src/black_absorber.h +57 -58
  8. xcoll/beam_elements/elements_src/black_crystal.h +49 -50
  9. xcoll/beam_elements/elements_src/everest_block.h +21 -11
  10. xcoll/beam_elements/elements_src/everest_collimator.h +100 -91
  11. xcoll/beam_elements/elements_src/everest_crystal.h +145 -140
  12. xcoll/beam_elements/elements_src/transparent_collimator.h +126 -0
  13. xcoll/beam_elements/elements_src/transparent_crystal.h +118 -0
  14. xcoll/beam_elements/everest.py +16 -5
  15. xcoll/beam_elements/monitor.py +1 -0
  16. xcoll/beam_elements/transparent.py +83 -0
  17. xcoll/colldb.py +15 -6
  18. xcoll/general.py +1 -1
  19. xcoll/general.py.orig +20 -0
  20. xcoll/headers/particle_states.py +51 -0
  21. xcoll/initial_distribution.py +121 -91
  22. xcoll/initial_distribution.py.orig +256 -0
  23. xcoll/interaction_record/interaction_record.py +2 -1
  24. xcoll/interaction_record/interaction_types.py +2 -2
  25. xcoll/line_tools.py +163 -73
  26. xcoll/lossmap.py +519 -127
  27. xcoll/plot.py +109 -0
  28. xcoll/rf_sweep.py +6 -0
  29. xcoll/scattering_routines/engine.py +414 -217
  30. xcoll/scattering_routines/environment.py +297 -0
  31. xcoll/scattering_routines/everest/amorphous.h +95 -71
  32. xcoll/scattering_routines/everest/{channeling.h → channelling.h} +121 -112
  33. xcoll/scattering_routines/everest/constants.h +1 -1
  34. xcoll/scattering_routines/everest/crystal_parameters.h +9 -9
  35. xcoll/scattering_routines/everest/everest.h +8 -3
  36. xcoll/scattering_routines/everest/everest.py +2 -1
  37. xcoll/scattering_routines/everest/ionisation_loss.h +141 -0
  38. xcoll/scattering_routines/everest/jaw.h +19 -24
  39. xcoll/scattering_routines/everest/materials.py +2 -0
  40. xcoll/scattering_routines/everest/multiple_coulomb_scattering.h +2 -2
  41. xcoll/scattering_routines/everest/nuclear_interaction.h +35 -19
  42. xcoll/scattering_routines/everest/properties.h +3 -72
  43. xcoll/xaux.py +65 -109
  44. {xcoll-0.5.12.dist-info → xcoll-0.6.1.dist-info}/METADATA +5 -5
  45. xcoll-0.6.1.dist-info/RECORD +138 -0
  46. xcoll/_manager.py +0 -22
  47. xcoll/headers/particle_states.h +0 -25
  48. xcoll/install.py +0 -35
  49. xcoll/scattering_routines/geant4/collimasim/.git +0 -1
  50. xcoll/scattering_routines/geant4/collimasim/.gitignore +0 -12
  51. xcoll/scattering_routines/geant4/collimasim/.gitmodules +0 -3
  52. xcoll/scattering_routines/geant4/collimasim/CMakeLists.txt +0 -26
  53. xcoll/scattering_routines/geant4/collimasim/README.md +0 -21
  54. xcoll/scattering_routines/geant4/collimasim/docs/Makefile +0 -20
  55. xcoll/scattering_routines/geant4/collimasim/docs/make.bat +0 -35
  56. xcoll/scattering_routines/geant4/collimasim/docs/source/collimasim.rst +0 -10
  57. xcoll/scattering_routines/geant4/collimasim/docs/source/conf.py +0 -59
  58. xcoll/scattering_routines/geant4/collimasim/docs/source/index.rst +0 -26
  59. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.appveyor.yml +0 -37
  60. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.clang-format +0 -19
  61. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.clang-tidy +0 -65
  62. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.cmake-format.yaml +0 -73
  63. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.git +0 -1
  64. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/CODEOWNERS +0 -9
  65. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/CONTRIBUTING.md +0 -386
  66. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/ISSUE_TEMPLATE/bug-report.yml +0 -45
  67. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/ISSUE_TEMPLATE/config.yml +0 -8
  68. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/dependabot.yml +0 -16
  69. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/labeler.yml +0 -8
  70. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/labeler_merged.yml +0 -3
  71. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/pull_request_template.md +0 -19
  72. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/ci.yml +0 -969
  73. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/configure.yml +0 -84
  74. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/format.yml +0 -48
  75. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/labeler.yml +0 -16
  76. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/pip.yml +0 -103
  77. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.gitignore +0 -45
  78. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.pre-commit-config.yaml +0 -151
  79. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.readthedocs.yml +0 -3
  80. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/CMakeLists.txt +0 -297
  81. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/LICENSE +0 -29
  82. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/MANIFEST.in +0 -6
  83. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/README.rst +0 -180
  84. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/Doxyfile +0 -23
  85. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/Makefile +0 -192
  86. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/_static/theme_overrides.css +0 -11
  87. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/chrono.rst +0 -81
  88. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/custom.rst +0 -93
  89. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/eigen.rst +0 -310
  90. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/functional.rst +0 -109
  91. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/index.rst +0 -43
  92. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/overview.rst +0 -171
  93. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/stl.rst +0 -251
  94. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/strings.rst +0 -305
  95. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/classes.rst +0 -1297
  96. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/embedding.rst +0 -262
  97. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/exceptions.rst +0 -396
  98. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/functions.rst +0 -568
  99. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/misc.rst +0 -337
  100. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/index.rst +0 -13
  101. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/numpy.rst +0 -463
  102. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/object.rst +0 -286
  103. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/utilities.rst +0 -155
  104. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/smart_ptrs.rst +0 -174
  105. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/basics.rst +0 -308
  106. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/benchmark.py +0 -91
  107. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/benchmark.rst +0 -95
  108. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/changelog.rst +0 -2050
  109. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/classes.rst +0 -542
  110. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/cmake/index.rst +0 -8
  111. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/compiling.rst +0 -648
  112. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/conf.py +0 -381
  113. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/faq.rst +0 -343
  114. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/index.rst +0 -48
  115. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/installing.rst +0 -105
  116. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/limitations.rst +0 -72
  117. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11-logo.png +0 -0
  118. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python1.png +0 -0
  119. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python1.svg +0 -427
  120. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python2.png +0 -0
  121. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python2.svg +0 -427
  122. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/reference.rst +0 -130
  123. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/release.rst +0 -96
  124. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/requirements.txt +0 -8
  125. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/upgrade.rst +0 -548
  126. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/attr.h +0 -605
  127. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/buffer_info.h +0 -144
  128. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/cast.h +0 -1432
  129. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/chrono.h +0 -213
  130. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/common.h +0 -2
  131. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/complex.h +0 -65
  132. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/class.h +0 -709
  133. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/common.h +0 -1021
  134. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/descr.h +0 -104
  135. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/init.h +0 -346
  136. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/internals.h +0 -467
  137. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/type_caster_base.h +0 -978
  138. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/typeid.h +0 -55
  139. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/eigen.h +0 -606
  140. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/embed.h +0 -284
  141. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/eval.h +0 -163
  142. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/functional.h +0 -121
  143. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/gil.h +0 -193
  144. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/iostream.h +0 -275
  145. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/numpy.h +0 -1741
  146. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/operators.h +0 -163
  147. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/options.h +0 -65
  148. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/pybind11.h +0 -2497
  149. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/pytypes.h +0 -1879
  150. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl/filesystem.h +0 -103
  151. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl.h +0 -375
  152. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl_bind.h +0 -747
  153. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/noxfile.py +0 -88
  154. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/__init__.py +0 -11
  155. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/__main__.py +0 -52
  156. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/_version.py +0 -12
  157. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/_version.pyi +0 -6
  158. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/commands.py +0 -21
  159. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/py.typed +0 -0
  160. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/setup_helpers.py +0 -482
  161. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/setup_helpers.pyi +0 -63
  162. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pyproject.toml +0 -41
  163. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/setup.cfg +0 -56
  164. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/setup.py +0 -155
  165. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/CMakeLists.txt +0 -503
  166. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/conftest.py +0 -208
  167. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/constructor_stats.h +0 -275
  168. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/cross_module_gil_utils.cpp +0 -73
  169. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/env.py +0 -33
  170. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_python_package/pytest.ini +0 -0
  171. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_python_package/test_files.py +0 -279
  172. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_setuptools/pytest.ini +0 -0
  173. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_setuptools/test_setuphelper.py +0 -143
  174. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/local_bindings.h +0 -85
  175. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/object.h +0 -179
  176. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_cross_module_tests.cpp +0 -151
  177. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_tests.cpp +0 -91
  178. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_tests.h +0 -85
  179. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pytest.ini +0 -19
  180. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/requirements.txt +0 -12
  181. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_async.cpp +0 -26
  182. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_async.py +0 -25
  183. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_buffers.cpp +0 -216
  184. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_buffers.py +0 -163
  185. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_builtin_casters.cpp +0 -286
  186. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_builtin_casters.py +0 -536
  187. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_call_policies.cpp +0 -107
  188. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_call_policies.py +0 -248
  189. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_callbacks.cpp +0 -227
  190. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_callbacks.py +0 -202
  191. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_chrono.cpp +0 -84
  192. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_chrono.py +0 -210
  193. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_class.cpp +0 -550
  194. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_class.py +0 -473
  195. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/CMakeLists.txt +0 -84
  196. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/embed.cpp +0 -21
  197. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_embed/CMakeLists.txt +0 -28
  198. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_function/CMakeLists.txt +0 -39
  199. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_target/CMakeLists.txt +0 -46
  200. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/main.cpp +0 -6
  201. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt +0 -41
  202. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_function/CMakeLists.txt +0 -35
  203. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_target/CMakeLists.txt +0 -41
  204. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/test.py +0 -10
  205. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_constants_and_functions.cpp +0 -165
  206. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_constants_and_functions.py +0 -53
  207. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_copy_move.cpp +0 -238
  208. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_copy_move.py +0 -126
  209. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_casters.cpp +0 -141
  210. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_casters.py +0 -117
  211. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_setup.cpp +0 -41
  212. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_setup.py +0 -50
  213. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_docstring_options.cpp +0 -69
  214. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_docstring_options.py +0 -42
  215. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eigen.cpp +0 -348
  216. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eigen.py +0 -771
  217. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/CMakeLists.txt +0 -47
  218. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/catch.cpp +0 -22
  219. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/external_module.cpp +0 -23
  220. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/test_interpreter.cpp +0 -326
  221. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/test_interpreter.py +0 -15
  222. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_enum.cpp +0 -148
  223. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_enum.py +0 -272
  224. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval.cpp +0 -119
  225. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval.py +0 -51
  226. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval_call.py +0 -5
  227. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.cpp +0 -285
  228. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.h +0 -12
  229. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.py +0 -265
  230. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_factory_constructors.cpp +0 -397
  231. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_factory_constructors.py +0 -520
  232. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_gil_scoped.cpp +0 -49
  233. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_gil_scoped.py +0 -94
  234. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_iostream.cpp +0 -125
  235. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_iostream.py +0 -331
  236. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_kwargs_and_defaults.cpp +0 -153
  237. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_kwargs_and_defaults.py +0 -284
  238. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_local_bindings.cpp +0 -107
  239. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_local_bindings.py +0 -257
  240. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_methods_and_attributes.cpp +0 -412
  241. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_methods_and_attributes.py +0 -517
  242. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_modules.cpp +0 -102
  243. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_modules.py +0 -92
  244. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_multiple_inheritance.cpp +0 -233
  245. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_multiple_inheritance.py +0 -360
  246. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_array.cpp +0 -472
  247. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_array.py +0 -593
  248. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_dtypes.cpp +0 -524
  249. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_dtypes.py +0 -441
  250. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_vectorize.cpp +0 -103
  251. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_vectorize.py +0 -267
  252. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_opaque_types.cpp +0 -73
  253. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_opaque_types.py +0 -59
  254. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_operator_overloading.cpp +0 -235
  255. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_operator_overloading.py +0 -146
  256. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pickling.cpp +0 -189
  257. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pickling.py +0 -82
  258. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pytypes.cpp +0 -560
  259. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pytypes.py +0 -651
  260. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_sequences_and_iterators.cpp +0 -500
  261. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_sequences_and_iterators.py +0 -253
  262. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_smart_ptr.cpp +0 -452
  263. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_smart_ptr.py +0 -318
  264. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl.cpp +0 -342
  265. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl.py +0 -291
  266. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl_binders.cpp +0 -131
  267. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl_binders.py +0 -318
  268. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_tagbased_polymorphic.cpp +0 -144
  269. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_tagbased_polymorphic.py +0 -29
  270. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_thread.cpp +0 -66
  271. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_thread.py +0 -44
  272. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_union.cpp +0 -22
  273. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_union.py +0 -9
  274. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_virtual_functions.cpp +0 -510
  275. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_virtual_functions.py +0 -408
  276. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/valgrind-numpy-scipy.supp +0 -140
  277. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/valgrind-python.supp +0 -117
  278. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindCatch.cmake +0 -70
  279. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindEigen3.cmake +0 -86
  280. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindPythonLibsNew.cmake +0 -257
  281. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/check-style.sh +0 -44
  282. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/cmake_uninstall.cmake.in +0 -23
  283. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/libsize.py +0 -39
  284. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/make_changelog.py +0 -64
  285. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Common.cmake +0 -402
  286. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Config.cmake.in +0 -233
  287. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11NewTools.cmake +0 -276
  288. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Tools.cmake +0 -214
  289. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pyproject.toml +0 -3
  290. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/setup_global.py.in +0 -65
  291. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/setup_main.py.in +0 -41
  292. xcoll/scattering_routines/geant4/collimasim/pyproject.toml +0 -8
  293. xcoll/scattering_routines/geant4/collimasim/setup.py +0 -144
  294. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSPyATInterface.cpp +0 -403
  295. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSPyATInterface.hh +0 -100
  296. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSXtrackInterface.cpp +0 -763
  297. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSXtrackInterface.hh +0 -118
  298. xcoll/scattering_routines/geant4/collimasim/src/collimasim/__init__.py +0 -8
  299. xcoll/scattering_routines/geant4/collimasim/src/collimasim/bindings.cpp +0 -63
  300. xcoll/scattering_routines/geant4/collimasim/src/collimasim/pyCollimatorPass.py +0 -142
  301. xcoll/scattering_routines/geant4/collimasim/src/collimasim/xtrack_collimator.py +0 -556
  302. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/PKG-INFO +0 -6
  303. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/SOURCES.txt +0 -24
  304. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/dependency_links.txt +0 -1
  305. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/not-zip-safe +0 -1
  306. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/top_level.txt +0 -1
  307. xcoll/scattering_routines/geant4/collimasim/tests/README.md +0 -25
  308. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_forions.dat +0 -25
  309. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_new_example.dat +0 -18
  310. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_old_example.dat +0 -68
  311. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_testing.dat +0 -15
  312. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_yaml_example.yaml +0 -110
  313. xcoll/scattering_routines/geant4/collimasim/tests/resources/collgaps.dat +0 -7
  314. xcoll/scattering_routines/geant4/collimasim/tests/resources/collgaps_pyat_test.dat +0 -3
  315. xcoll/scattering_routines/geant4/collimasim/tests/resources/collonly_twiss_file_example.tfs +0 -54
  316. xcoll/scattering_routines/geant4/collimasim/tests/resources/settings.gmad +0 -3
  317. xcoll/scattering_routines/geant4/collimasim/tests/resources/settings_black_absorber.gmad +0 -3
  318. xcoll/scattering_routines/geant4/collimasim/tests/resources/settings_ions.gmad +0 -5
  319. xcoll/scattering_routines/geant4/collimasim/tests/resources/twiss_file_testing.tfs +0 -51
  320. xcoll/scattering_routines/geant4/collimasim/tests/test_pyat.py +0 -65
  321. xcoll/scattering_routines/geant4/collimasim/tests/test_pyat_passmethod.py +0 -59
  322. xcoll/scattering_routines/geant4/collimasim/tests/test_pyat_tracking.py +0 -102
  323. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack.py +0 -75
  324. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_angle.py +0 -74
  325. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_colldb_load.py +0 -84
  326. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_interaction.py +0 -159
  327. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_interaction_ion.py +0 -99
  328. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_ions.py +0 -78
  329. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_lost_energy.py +0 -88
  330. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tilt.py +0 -80
  331. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tracking.py +0 -97
  332. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tracking_ions.py +0 -96
  333. xcoll-0.5.12.dist-info/RECORD +0 -415
  334. {xcoll-0.5.12.dist-info → xcoll-0.6.1.dist-info}/LICENSE +0 -0
  335. {xcoll-0.5.12.dist-info → xcoll-0.6.1.dist-info}/NOTICE +0 -0
  336. {xcoll-0.5.12.dist-info → xcoll-0.6.1.dist-info}/WHEEL +0 -0
@@ -33,90 +33,87 @@ void EverestCrystal_set_material(EverestCrystalData el){
33
33
 
34
34
 
35
35
  /*gpufun*/
36
- CrystalGeometry EverestCrystal_init_geometry(EverestCrystalData el, LocalParticle* part0, int8_t active){
36
+ CrystalGeometry EverestCrystal_init_geometry(EverestCrystalData el, LocalParticle* part0){
37
37
  CrystalGeometry cg = (CrystalGeometry) malloc(sizeof(CrystalGeometry_));
38
- if (active){ // This is needed in order to avoid that the initialisation is called during a twiss!
39
- cg->length = EverestCrystalData_get_length(el);
40
- cg->side = EverestCrystalData_get__side(el);
41
- if (cg->side == 0){
42
- kill_all_particles(part0, XC_ERR_INVALID_XOFIELD);
43
- return cg;
44
- }
45
- double R = EverestCrystalData_get__bending_radius(el);
46
- double t_R = EverestCrystalData_get__bending_angle(el);
47
- cg->bending_radius = R;
48
- cg->bending_angle = t_R;
49
- cg->miscut_angle = EverestCrystalData_get_miscut(el);
50
- cg->width = EverestCrystalData_get_width(el);
51
- cg->height = EverestCrystalData_get_height(el);
52
- cg->jaw_U = EverestCrystalData_get__jaw_U(el);
53
- cg->sin_z = EverestCrystalData_get__sin_z(el);
54
- cg->cos_z = EverestCrystalData_get__cos_z(el);
55
- cg->sin_y = EverestCrystalData_get__sin_y(el);
56
- cg->cos_y = EverestCrystalData_get__cos_y(el);
57
- // Segments
58
- if (cg->side == 1){
59
- cg->segments = create_crystal(cg->bending_radius, cg->width, cg->length, cg->jaw_U, \
60
- cg->sin_y, cg->cos_y);
61
- } else if (cg->side == -1){
62
- // jaw_U is the inner corner (shifted if right-sided crystal)
63
- cg->segments = create_crystal(cg->bending_radius, cg->width, cg->length, cg->jaw_U - cg->width, \
64
- cg->sin_y, cg->cos_y);
65
- }
66
- // Bend centre
67
- cg->s_B = 0;
68
- cg->x_B = cg->bending_radius;
69
- // Miscut centre
70
- cg->s_P = -R*sin(cg->miscut_angle);
71
- cg->x_P = R*cos(cg->miscut_angle);
72
- if (cg->side == 1 && R < 0){
73
- // If R<0, a left-sided crystal bends towards the beam
74
- cg->x_P = cg->x_P + cg->width;
75
- cg->x_B = cg->x_B + cg->width;
76
- } else if (cg->side == -1 && R > 0){
77
- // If R>0, a right-sided crystal bends towards the beam
78
- cg->x_P = cg->x_P - cg->width;
79
- cg->x_B = cg->x_B - cg->width;
80
- }
81
- if (cg->side == -1){
82
- // Mirror the crystal geometry
83
- cg->bending_radius = -cg->bending_radius;
84
- cg->bending_angle = -cg->bending_angle;
85
- cg->miscut_angle = -cg->miscut_angle;
86
- cg->x_P = -cg->x_P;
87
- cg->x_B = -cg->x_B;
88
- }
89
- // From here on, crystal geometry parameters can always be treated as left-sided.
90
- // Note that the segments are not mirrored, which is fine as get_s_of_first_crossing_with_vlimit
91
- // is absolute (not in the jaw reference frame). It is only after a hit is registered, that we
92
- // need to transform the particle to the jaw reference frame.
93
- double Rb;
94
- if (cg->miscut_angle > 0){
95
- Rb = R - cg->width;
96
- } else {
97
- Rb = R;
98
- }
99
- cg->t_VImax = atan( (Rb*sin(t_R) - cg->s_P) / (R - Rb*cos(t_R) - cg->x_P) );
100
- // Impact table
101
- cg->record = EverestCrystalData_getp_internal_record(el, part0);
102
- cg->record_index = NULL;
103
- cg->record_impacts = 0;
104
- cg->record_exits = 0;
105
- if (cg->record){
106
- cg->record_index = InteractionRecordData_getp__index(cg->record);
107
- cg->record_impacts = EverestCrystalData_get_record_impacts(el);
108
- cg->record_exits = EverestCrystalData_get_record_exits(el);
109
- }
38
+ cg->length = EverestCrystalData_get_length(el);
39
+ cg->side = EverestCrystalData_get__side(el);
40
+ if (cg->side == 0){
41
+ kill_all_particles(part0, XC_ERR_INVALID_XOFIELD);
42
+ return cg;
43
+ }
44
+ double R = EverestCrystalData_get__bending_radius(el);
45
+ double t_R = EverestCrystalData_get__bending_angle(el);
46
+ cg->bending_radius = R;
47
+ cg->bending_angle = t_R;
48
+ cg->miscut_angle = EverestCrystalData_get_miscut(el);
49
+ cg->width = EverestCrystalData_get__width(el);
50
+ cg->height = EverestCrystalData_get__height(el);
51
+ cg->jaw_U = EverestCrystalData_get__jaw_U(el);
52
+ cg->sin_z = EverestCrystalData_get__sin_z(el);
53
+ cg->cos_z = EverestCrystalData_get__cos_z(el);
54
+ cg->sin_y = EverestCrystalData_get__sin_y(el);
55
+ cg->cos_y = EverestCrystalData_get__cos_y(el);
56
+ // Segments
57
+ if (cg->side == 1){
58
+ cg->segments = create_crystal(cg->bending_radius, cg->width, cg->length, cg->jaw_U, \
59
+ cg->sin_y, cg->cos_y);
60
+ } else if (cg->side == -1){
61
+ // jaw_U is the inner corner (shifted if right-sided crystal)
62
+ cg->segments = create_crystal(cg->bending_radius, cg->width, cg->length, cg->jaw_U - cg->width, \
63
+ cg->sin_y, cg->cos_y);
64
+ }
65
+ // // Jaw frame is always left-sided
66
+ // cg->segments_jf = create_crystal(cg->bending_radius, cg->width, cg->length, 0, 0, 1);
67
+ // Bend centre
68
+ cg->s_B = 0;
69
+ cg->x_B = cg->bending_radius;
70
+ // Miscut centre
71
+ cg->s_P = -R*sin(cg->miscut_angle);
72
+ cg->x_P = R*cos(cg->miscut_angle);
73
+ if (cg->side == 1 && R < 0){
74
+ // If R<0, a left-sided crystal bends towards the beam
75
+ cg->x_P = cg->x_P + cg->width;
76
+ cg->x_B = cg->x_B + cg->width;
77
+ } else if (cg->side == -1 && R > 0){
78
+ // If R>0, a right-sided crystal bends towards the beam
79
+ cg->x_P = cg->x_P - cg->width;
80
+ cg->x_B = cg->x_B - cg->width;
81
+ }
82
+ if (cg->side == -1){
83
+ // Mirror the crystal geometry
84
+ cg->bending_radius = -cg->bending_radius;
85
+ cg->bending_angle = -cg->bending_angle;
86
+ cg->miscut_angle = -cg->miscut_angle;
87
+ cg->x_P = -cg->x_P;
88
+ cg->x_B = -cg->x_B;
89
+ }
90
+ // From here on, crystal geometry parameters can always be treated as left-sided.
91
+ // Note that the segments are not mirrored, which is fine as get_s_of_first_crossing_with_vlimit
92
+ // is absolute (not in the jaw reference frame). It is only after a hit is registered, that we
93
+ // need to transform the particle to the jaw reference frame.
94
+ double Rb;
95
+ if (cg->miscut_angle > 0){
96
+ Rb = R - cg->width;
97
+ } else {
98
+ Rb = R;
99
+ }
100
+ cg->t_VImax = atan( (Rb*sin(t_R) - cg->s_P) / (R - Rb*cos(t_R) - cg->x_P) );
101
+ // Impact table
102
+ cg->record = EverestCrystalData_getp_internal_record(el, part0);
103
+ cg->record_index = NULL;
104
+ cg->record_impacts = 0;
105
+ cg->record_exits = 0;
106
+ if (cg->record){
107
+ cg->record_index = InteractionRecordData_getp__index(cg->record);
108
+ cg->record_impacts = EverestCrystalData_get_record_impacts(el);
109
+ cg->record_exits = EverestCrystalData_get_record_exits(el);
110
110
  }
111
-
112
111
  return cg;
113
112
  }
114
113
 
115
114
  /*gpufun*/
116
- void EverestCrystal_free(CrystalGeometry restrict cg, int8_t active){
117
- if (active){
118
- destroy_crystal(cg->segments);
119
- }
115
+ void EverestCrystal_free(CrystalGeometry restrict cg){
116
+ destroy_crystal(cg->segments);
120
117
  free(cg);
121
118
  }
122
119
 
@@ -124,35 +121,33 @@ void EverestCrystal_free(CrystalGeometry restrict cg, int8_t active){
124
121
  // TODO: it would be great if we could set EverestData as an xofield, because then we could
125
122
  // run this function at creation of the collimator instead of every turn
126
123
  /*gpufun*/
127
- EverestCollData EverestCrystal_init(EverestCrystalData el, LocalParticle* part0, int8_t active){
124
+ EverestCollData EverestCrystal_init(EverestCrystalData el, LocalParticle* part0){
128
125
  EverestCollData coll = (EverestCollData) malloc(sizeof(EverestCollData_));
129
- if (active){ // This is needed in order to avoid that the initialisation is called during a twiss!
130
- // Random generator and material
131
- coll->rng = EverestCrystalData_getp_rutherford_rng(el);
132
- CrystalMaterialData material = EverestCrystalData_getp__material(el);
133
- coll->exenergy = CrystalMaterialData_get_excitation_energy(material)*1.0e3; // MeV
134
- coll->rho = CrystalMaterialData_get_density(material);
135
- coll->anuc = CrystalMaterialData_get_A(material);
136
- coll->zatom = CrystalMaterialData_get_Z(material);
137
- coll->bnref = CrystalMaterialData_get_nuclear_elastic_slope(material);
138
- coll->csref[0] = CrystalMaterialData_get_cross_section(material, 0);
139
- coll->csref[1] = CrystalMaterialData_get_cross_section(material, 1);
140
- coll->csref[5] = CrystalMaterialData_get_cross_section(material, 5);
141
- coll->only_mcs = CrystalMaterialData_get__only_mcs(material);
142
- coll->dlri = CrystalMaterialData_get_crystal_radiation_length(material);
143
- coll->dlyi = CrystalMaterialData_get_crystal_nuclear_length(material);
144
- coll->ai = CrystalMaterialData_get_crystal_plane_distance(material);
145
- coll->eum = CrystalMaterialData_get_crystal_potential(material);
146
- coll->collnt = CrystalMaterialData_get_nuclear_collision_length(material);
147
- coll->eta = 0.9; // Hard-coded channeling saturation factor
148
- coll->orient = EverestCrystalData_get__orient(el);
149
- // Impact table
150
- coll->record = EverestCrystalData_getp_internal_record(el, part0);
151
- coll->record_index = NULL;
152
- if (coll->record){
153
- coll->record_index = InteractionRecordData_getp__index(coll->record);
154
- coll->record_scatterings = EverestCrystalData_get_record_scatterings(el);
155
- }
126
+ // Random generator and material
127
+ coll->rng = EverestCrystalData_getp_rutherford_rng(el);
128
+ CrystalMaterialData material = EverestCrystalData_getp__material(el);
129
+ coll->exenergy = CrystalMaterialData_get_excitation_energy(material)*1.0e3; // MeV
130
+ coll->rho = CrystalMaterialData_get_density(material);
131
+ coll->anuc = CrystalMaterialData_get_A(material);
132
+ coll->zatom = CrystalMaterialData_get_Z(material);
133
+ coll->bnref = CrystalMaterialData_get_nuclear_elastic_slope(material);
134
+ coll->csref[0] = CrystalMaterialData_get_cross_section(material, 0);
135
+ coll->csref[1] = CrystalMaterialData_get_cross_section(material, 1);
136
+ coll->csref[5] = CrystalMaterialData_get_cross_section(material, 5);
137
+ coll->only_mcs = CrystalMaterialData_get__only_mcs(material);
138
+ coll->dlri = CrystalMaterialData_get_crystal_radiation_length(material);
139
+ coll->dlyi = CrystalMaterialData_get_crystal_nuclear_length(material);
140
+ coll->ai = CrystalMaterialData_get_crystal_plane_distance(material);
141
+ coll->eum = CrystalMaterialData_get_crystal_potential(material);
142
+ coll->collnt = CrystalMaterialData_get_nuclear_collision_length(material);
143
+ coll->eta = 0.9; // Hard-coded channeling saturation factor
144
+ coll->orient = EverestCrystalData_get__orient(el);
145
+ // Impact table
146
+ coll->record = EverestCrystalData_getp_internal_record(el, part0);
147
+ coll->record_index = NULL;
148
+ if (coll->record){
149
+ coll->record_index = InteractionRecordData_getp__index(coll->record);
150
+ coll->record_scatterings = EverestCrystalData_get_record_scatterings(el);
156
151
  }
157
152
  return coll;
158
153
  }
@@ -180,17 +175,25 @@ void EverestCrystal_track_local_particle(EverestCrystalData el, LocalParticle* p
180
175
  double length = EverestCrystalData_get_length(el);
181
176
 
182
177
  // Initialise collimator data
183
- // TODO: we want this to happen before tracking (instead of every turn), as a separate kernel
184
- EverestCollData coll = EverestCrystal_init(el, part0, active);
185
- CrystalGeometry cg = EverestCrystal_init_geometry(el, part0, active);
178
+ EverestCollData coll;
179
+ CrystalGeometry cg;
180
+ if (active){
181
+ // TODO: we want this to happen before tracking (instead of every turn), as a separate kernel
182
+ coll = EverestCrystal_init(el, part0);
183
+ cg = EverestCrystal_init_geometry(el, part0);
186
184
 
187
- // For info
188
- double const e0 = LocalParticle_get_energy0(part0);
189
- double t_c0 = _critical_angle0(coll, e0);
190
- double Rcrit = _critical_radius(coll, e0);
191
- double t_c = _critical_angle(coll, t_c0, Rcrit / fabs(cg->bending_radius));
192
- EverestCrystalData_set__critical_radius(el, Rcrit);
193
- EverestCrystalData_set__critical_angle(el, t_c);
185
+ // For info
186
+ double const e0 = LocalParticle_get_energy0(part0);
187
+ double t_c0 = _critical_angle0(coll, e0);
188
+ double Rcrit = _critical_radius(coll, e0);
189
+ double t_c = _critical_angle(coll, t_c0, Rcrit / fabs(cg->bending_radius));
190
+ EverestCrystalData_set__critical_radius(el, Rcrit);
191
+ EverestCrystalData_set__critical_angle(el, t_c);
192
+
193
+ if (cg->width==0 || cg->height==0 || cg->bending_radius==0){
194
+ kill_all_particles(part0, XC_ERR_INVALID_XOFIELD);
195
+ }
196
+ }
194
197
 
195
198
  //start_per_particle_block (part0->part)
196
199
  if (!active){
@@ -207,17 +210,21 @@ void EverestCrystal_track_local_particle(EverestCrystalData el, LocalParticle* p
207
210
  LocalParticle_set_s(part, 0);
208
211
 
209
212
  // Store initial coordinates for updating later
210
- double const rvv_in = LocalParticle_get_rvv(part);
213
+ double const rvv_in = LocalParticle_get_rvv(part);
211
214
  #ifdef XCOLL_USE_EXACT
212
- double const xp_in = LocalParticle_get_exact_xp(part);
213
- double const yp_in = LocalParticle_get_exact_yp(part);
215
+ double const xp_in = LocalParticle_get_exact_xp(part);
216
+ double const yp_in = LocalParticle_get_exact_yp(part);
214
217
  #else
215
- double const xp_in = LocalParticle_get_xp(part);
216
- double const yp_in = LocalParticle_get_yp(part);
218
+ double const xp_in = LocalParticle_get_xp(part);
219
+ double const yp_in = LocalParticle_get_yp(part);
217
220
  #endif
218
- double const zeta_in = LocalParticle_get_zeta(part);
219
- double const energy_in = LocalParticle_get_energy(part);
220
- double energy_out;
221
+ double const zeta_in = LocalParticle_get_zeta(part);
222
+ double const p0c = LocalParticle_get_p0c(part);
223
+ double const delta = LocalParticle_get_delta(part);
224
+ double const qq0 = LocalParticle_get_charge_ratio(part);
225
+ double const chi = LocalParticle_get_chi(part);
226
+ double const pc_in = (1 + delta)*p0c*qq0/chi;
227
+ double pc_out;
221
228
 
222
229
  // Check if hit on jaws
223
230
  int8_t is_hit = hit_crystal_check_and_transform(part, cg);
@@ -227,17 +234,7 @@ void EverestCrystal_track_local_particle(EverestCrystalData el, LocalParticle* p
227
234
  double remaining_length = length - LocalParticle_get_s(part);
228
235
  // Scatter
229
236
  EverestData everest = EverestCrystal_init_data(part, coll, cg);
230
- calculate_initial_angle(everest, part, cg);
231
- #ifdef XCOLL_USE_EXACT
232
- double const xp = LocalParticle_get_exact_xp(part);
233
- #else
234
- double const xp = LocalParticle_get_xp(part);
235
- #endif
236
- if (fabs(xp - everest->t_I) < everest->t_c) {
237
- energy_out = Channel(everest, part, cg, energy_in/1.e9, remaining_length)*1.e9;
238
- } else {
239
- energy_out = Amorphous(everest, part, cg, energy_in/1.e9, remaining_length, 1)*1.e9;
240
- }
237
+ pc_out = do_crystal(everest, part, cg, pc_in/1.e9, remaining_length)*1.e9;
241
238
  free(everest);
242
239
  }
243
240
 
@@ -246,10 +243,16 @@ void EverestCrystal_track_local_particle(EverestCrystalData el, LocalParticle* p
246
243
  LocalParticle_add_to_s(part, s_coll);
247
244
 
248
245
  LocalParticle_set_zeta(part, zeta_in);
246
+
249
247
  // Hit and survived particles need correcting:
250
248
  if (is_hit!=0 && LocalParticle_get_state(part)>0){
251
- // Update energy; the last flag keeps angles constant (even valid for exact angles!)
252
- LocalParticle_add_to_energy(part, energy_out - energy_in, 0);
249
+ double const rpp_old = LocalParticle_get_rpp(part);
250
+ LocalParticle_update_delta(part, pc_out*chi/p0c/qq0 - 1);
251
+ // Keep angles constant (this is also correct for exact angles): px_new = px_old*(1 + δ_new)/(1 + δ_old)
252
+ double const scale = rpp_old / LocalParticle_get_rpp(part);
253
+ LocalParticle_scale_px(part, scale);
254
+ LocalParticle_scale_py(part, scale);
255
+
253
256
  // Update zeta
254
257
  #ifdef XCOLL_USE_EXACT
255
258
  double xp = LocalParticle_get_exact_xp(part);
@@ -267,9 +270,11 @@ void EverestCrystal_track_local_particle(EverestCrystalData el, LocalParticle* p
267
270
  }
268
271
  }
269
272
  //end_per_particle_block
270
- EverestCrystal_free(cg, active);
271
- free(coll);
273
+ if (active){
274
+ EverestCrystal_free(cg);
275
+ free(coll);
276
+ }
272
277
  }
273
278
 
274
279
 
275
- #endif /* XCOLL_EVEREST_CRYSTAL_H */
280
+ #endif /* XCOLL_EVEREST_CRYSTAL_H */
@@ -0,0 +1,126 @@
1
+ // copyright ############################### #
2
+ // This file is part of the Xcoll package. #
3
+ // Copyright (c) CERN, 2025. #
4
+ // ######################################### #
5
+
6
+ #ifndef XCOLL_TRANSPARENT_COLL_H
7
+ #define XCOLL_TRANSPARENT_COLL_H
8
+
9
+
10
+ /*gpufun*/
11
+ int8_t TransparentCollimatorData_get_record_impacts(TransparentCollimatorData el){
12
+ return TransparentCollimatorData_get__record_interactions(el) % 2;
13
+ }
14
+
15
+ /*gpufun*/
16
+ int8_t TransparentCollimatorData_get_record_exits(TransparentCollimatorData el){
17
+ return (TransparentCollimatorData_get__record_interactions(el) >> 1) % 2;
18
+ }
19
+
20
+ /*gpufun*/
21
+ int8_t TransparentCollimatorData_get_record_scatterings(TransparentCollimatorData el){
22
+ return (TransparentCollimatorData_get__record_interactions(el) >> 2) % 2;
23
+ }
24
+
25
+
26
+ /*gpufun*/
27
+ CollimatorGeometry TransparentCollimator_init_geometry(TransparentCollimatorData el, LocalParticle* part0){
28
+ CollimatorGeometry cg = (CollimatorGeometry) malloc(sizeof(CollimatorGeometry_));
29
+ // Jaw corners (with tilts)
30
+ cg->jaw_LU = TransparentCollimatorData_get__jaw_LU(el);
31
+ cg->jaw_RU = TransparentCollimatorData_get__jaw_RU(el);
32
+ // Get angles of jaws
33
+ cg->sin_zL = TransparentCollimatorData_get__sin_zL(el);
34
+ cg->cos_zL = TransparentCollimatorData_get__cos_zL(el);
35
+ cg->sin_zR = TransparentCollimatorData_get__sin_zR(el);
36
+ cg->cos_zR = TransparentCollimatorData_get__cos_zR(el);
37
+ cg->sin_zDiff = TransparentCollimatorData_get__sin_zDiff(el);
38
+ cg->cos_zDiff = TransparentCollimatorData_get__cos_zDiff(el);
39
+ cg->jaws_parallel = TransparentCollimatorData_get__jaws_parallel(el);
40
+ // Tilts
41
+ cg->sin_yL = TransparentCollimatorData_get__sin_yL(el);
42
+ cg->cos_yL = TransparentCollimatorData_get__cos_yL(el);
43
+ cg->sin_yR = TransparentCollimatorData_get__sin_yR(el);
44
+ cg->cos_yR = TransparentCollimatorData_get__cos_yR(el);
45
+ // Length and segments
46
+ cg->length = TransparentCollimatorData_get_length(el);
47
+ cg->side = TransparentCollimatorData_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 = TransparentCollimatorData_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 = TransparentCollimatorData_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 = TransparentCollimatorData_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 = TransparentCollimatorData_get_record_impacts(el);
69
+ cg->record_exits = TransparentCollimatorData_get_record_exits(el);
70
+ }
71
+ return cg;
72
+ }
73
+
74
+ /*gpufun*/
75
+ void TransparentCollimator_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);
81
+ }
82
+ free(cg);
83
+ }
84
+
85
+
86
+ /*gpufun*/
87
+ void TransparentCollimator_track_local_particle(TransparentCollimatorData el, LocalParticle* part0){
88
+ int8_t active = TransparentCollimatorData_get_active(el);
89
+ active *= TransparentCollimatorData_get__tracking(el);
90
+ double const length = TransparentCollimatorData_get_length(el);
91
+
92
+ // Get geometry
93
+ CollimatorGeometry cg;
94
+ if (active){
95
+ cg = TransparentCollimator_init_geometry(el, part0);
96
+ }
97
+
98
+ //start_per_particle_block (part0->part)
99
+ if (!active){
100
+ // Drift full length
101
+ Drift_single_particle(part, length);
102
+
103
+ } else {
104
+ // Check collimator initialisation
105
+ int8_t is_tracking = assert_tracking(part, XC_ERR_INVALID_TRACK);
106
+
107
+ if (is_tracking) {
108
+ // Store s-location of start of collimator
109
+ double s_coll = LocalParticle_get_s(part);
110
+ LocalParticle_set_s(part, 0);
111
+
112
+ // Check if hit on jaws
113
+ int8_t is_hit = hit_jaws_check_and_transform(part, cg);
114
+
115
+ // Transform back to the lab frame
116
+ hit_jaws_transform_back(is_hit, part, cg);
117
+ LocalParticle_add_to_s(part, s_coll);
118
+ }
119
+ }
120
+ //end_per_particle_block
121
+ if (active){
122
+ TransparentCollimator_free(cg);
123
+ }
124
+ }
125
+
126
+ #endif /* XCOLL_TRANSPARENT_COLL_H */
@@ -0,0 +1,118 @@
1
+ // copyright ############################### #
2
+ // This file is part of the Xcoll package. #
3
+ // Copyright (c) CERN, 2025. #
4
+ // ######################################### #
5
+
6
+ #ifndef XCOLL_TRANSPAREN_CRY_H
7
+ #define XCOLL_TRANSPAREN_CRY_H
8
+
9
+
10
+ /*gpufun*/
11
+ int8_t TransparentCrystalData_get_record_impacts(TransparentCrystalData el){
12
+ return TransparentCrystalData_get__record_interactions(el) % 2;
13
+ }
14
+
15
+ /*gpufun*/
16
+ int8_t TransparentCrystalData_get_record_exits(TransparentCrystalData el){
17
+ return (TransparentCrystalData_get__record_interactions(el) >> 1) % 2;
18
+ }
19
+
20
+ /*gpufun*/
21
+ int8_t TransparentCrystalData_get_record_scatterings(TransparentCrystalData el){
22
+ return (TransparentCrystalData_get__record_interactions(el) >> 2) % 2;
23
+ }
24
+
25
+
26
+ /*gpufun*/
27
+ CrystalGeometry TransparentCrystal_init_geometry(TransparentCrystalData el, LocalParticle* part0){
28
+ CrystalGeometry cg = (CrystalGeometry) malloc(sizeof(CrystalGeometry_));
29
+ cg->length = TransparentCrystalData_get_length(el);
30
+ cg->side = TransparentCrystalData_get__side(el);
31
+ cg->bending_radius = TransparentCrystalData_get__bending_radius(el);
32
+ cg->bending_angle = TransparentCrystalData_get__bending_angle(el);
33
+ cg->width = TransparentCrystalData_get__width(el);
34
+ cg->height = TransparentCrystalData_get__height(el);
35
+ cg->jaw_U = TransparentCrystalData_get__jaw_U(el);
36
+ cg->sin_z = TransparentCrystalData_get__sin_z(el);
37
+ cg->cos_z = TransparentCrystalData_get__cos_z(el);
38
+ cg->sin_y = TransparentCrystalData_get__sin_y(el);
39
+ cg->cos_y = TransparentCrystalData_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;
48
+ }
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 = TransparentCrystalData_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 = TransparentCrystalData_get_record_impacts(el);
58
+ cg->record_exits = TransparentCrystalData_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;
65
+ return cg;
66
+ }
67
+
68
+ /*gpufun*/
69
+ void TransparentCrystal_free(CrystalGeometry restrict cg){
70
+ destroy_crystal(cg->segments);
71
+ free(cg);
72
+ }
73
+
74
+
75
+ /*gpufun*/
76
+ void TransparentCrystal_track_local_particle(TransparentCrystalData el, LocalParticle* part0){
77
+ int8_t active = TransparentCrystalData_get_active(el);
78
+ active *= TransparentCrystalData_get__tracking(el);
79
+ double const length = TransparentCrystalData_get_length(el);
80
+
81
+ // Get geometry
82
+ CrystalGeometry cg;
83
+ if (active){
84
+ cg = TransparentCrystal_init_geometry(el, part0);
85
+ if (cg->width==0 || cg->height==0 || cg->bending_radius==0){
86
+ kill_all_particles(part0, XC_ERR_INVALID_XOFIELD);
87
+ }
88
+ }
89
+
90
+ //start_per_particle_block (part0->part)
91
+ if (!active){
92
+ // Drift full length
93
+ Drift_single_particle(part, length);
94
+
95
+ } else {
96
+ // Check collimator initialisation
97
+ int8_t is_tracking = assert_tracking(part, XC_ERR_INVALID_TRACK);
98
+
99
+ if (is_tracking) {
100
+ // Store s-location of start of collimator
101
+ double s_coll = LocalParticle_get_s(part);
102
+ LocalParticle_set_s(part, 0);
103
+
104
+ // Check if hit on jaws
105
+ int8_t is_hit = hit_crystal_check_and_transform(part, cg);
106
+
107
+ // Transform back to the lab frame
108
+ hit_crystal_transform_back(is_hit, part, cg);
109
+ LocalParticle_add_to_s(part, s_coll);
110
+ }
111
+ }
112
+ //end_per_particle_block
113
+ if (active){
114
+ TransparentCrystal_free(cg);
115
+ }
116
+ }
117
+
118
+ #endif /* XCOLL_TRANSPAREN_CRY_H */
@@ -31,11 +31,15 @@ class EverestBlock(BaseBlock):
31
31
  isthick = True
32
32
  needs_rng = True
33
33
  allow_track = True
34
+ allow_double_sided = False
34
35
  behaves_like_drift = True
36
+ allow_rot_and_shift = False
37
+ allow_loss_refinement = True
35
38
  skip_in_loss_location_refinement = True
36
39
 
37
- _skip_in_to_dict = ['_material']
38
- _store_in_to_dict = ['material']
40
+ _noexpr_fields = {'material'}
41
+ _skip_in_to_dict = [*BaseBlock._skip_in_to_dict, '_material']
42
+ _store_in_to_dict = [*BaseBlock._store_in_to_dict, 'material']
39
43
  _internal_record_class = BaseBlock._internal_record_class
40
44
 
41
45
  _depends_on = [BaseBlock, EverestEngine]
@@ -95,11 +99,15 @@ class EverestCollimator(BaseCollimator):
95
99
  isthick = True
96
100
  needs_rng = True
97
101
  allow_track = True
102
+ allow_double_sided = True
98
103
  behaves_like_drift = True
104
+ allow_rot_and_shift = False
105
+ allow_loss_refinement = True
99
106
  skip_in_loss_location_refinement = True
100
107
 
101
- _skip_in_to_dict = [ *BaseCollimator._skip_in_to_dict, '_material' ]
102
- _store_in_to_dict = [ *BaseCollimator._store_in_to_dict, 'material' ]
108
+ _noexpr_fields = {*BaseCollimator._noexpr_fields, 'material'}
109
+ _skip_in_to_dict = [*BaseCollimator._skip_in_to_dict, '_material']
110
+ _store_in_to_dict = [*BaseCollimator._store_in_to_dict, 'material']
103
111
  _internal_record_class = BaseCollimator._internal_record_class
104
112
 
105
113
  _depends_on = [BaseCollimator, EverestEngine]
@@ -148,7 +156,6 @@ class EverestCollimator(BaseCollimator):
148
156
  _buffer=_buffer, _offset=_offset)
149
157
 
150
158
 
151
-
152
159
  class EverestCrystal(BaseCrystal):
153
160
  _xofields = {**BaseCrystal._xofields,
154
161
  'miscut': xo.Float64,
@@ -163,9 +170,13 @@ class EverestCrystal(BaseCrystal):
163
170
  isthick = True
164
171
  needs_rng = True
165
172
  allow_track = True
173
+ allow_double_sided = False
166
174
  behaves_like_drift = True
175
+ allow_rot_and_shift = False
176
+ allow_loss_refinement = True
167
177
  skip_in_loss_location_refinement = True
168
178
 
179
+ _noexpr_fields = {*BaseCrystal._noexpr_fields, 'material', 'lattice'}
169
180
  _skip_in_to_dict = [*BaseCrystal._skip_in_to_dict, '_orient', '_material']
170
181
  _store_in_to_dict = [*BaseCrystal._store_in_to_dict, 'lattice', 'material']
171
182
  _internal_record_class = BaseCrystal._internal_record_class