Added support to import LongTrack settings file and to match with user defined twiss values

This commit is contained in:
2026-03-05 11:00:17 +01:00
parent bc81dcce00
commit 9bef0adc13
6 changed files with 340 additions and 20 deletions
+4 -1
View File
@@ -81,7 +81,7 @@ class MatchMaker:
def match(self, om, variables = None, Injector=True, Athos = True, Aramis = False, Porthos = False):
def match(self, om, variables = None, initCond=None, Injector=True, Athos = True, Aramis = False, Porthos = False):
self.matchresult.clear()
cwd = os.getcwd()
@@ -98,6 +98,9 @@ class MatchMaker:
madx.updateLattice(om, target) # write lattice
madx.commonHeader('SwissFEL', '#s/#e', None) # sets header
madx.madx.call('initTwiss.madx')
if not initCond is None:
madx.madx.input('Twiss0: beta0, betx = %f, alfx = %f, bety = %f, alfy = %f;\n'
% (initCond['betax'],initCond['alphax'],initCond['betay'],initCond['alphay']))
if not variables is None:
madx.definePresets(variables)
if Injector: