Package xal.smf.impl
Class RfGap
java.lang.Object
xal.smf.AcceleratorNode
xal.smf.impl.RfGap
- All Implemented Interfaces:
Comparable
,ElementType
,DataListener
- Direct Known Subclasses:
ESSRfGap
,RfFieldMap
The implementation of the RF gap element.
The RfGap class is meant to be used in connection with a set of related RF
gaps, such as the gaps in a DTL Tank, which are all part of a single resonant
cavity controlled by a single klystron. Each gap may have a fixed scale
factor for both the field and phase, relative to a nominal field and phase.
- Author:
- J. Galambos
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected RfGapBucket
The rf gap bucket containing the length, ampFactor, phaseFactor and TTFstatic final String
-
Constructor Summary
ConstructorsConstructorDescriptionConstructorRfGap
(String strId, ChannelFactory channelFactory) Primary Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBucket
(AttributeBucket buc) Override AcceleratorNode implementation to check for a RfGapBucketdouble
Computes and returns the design value of the energy gain for this gap.double
return the RF amplitude in the gap (kV/m).double
return the RF amplitude in the gap (kV/m)double
This is the product of the field * gap length * TTFdouble
return the RF fundamental frequencydouble
return the RF phase in the gap (deg)double
This is the product of the field * gap length * TTFdouble
return Rf Gap Lengthdouble
these may be different, for example, for a DTL cavitydouble
This includes the calibration offset factor if it has been setdouble
return TTFgetRfGap()
getSFit()
Return a polynomial fit of the sine transit time factor S(β) as a function of normalized velocity β.Return a polynomial fit of the sine transit time factor derivative S'(β) as a function of normalized velocity β.double
Return a polynomial fit of the transit time factor T(β) as a function of normalized velocity β.Return a polynomial fit of the transit time factor derivative T'(β) as a function of normalized velocity β.getType()
Override to provide type signatureboolean
returns whether this is the last gap of a cavity stringboolean
returns whether this is the first gap of a cavity stringvoid
setFirstCell
(boolean tf) sets the flag indicating whether this is the first gap in a cavityvoid
setGapAmp
(double cavAmp) Set the RF amplitude in the (kV/m) should be done by the parent cavity (e.g.void
setGapPhase
(double cavPhase) Set the RF phase in the gap (deg) should be done by the parent cavity (e.g.void
setGapTTF
(double gapTTFval) void
setRfGap
(RfGapBucket buc) double
toE0TLFromGapField
(double field) Convert RF gap field, E0, to E0TL.double
toGapAmpFromCavityAmp
(double cavityAmp) Convert RF cavity amplitude to get the RF gap's amplitude.double
toGapPhaseFromCavityPhase
(double cavityPhase) Convert RF cavity phase to get the RF gap's phase.Methods inherited from class xal.smf.AcceleratorNode
batchConnectAllHandles, batchConnectAllHandlesAndWait, channelSuite, clear, compareTo, dataLabel, findChannel, getAccelerator, getAccessibleProperties, getAccessibleProperties, getAlign, getAllChannels, getAndConnectChannel, getAndConnectChannelSetAndReadback, getAper, getBucket, getBuckets, getChannel, getDefaultHandles, getDesignPropertyValue, getEId, getHandles, getId, getLength, getLivePropertyChannels, getLivePropertyValue, getParent, getPId, getPitchAngle, getPosition, getPrimaryAncestor, getProperties, getReadbackHandles, getRollAngle, getSDisplay, getSetHandle, getSoftType, getStatus, getTwiss, getValid, getXOffset, getYawAngle, getYOffset, getZOffset, hasBucket, hasParent, isChannelSettable, isKindOf, isMagnet, lazilyGetAndConnect, removeFromParent, setAccelerator, setAlign, setAper, setDesignPropertyValue, setLength, setLivePropertyValue, setParent, setPitchAngle, setPosition, setRollAngle, setSDisplay, setStatus, setTwiss, setValid, setValueAndVerify, setXOffset, setYawAngle, setYOffset, setZOffset, toString, update, write, writeAttributes, writeStatus
-
Field Details
-
TYPE
- See Also:
-
bucRfGap
The rf gap bucket containing the length, ampFactor, phaseFactor and TTF
-
-
Constructor Details
-
RfGap
Primary Constructor -
RfGap
Constructor
-
-
Method Details
-
getType
Override to provide type signature- Specified by:
getType
in classAcceleratorNode
-
getRfGap
-
setRfGap
-
addBucket
Override AcceleratorNode implementation to check for a RfGapBucket- Overrides:
addBucket
in classAcceleratorNode
-
getGapAmpAvg
return the RF amplitude in the gap (kV/m). Note, this method should probably be modified- Throws:
GetException
-
getGapDfltAmp
public double getGapDfltAmp()return the RF amplitude in the gap (kV/m) -
getGapPhaseAvg
This includes the calibration offset factor if it has been set- Returns:
- the RF phase in the gap (deg).
- Throws:
GetException
-
getGapE0TL
This is the product of the field * gap length * TTF- Returns:
- the E0TL product (kV)
- Throws:
GetException
-
getGapDfltE0TL
public double getGapDfltE0TL()This is the product of the field * gap length * TTF- Returns:
- the E0TL product (kV)
-
getGapDfltPhase
public double getGapDfltPhase()return the RF phase in the gap (deg) -
getGapDfltFrequency
public double getGapDfltFrequency()return the RF fundamental frequency -
toGapAmpFromCavityAmp
public double toGapAmpFromCavityAmp(double cavityAmp) Convert RF cavity amplitude to get the RF gap's amplitude.- Parameters:
cavityAmp
- the RF cavity's amplitude- Returns:
- this RF gap's amplitude
-
toGapPhaseFromCavityPhase
public double toGapPhaseFromCavityPhase(double cavityPhase) Convert RF cavity phase to get the RF gap's phase.- Parameters:
cavityPhase
- the RF cavity's phase- Returns:
- this RF gap's phase
-
toE0TLFromGapField
public double toE0TLFromGapField(double field) Convert RF gap field, E0, to E0TL. This is the product of the field * gap length * TTF.- Parameters:
field
- the RF field in KV/m- Returns:
- the E0TL product (kV)
-
getGapLength
public double getGapLength()return Rf Gap LengthCKA NOTES:
· I believe this is the length of the overall gap cell structure, not just the gap itself.
· Specifically, it is the distance from one gap center to the next in an accelerating structure. -
getGapTTF
public double getGapTTF()return TTF -
setGapTTF
public void setGapTTF(double gapTTFval) -
setGapAmp
public void setGapAmp(double cavAmp) Set the RF amplitude in the (kV/m) should be done by the parent cavity (e.g. DTL tank)
Currently this method does nothing!- Parameters:
cavAmp
- The amplitude of the first gap (kV/m)
-
setGapPhase
public void setGapPhase(double cavPhase) Set the RF phase in the gap (deg) should be done by the parent cavity (e.g. DTL tank)- Parameters:
cavPhase
- The phase of the first gap (deg)
-
getTTFFit
Return a polynomial fit of the transit time factor T(β) as a function of normalized velocity β.CKA NOTES:
· It appears to me that the returned value of T'(β) is in the units of centimeters.
· The units for the transit time factor T(β) are in meters.
· This is a confusing inconsistency and hopefully we can resolve this in the future.
· The modeling elementIdealRfGap
uses the magic number of 0.01 as a factor in front of
.getTTFPrimeFit()
- Returns:
- T(β) ≈ a0 + a1β + a2β2 + ...
-
getTTFPrimeFit
Return a polynomial fit of the transit time factor derivative T'(β) as a function of normalized velocity β. Note that the derivative is with respect to the wave number k; that is, T'(&beta) = dT(β)/dk.
CKA NOTES:
· It appears to me that the returned value of T'(β) is in the units of centimeters.
· The units for the transit time factor T(β) are in meters.
· This is a confusing inconsistency and hopefully we can resolve this in the future.
· The modeling elementIdealRfGap
uses the magic number of 0.01 as a factor in front of
.getTTFPrimeFit()
· Equally distressing is that the code withinIdealRfGap
, the modeling element for an RF gap, treats this value as if it where the derivative with respect to wave number k. That is, the returned value here is ∂T(β)/∂k.- Returns:
- T(β) ≈ a0 + a1β + a2β2 + ...
-
getSFit
Return a polynomial fit of the sine transit time factor S(β) as a function of normalized velocity β.- Returns:
- S(β) ≈ b0 + b1β + b2β2 + ...
-
getSPrimeFit
Return a polynomial fit of the sine transit time factor derivative S'(β) as a function of normalized velocity β. Note that the derivative is with respect to the wave number k; that is, S'(&beta) = dS(β)/dk.
CKA NOTES:
· It appears to me that the returned value of S'(β) is in the units of centimeters.
· The units for the transit time factor S(β) are in meters.
· This is a confusing inconsistency and hopefully we can resolve this in the future.
· The modeling elementIdealRfGap
uses the magic number of 0.01 as a factor in front of
.#getSTFPrimeFit()
- Returns:
- S(β) ≈ b0 + b1β + b2β2 + ...
-
getStructureMode
public double getStructureMode()- Returns:
- 0 if the gap is part of a 0 mode cavity
structure (e.g. DTL)
1 if the gap is part of a π mode cavity (e.g. CCL, Superconducting)
-
getGapOffset
public double getGapOffset()these may be different, for example, for a DTL cavity- Returns:
- the offset of the gap center from the cell center (m)
-
setFirstCell
public void setFirstCell(boolean tf) sets the flag indicating whether this is the first gap in a cavity -
isFirstCell
public boolean isFirstCell()returns whether this is the first gap of a cavity string -
isEndCell
public boolean isEndCell()returns whether this is the last gap of a cavity string -
getDesignEnergyGain
public double getDesignEnergyGain()Computes and returns the design value of the energy gain for this gap. The energy gain is given by the Panofsky equation
ΔW = q E0L T(β) cos(φ0).- Returns:
- design energy gain ΔW (eV) Added 10/17/02 CKA
-