Class IdealRfGap
- All Implemented Interfaces:
IRfCavityCell
,IRfGap
,IComponent
,IElement
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.
- Author:
- Christopher K. Allen, Juan F. Esteban Müller <juanf.estebanmuller@esss.se>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected InverseRealPolynomial
fit of the TTF vs. betastatic 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 TypeMethodDescriptionprotected double
computeBetaFromGamma
(double gamma) 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.int
Returns the index of this cell within the parent RF cavity.double
Returns the structure mode number q for the cavity in which this gap belongs.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
double
getPhase()
Return the RF phase delay of the gap with respect to the synchronous particle.double
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
Returns flag indicating whether or not this gap is in the initial or terminal cell in a string of cells within an RF cavity.boolean
Indicates whether or not this cell is the first cell of an RF cavity.protected double
longitudinalPhaseAdvance
(IProbe probe) Again, this is a kluge.void
print
(PrintWriter os) Dump current state and content to output stream.void
setCavityCellIndex
(int indCell) Set the index n of this cell within the enclosing RF cavity.void
setCavityModeConstant
(double dblCavModeConst) Sets the structure mode number q for the cavity in which this cell belongs.void
setCellLength
(double cellLength) void
setE0
(double cavAmp) Set the on accelerating fieldvoid
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
setLongitudinalPhaseReference
(double longitudinalPhaseReference) void
setPhase
(double cavPhase) Set the phase delay of the RF in the cavity with respect to the synchronous particle.void
setStructureMode
(double structureMode) void
setTTFFit
(InverseRealPolynomial ttfFit) protected PhaseMap
transferMap
(IProbe probe) Compute the transfer map for an ideal RF gap.Methods inherited from class xal.model.elem.ThinElement
applyErrors, elapsedTime, energyGain, getLength, 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:
-
ttfFit
fit of the TTF vs. beta
-
-
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 )
-
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 cavPhase) Set the phase delay of the RF in the cavity 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 (inHertz )
-
setE0
public void setE0(double cavAmp) Set the on accelerating field -
getE0
public double getE0()Get the on accelerating field (V/m) -
getCellLength
public double getCellLength()return the cell length (m) -
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
- Returns:
- energy gain for this probe (in electron-volts)
-
computeBetaFromGamma
protected double computeBetaFromGamma(double gamma) -
transferMap
Compute the transfer map for an ideal RF gap. </p
New transfer matrix with same definitions of kr and kz from Trace3D manual, but correctly considering XAL and trace3d longitudinal phase. transformation
Modified on 21 Jul 06 Sako (consistency checked with Trace3D).
Modified on 15 Aug 17 Juan F. Esteban Müller to correct synchronous phase calculation
- 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
-
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
-
setCellLength
public void setCellLength(double cellLength) -
getStructureMode
public double getStructureMode() -
setStructureMode
public void setStructureMode(double structureMode) -
setTTFFit
-
longitudinalPhaseAdvance
Description copied from class:ThinElement
Again, this is a kluge. We return zero since the notion of frequency is not defined for every element (perhaps if this element is the child of an RF cavity). For those elements that do create a phase advance they need to override this method.
There is some legitimacy in returning zero since a thin element generally has no phase advance. That is, there is no propagation therefore no elapsed time and no phase advance. Only if there is energy gain must there be a corresponding conjugate phase advance.
- Overrides:
longitudinalPhaseAdvance
in classThinElement
- Parameters:
probe
- probe experiencing a phase advance through this element- Returns:
- the change in phase while going through the element
-
setCavityCellIndex
public void setCavityCellIndex(int indCell) Description copied from interface:IRfCavityCell
Set the index n of this cell within the enclosing RF cavity. The index origin begins at 0, specifically, the first cell in the cavity will have a cell index of O. Since cell phase φ seen by the probe is
φ = nqπ + φ0
where q is the cavity structure constant and φ0 is the klystron driving phase, the first cell always has the phase of the klystron.When considered with an RF gap, it can be convenient to consider the phase rather as a spatial component of the field and combine it with the field amplitude. We simply get a signum function effect where the new field E>n at cell n is given by
En = E0 cos(nqπ)
where E0 is the usual gap field strength.See the discussion below on cavity mode constants.
- Specified by:
setCavityCellIndex
in interfaceIRfCavityCell
- Parameters:
indCell
- index of the cavity cell within the cavity, starting at 0- Since:
- Jan 8, 2015 by Christopher K. Allen
- See Also:
-
setCavityModeConstant
public void setCavityModeConstant(double dblCavModeConst) Description copied from interface:IRfCavityCell
Sets the structure mode number q for the cavity in which this cell belongs. Here the structure mode number is defined in terms of the fractional phase advance between cells, with respect to π. To make this explicit
q = 0 ⇛ 0 mode
q = 1/2 ⇒ π/2 mode
q = 1 ⇛ π mode
Thus, a cavity mode constant of q = 1/2 indicates a π/2 phase advance between adjacent cells and a corresponding cell amplitude function An of
An = cos(nqπ)
where n is the index of the cell within the coupled cavity.- Specified by:
setCavityModeConstant
in interfaceIRfCavityCell
- Parameters:
dblCavModeConst
- the cavity mode structure constant for the cavity containing this cell- Since:
- Jan 8, 2015 by Christopher K. Allen
- See Also:
-
getCavityCellIndex
public int getCavityCellIndex()Description copied from interface:IRfCavityCell
Returns the index of this cell within the parent RF cavity. The index origin starts at zero.- Specified by:
getCavityCellIndex
in interfaceIRfCavityCell
- Returns:
- the cell number within the parent cavity, starting at zero
- Since:
- Jan 8, 2015 by Christopher K. Allen
- See Also:
-
getCavityModeConstant
public double getCavityModeConstant()Returns the structure mode number q for the cavity in which this gap belongs. Here the structure mode number is defined in terms of the fractional phase advance between cells, with respect to π. To make this explicit
q = 0 ⇛ 0 mode
q = 1/2 ⇒ π/2 mode
q = 1 ⇛ π mode
Thus, a cavity mode constant of q = 1/2 indicates a π/2 phase advance between adjacent cells and a corresponding cell amplitude function An of
An = cos(nqπ)
where n is the index of the cell within the coupled cavity.- Specified by:
getCavityModeConstant
in interfaceIRfCavityCell
- Returns:
- the cavity mode constant for the cell containing this gap
- Since:
- Nov 20, 2014
- See Also:
-
- RF Linear Accelerators, Thomas P. Wangler (Wiley, 2008).
-
isEndCell
public boolean isEndCell()Returns flag indicating whether or not this gap is in the initial or terminal cell in a string of cells within an RF cavity.- Specified by:
isEndCell
in interfaceIRfCavityCell
- Returns:
true
if this gap is in a cavity cell at either end of a cavity cell bank,false
otherwise- Since:
- Jan 23, 2015 by Christopher K. Allen
-
isFirstCell
public boolean isFirstCell()Description copied from interface:IRfCavityCell
Indicates whether or not this cell is the first cell of an RF cavity.- Specified by:
isFirstCell
in interfaceIRfCavityCell
- Returns:
true
if this is the initial cell in an RF cavity,false
otherwise- Since:
- Jan 23, 2015 by Christopher K. Allen
- See Also:
-
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:
-
setLongitudinalPhaseReference
public void setLongitudinalPhaseReference(double longitudinalPhaseReference) - Specified by:
setLongitudinalPhaseReference
in interfaceIRfCavityCell
-
getLongitudinalPhaseReference
public double getLongitudinalPhaseReference()- Specified by:
getLongitudinalPhaseReference
in interfaceIRfCavityCell
-