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 Stringthe 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 forIdealRfCavitywith string identifier.IdealRfCavity(String strId, int szReserve) Constructor for IdealRfCavity. -
Method Summary
Modifier and TypeMethodDescriptionvoidbackPropagate(IProbe probe) I am overriding this method even though a proper back propagation is impossible.voidCompute the synchronous phase and the energy gain for a cavity gap.doubleGet the amplitude of the RF signal feeding the cavity.doubleGet the operating frequency of the RF cavity in Hertz.doubleGet the operating mode constant λ for the RF cavity design.doubleGet the RF phase of the cavity with respect to the propagating probe.doubleReturn the energy gain of a cavity gap previously calculated.doubleReturn the synchronous phase of a cavity gap, which must be previously calculated using computeSynchronousPhase.voidinitializeFrom(LatticeElement latticeElement) Initializes the frequency and cavity mode constant from the given proxy element.voidSets the probes longitudinal phase to the phase of this cavity upon entrance.voidsetCavAmp(double dblAmp) Sets the amplitude of the RF signal feeding the cavity.voidsetCavFrequency(double dblFreq) Set the operating frequency of the RF cavity in Hertz.voidsetCavityModeConstant(double dblModeConst) Set the operating mode constant λ for the RF cavity design.voidsetCavPhase(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, toStringLegacyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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 forIdealRfCavitywith 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:
getCavFrequencyin 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:
getCavPhasein 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:
setCavFrequencyin 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:
setCavPhasein 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:
initializeFromin interfaceIComponent- Overrides:
initializeFromin 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
propagatemethod.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:
propagatein interfaceIComponent- Specified by:
propagatein interfaceIComposite- Overrides:
propagatein 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:
backPropagatein interfaceIComponent- Overrides:
backPropagatein 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:IRfCavityCompute the synchronous phase and the energy gain for a cavity gap.- Specified by:
computeSynchronousPhaseAndEnergyGainin interfaceIRfCavity
-
getSynchronousPhase
public double getSynchronousPhase()Description copied from interface:IRfCavityReturn the synchronous phase of a cavity gap, which must be previously calculated using computeSynchronousPhase.- Specified by:
getSynchronousPhasein interfaceIRfCavity- Returns:
- synchronous phase [rad]
-
getEnergyGain
public double getEnergyGain()Return the energy gain of a cavity gap previously calculated.- Specified by:
getEnergyGainin interfaceIRfCavity- Returns:
-