Class ThickRfFieldMap
- All Implemented Interfaces:
IRfCavityCell
,IRfGap
,IComponent
,IElement
ThinRfFieldMap
for fieldmaps with many data points, since it removes the
overhead of creating an element for every point in the fieldmap. The drawback is that it can't be superposed to other
ThickElements.- Author:
- Juan F. Esteban Müller <JuanF.EstebanMuller@esss.se>
-
Field Summary
Fields inherited from class xal.model.elem.Element
dblNodeLen, dblNodePos
Fields inherited from interface xal.model.IElement
LIGHT_SPEED, PERMEABILITY, PERMITTIVITY, UNIT_CHARGE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
computePhaseDriftAndEnergyGain
(IProbe probe, double dblLen) Method calculates the phase drift and the energy gain on the current range (i.e from probe.getPosition, and for dblLength).void
Compute the synchronous phase and the energy gain for a cavity gap.double
elapsedTime
(IProbe probe, double dblLen) Returns the time taken for the probeprobe
to propagate through a subsection of the element with lengthdblLen
.double
energyGain
(IProbe probe, double dblLen) Return the energy gain of the beamline element over a subsection of the specified length.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
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
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 whether or not the cell is the first or last in a string of cells within an RF cavity.boolean
Indicates whether or not this cell is the first cell of an RF cavity.double
longitudinalPhaseAdvance
(IProbe probe, double dblLen) This is a kluge to make RF gaps work, since frequency is not defined for modeling elements outside RF cavities.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 field.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
setLongitudinalPhaseReference
(double longitudinalPhaseEntrance) void
setPhase
(double cavPhase) Set the phase delay of the RF in gap with respect to the synchronous particle.transferMap
(IProbe probe, double dblLen) Method calculates transfer matrix for the field map on the current range (i.e from probe.getPosition, and for dblLength).Methods inherited from class xal.model.elem.ThickElement
applyErrors, getLength, isFirstSubslice, isLastSubslice, setLength
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, print, propagate, propagate, setAlign, setAlignX, setAlignY, setAlignZ, setHardwareNodeId, setId, setParent, setPhiX, setPhiY, setPhiZ, setPosition, toString
-
Constructor Details
-
ThickRfFieldMap
public ThickRfFieldMap() -
ThickRfFieldMap
-
-
Method Details
-
getCellLength
public double getCellLength() -
setCellLength
public void setCellLength(double cellLength) -
initializeFrom
Description copied from class:ThickElement
Conversion method to be provided by the user- Specified by:
initializeFrom
in interfaceIComponent
- Overrides:
initializeFrom
in classThickElement
- Parameters:
element
- the SMF node to convert
-
computePhaseDriftAndEnergyGain
Method calculates the phase drift and the energy gain on the current range (i.e from probe.getPosition, and for dblLength).- Throws:
ModelException
-
transferMap
Method calculates transfer matrix for the field map on the current range (i.e from probe.getPosition, and for dblLength).- Specified by:
transferMap
in interfaceIElement
- Specified by:
transferMap
in classThickElement
- Parameters:
probe
- probe containing parameters for the sub-sectional transfer matrixdblLen
- length of sub-element- Returns:
- See Also:
-
longitudinalPhaseAdvance
Description copied from class:ThickElement
This is a kluge to make RF gaps work, since frequency is not defined for modeling elements outside RF cavities. For such elements we simply return 0 phase advance. For elements where frequency is defined, we compute the phase advance as the angular frequency times the elapsed time through the element (see
).ThickElement.elapsedTime(IProbe, double)
- Specified by:
longitudinalPhaseAdvance
in interfaceIElement
- Overrides:
longitudinalPhaseAdvance
in classThickElement
- Parameters:
probe
- the probe propagating through this elementdblLen
- distance the probe propagates through the element- Returns:
- longitudinal phase advance of the probe through given distance
- See Also:
-
energyGain
Description copied from class:ThickElement
Return the energy gain of the beamline element over a subsection of the specified length.- Specified by:
energyGain
in interfaceIElement
- Specified by:
energyGain
in classThickElement
- Parameters:
probe
- probe for which energy gain is to be determineddblLen
- subsection length to calculate energyGain for- Returns:
- the value #subEnergyGain(probe)*#getCount()
-
elapsedTime
Description copied from class:Element
Returns the time taken for the probeprobe
to propagate through a subsection of the element with lengthdblLen
.- Specified by:
elapsedTime
in interfaceIElement
- Specified by:
elapsedTime
in classThickElement
- Parameters:
probe
- determine energy gain for this probedblLen
- length of subsection to calculate energy gain for- Returns:
- the elapsed time through section
Units: seconds
-
setETL
public void setETL(double dblETL) Description copied from interface:IRfGap
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. -
setE0
public void setE0(double cavAmp) Description copied from interface:IRfGap
Set the on accelerating field. This method should be called by the RF cavity containing this gap and should use the amplitude factor. -
setPhase
public void setPhase(double cavPhase) Description copied from interface:IRfGap
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. This method should be called by the RF cavity containing this gap and should use the phase factor. -
setFrequency
public void setFrequency(double dblFreq) Description copied from interface:IRfGap
Set the operating frequency of the RF gap.- Specified by:
setFrequency
in interfaceIRfGap
- Parameters:
dblFreq
- frequency of RF gap (inHertz )
-
getETL
public double getETL()Description copied from interface:IRfGap
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()Description copied from interface:IRfGap
Return the RF phase delay of the gap with respect to the synchronous particle. -
getFrequency
public double getFrequency()Description copied from interface:IRfGap
Get the operating frequency of the RF gap.- Specified by:
getFrequency
in interfaceIRfGap
- Returns:
- frequency of RF gap (in
Hertz )
-
getE0
public double getE0()Description copied from interface:IRfGap
Get the on accelerating field (V/m) -
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
-
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- See Also:
-
- RF Linear Accelerators, Thomas P. Wangler (Wiley, 2008).
-
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
- See Also:
-
getCavityModeConstant
public double getCavityModeConstant()Description copied from interface:IRfCavityCell
Returns the structure mode number q for the cavity in which this gap belongs. This is the fractional phase advance between cells, with respect to π. It can also be interpreted as describing the spatial advance of the axial electric field from cell to cell.
- Specified by:
getCavityModeConstant
in interfaceIRfCavityCell
- Returns:
- the cavity mode constant for the cell containing this gap
- See Also:
-
- RF Linear Accelerators, Thomas P. Wangler (Wiley, 2008).
IRfCavityCell.setCavityModeConstant(double)
-
isEndCell
public boolean isEndCell()Description copied from interface:IRfCavityCell
Returns whether or not the cell is the first or last in a string of cells within an RF cavity. This is particularly important in structures operating outside 0 mode where the cell phasing may change.- Specified by:
isEndCell
in interfaceIRfCavityCell
- Returns:
true
if this cell is at either end in a bank of cells,false
otherwise
-
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
-
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 longitudinalPhaseEntrance) - Specified by:
setLongitudinalPhaseReference
in interfaceIRfCavityCell
-
getLongitudinalPhaseReference
public double getLongitudinalPhaseReference()- Specified by:
getLongitudinalPhaseReference
in interfaceIRfCavityCell
-