Skip to content

Commit

Permalink
Merge pull request #30 from xsuite/release0.2.5
Browse files Browse the repository at this point in the history
Release 0.2.5
  • Loading branch information
freddieknets authored Aug 16, 2023
2 parents 9d2543a + 4c6c82e commit 3813137
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from xcoll import __version__

def test_version():
assert __version__ == '0.2.4'
assert __version__ == '0.2.5'

2 changes: 1 addition & 1 deletion xcoll/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
from .manager import CollimatorManager
from .colldb import CollimatorDatabase, load_SixTrack_colldb

__version__ = '0.2.4'
__version__ = '0.2.5'
21 changes: 10 additions & 11 deletions xcoll/scattering_routines/everest/scatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---------------------------------------------------
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3813137

Please sign in to comment.