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
@@ -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