ATRFCAVITY(FAMNAME,LENGTH,VOLTAGE,FREQUENCY,HARMONICNUMBER,ENERGY,PASSMETHOD) creates an rfcavity element with Class 'RFCavity' FAMNAME family name LENGTH length [m] VOLTAGE peak voltage [V] FREQUENCY RF frequency [Hz] HARMNUMBER Harmonic Number ENERGY Energy [eV] PASSMETHOD tracking function, defaults to 'CavityPass' ATRFCAVITY(FAMNAME,...,PASSMETHOD,'FIELDNAME1',VALUE1,...) Each pair {'FIELDNAME',VALUE} is added to the element See also: ATDRIFT, ATSEXTUPOLE, ATSBEND, ATRBEND ATMULTIPOLE, ATTHINMULTIPOLE, ATMARKER, ATCORRECTOR
0001 function elem=atrfcavity(fname,varargin) 0002 %ATRFCAVITY(FAMNAME,LENGTH,VOLTAGE,FREQUENCY,HARMONICNUMBER,ENERGY,PASSMETHOD) 0003 % creates an rfcavity element with Class 'RFCavity' 0004 % 0005 %FAMNAME family name 0006 %LENGTH length [m] 0007 %VOLTAGE peak voltage [V] 0008 %FREQUENCY RF frequency [Hz] 0009 %HARMNUMBER Harmonic Number 0010 %ENERGY Energy [eV] 0011 %PASSMETHOD tracking function, defaults to 'CavityPass' 0012 % 0013 %ATRFCAVITY(FAMNAME,...,PASSMETHOD,'FIELDNAME1',VALUE1,...) 0014 % Each pair {'FIELDNAME',VALUE} is added to the element 0015 % 0016 %See also: ATDRIFT, ATSEXTUPOLE, ATSBEND, ATRBEND 0017 % ATMULTIPOLE, ATTHINMULTIPOLE, ATMARKER, ATCORRECTOR 0018 0019 [rsrc,L,V,F,H,E,method]=decodeatargs({0,0,1,1,1.E9,'CavityPass'},varargin); 0020 [L,rsrc]=getoption(rsrc,'Length',L); 0021 [V,rsrc]=getoption(rsrc,'Voltage',V); 0022 [F,rsrc]=getoption(rsrc,'Frequency',F); 0023 [H,rsrc]=getoption(rsrc,'HarmNumber',H); 0024 [E,rsrc]=getoption(rsrc,'Energy',E); 0025 [timelag,rsrc]=getoption(rsrc,'TimeLag',0); 0026 [method,rsrc]=getoption(rsrc,'PassMethod',method); 0027 [cl,rsrc]=getoption(rsrc,'Class','RFCavity'); 0028 elem=atbaselem(fname,method,'Class',cl,'Length',L,... 0029 'Voltage',V,'Frequency',F,'HarmNumber',H,'TimeLag',timelag,... 0030 'Energy',E,rsrc{:}); 0031 end