{
Linac900Ext6Xc2_nosample = Linac900Ext6Xc2 with sample files switched off entirely
March 16th, 2012
}

!MINVER 4.45

{Parameter Value}
t_max 3.5us
n_decays 5
seed 0
seedpitch 1

{Cylinder-blockage Zsize radius Zhere Z rotZX AbsorptionLength}
BackFace 0.10 0.40 #0.10/2# -0.15 0 0
{Annulus-blockage Zsize OuterRadius InnerRadius Z AbsorptionLength}
BackAnnulus 0.20 0.40 0.30 -0.1 0
BackEnd: BackFace,BackAnnulus;

{RodSource File X Y Z RodAngle}
TantalumRod pi_plus_10GeV.csv 0 0 [0,0.45] [0,0.5]

{Synchronous-particle t_start Energy Z}
SyncMuon 5ns 180MeV #TantalumRod.Z#

#Blocks=6;

{Parameter Value}
DecayCells [1,50]; #// 17-44 possible in original, PhaseRotC optimum was 23
#DecayCells=int(DecayCells);

#for (n=1;n<=9 && n<=DecayCells;n++)
#{
	{Solenoid Length Radius Field}
#	if (n==1) #S1 [0.2,0.45] 0.1 [0,20];#;
#	else {S[n]# [0.2,0.9] [0.1,0.4] #if (n<=4) #[-5,5];#; else #[-4,4];#;}
	{Drift Length Bore}
	#D[n]# [0.5,1] 0.5
#}
#for (bn=1;bn<=Blocks;bn++)
#{
	{Solenoid Length Radius Field}
	#SB[bn]# [0.2,0.9] [0.1,0.4] [-4,4]
	{Drift Length Bore}
	#DB[bn]# [0.5,1] 0.5
#}

DecayChannel:
#for (n=1;n<=9 && n<=DecayCells;n++) {S[n]#,#D[n] if (n<DecayCells) #,#;}
#bn=1;
#for (n=10;n<=DecayCells;n++)
#{
#	if (1+((n-10)/(DecayCells+1-10))*Blocks>=bn+1) bn++;
#	SB[bn] if (n<DecayCells) {#,#DB[bn]#,#}}
#}#;

{Parameter Value}
LinacCells [0,400]; #// Linac to 400MeV had 60-120 cells
#LinacCells=int(LinacCells);

#for (n=1;n<=Blocks;n++)
#{
	{Solenoid Length Radius Field}
	LS#n# [0.2,0.9] 0.15 [-4,4]
	{Parameter Value}
	LD#n# [0.5,1]
	{Drift Length Bore}
	LD#n#a #LD[n]*2/3# 0.15
	LD#n#b #LD[n]/3# 0.15
	{RF Frequency/MHz Radius Voltage/MV Phase}
	RF#n# 88 0.15 [0,#(LD[n]+LS[n].Length)*3.6/0.9#] [-360°,+360°]
#}

Linac:
#bn=1;
#for (n=1;n<=LinacCells;n++)
#{
#	if (1+((n-1)/LinacCells)*Blocks>=bn+1) bn++;
	LD#bn#a,RF#bn#,LD#bn#b,LS#bn if (n<LinacCells) #,#;
#}#;

{Finish-aperture radius MinEnergy MaxEnergy}
END 0.5 830.41MeV 969.64MeV

BackEnd,TantalumRod,SyncMuon,DecayChannel,Linac,END;