xcoll 0.3.3__py3-none-any.whl → 0.3.5__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 (317) hide show
  1. xcoll/beam_elements/__init__.py +5 -0
  2. xcoll/beam_elements/absorber.py +2 -1
  3. xcoll/beam_elements/base.py +32 -17
  4. xcoll/beam_elements/collimators_src/absorber.h +5 -0
  5. xcoll/beam_elements/everest.py +14 -25
  6. xcoll/colldb.py +50 -27
  7. xcoll/general.py +1 -1
  8. xcoll/headers/checks.h +7 -1
  9. xcoll/impacts/impacts.py +2 -1
  10. xcoll/impacts/impacts_src/impacts.h +1 -6
  11. xcoll/manager.py +5 -5
  12. xcoll/rf_sweep.py +90 -19
  13. xcoll/scattering_routines/everest/__init__.py +5 -0
  14. xcoll/scattering_routines/everest/everest.py +1 -1
  15. xcoll/scattering_routines/fluka/build_fluka_input.py +58 -0
  16. xcoll/scattering_routines/fluka/flukaio/lib/libFlukaIO64.a +0 -0
  17. xcoll/scattering_routines/fluka/flukaio/lib/libFlukaIO64.so +0 -0
  18. xcoll/scattering_routines/fluka/flukaio/src/Connection.d +68 -48
  19. xcoll/scattering_routines/fluka/flukaio/src/Connection.o +0 -0
  20. xcoll/scattering_routines/fluka/flukaio/src/FlukaIO.d +46 -37
  21. xcoll/scattering_routines/fluka/flukaio/src/FlukaIO.o +0 -0
  22. xcoll/scattering_routines/fluka/flukaio/src/FlukaIOHandshake.d +28 -25
  23. xcoll/scattering_routines/fluka/flukaio/src/FlukaIOHandshake.o +0 -0
  24. xcoll/scattering_routines/fluka/flukaio/src/FlukaIOServer.d +67 -47
  25. xcoll/scattering_routines/fluka/flukaio/src/FlukaIOServer.o +0 -0
  26. xcoll/scattering_routines/fluka/flukaio/src/FortranFlukaIO.d +39 -33
  27. xcoll/scattering_routines/fluka/flukaio/src/FortranFlukaIO.o +0 -0
  28. xcoll/scattering_routines/fluka/flukaio/src/NetIO.d +66 -47
  29. xcoll/scattering_routines/fluka/flukaio/src/NetIO.o +0 -0
  30. {xcoll-0.3.3.dist-info → xcoll-0.3.5.dist-info}/METADATA +3 -2
  31. xcoll-0.3.5.dist-info/NOTICE +2 -0
  32. xcoll-0.3.5.dist-info/RECORD +111 -0
  33. {xcoll-0.3.3.dist-info → xcoll-0.3.5.dist-info}/WHEEL +1 -1
  34. xcoll/beam_elements/collimators_src/base_block.h +0 -14
  35. xcoll/beam_elements/collimators_src/base_collimator.h +0 -14
  36. xcoll/beam_elements/collimators_src/invalid_collimator.h +0 -15
  37. xcoll/install_collimators.py +0 -180
  38. xcoll/scattering_routines/geant4/collimasim/.git +0 -1
  39. xcoll/scattering_routines/geant4/collimasim/.gitignore +0 -12
  40. xcoll/scattering_routines/geant4/collimasim/.gitmodules +0 -3
  41. xcoll/scattering_routines/geant4/collimasim/CMakeLists.txt +0 -26
  42. xcoll/scattering_routines/geant4/collimasim/README.md +0 -21
  43. xcoll/scattering_routines/geant4/collimasim/docs/Makefile +0 -20
  44. xcoll/scattering_routines/geant4/collimasim/docs/make.bat +0 -35
  45. xcoll/scattering_routines/geant4/collimasim/docs/source/collimasim.rst +0 -10
  46. xcoll/scattering_routines/geant4/collimasim/docs/source/conf.py +0 -59
  47. xcoll/scattering_routines/geant4/collimasim/docs/source/index.rst +0 -26
  48. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.appveyor.yml +0 -37
  49. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.clang-format +0 -19
  50. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.clang-tidy +0 -65
  51. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.cmake-format.yaml +0 -73
  52. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.git +0 -1
  53. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/CODEOWNERS +0 -9
  54. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/CONTRIBUTING.md +0 -386
  55. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/ISSUE_TEMPLATE/bug-report.yml +0 -45
  56. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/ISSUE_TEMPLATE/config.yml +0 -8
  57. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/dependabot.yml +0 -16
  58. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/labeler.yml +0 -8
  59. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/labeler_merged.yml +0 -3
  60. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/pull_request_template.md +0 -19
  61. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/ci.yml +0 -969
  62. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/configure.yml +0 -84
  63. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/format.yml +0 -48
  64. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/labeler.yml +0 -16
  65. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/pip.yml +0 -103
  66. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.gitignore +0 -45
  67. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.pre-commit-config.yaml +0 -151
  68. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.readthedocs.yml +0 -3
  69. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/CMakeLists.txt +0 -297
  70. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/LICENSE +0 -29
  71. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/MANIFEST.in +0 -6
  72. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/README.rst +0 -180
  73. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/Doxyfile +0 -23
  74. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/Makefile +0 -192
  75. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/_static/theme_overrides.css +0 -11
  76. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/chrono.rst +0 -81
  77. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/custom.rst +0 -93
  78. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/eigen.rst +0 -310
  79. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/functional.rst +0 -109
  80. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/index.rst +0 -43
  81. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/overview.rst +0 -171
  82. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/stl.rst +0 -251
  83. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/strings.rst +0 -305
  84. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/classes.rst +0 -1297
  85. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/embedding.rst +0 -262
  86. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/exceptions.rst +0 -396
  87. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/functions.rst +0 -568
  88. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/misc.rst +0 -337
  89. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/index.rst +0 -13
  90. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/numpy.rst +0 -463
  91. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/object.rst +0 -286
  92. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/utilities.rst +0 -155
  93. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/smart_ptrs.rst +0 -174
  94. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/basics.rst +0 -308
  95. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/benchmark.py +0 -91
  96. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/benchmark.rst +0 -95
  97. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/changelog.rst +0 -2050
  98. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/classes.rst +0 -542
  99. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/cmake/index.rst +0 -8
  100. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/compiling.rst +0 -648
  101. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/conf.py +0 -381
  102. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/faq.rst +0 -343
  103. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/index.rst +0 -48
  104. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/installing.rst +0 -105
  105. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/limitations.rst +0 -72
  106. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11-logo.png +0 -0
  107. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python1.png +0 -0
  108. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python1.svg +0 -427
  109. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python2.png +0 -0
  110. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python2.svg +0 -427
  111. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/reference.rst +0 -130
  112. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/release.rst +0 -96
  113. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/requirements.txt +0 -8
  114. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/upgrade.rst +0 -548
  115. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/attr.h +0 -605
  116. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/buffer_info.h +0 -144
  117. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/cast.h +0 -1432
  118. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/chrono.h +0 -213
  119. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/common.h +0 -2
  120. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/complex.h +0 -65
  121. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/class.h +0 -709
  122. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/common.h +0 -1021
  123. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/descr.h +0 -104
  124. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/init.h +0 -346
  125. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/internals.h +0 -467
  126. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/type_caster_base.h +0 -978
  127. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/typeid.h +0 -55
  128. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/eigen.h +0 -606
  129. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/embed.h +0 -284
  130. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/eval.h +0 -163
  131. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/functional.h +0 -121
  132. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/gil.h +0 -193
  133. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/iostream.h +0 -275
  134. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/numpy.h +0 -1741
  135. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/operators.h +0 -163
  136. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/options.h +0 -65
  137. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/pybind11.h +0 -2497
  138. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/pytypes.h +0 -1879
  139. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl/filesystem.h +0 -103
  140. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl.h +0 -375
  141. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl_bind.h +0 -747
  142. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/noxfile.py +0 -88
  143. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/__init__.py +0 -11
  144. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/__main__.py +0 -52
  145. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/_version.py +0 -12
  146. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/_version.pyi +0 -6
  147. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/commands.py +0 -21
  148. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/py.typed +0 -0
  149. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/setup_helpers.py +0 -482
  150. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/setup_helpers.pyi +0 -63
  151. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pyproject.toml +0 -41
  152. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/setup.cfg +0 -56
  153. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/setup.py +0 -155
  154. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/CMakeLists.txt +0 -503
  155. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/conftest.py +0 -208
  156. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/constructor_stats.h +0 -275
  157. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/cross_module_gil_utils.cpp +0 -73
  158. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/env.py +0 -33
  159. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_python_package/pytest.ini +0 -0
  160. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_python_package/test_files.py +0 -279
  161. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_setuptools/pytest.ini +0 -0
  162. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_setuptools/test_setuphelper.py +0 -143
  163. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/local_bindings.h +0 -85
  164. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/object.h +0 -179
  165. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_cross_module_tests.cpp +0 -151
  166. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_tests.cpp +0 -91
  167. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_tests.h +0 -85
  168. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pytest.ini +0 -19
  169. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/requirements.txt +0 -12
  170. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_async.cpp +0 -26
  171. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_async.py +0 -25
  172. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_buffers.cpp +0 -216
  173. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_buffers.py +0 -163
  174. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_builtin_casters.cpp +0 -286
  175. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_builtin_casters.py +0 -536
  176. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_call_policies.cpp +0 -107
  177. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_call_policies.py +0 -248
  178. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_callbacks.cpp +0 -227
  179. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_callbacks.py +0 -202
  180. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_chrono.cpp +0 -84
  181. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_chrono.py +0 -210
  182. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_class.cpp +0 -550
  183. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_class.py +0 -473
  184. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/CMakeLists.txt +0 -84
  185. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/embed.cpp +0 -21
  186. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_embed/CMakeLists.txt +0 -28
  187. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_function/CMakeLists.txt +0 -39
  188. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_target/CMakeLists.txt +0 -46
  189. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/main.cpp +0 -6
  190. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt +0 -41
  191. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_function/CMakeLists.txt +0 -35
  192. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_target/CMakeLists.txt +0 -41
  193. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/test.py +0 -10
  194. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_constants_and_functions.cpp +0 -165
  195. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_constants_and_functions.py +0 -53
  196. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_copy_move.cpp +0 -238
  197. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_copy_move.py +0 -126
  198. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_casters.cpp +0 -141
  199. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_casters.py +0 -117
  200. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_setup.cpp +0 -41
  201. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_setup.py +0 -50
  202. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_docstring_options.cpp +0 -69
  203. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_docstring_options.py +0 -42
  204. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eigen.cpp +0 -348
  205. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eigen.py +0 -771
  206. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/CMakeLists.txt +0 -47
  207. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/catch.cpp +0 -22
  208. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/external_module.cpp +0 -23
  209. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/test_interpreter.cpp +0 -326
  210. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/test_interpreter.py +0 -15
  211. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_enum.cpp +0 -148
  212. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_enum.py +0 -272
  213. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval.cpp +0 -119
  214. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval.py +0 -51
  215. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval_call.py +0 -5
  216. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.cpp +0 -285
  217. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.h +0 -12
  218. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.py +0 -265
  219. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_factory_constructors.cpp +0 -397
  220. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_factory_constructors.py +0 -520
  221. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_gil_scoped.cpp +0 -49
  222. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_gil_scoped.py +0 -94
  223. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_iostream.cpp +0 -125
  224. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_iostream.py +0 -331
  225. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_kwargs_and_defaults.cpp +0 -153
  226. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_kwargs_and_defaults.py +0 -284
  227. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_local_bindings.cpp +0 -107
  228. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_local_bindings.py +0 -257
  229. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_methods_and_attributes.cpp +0 -412
  230. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_methods_and_attributes.py +0 -517
  231. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_modules.cpp +0 -102
  232. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_modules.py +0 -92
  233. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_multiple_inheritance.cpp +0 -233
  234. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_multiple_inheritance.py +0 -360
  235. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_array.cpp +0 -472
  236. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_array.py +0 -593
  237. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_dtypes.cpp +0 -524
  238. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_dtypes.py +0 -441
  239. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_vectorize.cpp +0 -103
  240. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_vectorize.py +0 -267
  241. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_opaque_types.cpp +0 -73
  242. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_opaque_types.py +0 -59
  243. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_operator_overloading.cpp +0 -235
  244. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_operator_overloading.py +0 -146
  245. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pickling.cpp +0 -189
  246. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pickling.py +0 -82
  247. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pytypes.cpp +0 -560
  248. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pytypes.py +0 -651
  249. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_sequences_and_iterators.cpp +0 -500
  250. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_sequences_and_iterators.py +0 -253
  251. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_smart_ptr.cpp +0 -452
  252. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_smart_ptr.py +0 -318
  253. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl.cpp +0 -342
  254. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl.py +0 -291
  255. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl_binders.cpp +0 -131
  256. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl_binders.py +0 -318
  257. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_tagbased_polymorphic.cpp +0 -144
  258. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_tagbased_polymorphic.py +0 -29
  259. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_thread.cpp +0 -66
  260. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_thread.py +0 -44
  261. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_union.cpp +0 -22
  262. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_union.py +0 -9
  263. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_virtual_functions.cpp +0 -510
  264. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_virtual_functions.py +0 -408
  265. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/valgrind-numpy-scipy.supp +0 -140
  266. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/valgrind-python.supp +0 -117
  267. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindCatch.cmake +0 -70
  268. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindEigen3.cmake +0 -86
  269. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindPythonLibsNew.cmake +0 -257
  270. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/check-style.sh +0 -44
  271. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/cmake_uninstall.cmake.in +0 -23
  272. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/libsize.py +0 -39
  273. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/make_changelog.py +0 -64
  274. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Common.cmake +0 -402
  275. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Config.cmake.in +0 -233
  276. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11NewTools.cmake +0 -276
  277. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Tools.cmake +0 -214
  278. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pyproject.toml +0 -3
  279. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/setup_global.py.in +0 -65
  280. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/setup_main.py.in +0 -41
  281. xcoll/scattering_routines/geant4/collimasim/pyproject.toml +0 -8
  282. xcoll/scattering_routines/geant4/collimasim/setup.py +0 -144
  283. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSPyATInterface.cpp +0 -403
  284. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSPyATInterface.hh +0 -100
  285. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSXtrackInterface.cpp +0 -662
  286. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSXtrackInterface.hh +0 -110
  287. xcoll/scattering_routines/geant4/collimasim/src/collimasim/__init__.py +0 -8
  288. xcoll/scattering_routines/geant4/collimasim/src/collimasim/bindings.cpp +0 -63
  289. xcoll/scattering_routines/geant4/collimasim/src/collimasim/pyCollimatorPass.py +0 -142
  290. xcoll/scattering_routines/geant4/collimasim/src/collimasim/xtrack_collimator.py +0 -475
  291. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/PKG-INFO +0 -6
  292. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/SOURCES.txt +0 -20
  293. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/dependency_links.txt +0 -1
  294. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/not-zip-safe +0 -1
  295. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/top_level.txt +0 -1
  296. xcoll/scattering_routines/geant4/collimasim/tests/README.md +0 -25
  297. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_new_example.dat +0 -18
  298. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_old_example.dat +0 -68
  299. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_testing.dat +0 -15
  300. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_yaml_example.yaml +0 -110
  301. xcoll/scattering_routines/geant4/collimasim/tests/resources/collgaps.dat +0 -7
  302. xcoll/scattering_routines/geant4/collimasim/tests/resources/collgaps_pyat_test.dat +0 -3
  303. xcoll/scattering_routines/geant4/collimasim/tests/resources/collonly_twiss_file_example.tfs +0 -54
  304. xcoll/scattering_routines/geant4/collimasim/tests/resources/settings.gmad +0 -3
  305. xcoll/scattering_routines/geant4/collimasim/tests/resources/settings_black_absorber.gmad +0 -3
  306. xcoll/scattering_routines/geant4/collimasim/tests/resources/twiss_file_testing.tfs +0 -51
  307. xcoll/scattering_routines/geant4/collimasim/tests/test_pyat.py +0 -65
  308. xcoll/scattering_routines/geant4/collimasim/tests/test_pyat_passmethod.py +0 -59
  309. xcoll/scattering_routines/geant4/collimasim/tests/test_pyat_tracking.py +0 -102
  310. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack.py +0 -75
  311. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_angle.py +0 -74
  312. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_colldb_load.py +0 -84
  313. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_interaction.py +0 -159
  314. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tilt.py +0 -80
  315. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tracking.py +0 -97
  316. xcoll-0.3.3.dist-info/RECORD +0 -391
  317. {xcoll-0.3.3.dist-info → xcoll-0.3.5.dist-info}/LICENSE +0 -0
@@ -1,3 +1,8 @@
1
+ # copyright ############################### #
2
+ # This file is part of the Xcoll Package. #
3
+ # Copyright (c) CERN, 2024. #
4
+ # ######################################### #
5
+
1
6
  from .base import BaseBlock, BaseCollimator
2
7
  from .absorber import BlackAbsorber
3
8
  from .everest import EverestBlock, EverestCollimator, EverestCrystal
@@ -1,5 +1,5 @@
1
1
  # copyright ############################### #
2
- # This file is part of the Xcoll Package. #
2
+ # This file is part of the Xcoll Package. #
3
3
  # Copyright (c) CERN, 2023. #
4
4
  # ######################################### #
5
5
 
@@ -19,6 +19,7 @@ class BlackAbsorber(BaseCollimator):
19
19
  ]
20
20
 
21
21
  isthick = True
22
+ allow_track = True
22
23
  behaves_like_drift = True
23
24
  skip_in_loss_location_refinement = True
24
25
 
@@ -20,15 +20,14 @@ class InvalidXcoll(xt.BeamElement):
20
20
 
21
21
  isthick = True
22
22
  behaves_like_drift = True
23
- # allow_track = False # Need to wait for xtrack release to implement
23
+ allow_track = False
24
24
  skip_in_loss_location_refinement = True
25
25
  allow_backtrack = True
26
26
 
27
27
  # InvalidXcoll catches unallowed cases, like backtracking through a collimator
28
28
  _extra_c_sources = [
29
29
  _pkg_root.joinpath('headers','particle_states.h'),
30
- _pkg_root.joinpath('headers','checks.h'),
31
- _pkg_root.joinpath('beam_elements','collimators_src','invalid_collimator.h')
30
+ _pkg_root.joinpath('headers','checks.h')
32
31
  ]
33
32
 
34
33
  _depends_on = [xt.RandomRutherford] # Needed for checks
@@ -47,18 +46,27 @@ class BaseBlock(xt.BeamElement):
47
46
  }
48
47
 
49
48
  isthick = True
49
+ allow_track = False
50
50
  behaves_like_drift = True
51
- # allow_track = False # Need to wait for xtrack release to implement
52
51
  skip_in_loss_location_refinement = True
53
52
 
54
- _extra_c_sources = [
55
- _pkg_root.joinpath('beam_elements','collimators_src','base_block.h')
56
- ]
57
53
  _depends_on = [InvalidXcoll]
58
54
  _internal_record_class = CollimatorImpacts
59
55
 
60
- def __init__(self, **kwargs):
61
- super().__init__(**kwargs)
56
+ # This is an abstract class and cannot be instantiated
57
+ def __new__(cls, *args, **kwargs):
58
+ if cls == BaseBlock:
59
+ raise Exception("Abstract class `BaseBlock` cannot be instantiated!")
60
+ instance = super().__new__(cls)
61
+ return instance
62
+
63
+ def enable_scattering(self):
64
+ if hasattr(self, '_tracking'):
65
+ self._tracking = True
66
+
67
+ def disable_scattering(self):
68
+ if hasattr(self, '_tracking'):
69
+ self._tracking = False
62
70
 
63
71
  def get_backtrack_element(self, _context=None, _buffer=None, _offset=None):
64
72
  return InvalidXcoll(length=-self.length,
@@ -89,8 +97,8 @@ class BaseCollimator(xt.BeamElement):
89
97
  }
90
98
 
91
99
  isthick = True
100
+ allow_track = False
92
101
  behaves_like_drift = True
93
- # allow_track = False # Need to wait for xtrack release to implement
94
102
  skip_in_loss_location_refinement = True
95
103
 
96
104
  _skip_in_to_dict = ['jaw_L', 'jaw_R', 'ref_x', 'ref_y',
@@ -99,18 +107,17 @@ class BaseCollimator(xt.BeamElement):
99
107
  _store_in_to_dict = ['angle', 'tilt', 'jaw', 'reference_center', 'side']
100
108
  # Extra fields (only in Python): angle_L, angle_R, tilt_L, tilt_R, jaw_LU, jaw_LD, jaw_RU, jaw_RD
101
109
 
102
- _extra_c_sources = [
103
- _pkg_root.joinpath('beam_elements','collimators_src','base_collimator.h')
104
- ]
105
110
  _depends_on = [InvalidXcoll, xt.Drift, xt.XYShift, xt.SRotation, xt.YRotation]
106
111
  _internal_record_class = CollimatorImpacts
107
112
 
113
+ # This is an abstract class and cannot be instantiated
114
+ def __new__(cls, *args, **kwargs):
115
+ if cls == BaseCollimator:
116
+ raise Exception("Abstract class `BaseCollimator` cannot be instantiated!")
117
+ instance = super().__new__(cls)
118
+ return instance
108
119
 
109
120
  def __init__(self, **kwargs):
110
- # TODO: quick hack to avoid instantiation; did not manage to get it to work correclty with ABC
111
- if self.__class__.__name__ == 'BaseCollimator':
112
- raise Exception("Abstract class 'BaseCollimator' cannot be instantiated!")
113
-
114
121
  if '_xobject' not in kwargs:
115
122
  # Set jaw
116
123
  if 'jaw' in kwargs:
@@ -197,6 +204,14 @@ class BaseCollimator(xt.BeamElement):
197
204
  super().__init__(**kwargs)
198
205
 
199
206
 
207
+ def enable_scattering(self):
208
+ if hasattr(self, '_tracking'):
209
+ self._tracking = True
210
+
211
+ def disable_scattering(self):
212
+ if hasattr(self, '_tracking'):
213
+ self._tracking = False
214
+
200
215
  @property
201
216
  def jaw(self):
202
217
  return _get_LR(self, 'jaw', neg=True)
@@ -1,3 +1,8 @@
1
+ // copyright ############################### #
2
+ // This file is part of the Xcoll Package. #
3
+ // Copyright (c) CERN, 2024. #
4
+ // ######################################### #
5
+
1
6
  #ifndef XCOLL_ABSORBER_H
2
7
  #define XCOLL_ABSORBER_H
3
8
 
@@ -1,5 +1,5 @@
1
1
  # copyright ############################### #
2
- # This file is part of the Xcoll Package. #
2
+ # This file is part of the Xcoll Package. #
3
3
  # Copyright (c) CERN, 2023. #
4
4
  # ######################################### #
5
5
 
@@ -31,6 +31,8 @@ class EverestBlock(BaseBlock):
31
31
  }
32
32
 
33
33
  isthick = True
34
+ needs_rng = True
35
+ allow_track = True
34
36
  behaves_like_drift = True
35
37
  skip_in_loss_location_refinement = True
36
38
 
@@ -67,12 +69,7 @@ class EverestBlock(BaseBlock):
67
69
  use_prebuilt_kernels = kwargs.pop('use_prebuilt_kernels', True)
68
70
  super().__init__(**kwargs)
69
71
  if '_xobject' not in kwargs:
70
- try: # TODO: small workaround until PR
71
- self.compile_kernels(use_prebuilt_kernels=use_prebuilt_kernels,
72
- only_if_needed=True)
73
- except TypeError:
74
- self.compile_kernels(only_if_needed=True)
75
- self._context.kernels.EverestBlock_set_material(el=self)
72
+ self.EverestBlock_set_material(el=self)
76
73
 
77
74
 
78
75
  @property
@@ -86,8 +83,7 @@ class EverestBlock(BaseBlock):
86
83
  raise ValueError("Invalid material!")
87
84
  if not xt.line._dicts_equal(self.material.to_dict(), material.to_dict()):
88
85
  self._material = material
89
- self.compile_kernels(only_if_needed=True)
90
- self._context.kernels.EverestBlock_set_material(el=self)
86
+ self.EverestBlock_set_material(el=self)
91
87
 
92
88
  def get_backtrack_element(self, _context=None, _buffer=None, _offset=None):
93
89
  return InvalidXcoll(length=-self.length, _context=_context,
@@ -102,6 +98,8 @@ class EverestCollimator(BaseCollimator):
102
98
  }
103
99
 
104
100
  isthick = True
101
+ needs_rng = True
102
+ allow_track = True
105
103
  behaves_like_drift = True
106
104
  skip_in_loss_location_refinement = True
107
105
 
@@ -137,12 +135,7 @@ class EverestCollimator(BaseCollimator):
137
135
  use_prebuilt_kernels = kwargs.pop('use_prebuilt_kernels', True)
138
136
  super().__init__(**kwargs)
139
137
  if '_xobject' not in kwargs:
140
- try: # TODO: small workaround until PR
141
- self.compile_kernels(use_prebuilt_kernels=use_prebuilt_kernels,
142
- only_if_needed=True)
143
- except TypeError:
144
- self.compile_kernels(only_if_needed=True)
145
- self._context.kernels.EverestCollimator_set_material(el=self)
138
+ self.EverestCollimator_set_material(el=self)
146
139
 
147
140
  @property
148
141
  def material(self):
@@ -155,8 +148,7 @@ class EverestCollimator(BaseCollimator):
155
148
  raise ValueError("Invalid material!")
156
149
  if not xt.line._dicts_equal(self.material.to_dict(), material.to_dict()):
157
150
  self._material = material
158
- self.compile_kernels(only_if_needed=True)
159
- self._context.kernels.EverestCollimator_set_material(el=self)
151
+ self.EverestCollimator_set_material(el=self)
160
152
 
161
153
  def get_backtrack_element(self, _context=None, _buffer=None, _offset=None):
162
154
  return InvalidXcoll(length=-self.length, _context=_context,
@@ -181,6 +173,8 @@ class EverestCrystal(BaseCollimator):
181
173
  }
182
174
 
183
175
  isthick = True
176
+ needs_rng = True
177
+ allow_track = True
184
178
  behaves_like_drift = True
185
179
  skip_in_loss_location_refinement = True
186
180
 
@@ -236,12 +230,7 @@ class EverestCrystal(BaseCollimator):
236
230
  self._bending_angle = np.arcsin(self.active_length/bending_radius)
237
231
  if bending_angle:
238
232
  self._bending_radius = self.active_length / np.sin(bending_angle)
239
- try: # TODO: small workaround until PR
240
- self.compile_kernels(use_prebuilt_kernels=use_prebuilt_kernels,
241
- only_if_needed=True)
242
- except TypeError:
243
- self.compile_kernels(only_if_needed=True)
244
- self._context.kernels.EverestCrystal_set_material(el=self)
233
+ self.EverestCrystal_set_material(el=self)
245
234
 
246
235
 
247
236
  @property
@@ -290,8 +279,7 @@ class EverestCrystal(BaseCollimator):
290
279
  raise ValueError("Invalid material!")
291
280
  if not xt.line._dicts_equal(self.material.to_dict(), material.to_dict()):
292
281
  self._material = material
293
- self.compile_kernels(only_if_needed=True)
294
- self._context.kernels.EverestCrystal_set_material(el=self)
282
+ self.EverestCrystal_set_material(el=self)
295
283
 
296
284
 
297
285
  def get_backtrack_element(self, _context=None, _buffer=None, _offset=None):
@@ -307,3 +295,4 @@ def _lattice_setter(lattice):
307
295
  else:
308
296
  raise ValueError(f"Illegal value {lattice} for 'lattice'! "
309
297
  + "Only use 'strip' (110) or 'quasi-mosaic' (111).")
298
+
xcoll/colldb.py CHANGED
@@ -111,7 +111,7 @@ class CollimatorDatabase:
111
111
  raise ValueError("Missing name tag / anchor in "
112
112
  + "CollimatorDatabase['families']!")
113
113
  # We get the anchor from the rt yaml, and use it as key in the families dict
114
- families[full_fam.anchor.value.lower()] = fam
114
+ families[full_fam.anchor.value.lower()] = {f.lower(): v for f, v in fam.items()}
115
115
  dct['families'] = families
116
116
 
117
117
  # Now we need to loop over each collimator, and verify which family was used
@@ -184,10 +184,8 @@ class CollimatorDatabase:
184
184
  beam=beam, _yaml_merged=_yaml_merged, ignore_crystals=ignore_crystals)
185
185
 
186
186
 
187
- # TODO: load crystals with SixTrack loader
188
- # TODO: load families with SixTrack loader
189
187
  @classmethod
190
- def from_SixTrack(cls, file, **kwargs):
188
+ def from_SixTrack(cls, file, ignore_crystals=True, **kwargs):
191
189
  # only import regex here
192
190
  import re
193
191
  with open(file, 'r') as infile:
@@ -195,49 +193,69 @@ class CollimatorDatabase:
195
193
  family_settings = {}
196
194
  family_types = {}
197
195
  side = {}
196
+ cry_fields = ['bending_radius', 'xdim', 'ydim', 'thick', 'miscut', 'crystal']
197
+ cry = {}
198
198
 
199
199
  for l_no, line in enumerate(infile):
200
200
  if line.startswith('#'):
201
201
  continue # Comment
202
-
203
202
  sline = line.split()
204
- if len(sline) > 0 and len(sline) < 6:
203
+ if len(sline) > 0:
205
204
  if sline[0].lower() == 'nsig_fam':
206
205
  family_settings[sline[1]] = float(sline[2])
207
206
  family_types[sline[1]] = sline[3]
208
207
  elif sline[0].lower() == 'onesided':
209
208
  side[sline[1]] = int(sline[2])
209
+ elif sline[0].lower() == "crystal":
210
+ cry[sline[1]] = {}
211
+ for i, key in enumerate(cry_fields):
212
+ idx = i+2 if i < 4 else i+3 # we skip "tilt"
213
+ if i < 5:
214
+ cry[sline[1]][key] = float(sline[idx])
215
+ else:
216
+ cry[sline[1]][key] = int(sline[idx])
210
217
  elif sline[0].lower() == 'settings':
211
- # TODO CRYSTAL
212
218
  pass # Acknowledge and ignore this line
219
+ elif len(sline) == 6:
220
+ # Standard collimator definition
221
+ coll_data_string += line
213
222
  else:
214
223
  print(f"Unknown setting {line}")
215
- else:
216
- coll_data_string += line
224
+
225
+ defaults = {}
226
+ _initialise_None(defaults)
217
227
 
218
228
  famdct = {key: {'gap': family_settings[key], 'stage': family_types[key]} for key in family_settings}
219
229
  names = ['name', 'gap', 'material', 'active_length', 'angle', 'offset']
220
230
 
221
- df = pd.read_csv(io.StringIO(coll_data_string), delim_whitespace=True,
222
- index_col=False, names=names)
231
+ df = pd.read_csv(io.StringIO(coll_data_string), sep=r'\s+', index_col=False, names=names)
223
232
  df['family'] = df['gap'].copy()
224
233
  df['family'] = df['family'].apply(lambda s: None if re.match(r'^-?\d+(\.\d+)?$', str(s)) else s)
225
234
  df.insert(5,'stage', df['gap'].apply(lambda s: family_types.get(s, 'UNKNOWN')))
226
- sides = df['name'].apply(lambda s: side.get(s, 0))
235
+
227
236
  df['gap'] = df['gap'].apply(lambda s: float(family_settings.get(s, s)))
228
- df['name'] = df['name'].str.lower() # Make the names lowercase for easy processing # TODO this breaks code if a key has upper case, e.g. gap_L
237
+ # TODO this breaks code if a key has upper case, e.g. gap_L
238
+ df['name'] = df['name'].str.lower() # Make the names lowercase for easy processing
229
239
  df['parking'] = 0.025
240
+ if ignore_crystals:
241
+ df = df[~df.name.isin(list(cry.keys()))]
242
+ else:
243
+ for key in cry_fields:
244
+ df[key] = [cry[name][key] if name in cry else defaults[key]
245
+ for name in df['name']]
246
+ df['crystal'] = ['strip' if s==1 else s for s in df['crystal']]
247
+ df['crystal'] = ['quasi-mosaic' if s==2 else s for s in df['crystal']]
248
+ df['side'] = [side[name] if name in side else defaults['side']
249
+ for name in df['name']]
250
+ df['side'] = ['both' if s==0 else s for s in df['side']]
251
+ df['side'] = ['left' if s==1 else s for s in df['side']]
252
+ df['side'] = ['right' if s==2 else s for s in df['side']]
230
253
  df = df.set_index('name')
231
- df['side'] = sides.values
232
- df['side'] = [ 'both' if s==0 else s for s in df['side'] ]
233
- df['side'] = [ 'left' if s==1 else s for s in df['side'] ]
234
- df['side'] = [ 'right' if s==2 else s for s in df['side'] ]
235
- return cls.from_dict({'collimators': df.transpose().to_dict(), 'families': famdct}, **kwargs)
236
254
 
237
- # -------------------------------
238
- # ------ Dump to disk -----------
239
- # -------------------------------
240
-
255
+ return cls.from_dict({'collimators': df.transpose().to_dict(), 'families': famdct}, \
256
+ ignore_crystals=ignore_crystals, **kwargs)
257
+
258
+
241
259
  def write_to_yaml(self, out, lhc_style=True):
242
260
  """
243
261
  Writes a colldb in memory to disk in the yaml format.
@@ -286,8 +304,8 @@ class CollimatorDatabase:
286
304
  fam_keys = dcts._family_dict[fam].keys()
287
305
  coll_dict = {**{'<<': '*'+fam}, **coll_dict}
288
306
  temp_items_to_print = []
289
- if coll_dict['crystal']:
290
- temp_items_to_print = ['bend','xdim','ydim','miscut','crystal']
307
+ if coll_dict['crystal'] and str(coll_dict['crystal'])!='nan':
308
+ temp_items_to_print = ['bending_radius','xdim','ydim','miscut','crystal', 'thick']
291
309
  if coll_dict['angle_L'] == coll_dict['angle_R']:
292
310
  coll_dict.update({'angle': coll_dict['angle_L']})
293
311
  else:
@@ -303,6 +321,8 @@ class CollimatorDatabase:
303
321
  value = {}
304
322
  overwritten_keys = coll_dict['overwritten_keys']
305
323
  for key, val in coll_dict.items():
324
+ if key == 'active_length':
325
+ key = 'length'
306
326
  if (key in coll_items_to_print+temp_items_to_print) and (key not in (set(fam_keys)-set(overwritten_keys))) and (val != 'both'):
307
327
  value.update({key: val})
308
328
  file.write(_format_dict_entry(coll, value, spacing=' '))
@@ -387,7 +407,7 @@ class CollimatorDatabase:
387
407
  _print_colls(b2_colls, self, 'b2', file)
388
408
  if len(bx_colls) > 0:
389
409
  _print_colls(bx_colls, self, 'bx', file)
390
- print('WARNING -- some collimators could not be assigned to b1 or b2. Tracking might not work with those collimators. Please manually change the output file if necessary.')
410
+ print('WARNING -- some collimators could not be assigned to b1 or b2. Tracking might not work with those collimators. Please manually change the output file if necessary.')
391
411
 
392
412
 
393
413
  def __init__(self, **kwargs):
@@ -450,7 +470,7 @@ class CollimatorDatabase:
450
470
  # Only do this check if we didn't do a YAML merge earlier (because then it
451
471
  # is already taken care of)
452
472
  if not _yaml_merged:
453
- overwritten_keys = [key for key in settings.keys() if key in fam[thisfam]]
473
+ overwritten_keys = [key.lower() for key in settings.keys() if key in fam[thisfam]]
454
474
  if len(overwritten_keys) > 0:
455
475
  settings['overwritten_keys'] = overwritten_keys
456
476
 
@@ -463,7 +483,10 @@ class CollimatorDatabase:
463
483
 
464
484
  # Save list of crystals
465
485
  if 'crystal' in settings:
466
- crystals += [thiscoll]
486
+ if settings['crystal'] != 0.0:
487
+ crystals += [thiscoll]
488
+ else:
489
+ settings['crystal'] = None
467
490
 
468
491
  # Remove crystals from colldb
469
492
  if ignore_crystals:
xcoll/general.py CHANGED
@@ -12,5 +12,5 @@ citation = "F.F. Van der Veken, et al.: Recent Developments with the New Tools f
12
12
  # ===================
13
13
  # Do not change
14
14
  # ===================
15
- __version__ = '0.3.2'
15
+ __version__ = '0.3.5'
16
16
  # ===================
xcoll/headers/checks.h CHANGED
@@ -6,6 +6,12 @@
6
6
  #ifndef XCOLL_CHECKS_H
7
7
  #define XCOLL_CHECKS_H
8
8
 
9
+ // This is a quick macro to use inside a function body on a parameter that is not
10
+ // used inside the function (this avoids throwing warnings at compilation time).
11
+ #ifndef UNUSED
12
+ #define UNUSED(expr) (void)(expr)
13
+ #endif
14
+
9
15
  /*gpufun*/
10
16
  int8_t xcoll_check_particle_init(RandomRutherfordData rng, LocalParticle* part) {
11
17
  int8_t is_tracking = assert_tracking(part, XC_ERR_INVALID_TRACK);
@@ -26,4 +32,4 @@ int8_t xcoll_check_particle_init(RandomRutherfordData rng, LocalParticle* part)
26
32
  return is_tracking*rng_is_set*ruth_is_set;
27
33
  }
28
34
 
29
- #endif /* XCOLL_CHECKS_H */
35
+ #endif /* XCOLL_CHECKS_H */
xcoll/impacts/impacts.py CHANGED
@@ -14,7 +14,6 @@ import pandas as pd
14
14
 
15
15
 
16
16
  class CollimatorImpacts(xt.BeamElement):
17
-
18
17
  _xofields = {
19
18
  '_index': xt.RecordIndex,
20
19
  'at_element': xo.Int64[:],
@@ -49,6 +48,8 @@ class CollimatorImpacts(xt.BeamElement):
49
48
  'child_pdgid': xo.Int64[:],
50
49
  }
51
50
 
51
+ allow_track = False
52
+
52
53
  _extra_c_sources = [
53
54
  source,
54
55
  _pkg_root.joinpath('headers','particle_states.h'),
@@ -7,11 +7,6 @@
7
7
  #ifndef XCOLL_IMPACTS_H
8
8
  #define XCOLL_IMPACTS_H
9
9
 
10
- /*gpufun*/
11
- void CollimatorImpacts_track_local_particle(CollimatorImpactsData el, LocalParticle* part0) {
12
- kill_all_particles(part0, XC_ERR_INVALID_TRACK);
13
- }
14
-
15
10
  // TODO: do we need to pass RecordIndex?
16
11
  // probably can do RecordIndex record_index = CollimatorImpactsData_getp__index(record); ?
17
12
  /*gpufun*/
@@ -101,4 +96,4 @@ void CollimatorImpactsData_log_child(CollimatorImpactsData record, int64_t i_slo
101
96
  }
102
97
  }
103
98
 
104
- #endif /* XCOLL_IMPACTS_H */
99
+ #endif /* XCOLL_IMPACTS_H */
xcoll/manager.py CHANGED
@@ -8,7 +8,7 @@ from pathlib import Path
8
8
  import numpy as np
9
9
  import pandas as pd
10
10
 
11
- from .beam_elements import BaseCollimator, BlackAbsorber, EverestCollimator, EverestCrystal, _all_collimator_types
11
+ from .beam_elements import BaseCollimator, BlackAbsorber, EverestCollimator, EverestCrystal, _all_collimator_types, element_classes
12
12
  from .colldb import CollimatorDatabase
13
13
  from .impacts import CollimatorImpacts
14
14
  from .scattering_routines.everest.materials import SixTrack_to_xcoll, CrystalMaterial
@@ -775,14 +775,14 @@ class CollimatorManager:
775
775
 
776
776
  def enable_scattering(self):
777
777
  # Prepare collimators for tracking
778
- for coll in self.collimator_names:
779
- self.line[coll]._tracking = True
778
+ for el in self.line.get_elements_of_type(element_classes)[0]:
779
+ el.enable_scattering()
780
780
  self._set_record_impacts()
781
781
 
782
782
  def disable_scattering(self):
783
783
  # Prepare collimators for tracking
784
- for coll in self.collimator_names:
785
- self.line[coll]._tracking = False
784
+ for el in self.line.get_elements_of_type(element_classes)[0]:
785
+ el.disable_scattering()
786
786
 
787
787
  @property
788
788
  def scattering_enabled(self):
xcoll/rf_sweep.py CHANGED
@@ -4,11 +4,11 @@
4
4
  # ######################################### #
5
5
 
6
6
  import numpy as np
7
- import pandas as pd
8
7
  import scipy.constants as sc
8
+ from time import perf_counter
9
9
 
10
10
  import xtrack as xt
11
-
11
+ from xtrack.progress_indicator import progress
12
12
 
13
13
  class RFSweep:
14
14
 
@@ -81,7 +81,7 @@ class RFSweep:
81
81
  + f"the bucket and remain uncaptured.")
82
82
 
83
83
 
84
- def track(self, sweep=0, num_turns=0, particles=None, verbose=True, *args, **kwargs):
84
+ def track(self, sweep=0, particles=None, num_turns=0, verbose=True, *args, **kwargs):
85
85
 
86
86
  # Was there a previous sweep?
87
87
  # If yes, we do not overwrite it but continue from there
@@ -101,20 +101,91 @@ class RFSweep:
101
101
  raise ValueError("Need to build tracker first!")
102
102
  if particles is None:
103
103
  raise ValueError("Need particles to track!")
104
+ time = kwargs.pop('time', False)
105
+ with_progress = kwargs.pop('with_progress', False)
104
106
  rf_shift_per_turn = sweep / num_turns
105
- if 'time' in kwargs and kwargs['time']:
106
- self.line.tracker.time_last_track = 0
107
- for i in range(num_turns):
108
- sweep = existing_sweep + i*rf_shift_per_turn
109
- self.line['rf_sweep'].dzeta = self.L * sweep / (self.f_RF + sweep)
110
- # for cav in cavities:
111
- # self.line[cav].frequency = freq + sweep
112
- if 'time' in kwargs and kwargs['time']:
113
- prev_time = self.line.time_last_track
114
- self.line.track(particles, num_turns=1, *args, **kwargs)
115
- if 'time' in kwargs and kwargs['time']:
116
- self.line.tracker.time_last_track += prev_time
117
- if not np.any(particles.state == 1):
118
- print(f"All particles lost at turn {i}, stopped sweep at "
119
- + f"{existing_sweep + i*rf_shift_per_turn}Hz.")
120
- break
107
+
108
+ # This is taken from xtrack.tracker.Tracker._track
109
+ if time:
110
+ t0 = perf_counter()
111
+ if with_progress:
112
+ if self.line.tracker.enable_pipeline_hold:
113
+ raise ValueError("Progress indicator is not supported with pipeline hold")
114
+ if num_turns < 2:
115
+ raise ValueError('Tracking with progress indicator is only '
116
+ 'possible over more than one turn.')
117
+ if with_progress is True:
118
+ batch_size = scaling = 100
119
+ else:
120
+ batch_size = int(with_progress)
121
+ scaling = with_progress if batch_size > 1 else None
122
+ if kwargs.get('turn_by_turn_monitor') is True:
123
+ ele_start = kwargs.get('ele_start') or 0
124
+ ele_stop = kwargs.get('ele_stop')
125
+ if ele_stop is None:
126
+ ele_stop = len(self.line)
127
+ if ele_start >= ele_stop:
128
+ # we need an additional turn and space in the monitor for
129
+ # the incomplete turn
130
+ num_turns += 1
131
+ _, monitor, _, _ = self.line.tracker._get_monitor(particles, True, num_turns)
132
+ kwargs['turn_by_turn_monitor'] = monitor
133
+
134
+ for ii in progress(
135
+ range(0, num_turns, batch_size),
136
+ desc='Tracking',
137
+ unit_scale=scaling,
138
+ ):
139
+ one_turn_kwargs = kwargs.copy()
140
+ is_first_batch = ii == 0
141
+ is_last_batch = ii + batch_size >= num_turns
142
+
143
+ if is_first_batch and is_last_batch:
144
+ # This is the only batch, we track as normal
145
+ pass
146
+ elif is_first_batch:
147
+ # Not the last batch, so track until the last element
148
+ one_turn_kwargs['ele_stop'] = None
149
+ one_turn_kwargs['num_turns'] = batch_size
150
+ elif is_last_batch:
151
+ # Not the first batch, so track from the first element
152
+ one_turn_kwargs['ele_start'] = None
153
+ remaining_turns = num_turns % batch_size
154
+ if remaining_turns == 0:
155
+ remaining_turns = batch_size
156
+ one_turn_kwargs['num_turns'] = remaining_turns
157
+ one_turn_kwargs['_reset_log'] = False
158
+ elif not is_first_batch and not is_last_batch:
159
+ # A 'middle batch', track from first to last element
160
+ one_turn_kwargs['num_turns'] = batch_size
161
+ one_turn_kwargs['ele_start'] = None
162
+ one_turn_kwargs['ele_stop'] = None
163
+ one_turn_kwargs['_reset_log'] = False
164
+ self._tracking_func(particles, rf_shift_per_turn, **one_turn_kwargs)
165
+ if not np.any(particles.state == 1):
166
+ break
167
+
168
+ else:
169
+ self._tracking_func(particles, rf_shift_per_turn, num_turns=num_turns, *args, **kwargs)
170
+
171
+ if not np.any(particles.state == 1):
172
+ print(f"All particles lost at turn {particles.at_turn.max()}, stopped sweep at "
173
+ + f"{self.current_sweep_value}Hz.")
174
+
175
+ if time:
176
+ t1 = perf_counter()
177
+ self.line.tracker._context.synchronize()
178
+ self.line.tracker.time_last_track = t1 - t0
179
+ else:
180
+ self.line.tracker.time_last_track = None
181
+
182
+ def _tracking_func(self, particles, rf_shift_per_turn, num_turns=1, *args, **kwargs):
183
+ existing_sweep = self.current_sweep_value
184
+ for i in range(num_turns):
185
+ sweep = existing_sweep + i*rf_shift_per_turn
186
+ self.line['rf_sweep'].dzeta = self.L * sweep / (self.f_RF + sweep)
187
+ # for cav in cavities:
188
+ # self.line[cav].frequency = freq + sweep
189
+ self.line.track(particles, num_turns=1, *args, **kwargs)
190
+ if not np.any(particles.state == 1):
191
+ break
@@ -1,2 +1,7 @@
1
+ # copyright ############################### #
2
+ # This file is part of the Xcoll Package. #
3
+ # Copyright (c) CERN, 2024. #
4
+ # ######################################### #
5
+
1
6
  from .materials import GeneralMaterial, Material, CrystalMaterial
2
7
  from .everest import EverestEngine
@@ -1,5 +1,5 @@
1
1
  # copyright ############################### #
2
- # This file is part of the Xcoll Package. #
2
+ # This file is part of the Xcoll Package. #
3
3
  # Copyright (c) CERN, 2023. #
4
4
  # ######################################### #
5
5