From 23ecb01a1555d83438498f1104e5f4038c6bfa9c Mon Sep 17 00:00:00 2001 From: Frederik Van der Veken Date: Wed, 16 Aug 2023 15:16:06 +0200 Subject: [PATCH 1/2] Bugfix of previous bugfix (v0.2.4) --- xcoll/scattering_routines/everest/scatter.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/xcoll/scattering_routines/everest/scatter.h b/xcoll/scattering_routines/everest/scatter.h index e4b9ba09..28413198 100644 --- a/xcoll/scattering_routines/everest/scatter.h +++ b/xcoll/scattering_routines/everest/scatter.h @@ -226,15 +226,20 @@ void scatter(LocalParticle* part, double length, MaterialData material, RandomRu y_out = z*cRRot - x*sRRot; xp_out = xp*cRRot + zp*sRRot; yp_out = zp*cRRot - xp*sRRot; + + LocalParticle_set_x(part, x_out); + LocalParticle_set_px(part, xp_out/rpp_in); + LocalParticle_set_y(part, y_out); + LocalParticle_set_py(part, yp_out/rpp_in); + + if (val_part_abs==0){ + LocalParticle_add_to_s(part, length); + } + } else { Drift_single_particle_4d(part, length); } - LocalParticle_set_x(part, x_out); - LocalParticle_set_px(part, xp_out/rpp_in); - LocalParticle_set_y(part, y_out); - LocalParticle_set_py(part, yp_out/rpp_in); - double energy_out = p_out; // Cannot assign energy directly to LocalParticle as it would update dependent variables, but needs to be corrected first! // Update energy --------------------------------------------------- @@ -271,12 +276,6 @@ void scatter(LocalParticle* part, double length, MaterialData material, RandomRu LocalParticle_add_to_zeta(part, drift_zeta_single(rvv, px*rpp, py*rpp, length/2) ); } - // Update s -------------------------------------------------------- - // TODO: move absorbed particles to last impact location - if (val_part_abs==0){ - LocalParticle_add_to_s(part, length); - } - // Update state ---------------------------------------------------- if (val_part_abs > 0){ LocalParticle_set_state(part, XC_LOST_ON_EVEREST); From 4c6c82ef6e54764a1d9755dc8d298a3d85b19e4a Mon Sep 17 00:00:00 2001 From: Frederik Van der Veken Date: Wed, 16 Aug 2023 15:24:36 +0200 Subject: [PATCH 2/2] Updated version number to v0.2.5. --- pyproject.toml | 2 +- tests/test_version.py | 2 +- xcoll/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c731e71d..28735770 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "xcoll" -version = "0.2.4" +version = "0.2.5" description = "Xsuite collimation package" homepage = "https://github.com/xsuite/xcoll" repository = "https://github.com/xsuite/xcoll" diff --git a/tests/test_version.py b/tests/test_version.py index 61a30794..e922033d 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -1,5 +1,5 @@ from xcoll import __version__ def test_version(): - assert __version__ == '0.2.4' + assert __version__ == '0.2.5' diff --git a/xcoll/__init__.py b/xcoll/__init__.py index c54d6011..edd4dbe9 100644 --- a/xcoll/__init__.py +++ b/xcoll/__init__.py @@ -5,4 +5,4 @@ from .manager import CollimatorManager from .colldb import CollimatorDatabase, load_SixTrack_colldb -__version__ = '0.2.4' +__version__ = '0.2.5'