1010The usual BaseRF_Gap nodes have a zero length.
1111
1212The apertures are added to the lattice.
13+
14+ There are two possible configurations:
15+
16+ 1. SCL Linac last cavity is 23d - final energy 1 GeV
17+ xml_file_name = "../sns_linac_xml/sns_linac.xml"
18+
19+ 2. SCL Linac last cavity is 32d - final energy 1.3 GeV
20+ xml_file_name = "../sns_linac_xml/sns_pup_linac.xml"
21+
22+ The output files will be:
23+
24+ file_out = open("pyorbit_twiss_sizes_ekin.dat", "w")
25+ or
26+ file_out = open("pyorbit_twiss_sizes_ekin_pup.dat", "w")
27+
28+ You have to edit script manually.
29+
1330"""
1431
1532import sys
5774sns_linac_factory .setMaxDriftLength (0.01 )
5875
5976# ---- the XML file name with the structure
60- xml_file_name = "../sns_linac_xml/sns_linac.xml"
77+ #xml_file_name = "../sns_linac_xml/sns_linac.xml"
78+ xml_file_name = "../sns_linac_xml/sns_pup_linac.xml"
6179
6280# ---- make lattice from XML file
6381accLattice = sns_linac_factory .getLinacAccLattice (names , xml_file_name )
103121# Replace_BaseRF_Gap_to_AxisField_Nodes(accLattice,z_step,dir_location,["MEBT","CCL1","CCL2","CCL3","CCL4","SCLMed"])
104122
105123# ------------------------------------------------------------------------------
106- # accSeq_names = ["MEBT","DTL1","DTL2","DTL3","DTL4","DTL5","DTL6","CCL1","CCL2","CCL3","CCL4","SCLMed"]
107- accSeq_names = ["MEBT" , "DTL1" , "DTL2" , "DTL3" , "DTL4" , "DTL5" , "DTL6" ]
124+ accSeq_names = ["MEBT" , "DTL1" , "DTL2" , "DTL3" , "DTL4" , "DTL5" , "DTL6" ]
125+ accSeq_names += ["CCL1" ,"CCL2" ,"CCL3" ,"CCL4" ]
126+ accSeq_names += ["SCLMed" ,"SCLHigh" ]
108127
109128# ---- hard-edge quad models will be replaced with soft-edge models
110129# ---- It is possible for DTL also - if the RF gap models are zero-length ones
273292
274293twiss_analysis = BunchTwissAnalysis ()
275294
276- file_out = open ("pyorbit_twiss_sizes_ekin.dat" , "w" )
295+ #file_out = open("pyorbit_twiss_sizes_ekin.dat", "w")
296+ file_out = open ("pyorbit_twiss_sizes_ekin_pup.dat" , "w" )
277297
278298s = " Node position "
279299s += " alphaX betaX emittX normEmittX"
@@ -312,7 +332,7 @@ def action_entrance(paramsDict):
312332 # ---- phi_de_emittZ will be in [pi*deg*MeV]
313333 phi_de_emittZ = z_to_phase_coeff * emittZ
314334 eKin = bunch .getSyncParticle ().kinEnergy () * 1.0e3
315- s = " %35s %4.5f " % (node .getName (), pos + pos_start )
335+ s = " %45s %4.5f " % (node .getName (), pos + pos_start )
316336 s += " %6.4f %6.4f %6.4f %6.4f " % (alphaX , betaX , emittX , norm_emittX )
317337 s += " %6.4f %6.4f %6.4f %6.4f " % (alphaY , betaY , emittY , norm_emittY )
318338 s += " %6.4f %6.4f %6.4f %6.4f " % (alphaZ , betaZ , emittZ , phi_de_emittZ )
@@ -322,7 +342,7 @@ def action_entrance(paramsDict):
322342 file_out .flush ()
323343 s_prt = " %5d %35s %4.5f " % (paramsDict ["count" ], node .getName (), pos + pos_start )
324344 s_prt += " %5.3f %5.3f %5.3f " % (x_rms , y_rms , z_rms_deg )
325- s_prt += " %10.6f %8d " % (eKin , nParts )
345+ s_prt += " %10.4f %8d " % (eKin , nParts )
326346 print (s_prt )
327347
328348
0 commit comments