Skip to content

Commit 55e6ab8

Browse files
committed
Losses on aperture downstream of collimators should only be shifted to the collimator if it is active.
1 parent 349e5d7 commit 55e6ab8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

xcoll/lossmap.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ def _correct_absorbed(self, part, line, verbose=True):
254254
prev_elem = len(line.element_names) - 1
255255
else:
256256
prev_elem = elem - 1
257-
if line.element_names[prev_elem] in coll_elements:
257+
if line.element_names[prev_elem] in coll_elements \
258+
and line[prev_elem].active:
258259
if verbose:
259260
print(f"Found at {line.element_names[elem]}, "
260261
+ f"moved to {line.element_names[elem-1]}")

0 commit comments

Comments
 (0)