Package xal.smf.impl

Class RfGap

All Implemented Interfaces:
Comparable, ElementType, DataListener
Direct Known Subclasses:
ESSRfGap, RfFieldMap

public class RfGap extends AcceleratorNode
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 Details

  • Constructor Details

    • RfGap

      public RfGap(String strId, ChannelFactory channelFactory)
      Primary Constructor
    • RfGap

      public RfGap(String strId)
      Constructor
  • Method Details

    • getType

      public String getType()
      Override to provide type signature
      Specified by:
      getType in class AcceleratorNode
    • getRfGap

      public RfGapBucket getRfGap()
    • setRfGap

      public void setRfGap(RfGapBucket buc)
    • addBucket

      public void addBucket(AttributeBucket buc)
      Override AcceleratorNode implementation to check for a RfGapBucket
      Overrides:
      addBucket in class AcceleratorNode
    • getGapAmpAvg

      public double getGapAmpAvg() throws GetException
      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

      public double getGapPhaseAvg() throws GetException
      This includes the calibration offset factor if it has been set
      Returns:
      the RF phase in the gap (deg).
      Throws:
      GetException
    • getGapE0TL

      public double getGapE0TL() throws GetException
      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 Length

      CKA 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

      public RealUnivariatePolynomial 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 element IdealRfGap uses the magic number of 0.01 as a factor in front of getTTFPrimeFit().

      Returns:
          T(β) ≈ a0 + a1β + a2β2 + ...
    • getTTFPrimeFit

      public RealUnivariatePolynomial 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 element IdealRfGap uses the magic number of 0.01 as a factor in front of getTTFPrimeFit().
      · Equally distressing is that the code within IdealRfGap, 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

      public RealUnivariatePolynomial 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

      public RealUnivariatePolynomial 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 element IdealRfGap 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