xcoll 0.4.0__tar.gz → 0.5.0__tar.gz

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 (412) hide show
  1. {xcoll-0.4.0 → xcoll-0.5.0}/PKG-INFO +1 -1
  2. {xcoll-0.4.0 → xcoll-0.5.0}/pyproject.toml +1 -1
  3. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/__init__.py +2 -1
  4. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/beam_elements/__init__.py +7 -1
  5. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/beam_elements/absorber.py +2 -2
  6. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/beam_elements/base.py +105 -67
  7. xcoll-0.5.0/xcoll/beam_elements/blowup.py +198 -0
  8. {xcoll-0.4.0/xcoll/beam_elements/collimators_src → xcoll-0.5.0/xcoll/beam_elements/elements_src}/black_absorber.h +21 -3
  9. {xcoll-0.4.0/xcoll/beam_elements/collimators_src → xcoll-0.5.0/xcoll/beam_elements/elements_src}/black_crystal.h +20 -2
  10. xcoll-0.5.0/xcoll/beam_elements/elements_src/blowup.h +42 -0
  11. xcoll-0.5.0/xcoll/beam_elements/elements_src/emittance_monitor.h +109 -0
  12. {xcoll-0.4.0/xcoll/beam_elements/collimators_src → xcoll-0.5.0/xcoll/beam_elements/elements_src}/everest_block.h +19 -2
  13. {xcoll-0.4.0/xcoll/beam_elements/collimators_src → xcoll-0.5.0/xcoll/beam_elements/elements_src}/everest_collimator.h +19 -3
  14. {xcoll-0.4.0/xcoll/beam_elements/collimators_src → xcoll-0.5.0/xcoll/beam_elements/elements_src}/everest_crystal.h +30 -9
  15. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/beam_elements/everest.py +5 -6
  16. xcoll-0.5.0/xcoll/beam_elements/monitor.py +428 -0
  17. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/colldb.py +103 -74
  18. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/general.py +4 -4
  19. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/initial_distribution.py +18 -6
  20. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/install.py +3 -1
  21. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/interaction_record/interaction_record.py +126 -80
  22. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/interaction_record/interaction_record_src/interaction_record.h +43 -43
  23. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/line_tools.py +8 -9
  24. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/lossmap.py +48 -38
  25. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/everest/amorphous.h +4 -11
  26. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/everest/channeling.h +3 -8
  27. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/everest/everest.h +4 -1
  28. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/everest/jaw.h +4 -3
  29. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/everest/materials.py +35 -15
  30. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/everest/multiple_coulomb_scattering.h +2 -2
  31. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/everest/nuclear_interaction.h +1 -1
  32. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/everest/properties.h +6 -1
  33. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/lib/libFlukaIO64.a +0 -0
  34. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/.git +1 -0
  35. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/.gitignore +12 -0
  36. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/.gitmodules +3 -0
  37. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/CMakeLists.txt +26 -0
  38. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/README.md +21 -0
  39. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/docs/Makefile +20 -0
  40. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/docs/make.bat +35 -0
  41. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/docs/source/collimasim.rst +10 -0
  42. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/docs/source/conf.py +59 -0
  43. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/docs/source/index.rst +26 -0
  44. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.appveyor.yml +37 -0
  45. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.clang-format +19 -0
  46. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.clang-tidy +65 -0
  47. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.cmake-format.yaml +73 -0
  48. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.git +1 -0
  49. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/CODEOWNERS +9 -0
  50. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/CONTRIBUTING.md +386 -0
  51. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/ISSUE_TEMPLATE/bug-report.yml +45 -0
  52. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/ISSUE_TEMPLATE/config.yml +8 -0
  53. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/dependabot.yml +16 -0
  54. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/labeler.yml +8 -0
  55. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/labeler_merged.yml +3 -0
  56. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/pull_request_template.md +19 -0
  57. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/ci.yml +969 -0
  58. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/configure.yml +84 -0
  59. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/format.yml +48 -0
  60. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/labeler.yml +16 -0
  61. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/pip.yml +103 -0
  62. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.gitignore +45 -0
  63. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.pre-commit-config.yaml +151 -0
  64. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.readthedocs.yml +3 -0
  65. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/CMakeLists.txt +297 -0
  66. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/LICENSE +29 -0
  67. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/MANIFEST.in +6 -0
  68. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/README.rst +180 -0
  69. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/Doxyfile +23 -0
  70. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/Makefile +192 -0
  71. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/_static/theme_overrides.css +11 -0
  72. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/chrono.rst +81 -0
  73. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/custom.rst +93 -0
  74. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/eigen.rst +310 -0
  75. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/functional.rst +109 -0
  76. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/index.rst +43 -0
  77. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/overview.rst +171 -0
  78. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/stl.rst +251 -0
  79. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/strings.rst +305 -0
  80. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/classes.rst +1297 -0
  81. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/embedding.rst +262 -0
  82. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/exceptions.rst +396 -0
  83. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/functions.rst +568 -0
  84. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/misc.rst +337 -0
  85. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/index.rst +13 -0
  86. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/numpy.rst +463 -0
  87. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/object.rst +286 -0
  88. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/utilities.rst +155 -0
  89. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/smart_ptrs.rst +174 -0
  90. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/basics.rst +308 -0
  91. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/benchmark.py +91 -0
  92. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/benchmark.rst +95 -0
  93. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/changelog.rst +2050 -0
  94. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/classes.rst +542 -0
  95. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/cmake/index.rst +8 -0
  96. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/compiling.rst +648 -0
  97. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/conf.py +381 -0
  98. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/faq.rst +343 -0
  99. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/index.rst +48 -0
  100. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/installing.rst +105 -0
  101. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/limitations.rst +72 -0
  102. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11-logo.png +0 -0
  103. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python1.png +0 -0
  104. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python1.svg +427 -0
  105. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python2.png +0 -0
  106. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python2.svg +427 -0
  107. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/reference.rst +130 -0
  108. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/release.rst +96 -0
  109. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/requirements.txt +8 -0
  110. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/upgrade.rst +548 -0
  111. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/attr.h +605 -0
  112. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/buffer_info.h +144 -0
  113. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/cast.h +1432 -0
  114. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/chrono.h +213 -0
  115. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/common.h +2 -0
  116. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/complex.h +65 -0
  117. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/class.h +709 -0
  118. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/common.h +1021 -0
  119. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/descr.h +104 -0
  120. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/init.h +346 -0
  121. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/internals.h +467 -0
  122. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/type_caster_base.h +978 -0
  123. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/typeid.h +55 -0
  124. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/eigen.h +606 -0
  125. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/embed.h +284 -0
  126. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/eval.h +163 -0
  127. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/functional.h +121 -0
  128. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/gil.h +193 -0
  129. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/iostream.h +275 -0
  130. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/numpy.h +1741 -0
  131. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/operators.h +163 -0
  132. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/options.h +65 -0
  133. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/pybind11.h +2497 -0
  134. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/pytypes.h +1879 -0
  135. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl/filesystem.h +103 -0
  136. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl.h +375 -0
  137. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl_bind.h +747 -0
  138. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/noxfile.py +88 -0
  139. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/__init__.py +11 -0
  140. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/__main__.py +52 -0
  141. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/_version.py +12 -0
  142. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/_version.pyi +6 -0
  143. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/commands.py +21 -0
  144. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/py.typed +0 -0
  145. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/setup_helpers.py +482 -0
  146. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/setup_helpers.pyi +63 -0
  147. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pyproject.toml +41 -0
  148. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/setup.cfg +56 -0
  149. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/setup.py +155 -0
  150. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/CMakeLists.txt +503 -0
  151. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/conftest.py +208 -0
  152. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/constructor_stats.h +275 -0
  153. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/cross_module_gil_utils.cpp +73 -0
  154. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/env.py +33 -0
  155. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_python_package/pytest.ini +0 -0
  156. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_python_package/test_files.py +279 -0
  157. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_setuptools/pytest.ini +0 -0
  158. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_setuptools/test_setuphelper.py +143 -0
  159. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/local_bindings.h +85 -0
  160. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/object.h +179 -0
  161. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_cross_module_tests.cpp +151 -0
  162. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_tests.cpp +91 -0
  163. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_tests.h +85 -0
  164. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pytest.ini +19 -0
  165. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/requirements.txt +12 -0
  166. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_async.cpp +26 -0
  167. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_async.py +25 -0
  168. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_buffers.cpp +216 -0
  169. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_buffers.py +163 -0
  170. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_builtin_casters.cpp +286 -0
  171. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_builtin_casters.py +536 -0
  172. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_call_policies.cpp +107 -0
  173. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_call_policies.py +248 -0
  174. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_callbacks.cpp +227 -0
  175. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_callbacks.py +202 -0
  176. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_chrono.cpp +84 -0
  177. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_chrono.py +210 -0
  178. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_class.cpp +550 -0
  179. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_class.py +473 -0
  180. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/CMakeLists.txt +84 -0
  181. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/embed.cpp +21 -0
  182. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_embed/CMakeLists.txt +28 -0
  183. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_function/CMakeLists.txt +39 -0
  184. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_target/CMakeLists.txt +46 -0
  185. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/main.cpp +6 -0
  186. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt +41 -0
  187. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_function/CMakeLists.txt +35 -0
  188. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_target/CMakeLists.txt +41 -0
  189. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/test.py +10 -0
  190. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_constants_and_functions.cpp +165 -0
  191. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_constants_and_functions.py +53 -0
  192. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_copy_move.cpp +238 -0
  193. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_copy_move.py +126 -0
  194. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_casters.cpp +141 -0
  195. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_casters.py +117 -0
  196. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_setup.cpp +41 -0
  197. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_setup.py +50 -0
  198. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_docstring_options.cpp +69 -0
  199. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_docstring_options.py +42 -0
  200. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eigen.cpp +348 -0
  201. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eigen.py +771 -0
  202. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/CMakeLists.txt +47 -0
  203. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/catch.cpp +22 -0
  204. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/external_module.cpp +23 -0
  205. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/test_interpreter.cpp +326 -0
  206. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/test_interpreter.py +15 -0
  207. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_enum.cpp +148 -0
  208. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_enum.py +272 -0
  209. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval.cpp +119 -0
  210. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval.py +51 -0
  211. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval_call.py +5 -0
  212. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.cpp +285 -0
  213. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.h +12 -0
  214. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.py +265 -0
  215. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_factory_constructors.cpp +397 -0
  216. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_factory_constructors.py +520 -0
  217. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_gil_scoped.cpp +49 -0
  218. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_gil_scoped.py +94 -0
  219. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_iostream.cpp +125 -0
  220. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_iostream.py +331 -0
  221. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_kwargs_and_defaults.cpp +153 -0
  222. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_kwargs_and_defaults.py +284 -0
  223. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_local_bindings.cpp +107 -0
  224. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_local_bindings.py +257 -0
  225. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_methods_and_attributes.cpp +412 -0
  226. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_methods_and_attributes.py +517 -0
  227. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_modules.cpp +102 -0
  228. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_modules.py +92 -0
  229. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_multiple_inheritance.cpp +233 -0
  230. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_multiple_inheritance.py +360 -0
  231. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_array.cpp +472 -0
  232. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_array.py +593 -0
  233. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_dtypes.cpp +524 -0
  234. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_dtypes.py +441 -0
  235. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_vectorize.cpp +103 -0
  236. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_vectorize.py +267 -0
  237. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_opaque_types.cpp +73 -0
  238. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_opaque_types.py +59 -0
  239. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_operator_overloading.cpp +235 -0
  240. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_operator_overloading.py +146 -0
  241. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pickling.cpp +189 -0
  242. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pickling.py +82 -0
  243. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pytypes.cpp +560 -0
  244. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pytypes.py +651 -0
  245. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_sequences_and_iterators.cpp +500 -0
  246. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_sequences_and_iterators.py +253 -0
  247. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_smart_ptr.cpp +452 -0
  248. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_smart_ptr.py +318 -0
  249. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl.cpp +342 -0
  250. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl.py +291 -0
  251. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl_binders.cpp +131 -0
  252. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl_binders.py +318 -0
  253. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_tagbased_polymorphic.cpp +144 -0
  254. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_tagbased_polymorphic.py +29 -0
  255. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_thread.cpp +66 -0
  256. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_thread.py +44 -0
  257. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_union.cpp +22 -0
  258. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_union.py +9 -0
  259. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_virtual_functions.cpp +510 -0
  260. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_virtual_functions.py +408 -0
  261. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/valgrind-numpy-scipy.supp +140 -0
  262. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/valgrind-python.supp +117 -0
  263. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindCatch.cmake +70 -0
  264. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindEigen3.cmake +86 -0
  265. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindPythonLibsNew.cmake +257 -0
  266. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/check-style.sh +44 -0
  267. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/cmake_uninstall.cmake.in +23 -0
  268. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/libsize.py +39 -0
  269. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/make_changelog.py +64 -0
  270. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Common.cmake +402 -0
  271. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Config.cmake.in +233 -0
  272. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11NewTools.cmake +276 -0
  273. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Tools.cmake +214 -0
  274. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pyproject.toml +3 -0
  275. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/setup_global.py.in +65 -0
  276. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/setup_main.py.in +41 -0
  277. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/pyproject.toml +8 -0
  278. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/setup.py +144 -0
  279. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSPyATInterface.cpp +403 -0
  280. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSPyATInterface.hh +100 -0
  281. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSXtrackInterface.cpp +763 -0
  282. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSXtrackInterface.hh +118 -0
  283. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/src/collimasim/__init__.py +8 -0
  284. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/src/collimasim/bindings.cpp +63 -0
  285. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/src/collimasim/pyCollimatorPass.py +142 -0
  286. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/src/collimasim/xtrack_collimator.py +556 -0
  287. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/PKG-INFO +6 -0
  288. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/SOURCES.txt +24 -0
  289. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/dependency_links.txt +1 -0
  290. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/not-zip-safe +1 -0
  291. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/top_level.txt +1 -0
  292. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/README.md +25 -0
  293. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_forions.dat +25 -0
  294. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_new_example.dat +18 -0
  295. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_old_example.dat +68 -0
  296. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_testing.dat +15 -0
  297. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_yaml_example.yaml +110 -0
  298. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/resources/collgaps.dat +7 -0
  299. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/resources/collgaps_pyat_test.dat +3 -0
  300. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/resources/collonly_twiss_file_example.tfs +54 -0
  301. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/resources/settings.gmad +3 -0
  302. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/resources/settings_black_absorber.gmad +3 -0
  303. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/resources/settings_ions.gmad +5 -0
  304. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/resources/twiss_file_testing.tfs +51 -0
  305. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/test_pyat.py +65 -0
  306. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/test_pyat_passmethod.py +59 -0
  307. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/test_pyat_tracking.py +102 -0
  308. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack.py +75 -0
  309. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_angle.py +74 -0
  310. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_colldb_load.py +84 -0
  311. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_interaction.py +159 -0
  312. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_interaction_ion.py +99 -0
  313. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_ions.py +78 -0
  314. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_lost_energy.py +88 -0
  315. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tilt.py +80 -0
  316. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tracking.py +97 -0
  317. xcoll-0.5.0/xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tracking_ions.py +96 -0
  318. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/geometry/collimator_geometry.h +9 -10
  319. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/geometry/crystal_geometry.h +9 -6
  320. xcoll-0.4.0/xcoll/scattering_routines/fluka/build_fluka_input.py +0 -58
  321. {xcoll-0.4.0 → xcoll-0.5.0}/LICENSE +0 -0
  322. {xcoll-0.4.0 → xcoll-0.5.0}/NOTICE +0 -0
  323. {xcoll-0.4.0 → xcoll-0.5.0}/README.md +0 -0
  324. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/headers/checks.h +0 -0
  325. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/headers/particle_states.h +0 -0
  326. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/interaction_record/__init__.py +0 -0
  327. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/interaction_record/interaction_types.py +0 -0
  328. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/manager.py +0 -0
  329. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/rf_sweep.py +0 -0
  330. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/everest/__init__.py +0 -0
  331. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/everest/constants.h +0 -0
  332. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/everest/crystal_parameters.h +0 -0
  333. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/everest/everest.py +0 -0
  334. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/.git +0 -0
  335. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/.gitignore +0 -0
  336. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/CMakeLists.txt +0 -0
  337. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/ComponentMakefile +0 -0
  338. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/Makefile +0 -0
  339. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/README +0 -0
  340. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/doc/Doxyfile +0 -0
  341. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO.asciidoc +0 -0
  342. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO.epub +0 -0
  343. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO.html +0 -0
  344. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO.pdf +0 -0
  345. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__1.png +0 -0
  346. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__2.png +0 -0
  347. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__3.png +0 -0
  348. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__4.png +0 -0
  349. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__5.png +0 -0
  350. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__6.png +0 -0
  351. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__7.png +0 -0
  352. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/doc/Makefile +0 -0
  353. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/doc/docbook.xsl +0 -0
  354. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/include/Connection.h +0 -0
  355. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/include/FlukaIO.h +0 -0
  356. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/include/FlukaIOServer.h +0 -0
  357. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/include/FortranFlukaIO.h +0 -0
  358. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/include/Message.h +0 -0
  359. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/include/ParticleInfo.h +0 -0
  360. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/lib/libFlukaIO64.so +0 -0
  361. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/samples/ClientTest.c +0 -0
  362. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/samples/ServerTest.c +0 -0
  363. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/samples/fclient.f +0 -0
  364. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/samples/fserver.f +0 -0
  365. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/Connection.c +0 -0
  366. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/Connection.d +0 -0
  367. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/Connection.o +0 -0
  368. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/FlukaIO.c +0 -0
  369. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/FlukaIO.d +0 -0
  370. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/FlukaIO.o +0 -0
  371. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/FlukaIOHandshake.c +0 -0
  372. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/FlukaIOHandshake.d +0 -0
  373. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/FlukaIOHandshake.h +0 -0
  374. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/FlukaIOHandshake.o +0 -0
  375. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/FlukaIOServer.c +0 -0
  376. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/FlukaIOServer.d +0 -0
  377. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/FlukaIOServer.o +0 -0
  378. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/FlukaIOServer_private.h +0 -0
  379. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/FlukaIO_private.h +0 -0
  380. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/FortranFlukaIO.c +0 -0
  381. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/FortranFlukaIO.d +0 -0
  382. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/FortranFlukaIO.o +0 -0
  383. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/NetIO.c +0 -0
  384. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/NetIO.d +0 -0
  385. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/NetIO.h +0 -0
  386. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/NetIO.o +0 -0
  387. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/src/tags +0 -0
  388. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/tests/AllTests.cpp +0 -0
  389. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/tests/CommonTest.h +0 -0
  390. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/tests/ConnectionTest.cpp +0 -0
  391. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/tests/FlukaIOServerTest.cpp +0 -0
  392. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/tests/FlukaIOTest.cpp +0 -0
  393. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/tests/FortranFlukaIOTest.cpp +0 -0
  394. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeConnection.c +0 -0
  395. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeConnection.h +0 -0
  396. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIO.c +0 -0
  397. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIO.h +0 -0
  398. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIOHandshake.c +0 -0
  399. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIOHandshake.h +0 -0
  400. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIOServer.c +0 -0
  401. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIOServer.h +0 -0
  402. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFortranFlukaIO.h +0 -0
  403. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeNetIO.c +0 -0
  404. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeNetIO.h +0 -0
  405. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/geometry/__init__.py +0 -0
  406. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/geometry/geometry.py +0 -0
  407. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/geometry/get_s.h +0 -0
  408. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/geometry/methods.h +0 -0
  409. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/geometry/objects.h +0 -0
  410. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/geometry/rotation.h +0 -0
  411. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/geometry/segments.h +0 -0
  412. {xcoll-0.4.0 → xcoll-0.5.0}/xcoll/scattering_routines/geometry/sort.h +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xcoll
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: Xsuite collimation package
5
5
  Home-page: https://github.com/xsuite/xcoll
6
6
  License: Apache 2.0
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "xcoll"
3
- version = "0.4.0"
3
+ version = "0.5.0"
4
4
  description = "Xsuite collimation package"
5
5
  homepage = "https://github.com/xsuite/xcoll"
6
6
  repository = "https://github.com/xsuite/xcoll"
@@ -5,7 +5,8 @@
5
5
 
6
6
  from .general import _pkg_root, __version__, citation
7
7
 
8
- from .beam_elements import BlackAbsorber, BlackCrystal, EverestBlock, EverestCollimator, EverestCrystal, element_classes
8
+ from .beam_elements import BlackAbsorber, BlackCrystal, EverestBlock, EverestCollimator, EverestCrystal, \
9
+ BlowUp, EmittanceMonitor, collimator_classes, crystal_classes, element_classes
9
10
  from .install import install_elements
10
11
  from .line_tools import assign_optics_to_collimators, open_collimators, send_to_parking, enable_scattering, disable_scattering
11
12
  from .scattering_routines.everest import materials, Material, CrystalMaterial
@@ -6,6 +6,8 @@
6
6
  from .base import BaseBlock, BaseCollimator, BaseCrystal
7
7
  from .absorber import BlackAbsorber, BlackCrystal
8
8
  from .everest import EverestBlock, EverestCollimator, EverestCrystal
9
+ from .blowup import BlowUp
10
+ from .monitor import EmittanceMonitor
9
11
 
10
12
  block_classes = tuple(v for v in globals().values()
11
13
  if isinstance(v, type) and issubclass(v, BaseBlock) and v != BaseBlock)
@@ -15,4 +17,8 @@ collimator_classes = tuple(v for v in globals().values()
15
17
  and v != BaseCollimator and v != BaseCrystal)
16
18
  crystal_classes = tuple(v for v in globals().values()
17
19
  if isinstance(v, type) and issubclass(v, BaseCrystal) and v != BaseCrystal)
18
- element_classes = block_classes + collimator_classes
20
+
21
+ element_classes = block_classes + collimator_classes + (BlowUp, EmittanceMonitor)
22
+
23
+ _all_collimator_classes = collimator_classes
24
+ _all_crystal_classes = crystal_classes
@@ -23,7 +23,7 @@ class BlackAbsorber(BaseCollimator):
23
23
  _depends_on = [BaseCollimator, XcollGeometry]
24
24
 
25
25
  _extra_c_sources = [
26
- _pkg_root.joinpath('beam_elements','collimators_src','black_absorber.h')
26
+ _pkg_root.joinpath('beam_elements','elements_src','black_absorber.h')
27
27
  ]
28
28
 
29
29
  _skip_in_to_dict = BaseCollimator._skip_in_to_dict
@@ -54,7 +54,7 @@ class BlackCrystal(BaseCrystal):
54
54
  _depends_on = [BaseCrystal, XcollGeometry]
55
55
 
56
56
  _extra_c_sources = [
57
- _pkg_root.joinpath('beam_elements','collimators_src','black_crystal.h')
57
+ _pkg_root.joinpath('beam_elements','elements_src','black_crystal.h')
58
58
  ]
59
59
 
60
60
  _skip_in_to_dict = BaseCrystal._skip_in_to_dict
@@ -10,7 +10,6 @@ import xtrack as xt
10
10
 
11
11
  from ..interaction_record import InteractionRecord
12
12
  from ..general import _pkg_root
13
- from ..scattering_routines.geometry import XcollGeometry
14
13
 
15
14
 
16
15
  OPEN_JAW = 3.
@@ -46,10 +45,9 @@ class InvalidXcoll(xt.BeamElement):
46
45
 
47
46
  class BaseBlock(xt.BeamElement):
48
47
  _xofields = {
49
- 'length': xo.Float64,
50
- 'active': xo.Int8,
51
- 'record_touches': xo.Int8,
52
- 'record_scatterings': xo.Int8
48
+ 'length': xo.Float64,
49
+ 'active': xo.Int8,
50
+ '_record_interactions': xo.Int8
53
51
  }
54
52
 
55
53
  isthick = True
@@ -57,6 +55,9 @@ class BaseBlock(xt.BeamElement):
57
55
  behaves_like_drift = True
58
56
  skip_in_loss_location_refinement = True
59
57
 
58
+ _skip_in_to_dict = ['_record_interactions']
59
+ _store_in_to_dict = ['record_impacts', 'record_exits', 'record_scatterings']
60
+
60
61
  _depends_on = [InvalidXcoll]
61
62
 
62
63
  _internal_record_class = InteractionRecord
@@ -68,14 +69,61 @@ class BaseBlock(xt.BeamElement):
68
69
  instance = super().__new__(cls)
69
70
  return instance
70
71
 
72
+ def __init__(self, **kwargs):
73
+ if '_xobject' not in kwargs:
74
+ kwargs.setdefault('active', True)
75
+ super().__init__(**kwargs)
76
+
71
77
  def enable_scattering(self):
72
78
  if hasattr(self, '_tracking'):
79
+ if hasattr(self, 'optics') and self.optics is None and \
80
+ (hasattr(self, '_gap_L_set_manually') and self._gap_L_set_manually() \
81
+ or hasattr(self, '_gap_R_set_manually') and self._gap_R_set_manually()):
82
+ raise ValueError("Gap set but optics not yet assigned! "
83
+ + "Cannot enable scattering.")
73
84
  self._tracking = True
74
85
 
75
86
  def disable_scattering(self):
76
87
  if hasattr(self, '_tracking'):
77
88
  self._tracking = False
78
89
 
90
+ @property
91
+ def record_impacts(self):
92
+ return bool(self._record_interactions % 2)
93
+
94
+ @record_impacts.setter
95
+ def record_impacts(self, val):
96
+ if val and not self.record_impacts:
97
+ self._record_interactions += 1
98
+ elif not val and self.record_impacts:
99
+ self._record_interactions -= 1
100
+
101
+ @property
102
+ def record_exits(self):
103
+ return bool((self._record_interactions >> 1) % 2)
104
+
105
+ @record_exits.setter
106
+ def record_exits(self, val):
107
+ if val and not self.record_exits:
108
+ self._record_interactions += 2
109
+ elif not val and self.record_exits:
110
+ self._record_interactions -= 2
111
+
112
+ @property
113
+ def record_scatterings(self):
114
+ return bool((self._record_interactions >> 2) % 2)
115
+
116
+ @record_scatterings.setter
117
+ def record_scatterings(self, val):
118
+ if val and not self.record_scatterings:
119
+ self._record_interactions += 4
120
+ elif not val and self.record_scatterings:
121
+ self._record_interactions -= 4
122
+
123
+ def _verify_consistency(self):
124
+ assert isinstance(self.active, bool) or self.active in [0, 1]
125
+ assert self._record_interactions in list(range(8))
126
+
79
127
  def get_backtrack_element(self, _context=None, _buffer=None, _offset=None):
80
128
  return InvalidXcoll(length=-self.length,
81
129
  _context=_context, _buffer=_buffer, _offset=_offset)
@@ -119,8 +167,8 @@ class BaseCollimator(BaseBlock):
119
167
  skip_in_loss_location_refinement = BaseBlock.skip_in_loss_location_refinement
120
168
  allow_double_sided = True
121
169
 
122
- _skip_in_to_dict = [f for f in _xofields if f.startswith('_')]
123
- _store_in_to_dict = ['angle', 'jaw', 'tilt', 'gap', 'side', 'align', 'emittance']
170
+ _skip_in_to_dict = [*BaseBlock._skip_in_to_dict, *[f for f in _xofields if f.startswith('_')]]
171
+ _store_in_to_dict = [*BaseBlock._store_in_to_dict, 'angle', 'jaw', 'tilt', 'gap', 'side', 'align', 'emittance']
124
172
 
125
173
  _depends_on = [BaseBlock]
126
174
 
@@ -203,9 +251,6 @@ class BaseCollimator(BaseBlock):
203
251
  # Set others
204
252
  to_assign['align'] = kwargs.pop('align', 'upstream')
205
253
  to_assign['emittance'] = kwargs.pop('emittance', None)
206
- kwargs.setdefault('active', True)
207
- kwargs.setdefault('record_touches', False)
208
- kwargs.setdefault('record_scatterings', False)
209
254
 
210
255
  super().__init__(**kwargs)
211
256
  # Careful: non-xofields are not passed correctly between copy's / to_dict. This messes with flags etc..
@@ -259,7 +304,7 @@ class BaseCollimator(BaseBlock):
259
304
 
260
305
  @property
261
306
  def angle_R(self):
262
- return round(np.rad2deg(np.arctan2(self._sin_zL, self._cos_zL)), 10)
307
+ return round(np.rad2deg(np.arctan2(self._sin_zR, self._cos_zR)), 10)
263
308
 
264
309
  @angle_R.setter
265
310
  def angle_R(self, angle_R):
@@ -336,7 +381,7 @@ class BaseCollimator(BaseBlock):
336
381
  diff = val - (self._jaw_LU + self._jaw_LD) / 2
337
382
  self._jaw_LU += diff
338
383
  self._jaw_LD += diff
339
- self._update_gaps()
384
+ self._update_gaps(only_L=True)
340
385
 
341
386
  @property
342
387
  def jaw_R(self):
@@ -351,11 +396,11 @@ class BaseCollimator(BaseBlock):
351
396
  print("Warning: Ignored value for jaw_R (left-sided collimator).")
352
397
  if val is None:
353
398
  val = -OPEN_JAW
354
- self._gap_R = OPEN_GAP
399
+ self._gap_R = -OPEN_GAP
355
400
  diff = val - (self._jaw_RU + self._jaw_RD) / 2
356
401
  self._jaw_RU += diff
357
402
  self._jaw_RD += diff
358
- self._update_gaps()
403
+ self._update_gaps(only_R=True)
359
404
 
360
405
  @property
361
406
  def jaw_LU(self):
@@ -372,7 +417,7 @@ class BaseCollimator(BaseBlock):
372
417
  raise ValueError("Cannot set corner to None! Use open_jaws() or set jaw_L to None.")
373
418
  self._jaw_LU = val
374
419
  self._update_tilts() # Extra, to update tilts which are also in C for efficiency
375
- self._update_gaps()
420
+ self._update_gaps(only_L=True)
376
421
 
377
422
  @property
378
423
  def jaw_LD(self):
@@ -389,7 +434,7 @@ class BaseCollimator(BaseBlock):
389
434
  raise ValueError("Cannot set corner to None! Use open_jaws() or set jaw_L to None.")
390
435
  self._jaw_LD = val
391
436
  self._update_tilts() # Extra, to update tilts which are also in C for efficiency
392
- self._update_gaps()
437
+ self._update_gaps(only_L=True)
393
438
 
394
439
  @property
395
440
  def jaw_RU(self):
@@ -406,7 +451,7 @@ class BaseCollimator(BaseBlock):
406
451
  raise ValueError("Cannot set corner to None! Use open_jaws() or set jaw_R to None.")
407
452
  self._jaw_RU = val
408
453
  self._update_tilts() # Extra, to update tilts which are also in C for efficiency
409
- self._update_gaps()
454
+ self._update_gaps(only_R=True)
410
455
 
411
456
  @property
412
457
  def jaw_RD(self):
@@ -423,7 +468,23 @@ class BaseCollimator(BaseBlock):
423
468
  raise ValueError("Cannot set corner to None! Use open_jaws() or set jaw_R to None.")
424
469
  self._jaw_RD = val
425
470
  self._update_tilts() # Extra, to update tilts which are also in C for efficiency
426
- self._update_gaps()
471
+ self._update_gaps(only_R=True)
472
+
473
+ @property
474
+ def jaw_s_LU(self):
475
+ return self.length/2 * (1 - self._cos_yL)
476
+
477
+ @property
478
+ def jaw_s_LD(self):
479
+ return self.length/2 * (1 + self._cos_yL)
480
+
481
+ @property
482
+ def jaw_s_RU(self):
483
+ return self.length/2 * (1 - self._cos_yR)
484
+
485
+ @property
486
+ def jaw_s_RD(self):
487
+ return self.length/2 * (1 + self._cos_yR)
427
488
 
428
489
  def open_jaws(self, keep_tilts=False):
429
490
  self.jaw_L = None
@@ -441,12 +502,12 @@ class BaseCollimator(BaseBlock):
441
502
  self._cos_yR = np.sqrt(1 - self._sin_yR**2)
442
503
  self._tan_yR = self._sin_yR / self._cos_yR
443
504
 
444
- def _update_gaps(self):
505
+ def _update_gaps(self, only_L=False, only_R=False):
445
506
  # If we had set a value for the gap manually, this needs to be updated
446
507
  # as well after setting the jaw
447
- if self._gap_L_set_manually():
508
+ if self._gap_L_set_manually() and not only_R:
448
509
  self._gap_L = self.gap_L
449
- if self._gap_R_set_manually():
510
+ if self._gap_R_set_manually() and not only_L:
450
511
  self._gap_R = self.gap_R
451
512
 
452
513
 
@@ -536,8 +597,8 @@ class BaseCollimator(BaseBlock):
536
597
 
537
598
  def assign_optics(self, *, nemitt_x=None, nemitt_y=None, beta_gamma_rel=None, name=None, twiss=None,
538
599
  twiss_upstream=None, twiss_downstream=None):
539
- from xcoll import element_classes
540
- if not isinstance(self, element_classes):
600
+ from xcoll.beam_elements import _all_collimator_classes
601
+ if not isinstance(self, _all_collimator_classes):
541
602
  raise ValueError("Please install collimator before assigning optics.")
542
603
  if nemitt_x is None:
543
604
  if self.nemitt_x is None:
@@ -587,8 +648,8 @@ class BaseCollimator(BaseBlock):
587
648
  @nemitt_x.setter
588
649
  def nemitt_x(self, val):
589
650
  if val is None:
590
- self._nemitt_x = 0
591
- if val <= 0:
651
+ val = 0
652
+ elif val <= 0:
592
653
  raise ValueError(f"The field `nemitt_x` should be positive, but got {val}.")
593
654
  self._nemitt_x = val
594
655
  self._apply_optics()
@@ -602,12 +663,11 @@ class BaseCollimator(BaseBlock):
602
663
  @nemitt_y.setter
603
664
  def nemitt_y(self, val):
604
665
  if val is None:
605
- self._nemitt_y = 0
606
- else:
607
- if val <= 0:
608
- raise ValueError(f"The field `nemitt_y` should be positive, but got {val}.")
609
- self._nemitt_y = val
610
- self._apply_optics()
666
+ val = 0
667
+ elif val <= 0:
668
+ raise ValueError(f"The field `nemitt_y` should be positive, but got {val}.")
669
+ self._nemitt_y = val
670
+ self._apply_optics()
611
671
 
612
672
  @property
613
673
  def emittance(self):
@@ -645,7 +705,7 @@ class BaseCollimator(BaseBlock):
645
705
  sigma_L = np.sqrt((sigma_x*self._cos_zL)**2 + (sigma_y*self._sin_zL)**2)
646
706
  sigma_R = np.sqrt((sigma_x*self._cos_zR)**2 + (sigma_y*self._sin_zR)**2)
647
707
  return [sigma_L, sigma_R], [sigma_x, sigma_y]
648
- else:
708
+ else: # crystal
649
709
  sigma = np.sqrt((sigma_x*self._cos_z)**2 + (sigma_y*self._sin_z)**2)
650
710
  return sigma, [sigma_x, sigma_y]
651
711
 
@@ -658,7 +718,7 @@ class BaseCollimator(BaseBlock):
658
718
  co_L = x*self._cos_zL + y*self._sin_zL
659
719
  co_R = x*self._cos_zR + y*self._sin_zR
660
720
  return [co_L, co_R], [x, y]
661
- else:
721
+ else: # crystal
662
722
  co = x*self._cos_z + y*self._sin_z
663
723
  return co, [x, y]
664
724
 
@@ -755,10 +815,10 @@ class BaseCollimator(BaseBlock):
755
815
  if val is None:
756
816
  val = OPEN_GAP
757
817
  self.jaw_L = None
758
- if val <= 0:
818
+ elif val <= 0:
759
819
  raise ValueError(f"The field `gap_L` should be positive, but got {val}.")
760
820
  self._gap_L = val
761
- self._apply_optics()
821
+ self._apply_optics(only_L=True)
762
822
 
763
823
  @property
764
824
  def gap_R(self):
@@ -775,10 +835,10 @@ class BaseCollimator(BaseBlock):
775
835
  if val is None:
776
836
  val = -OPEN_GAP
777
837
  self.jaw_R = None
778
- if val >= 0:
838
+ elif val >= 0:
779
839
  raise ValueError(f"The field `gap_R` should be negative, but got {val}.")
780
840
  self._gap_R = val
781
- self._apply_optics()
841
+ self._apply_optics(only_R=True)
782
842
 
783
843
  @property
784
844
  def gap_LU(self):
@@ -806,12 +866,12 @@ class BaseCollimator(BaseBlock):
806
866
  def _gap_R_set_manually(self):
807
867
  return not np.isclose(self._gap_R, -OPEN_GAP)
808
868
 
809
- def _apply_optics(self):
869
+ def _apply_optics(self, only_L=False, only_R=False):
810
870
  if self.optics_ready():
811
871
  # Only if we have set a value for the gap manually, this needs to be updated
812
- if self._gap_L_set_manually():
872
+ if self._gap_L_set_manually() and not only_R:
813
873
  self.jaw_L = self._gap_L * self.sigma[0][0] + self.co[0][0]
814
- if self._gap_R_set_manually():
874
+ if self._gap_R_set_manually() and not only_L:
815
875
  self.jaw_R = self._gap_R * self.sigma[0][1] + self.co[0][1]
816
876
 
817
877
 
@@ -862,17 +922,8 @@ class BaseCollimator(BaseBlock):
862
922
  # Methods
863
923
  # =======
864
924
 
865
- def enable_scattering(self):
866
- if hasattr(self, '_tracking'):
867
- if self.optics is None:
868
- raise ValueError("Optics not assigned! Cannot enable scattering.")
869
- self._tracking = True
870
-
871
- def disable_scattering(self):
872
- if hasattr(self, '_tracking'):
873
- self._tracking = False
874
-
875
925
  def _verify_consistency(self):
926
+ BaseBlock._verify_consistency(self)
876
927
  # Verify angles
877
928
  if abs(self.angle_L - self.angle_R) >= 90.:
878
929
  raise ValueError("Angles of both jaws differ more than 90 degrees!")
@@ -908,9 +959,6 @@ class BaseCollimator(BaseBlock):
908
959
  # Verify bools
909
960
  assert self._side in [-1, 1, 0]
910
961
  assert isinstance(self._jaws_parallel, bool) or self._jaws_parallel in [0, 1]
911
- assert isinstance(self.active, bool) or self.active in [0, 1]
912
- assert isinstance(self.record_touches, bool) or self.record_touches in [0, 1]
913
- assert isinstance(self.record_scatterings, bool) or self.record_scatterings in [0, 1]
914
962
 
915
963
  def jaw_func(self, pos):
916
964
  positions = ['LU', 'RU', 'LD', 'RD']
@@ -964,8 +1012,8 @@ class BaseCrystal(BaseBlock):
964
1012
  skip_in_loss_location_refinement = BaseBlock.skip_in_loss_location_refinement
965
1013
  allow_double_sided = False
966
1014
 
967
- _skip_in_to_dict = [f for f in _xofields if f.startswith('_')]
968
- _store_in_to_dict = ['angle', 'jaw', 'tilt', 'gap', 'side', 'align', 'emittance',
1015
+ _skip_in_to_dict = [*BaseBlock._skip_in_to_dict, *[f for f in _xofields if f.startswith('_')]]
1016
+ _store_in_to_dict = [*BaseBlock._store_in_to_dict, 'angle', 'jaw', 'tilt', 'gap', 'side', 'align', 'emittance',
969
1017
  'bending_radius', 'bending_angle']
970
1018
 
971
1019
  _depends_on = [BaseCollimator]
@@ -1026,8 +1074,6 @@ class BaseCrystal(BaseBlock):
1026
1074
  to_assign['align'] = kwargs.pop('align', 'upstream')
1027
1075
  to_assign['emittance'] = kwargs.pop('emittance', None)
1028
1076
  kwargs.setdefault('active', True)
1029
- kwargs.setdefault('record_touches', False)
1030
- kwargs.setdefault('record_scatterings', False)
1031
1077
 
1032
1078
  # Set crystal specific
1033
1079
  if 'bending_angle' in kwargs:
@@ -1299,13 +1345,8 @@ class BaseCrystal(BaseBlock):
1299
1345
  # Methods
1300
1346
  # =======
1301
1347
 
1302
- def enable_scattering(self):
1303
- BaseCollimator.enable_scattering(self)
1304
-
1305
- def disable_scattering(self):
1306
- BaseCollimator.disable_scattering(self)
1307
-
1308
1348
  def _verify_consistency(self):
1349
+ BaseBlock._verify_consistency(self)
1309
1350
  # Verify angles
1310
1351
  ang = abs(np.arccos(self._cos_z))
1311
1352
  ang = np.pi - ang if ang > np.pi/2 else ang
@@ -1315,10 +1356,7 @@ class BaseCrystal(BaseBlock):
1315
1356
  assert np.isclose(ang, abs(np.arcsin(self._sin_y)))
1316
1357
  assert np.isclose(self._sin_y/self._cos_y, self._tan_y)
1317
1358
  # Verify bools
1318
- assert self._side in [-1, 1, 0]
1319
- assert isinstance(self.active, bool) or self.active in [0, 1]
1320
- assert isinstance(self.record_touches, bool) or self.record_touches in [0, 1]
1321
- assert isinstance(self.record_scatterings, bool) or self.record_scatterings in [0, 1]
1359
+ assert self._side in [-1, 1]
1322
1360
  # Crystal specific
1323
1361
  assert np.isclose(self._bending_angle, np.arcsin(self.length/self._bending_radius))
1324
1362
 
@@ -0,0 +1,198 @@
1
+ # copyright ############################### #
2
+ # This file is part of the Xcoll Package. #
3
+ # Copyright (c) CERN, 2024. #
4
+ # ######################################### #
5
+
6
+ import numpy as np
7
+
8
+ import xobjects as xo
9
+ import xtrack as xt
10
+
11
+ from ..general import _pkg_root
12
+ from .base import InvalidXcoll
13
+
14
+
15
+ class BlowUp(InvalidXcoll):
16
+ _xofields = {
17
+ '_plane': xo.Int8,
18
+ 'start_at_turn': xo.Int64,
19
+ 'stop_at_turn': xo.Int64,
20
+ 'use_individual_kicks': xo.Int8,
21
+ '_max_kick': xo.Float64,
22
+ '_rans': xo.Float64[:],
23
+ '_calibration': xo.Float64,
24
+ '_active': xo.Int8,
25
+ }
26
+
27
+ isthick = False
28
+ behaves_like_drift = False
29
+ allow_track = True
30
+ needs_rng = True
31
+ skip_in_loss_location_refinement = True
32
+ allow_loss_refinement = False
33
+
34
+ _skip_in_to_dict = ['_max_kick', '_plane', '_calibration', '_active']
35
+ _store_in_to_dict = ['amplitude', 'plane', 'calibration']
36
+
37
+ _depends_on = [InvalidXcoll, xt.RandomUniform]
38
+
39
+ _extra_c_sources = [
40
+ _pkg_root.joinpath('beam_elements','elements_src','blowup.h')
41
+ ]
42
+
43
+ def __init__(self, **kwargs):
44
+ to_assign = {}
45
+ if '_xobject' not in kwargs:
46
+ start_at_turn = int(kwargs.get('start_at_turn', 0))
47
+ stop_at_turn = int(kwargs.get('stop_at_turn', start_at_turn+1))
48
+ kwargs['start_at_turn'] = start_at_turn
49
+ kwargs['stop_at_turn'] = stop_at_turn
50
+ kwargs['_rans'] = 2*np.random.uniform(size=stop_at_turn-start_at_turn) - 1
51
+ if 'plane' in kwargs:
52
+ to_assign['plane'] = kwargs.pop('plane')
53
+ to_assign['calibration'] = kwargs.pop('calibration', 1.)
54
+ to_assign['amplitude'] = kwargs.pop('amplitude', 1)
55
+ kwargs['_calibration'] = 1.
56
+ super().__init__(**kwargs)
57
+ for key, val in to_assign.items():
58
+ setattr(self, key, val)
59
+
60
+
61
+ @classmethod
62
+ def install(cls, line, name, *, at_s=None, at=None, need_apertures=True, aperture=None, s_tol=1.e-6, **kwargs):
63
+ self = cls(**kwargs)
64
+ line.insert_element(element=self, name=name, at_s=at_s, at=at, s_tol=s_tol)
65
+ self._name = name
66
+ self._line = line
67
+ if need_apertures:
68
+ if aperture is not None:
69
+ aper_upstream = aperture.copy()
70
+ aper_downstream = aperture.copy()
71
+ else:
72
+ idx = line.element_names.index(name)
73
+ while True:
74
+ if xt.line._is_aperture(line.elements[idx], line):
75
+ aper_upstream = line.elements[idx].copy()
76
+ break
77
+ idx -= 1
78
+ idx = line.element_names.index(name)
79
+ while True:
80
+ if xt.line._is_aperture(line.elements[idx], line):
81
+ aper_downstream = line.elements[idx].copy()
82
+ break
83
+ idx += 1
84
+ line.insert_element(element=aper_upstream, name=f'{name}_aper_upstream', at=name, s_tol=s_tol)
85
+ idx = line.element_names.index(name) + 1
86
+ line.insert_element(element=aper_downstream, name=f'{name}_aper_downstream', at=idx, s_tol=s_tol)
87
+ return self
88
+
89
+ def get_backtrack_element(self, _context=None, _buffer=None, _offset=None):
90
+ return xt.Marker(_context=_context, _buffer=_buffer, _offset=_offset)
91
+
92
+
93
+ @property
94
+ def plane(self):
95
+ if self._plane == 1:
96
+ return 'H'
97
+ elif self._plane == -1:
98
+ return 'V'
99
+ else:
100
+ raise ValueError("The plane of the BlowUp is not recognized.")
101
+
102
+ @plane.setter
103
+ def plane(self, val):
104
+ if val.lower() == 'h':
105
+ self._plane = 1
106
+ elif val.lower() == 'v':
107
+ self._plane = -1
108
+ else:
109
+ raise ValueError("The plane of the BlowUp must be either 'H' or 'V'.")
110
+
111
+ @property
112
+ def amplitude(self):
113
+ return (self._max_kick / self.calibration)**2
114
+
115
+ @amplitude.setter
116
+ def amplitude(self, val):
117
+ if val< 0:
118
+ raise ValueError("The amplitude cannot be negative!")
119
+ self._max_kick = np.sqrt(val) * self.calibration
120
+
121
+ @property
122
+ def calibration(self):
123
+ return self._calibration
124
+
125
+ @calibration.setter
126
+ def calibration(self, val):
127
+ if val< 0:
128
+ raise ValueError("The calibration cannot be negative!")
129
+ previous_amplitude = self.amplitude
130
+ self._calibration = val
131
+ self.amplitude = previous_amplitude
132
+
133
+ @property
134
+ def name(self):
135
+ if not hasattr(self, '_name'):
136
+ raise ValueError("Name not set! Install the blow-up using xc.BlowUp.install() "
137
+ "or manually set the name after installation.")
138
+ return self._name
139
+
140
+ @name.setter
141
+ def name(self, val):
142
+ self._name = val
143
+
144
+ @property
145
+ def line(self):
146
+ if not hasattr(self, '_line'):
147
+ raise ValueError("Line not set! Install the blow-up using xc.BlowUp.install() "
148
+ "or manually set the line after installation.")
149
+ return self._line
150
+
151
+ @line.setter
152
+ def line(self, val):
153
+ self._line = val
154
+
155
+
156
+ def calibrate_by_emittance(self, nemitt, *, twiss=None, beta_gamma_rel=None):
157
+ # The emittance gained per turn of blow up can be calculated as follows:
158
+ # <px^2> = gamma * eps
159
+ # gamma * eps = <px^2> = <(px0 + dpx)^2>
160
+ # where px0 is the initial momentum and dpx is the kick, and eps0 and eps
161
+ # are the geometric emittance before resp. after the kick, and gamma is the
162
+ # Courant-Snyder parameter.
163
+ # If each particle gets another random kick, we can write:
164
+ # <(px0 + dpx)^2> = <px0^2> + 2<px0 dpx> + <dpx^2>
165
+ # = gamma * eps0 + 2<px0 dpx> + 1/3 dpx_max^2 (variance of uniform distribution is 1/12(b-a)^2)
166
+ # The covariance can be estimated with an upper bound:
167
+ # 0 <= 2<px0 dpx> <= 2*sqrt(<px0^2> <dpx^2>)
168
+ # = 2/sqrt(3) * sqrt(gamma * eps0) * dpx_max
169
+ # So that we finally get for the emittance growth after one turn of blow-up:
170
+ # deps = (eps-eps0)/eps0 = [dPM^2, dPM^2 + 2dPM] (dPM = dpx_max/sqrt(3 * gamma * eps0))
171
+ # Or, to get an emittance growth of deps, we need:
172
+ # dpx_max = [sqrt(3* gamma * eps0 * deps), sqrt(3 * gamma * eps0)*(sqrt(1+deps) -1)]
173
+ # If all particles get the same kick, we can write:
174
+ # <(px0 + dpx)^2> = <px0^2> + 2<px0> dpx
175
+ # However, now things get a bit more complicated. At the start <px0> is the closed orbit,
176
+ # but when the bunch has had a kick in the previous turn, the bunch is no longer centred
177
+ # around the closed orbit. We can write:
178
+ # deps = (eps-eps0)/eps0 = 2<px0> dpx/gamma/eps0
179
+ name = self.name
180
+ line = self.line
181
+ if beta_gamma_rel is None:
182
+ if not hasattr(line, 'particle_ref'):
183
+ raise ValueError("The provided line has no reference particle. Use the argument `beta_gamma_rel`")
184
+ beta_gamma_rel = line.particle_ref.gamma0[0]*line.particle_ref.beta0[0]
185
+ if twiss is None:
186
+ twiss = line.twiss()
187
+ gamma = twiss.rows[name][f"gam{'x' if self.plane == 'H' else 'y'}"][0]
188
+ # Asumming a Gaussian beam, we will have shifted all beam beyond 5 sigma with an emittance growth
189
+ # of around a factor 60. In practive, a ~50x increase is enough due to the covariance terms.
190
+ # We want to do this slowly, over 1000 turns.
191
+ deps = 50/1000
192
+ self.calibration = np.sqrt(3*gamma*nemitt/beta_gamma_rel*deps)
193
+
194
+ def activate(self):
195
+ self._active = True
196
+
197
+ def deactivate(self):
198
+ self._active = False