{Scott's 2016-05-09 150MeV lattice using Holger's 2016-05-11 fieldmaps from Google Drive}

#h = +1.9610000439244032e-01;
#R=1.0/h;

#lqf = +1.3300000000000001e-01;
#lqd = +1.2200000000000000e-01;
#lfd = +7.0000000000000007e-02;
#ldf = +1.2000000000000000e-01;

#thqf=2*asin(0.5*lqf/R);
#thqd=2*asin(0.5*lqd/R);
#thfd=2*asin(0.5*lfd/R);
#thdf=2*asin(0.5*ldf/R);

{Drift Length Angle}
DF #R*thdf# #thdf*-1#
QF #R*thqf# #thqf*-1#
FD #R*thfd# #thfd*-1#
QD #R*thqd# #thqd*-1#
HDF #DF.Length/2# #DF.Angle/2#
HFD #FD.Length/2# #FD.Angle/2#
HDFS #HDF.Length#
QFS #QF.Length#
HFDS #HFD.Length#
QDS #QD.Length#

#scalboth = 1;
#dispboth = 0;
#scalF = 1;
#scalD = 1;
#dispF = 0;
#dispD = 0;

{TrilinearFieldMap File Strength Xrel MirrorY=1}
FMboth Cbeta\Iron_2016-05-11\160308a-38-48_5deg150MeVCombQdOnQfOn_polar.txt #scalboth*-1# #dispboth-R#
FMF Cbeta\Iron_2016-05-11\160308a-38-48_5deg150MeVSepQfOn_polar.txt #scalF*-1# #dispF-R#
FMD Cbeta\Iron_2016-05-11\160308a-38-48_5deg150MeVSepQdOn_polar.txt #scalD*-1# #dispD-R#

CellFM: HDF,QF,HFD,FMboth,HFD,QD,HDF;
CellFMsep: HDF,QF,HFD,FMF,FMD,HFD,QD,HDF;

#// Straight cell stuff removed (see Iron_2016-04-13) until I get separate maps

#Emin = +4.2000000000000000e+07;
#Emax = +1.5000000000000000e+08;
#n    = 4;

#EmasseV=510998.928;
{MatchScan Estart Egoal Estep Species=Electron AllowUnstable=1}
Match #Emax-EmasseV#eV #Emin-EmasseV#eV #(Emax-Emin)/(n-1)#eV
MatchFine #Match.Estart# #Match.Egoal# 1MeV
MatchSep #Match.Estart# #Match.Egoal# #Match.Estep#
MatchSepFine #MatchSep.Estart# #MatchSep.Egoal# 1MeV

{Match-Aperture} 
MatchEnd

CellFM,Match,CellFM,MatchEnd,CellFM,
CellFMsep,MatchSep,CellFMSep,MatchEnd,CellFMSep;
#//CellFM,Match,MatchFine,CellFM,MatchEnd,CellFM,
#//CellFM,Particles,10*CellFM,MatchEnd,CellFM;
#//4*CellFM;