1
1
# copyright ############################### #
2
2
# This file is part of the Xcoll package. #
3
- # Copyright (c) CERN, 2024 . #
3
+ # Copyright (c) CERN, 2025 . #
4
4
# ######################################### #
5
5
6
6
import numpy as np
@@ -88,11 +88,14 @@ def generate_pencil_on_collimator(line, name, num_particles, *, side='+-', penci
88
88
if side == '+-' :
89
89
num_plus = int (num_particles / 2 )
90
90
num_min = int (num_particles - num_plus )
91
- coords_plus = _generate_4D_pencil_one_jaw (line , name , num_plus , plane , '+' , impact_parameter , dr_sigmas , at_element , is_converging , tw_at_s )
92
- coords_min = _generate_4D_pencil_one_jaw (line , name , num_min , plane , '-' , impact_parameter , dr_sigmas , at_element , is_converging , tw_at_s )
91
+ coords_plus = _generate_4D_pencil_one_jaw (line , name , num_plus , plane , '+' , impact_parameter , dr_sigmas ,
92
+ at_element , is_converging , tw_at_s , ** kwargs )
93
+ coords_min = _generate_4D_pencil_one_jaw (line , name , num_min , plane , '-' , impact_parameter , dr_sigmas ,
94
+ at_element , is_converging , tw_at_s , ** kwargs )
93
95
coords = [ [* c_plus , * c_min ] for c_plus , c_min in zip (coords_plus , coords_min )]
94
96
else :
95
- coords = _generate_4D_pencil_one_jaw (line , name , num_particles , plane , side , impact_parameter , dr_sigmas , at_element , is_converging , tw_at_s )
97
+ coords = _generate_4D_pencil_one_jaw (line , name , num_particles , plane , side , impact_parameter ,
98
+ dr_sigmas , at_element , is_converging , tw_at_s , ** kwargs )
96
99
pencil = coords [0 ]
97
100
p_pencil = coords [1 ]
98
101
transverse_norm = coords [2 ]
@@ -183,7 +186,8 @@ def generate_delta_from_dispersion(line, at_element, *, plane, position_mm, nemi
183
186
184
187
185
188
def _generate_4D_pencil_one_jaw (line , name , num_particles , plane , side , impact_parameter ,
186
- dr_sigmas , at_element , is_converging , tw_at_s = None ):
189
+ dr_sigmas , at_element , is_converging , tw_at_s = None ,
190
+ _capacity = None , ** kwargs ):
187
191
coll = line [name ]
188
192
189
193
if side == '+' :
@@ -209,7 +213,7 @@ def _generate_4D_pencil_one_jaw(line, name, num_particles, plane, side, impact_p
209
213
pencil , p_pencil = xp .generate_2D_pencil_with_absolute_cut (
210
214
num_particles , plane = plane , absolute_cut = pencil_pos , line = line ,
211
215
dr_sigmas = dr_sigmas , nemitt_x = coll .nemitt_x , nemitt_y = coll .nemitt_y ,
212
- at_element = at_element , side = side , twiss = tw_at_s
216
+ at_element = at_element , side = side , twiss = tw_at_s , ** kwargs
213
217
)
214
218
215
219
# Other plane: generate gaussian distribution in normalized coordinates
0 commit comments