Skip to content

Commit f308a64

Browse files
committed
RFSystems / RFBucket interface revised. Admitted for master merge by Kevin. :-)
1 parent 8588b00 commit f308a64

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

trackers/rf_bucket.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
def attach_clean_buckets(rf_parameter_changing_method, rfsystems_instance):
1414
'''Wrap an rf_parameter_changing_method (that changes relevant RF
1515
parameters, i.e. Kick attributes). Needs to be an instance method,
16-
presumably an RFSystems instance.
16+
presumably an RFSystems instance (hence the self argument in
17+
cleaned_rf_parameter_changing_method).
1718
In detail, attaches a call to the rfsystems_instance.clean_buckets
1819
method after calling the wrapped function.
1920
'''
@@ -83,6 +84,7 @@ def p0_reference(self, value):
8384
def R(self):
8485
return self.circumference/(2*np.pi)
8586

87+
# should make use of eta functionality of LongitudinalMap at some point
8688
@property
8789
def eta0(self):
8890
return self.alpha0 - self.gamma_reference**-2
@@ -93,6 +95,9 @@ def beta_z(self):
9395

9496
@property
9597
def Qs(self):
98+
"""Neglects all other harmonics besides the maximum
99+
voltage one.
100+
"""
96101
ix = np.argmax(self.V)
97102
V = self.V[ix]
98103
h = self.h[ix]
@@ -211,9 +216,17 @@ def hamiltonian(self, z, dp):
211216
+ self.V_acc(z)) / self.p0_reference)
212217

213218
def H0_from_sigma(self, z0):
219+
"""Pure estimate value of H_0 starting from a bi-Gaussian bunch
220+
in a linear "RF bucket". Intended for use by iterative matching
221+
algorithms in the generators module.
222+
"""
214223
return np.abs(self.eta0)*self.beta_reference*c * (z0/self.beta_z)**2
215224

216225
def H0_from_epsn(self, epsn):
226+
"""Pure estimate value of H_0 starting from a bi-Gaussian bunch
227+
in a linear "RF bucket". Intended for use by iterative matching
228+
algorithms in the generators module.
229+
"""
217230
z0 = np.sqrt(epsn/(4.*np.pi) * self.beta_z * e/self.p0_reference)
218231
return np.abs(self.eta0)*self.beta_reference*c * (z0/self.beta_z)**2
219232

@@ -248,7 +261,6 @@ def make_is_accepted(self, margin):
248261
the returned is_accepted(z, dp) function is equivalent to
249262
self.is_in_separatrix(z, dp).
250263
"""
251-
252264
def is_accepted(z, dp):
253265
""" Returns boolean whether the coordinate (z, dp) is
254266
located inside the equihamiltonian defined by

trackers/simple_long_tracking.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,9 @@ def set_phi_offset_list(self, phi_offset_list):
542542
raise RuntimeError('Interface change: ' +
543543
'Use the list RFSystems.phi_offsets .')
544544

545-
# # should be more general:
545+
# # should be replaced by something more general:
546+
# # (something along the lines of
547+
# # summing over h_i * V_i * sin(phi_i?))
546548
# def Qs(self, gamma):
547549
# beta = np.sqrt(1 - gamma**-2)
548550
# p0 = m_p*np.sqrt(gamma**2 - 1)*c

0 commit comments

Comments
 (0)