Class IdealRfCavity
- All Implemented Interfaces:
Iterable<IComponent>
,IRfCavity
,IComponent
,IComposite
This class represents a general RF cavity being an composition of RF gaps and cavity drifts. The types and parameters of the internal elements define the operation (and configuration) of the cavity.
The propagation is done via the base class ElementSeq
which just
runs through the child elements propagating (or back propagating) in order.
Thus, currently at least, this element is really just a container of
elements.
- Since:
- Dec 3, 2014
- Author:
- Christopher K. Allen
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
the string type identifier for all Sector objectsFields inherited from class xal.model.elem.ElementSeq
SIZE_DEF_RESERVE
-
Constructor Summary
ConstructorsConstructorDescriptionZero constructor forIdealRfCavity
.IdealRfCavity
(String strId) Constructor forIdealRfCavity
with string identifier.IdealRfCavity
(String strId, int szReserve) Constructor for IdealRfCavity. -
Method Summary
Modifier and TypeMethodDescriptionvoid
backPropagate
(IProbe probe) I am overriding this method even though a proper back propagation is impossible.void
Compute the synchronous phase and the energy gain for a cavity gap.double
Get the amplitude of the RF signal feeding the cavity.double
Get the operating frequency of the RF cavity in Hertz.double
Get the operating mode constant λ for the RF cavity design.double
Get the RF phase of the cavity with respect to the propagating probe.double
Return the energy gain of a cavity gap previously calculated.double
Return the synchronous phase of a cavity gap, which must be previously calculated using computeSynchronousPhase.void
initializeFrom
(LatticeElement latticeElement) Initializes the frequency and cavity mode constant from the given proxy element.void
Sets the probes longitudinal phase to the phase of this cavity upon entrance.void
setCavAmp
(double dblAmp) Sets the amplitude of the RF signal feeding the cavity.void
setCavFrequency
(double dblFreq) Set the operating frequency of the RF cavity in Hertz.void
setCavityModeConstant
(double dblModeConst) Set the operating mode constant λ for the RF cavity design.void
setCavPhase
(double dblPhase) Sets the RF phase of the cavity with respect to the propagating probe.Methods inherited from class xal.model.elem.ElementSeq
addChild, backPropagate, childIterator, compDependParams, concatenateEquals, getAlignX, getAlignY, getAlignZ, getAllElements, getChild, getChildCount, getComments, getElementList, getForwardCompList, getHardwareNodeId, getId, getLatticePosition, getLeafCount, getLength, getParent, getPhiX, getPhiY, getPhiZ, getPosition, getReverseCompList, getType, globalBackIterator, globalIterator, iterator, localBackIterator, localIterator, print, propagate, remove, setAlign, setAlignX, setAlignY, setAlignZ, setComments, setCompList, setDirty, setHardwareNodeId, setId, setParent, setPhiX, setPhiY, setPhiZ, toString, toStringLegacy
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
STR_TYPEID
the string type identifier for all Sector objects- See Also:
-
-
Constructor Details
-
IdealRfCavity
public IdealRfCavity()Zero constructor forIdealRfCavity
.- Since:
- Dec 3, 2014
-
IdealRfCavity
Constructor forIdealRfCavity
with string identifier.- Parameters:
strId
- string identifier for the RF cavity- Since:
- Dec 3, 2014
-
IdealRfCavity
Constructor for IdealRfCavity.- Parameters:
strId
- string identifier for the RF cavityszReserve
- number of initial element positions to allocate (marginally increases performance, maybe)- Since:
- Dec 3, 2014
-
-
Method Details
-
setCavityModeConstant
public void setCavityModeConstant(double dblModeConst) Set the operating mode constant λ for the RF cavity design. The constant is half of the mode number q. Specifically,
λ = 0 (q=0) ⇒ 0 mode cavity structure (e.g. DTL)
λ = 1/2 (q=1) ⇒ π/2 mode structure (bi-periodic structures, e.g., SideCC)
λ = 1 (q=2) ⇒ π-mode cavity (e.g. CCL, super-conducting)- Parameters:
dblModeConst
- the new mode constant λ for the cavity drift
-
getCavityModeConstant
public double getCavityModeConstant()Get the operating mode constant λ for the RF cavity design. The constant is half of the mode number q. Specifically,
λ = 0 (q=0) ⇒ 0 mode cavity structure (e.g. DTL)
λ = 1/2 (q=1) ⇒ π/2 mode structure (bi-periodic structures, e.g., SideCC)
λ = 1 (q=2) ⇒ π-mode cavity (e.g. CCL, super-conducting)- Returns:
- the operating mode constant λ for the cavity drift
-
getCavFrequency
public double getCavFrequency()Get the operating frequency of the RF cavity in Hertz.- Specified by:
getCavFrequency
in interfaceIRfCavity
- Returns:
- the fundamental mode frequency f0 of the RF cavity
-
getCavAmp
public double getCavAmp()Get the amplitude of the RF signal feeding the cavity. Specifically, the voltage of the RF at the cavity RF window. -
getCavPhase
public double getCavPhase()Get the RF phase of the cavity with respect to the propagating probe. Specifically, this is the RF phase seen by the probe as it first enters the cavity.- Specified by:
getCavPhase
in interfaceIRfCavity
- Returns:
- RF phase of the cavity upon probe arrival (in radians)
- Since:
- Dec 16, 2014 by Christopher K. Allen
-
setCavFrequency
public void setCavFrequency(double dblFreq) Set the operating frequency of the RF cavity in Hertz.- Specified by:
setCavFrequency
in interfaceIRfCavity
- Parameters:
dblFreq
- fundamental RF frequency of the RF cavity (in Hertz)
-
setCavAmp
public void setCavAmp(double dblAmp) Sets the amplitude of the RF signal feeding the cavity. Specifically, the voltage of the RF at the cavity RF window. This method updates the voltage for all gaps in the cavity. -
setCavPhase
public void setCavPhase(double dblPhase) Sets the RF phase of the cavity with respect to the propagating probe. Specifically, this is the RF phase seen by the probe as it first enters the cavity. This method updates the phase for all gaps in the cavity.- Specified by:
setCavPhase
in interfaceIRfCavity
- Parameters:
dblPhase
- RF phase of the cavity upon probe arrival (in radians)- Since:
- Dec 16, 2014 by Christopher K. Allen
-
initializeFrom
Initializes the frequency and cavity mode constant from the given proxy element. The SMF node is taken from the proxy then queried directly. Eh, I don't like this.- Specified by:
initializeFrom
in interfaceIComponent
- Overrides:
initializeFrom
in classElementSeq
- Parameters:
latticeElement
- the SMF node to convert- Since:
- Dec 5, 2014 @author Christopher K. Allen
- See Also:
-
propagate
Sets the probes longitudinal phase to the phase of this cavity upon entrance. Then we propagate the probe through the composite structure as usual by calling the base class
propagate
method.It is unnecessary to override the
method since that method simply defers to theElementSeq.propagate(IProbe, double)
method ignoring the position parameter.propagate(IProbe)
- Specified by:
propagate
in interfaceIComponent
- Specified by:
propagate
in interfaceIComposite
- Overrides:
propagate
in classElementSeq
- Parameters:
probe
- the state of the probe will be advance using the elements dynamics- Throws:
ModelException
- an error occurred while advancing the probe state- Since:
- Dec 16, 2014 by Christopher K. Allen
- See Also:
-
backPropagate
I am overriding this method even though a proper back propagation is impossible. We set the longitudinal phase of the probe to the phase of the cavity as it backs into the exit. The true phase should be the phase of the particle as it leaves the cavity when forward propagating, however, we have no way of knowing that phase a priori.
It may be useful to use this setup during back propagations to explore various beam exit times and their effect.
It is unnecessary to override the
method since that method simply defers to theElementSeq.backPropagate(IProbe, double)
method ignoring the position parameter.backPropagate(IProbe)
- Specified by:
backPropagate
in interfaceIComponent
- Overrides:
backPropagate
in classElementSeq
- Parameters:
probe
- the state of the probe will be advance using the elements dynamics- Throws:
ModelException
- an error occurred while advancing the probe state- Since:
- Dec 16, 2014 by Christopher K. Allen
- See Also:
-
computeSynchronousPhaseAndEnergyGain
public void computeSynchronousPhaseAndEnergyGain()Description copied from interface:IRfCavity
Compute the synchronous phase and the energy gain for a cavity gap.- Specified by:
computeSynchronousPhaseAndEnergyGain
in interfaceIRfCavity
-
getSynchronousPhase
public double getSynchronousPhase()Description copied from interface:IRfCavity
Return the synchronous phase of a cavity gap, which must be previously calculated using computeSynchronousPhase.- Specified by:
getSynchronousPhase
in interfaceIRfCavity
- Returns:
- synchronous phase [rad]
-
getEnergyGain
public double getEnergyGain()Return the energy gain of a cavity gap previously calculated.- Specified by:
getEnergyGain
in interfaceIRfCavity
- Returns:
-