@@ -19,6 +19,16 @@ def twiss(
1919 alpha_x : np .float64 = 0.0 ,
2020 alpha_y : np .float64 = 0.0 ,
2121 alpha_t : np .float64 = 0.0 ,
22+ meanX : np .float64 = 0.0 ,
23+ meanY : np .float64 = 0.0 ,
24+ meanT : np .float64 = 0.0 ,
25+ meanPx : np .float64 = 0.0 ,
26+ meanPy : np .float64 = 0.0 ,
27+ meanPt : np .float64 = 0.0 ,
28+ dispX : np .float64 = 0.0 ,
29+ dispY : np .float64 = 0.0 ,
30+ dispPx : np .float64 = 0.0 ,
31+ dispPy : np .float64 = 0.0 ,
2232):
2333 """
2434 Helper function to convert Courant-Snyder / Twiss input into phase space ellipse input.
@@ -32,6 +42,16 @@ def twiss(
3242 :param alpha_x: Alpha function value () in the x dimension, default is 0.0.
3343 :param alpha_y: Alpha function value in the y dimension, default is 0.0.
3444 :param alpha_t: Alpha function value in the t dimension, default is 0.0.
45+ :param meanX: offset of the mean (centroid) position in x from that of the reference particle
46+ :param meanY: offset of the mean (centroid) position in y from that of the reference particle
47+ :param meanT: offset of the mean (centroid) position in t from that of the reference particle
48+ :param meanPx: offset of the mean (centroid) momentum in x from that of the reference particle
49+ :param meanPy: offset of the mean (centroid) momentum in y from that of the reference particle
50+ :param meanPt: offset of the mean (centroid) momentum in t from that of the reference particle
51+ :param dispX: dispersion and its derivative in horizontal and vertical directions
52+ :param dispY: dispersion and its derivative in horizontal and vertical directions
53+ :param dispPx: dispersion and its derivative in horizontal and vertical directions
54+ :param dispPy: dispersion and its derivative in horizontal and vertical directions
3555 :return: A dictionary containing calculated phase space input: 'lambdaX', 'lambdaY', 'lambdaT', 'lambdaPx', 'lambdaPy', 'lambdaPt', 'muxpx', 'muypy', 'mutpt'.
3656 """
3757 if beta_x <= 0.0 or beta_y <= 0.0 or beta_t <= 0.0 :
@@ -63,4 +83,14 @@ def twiss(
6383 "muxpx" : alpha_x / np .sqrt (beta_x * gamma_x ),
6484 "muypy" : alpha_y / np .sqrt (beta_y * gamma_y ),
6585 "mutpt" : alpha_t / np .sqrt (beta_t * gamma_t ),
86+ "meanX" : meanX ,
87+ "meanY" : meanY ,
88+ "meanT" : meanT ,
89+ "meanPx" : meanPx ,
90+ "meanPy" : meanPy ,
91+ "meanPt" : meanPt ,
92+ "dispX" : dispX ,
93+ "dispY" : dispY ,
94+ "dispPx" : dispPx ,
95+ "dispPy" : dispPy ,
6696 }
0 commit comments