Class ThinRfFieldMap
- All Implemented Interfaces:
IRfCavityCell,IRfGap,IComponent,IElement
You should use ThickRfFieldMap for big
non-superposed fieldmaps for high performance.
- Author:
- Juan F. Esteban Müller <JuanF.EstebanMuller@esss.se>
-
Field Summary
Fields inherited from class xal.model.elem.Element
dblNodeLen, dblNodePosFields inherited from interface xal.model.IElement
LIGHT_SPEED, PERMEABILITY, PERMITTIVITY, UNIT_CHARGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCompute the synchronous phase and the energy gain for a cavity gap.protected doubleelapsedTime(IProbe probe) Returns the time taken for the probe to propagate through element.protected doubleenergyGain(IProbe probe) Calculate the energy gain for this element on the supplied probe.intReturns the index of this cell within the parent RF cavity.doubleReturns the structure mode number q for the cavity in which this gap belongs.doubledoubledoublegetE0()Get the on accelerating field (V/m)doubleReturn the energy gain of a cavity gap previously calculated.doublegetETL()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.doubleGet the operating frequency of the RF gap.doubledoublegetPhase()Return the RF phase delay of the gap with respect to the synchronous particle.doubleReturn the synchronous phase of a cavity gap, which must be previously calculated using computeSynchronousPhase.voidinitializeFrom(LatticeElement element) Conversion method to be provided by the userbooleanReturns whether or not the cell is the first or last in a string of cells within an RF cavity.booleanIndicates whether or not this cell is the first cell of an RF cavity.protected doublelongitudinalPhaseAdvance(IProbe probe) Again, this is a kluge.voidsetCavityCellIndex(int indCell) Set the index n of this cell within the enclosing RF cavity.voidsetCavityModeConstant(double dblCavModeConst) Sets the structure mode number q for the cavity in which this cell belongs.voidsetCellLength(double cellLength) voidsetDeltaPhi(double deltaPhi) voidsetE0(double cavAmp) Set the on accelerating field.voidsetETL(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.voidsetFrequency(double dblFreq) Set the operating frequency of the RF gap.voidsetLongitudinalPhaseReference(double longitudinalPhaseEntrance) voidsetPhase(double cavPhase) Set the phase delay of the RF in gap with respect to the synchronous particle.transferMap(IProbe probe) Method calculates transfer matrix for the field map for a given data point in the field map.Drift spaces are calculated separately.Methods inherited from class xal.model.elem.ThinElement
applyErrors, elapsedTime, energyGain, getLength, longitudinalPhaseAdvance, transferMapMethods 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
-
ThinRfFieldMap
public ThinRfFieldMap() -
ThinRfFieldMap
-
-
Method Details
-
getCellLength
public double getCellLength() -
setCellLength
public void setCellLength(double cellLength) -
getDeltaPhi
public double getDeltaPhi() -
setDeltaPhi
public void setDeltaPhi(double deltaPhi) -
initializeFrom
Description copied from class:ElementConversion method to be provided by the user- Specified by:
initializeFromin interfaceIComponent- Overrides:
initializeFromin classElement- Parameters:
element- the SMF node to convert
-
transferMap
Method calculates transfer matrix for the field map for a given data point in the field map.Drift spaces are calculated separately.- Specified by:
transferMapin classThinElement- Parameters:
probe-- Returns:
- Throws:
ModelException
-
longitudinalPhaseAdvance
Description copied from class:ThinElementAgain, 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:
longitudinalPhaseAdvancein classThinElement- Parameters:
probe- probe experiencing a phase advance through this element- Returns:
- the change in phase while going through the element
-
elapsedTime
Description copied from class:ThinElementReturns the time taken for the probe to propagate through element.- Specified by:
elapsedTimein classThinElement- Parameters:
probe- propagating probe- Returns:
- elapsed time through element Units: seconds
-
energyGain
Calculate the energy gain for this element on the supplied probe.This implementation assumes that this method is always called after the transferMap method. This is true for the
EnvelopeTracker, but might differ for other algorithms.- Specified by:
energyGainin classThinElement- Returns:
- this element's energy gain
-
setETL
public void setETL(double dblETL) Description copied from interface:IRfGapSet 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:IRfGapSet 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:IRfGapSet 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:IRfGapSet the operating frequency of the RF gap.- Specified by:
setFrequencyin interfaceIRfGap- Parameters:
dblFreq- frequency of RF gap (inHertz )
-
getETL
public double getETL()Description copied from interface:IRfGapReturn 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:IRfGapReturn the RF phase delay of the gap with respect to the synchronous particle. -
getFrequency
public double getFrequency()Description copied from interface:IRfGapGet the operating frequency of the RF gap.- Specified by:
getFrequencyin interfaceIRfGap- Returns:
- frequency of RF gap (in
Hertz )
-
getE0
public double getE0()Description copied from interface:IRfGapGet the on accelerating field (V/m) -
setCavityCellIndex
public void setCavityCellIndex(int indCell) Description copied from interface:IRfCavityCellSet 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:
setCavityCellIndexin interfaceIRfCavityCell- Parameters:
indCell- index of the cavity cell within the cavity, starting at 0
-
setCavityModeConstant
public void setCavityModeConstant(double dblCavModeConst) Description copied from interface:IRfCavityCellSets 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:
setCavityModeConstantin 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:IRfCavityCellReturns the index of this cell within the parent RF cavity. The index origin starts at zero.- Specified by:
getCavityCellIndexin interfaceIRfCavityCell- Returns:
- the cell number within the parent cavity, starting at zero
- See Also:
-
getCavityModeConstant
public double getCavityModeConstant()Description copied from interface:IRfCavityCellReturns 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:
getCavityModeConstantin 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:IRfCavityCellReturns 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:
isEndCellin interfaceIRfCavityCell- Returns:
trueif this cell is at either end in a bank of cells,falseotherwise
-
isFirstCell
public boolean isFirstCell()Description copied from interface:IRfCavityCellIndicates whether or not this cell is the first cell of an RF cavity.- Specified by:
isFirstCellin interfaceIRfCavityCell- Returns:
trueif this is the initial cell in an RF cavity,falseotherwise
-
computeSynchronousPhaseAndEnergyGain
Description copied from interface:IRfGapCompute the synchronous phase and the energy gain for a cavity gap.- Specified by:
computeSynchronousPhaseAndEnergyGainin interfaceIRfGap
-
getSynchronousPhase
public double getSynchronousPhase()Description copied from interface:IRfGapReturn the synchronous phase of a cavity gap, which must be previously calculated using computeSynchronousPhase.- Specified by:
getSynchronousPhasein interfaceIRfGap- Returns:
- synchronous phase [rad]
-
getEnergyGain
public double getEnergyGain()Description copied from interface:IRfGapReturn the energy gain of a cavity gap previously calculated.- Specified by:
getEnergyGainin interfaceIRfGap- Returns:
-
setLongitudinalPhaseReference
public void setLongitudinalPhaseReference(double longitudinalPhaseEntrance) - Specified by:
setLongitudinalPhaseReferencein interfaceIRfCavityCell
-
getLongitudinalPhaseReference
public double getLongitudinalPhaseReference()- Specified by:
getLongitudinalPhaseReferencein interfaceIRfCavityCell
-