Class IdealRfGap
- All Implemented Interfaces:
IRfGap
,IComponent
,IElement
Represents the action of an ideal RF gap. Gap is modeled as a thin element whose accelerating action is given by the Panofsky formula.
The gap provides acceleration to the propagation probe as well as longitudinal focusing and radial defocusing. These mechanisms are implemented according to that provided by an ideal gap where the effects can be described analytically.
- Since:
- November 22, 2005
- Author:
- Christopher K. Allen
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Parameters for XAL MODEL LATTICE dtdstatic final String
Description of the Fieldstatic final String
Description of the Fieldstatic final String
the string type identifier for all IdealRfGap objectsFields inherited from class xal.model.elem.Element
dblNodeLen, dblNodePos
Fields inherited from interface xal.model.IElement
LIGHT_SPEED, PERMEABILITY, PERMITTIVITY, UNIT_CHARGE
-
Constructor Summary
ConstructorsConstructorDescriptionJavaBean constructor - creates a new uninitialized instance of IdealRfGap BE CAREFULIdealRfGap
(String strId, double dblETL, double dblPhase, double dblFreq) Creates a new instance of IdealRfGap -
Method Summary
Modifier and TypeMethodDescriptiondouble
betaMidGap
(IProbe probe) Compute and return the mid-gap normalized velocity for the given probe.double
compLongFocusing
(IProbe probe) Get the longitudinal focusing constant for a particular probe.double
compTransFocusing
(IProbe probe) Get the transverse focusing constant for a particular probe.void
Compute the synchronous phase and the energy gain for a cavity gap.double
elapsedTime
(IProbe probe) Returns the time taken for the probe to propagate through element.double
energyGain
(IProbe probe) Compute the energy gain of the RF gap for a probe including the effects of calculating the phase advance.double
return the cell length (m)double
getE0()
Get the on accelerating field (V/m)double
Return the energy gain of a cavity gap previously calculated.double
getETL()
Return the ETL product of the gap, where E is the longitudinal electric field, T is the transit time factor, and L is the gap length.double
Get the operating frequency of the RF gap.double
getPhase()
Return the RF phase delay of the gap with respect to the synchronous particle.double
Return the synchronous phase of a cavity gap, which must be previously calculated using computeSynchronousPhase.void
initializeFrom
(LatticeElement element) Conversion method to be provided by the userboolean
return whether this gap is the initial gap of a cavityvoid
print
(PrintWriter os) Dump current state and content to output stream.void
setE0
(double e) Set the on accelerating field @ param E - the on axis field (V/m)void
setETL
(double dblETL) Set the ETL product of the RF gap where E is the longitudinal electric field of the gap, T is the transit time factor of the gap, L is the length of the gap.void
setFrequency
(double dblFreq) Set the operating frequency of the RF gap.void
setPhase
(double dblPhase) Set the phase delay of the RF in gap with respect to the synchronous particle.double
simpleEnergyGain
(IProbe probe) Compute the energy gain of the RF gap for a probe assuming a fixed default phase at the gap center.protected PhaseMap
transferMap
(IProbe probe) Compute the transfer map for an ideal RF gap.double
Compute the wavelength of the RF.Methods inherited from class xal.model.elem.ThinElement
applyErrors, elapsedTime, energyGain, getLength, longitudinalPhaseAdvance, longitudinalPhaseAdvance, transferMap
Methods inherited from class xal.model.elem.Element
addCloseElements, backPropagate, backPropagate, compDriftingTime, compProbeLocation, getAlignX, getAlignY, getAlignZ, getCloseElements, getHardwareNodeId, getId, getLatticePosition, getNodeLen, getNodePos, getParent, getPhiX, getPhiY, getPhiZ, getPosition, getType, getUID, propagate, propagate, setAlign, setAlignX, setAlignY, setAlignZ, setHardwareNodeId, setId, setParent, setPhiX, setPhiY, setPhiZ, setPosition, toString
-
Field Details
-
TYPE
the string type identifier for all IdealRfGap objects- See Also:
-
PARAM_ETL
Parameters for XAL MODEL LATTICE dtd- See Also:
-
PARAM_PHASE
Description of the Field- See Also:
-
PARAM_FREQ
Description of the Field- See Also:
-
-
Constructor Details
-
IdealRfGap
Creates a new instance of IdealRfGap- Parameters:
strId
- instance identifier of elementdblETL
- field/transit time/length factor for gap (in volts )dblPhase
- operating phase of gap (in radians )dblFreq
- operating RF frequency of gap (in Hertz )
-
IdealRfGap
public IdealRfGap()JavaBean constructor - creates a new uninitialized instance of IdealRfGap BE CAREFUL
-
-
Method Details
-
getETL
public double getETL()Return the ETL product of the gap, where E is the longitudinal electric field, T is the transit time factor, and L is the gap length. -
getPhase
public double getPhase()Return the RF phase delay of the gap with respect to the synchronous particle. -
getFrequency
public double getFrequency()Get the operating frequency of the RF gap.- Specified by:
getFrequency
in interfaceIRfGap
- Returns:
- frequency of RF gap (in Hertz )
-
isFirstCell
public boolean isFirstCell()return whether this gap is the initial gap of a cavity- Returns:
- The firstGap value
-
setETL
public void setETL(double dblETL) Set the ETL product of the RF gap where E is the longitudinal electric field of the gap, T is the transit time factor of the gap, L is the length of the gap.The maximum energy gain from the gap is given by qETL where q is the charge (in coulombs) of the species particle.
-
setPhase
public void setPhase(double dblPhase) Set the phase delay of the RF in gap with respect to the synchronous particle. The actual energy gain from the gap is given by qETLcos(dblPhi) where dbkPhi is the phase delay. -
setFrequency
public void setFrequency(double dblFreq) Set the operating frequency of the RF gap.- Specified by:
setFrequency
in interfaceIRfGap
- Parameters:
dblFreq
- frequency of RF gap (in Hertz )
-
setE0
public void setE0(double e) Set the on accelerating field @ param E - the on axis field (V/m) -
getE0
public double getE0()Get the on accelerating field (V/m) -
getCellLength
public double getCellLength()return the cell length (m)- Returns:
- The cellLength value
-
wavelengthRF
public double wavelengthRF()Compute the wavelength of the RF.- Returns:
- RF wavelength in meters
-
betaMidGap
Compute and return the mid-gap normalized velocity for the given probe. NOTE: - Because of the state-dependent nature of the energy calculations (this needs to be fixed), this function will only work correctly if the function energyGain() is consistent.- Parameters:
probe
- probe containing energy information- Returns:
- average or "mid-gap" velocity in units of c
- See Also:
-
elapsedTime
Returns the time taken for the probe to propagate through element.- Specified by:
elapsedTime
in classThinElement
- Parameters:
probe
- propagating probe- Returns:
- value of zero
-
energyGain
Compute the energy gain of the RF gap for a probe including the effects of calculating the phase advance.- Specified by:
energyGain
in classThinElement
- Parameters:
probe
- uses the particle species charge- Returns:
- energy gain for this probe (in electron-volts )
-
transferMap
Compute the transfer map for an ideal RF gap.- Specified by:
transferMap
in classThinElement
- Parameters:
probe
- compute transfer map using parameters from this probe- Returns:
- transfer map for the probe
- Throws:
ModelException
- this should not occur
-
simpleEnergyGain
Compute the energy gain of the RF gap for a probe assuming a fixed default phase at the gap center.- Parameters:
probe
- uses the particle species charge- Returns:
- energy gain for this probe (in electron-volts )
-
compTransFocusing
Get the transverse focusing constant for a particular probe. The focusing constant is used in the construction of the transfer matrix for the RF gap. A gap provides longitudinal focusing and transverse defocusing as well as a gain in beam energy. This focusing constant describes the effect in the transverse direction, which is defocusing and, therefore, negative.The value represents the thin lens focusing constant for an ideal RF gap (this is the inverse of the focal length). To compute the focusing action for the lens we must include beam energy, which is changing through the gap. We use the value of beta for which the beam has received half the total energy gain.
- Parameters:
probe
- beam energy and particle charge are taken from the probe- Returns:
- (de)focusing constant (in radians/meter )
-
compLongFocusing
Get the longitudinal focusing constant for a particular probe. The focusing constant is used in the construction of the transfer matrix for the RF gap. A gap provides longitudinal focusing and transverse defocusing as well as a gain in beam energy. This focusing constant describes the effect in the longitudinal direction, which is focusing and, therefore, positive.The value represents the thin lens focusing constant for an ideal RF gap (this is the inverse of the focal length). To compute the focusing action for the lens we must include beam energy, which is changing through the gap. We use the value of beta for which the beam has received half the total energy gain.
- Parameters:
probe
- beam energy and particle charge are taken from the probe- Returns:
- (de)focusing constant (in radians/meter )
-
print
Dump current state and content to output stream. -
initializeFrom
Conversion method to be provided by the user- Specified by:
initializeFrom
in interfaceIComponent
- Overrides:
initializeFrom
in classElement
- Parameters:
element
- the SMF node to convert
-
computeSynchronousPhaseAndEnergyGain
Description copied from interface:IRfGap
Compute the synchronous phase and the energy gain for a cavity gap.- Specified by:
computeSynchronousPhaseAndEnergyGain
in interfaceIRfGap
-
getSynchronousPhase
public double getSynchronousPhase()Description copied from interface:IRfGap
Return the synchronous phase of a cavity gap, which must be previously calculated using computeSynchronousPhase.- Specified by:
getSynchronousPhase
in interfaceIRfGap
- Returns:
- synchronous phase [rad]
-
getEnergyGain
public double getEnergyGain()Description copied from interface:IRfGap
Return the energy gain of a cavity gap previously calculated.- Specified by:
getEnergyGain
in interfaceIRfGap
- Returns:
-