Package xal.smf.impl

Class RfCavity

All Implemented Interfaces:
Comparable, ElementType, DataListener
Direct Known Subclasses:
CCL, DTLTank, ESSRfCavity, ReBuncher, SCLCavity

public class RfCavity extends AcceleratorSeq
The implementation of the RF Cavity element. The Rf Cavity is the device that is directly connected to a klystron. There are internal RF gap(s) within this cavity, which are controlled by the cavity. The RfGaps are a separate class of type AcceleratorNode. The beam dynamics are done in the RfGap class. Note: the "knob" connections are to the klystron. The
Author:
Nikolay Malitsky, Christopher K. Allen
  • Field Details

  • Constructor Details

    • RfCavity

      public RfCavity(String strId, ChannelFactory channelFactory, int intReserve)
      Primary Constructor
    • RfCavity

      public RfCavity(String strId, ChannelFactory channelFactory)
      Constructor
    • RfCavity

      public RfCavity(String strId)
      Constructor
    • RfCavity

      public RfCavity(String strId, int intReserve)
      Constructor
  • Method Details

    • getType

      public String getType()
      Override to provide type signature
      Overrides:
      getType in class AcceleratorSeq
    • addNode

      public boolean addNode(AcceleratorNode newNode)
      Method to move a node from one sequence to this sequence warning be careful - need to check node position when moving it about!!
      Overrides:
      addNode in class AcceleratorSeq
    • update

      public void update(DataAdaptor adaptor)
      Collect all of the enclosed rf gaps for convenience
      Specified by:
      update in interface DataListener
      Overrides:
      update in class AcceleratorSeq
      Parameters:
      adaptor - The adaptor from which to update the data
    • getRfField

      public RfCavityBucket getRfField()
      returns the bucket for the RfField of this cavity
    • setRfField

      public void setRfField(RfCavityBucket buc)
      sets the bucket for the RfField of this cavity
    • addBucket

      public void addBucket(AttributeBucket buc)
      Override AcceleratorNode implementation to check for a RfCavityStruct Bucket
      Overrides:
      addBucket in class AcceleratorSeq
    • getCavAmpAvg

      public double getCavAmpAvg() throws GetException
      get the cavity amplitude (MV) and publish this to all the gaps connected to this cavity note the cavity amp [MV] = klystron amplitude * ampFactor where ampFactor is a calibration factor determined experimentally
      Throws:
      GetException
    • toCavAmpAvgFromCA

      public double toCavAmpAvgFromCA(double rawValue)
      Convert the raw channel access value to get the cavity amplitude in MV.
      Parameters:
      rawValue - the raw channel value
      Returns:
      the cavity amplitude in MV
    • toCAFromCavAmpAvg

      public double toCAFromCavAmpAvg(double value)
      Convert the cavity amplitude to channel access.
      Parameters:
      value - the cavity amplitude
      Returns:
      the channel access value
    • getCavPhaseAvg

      public double getCavPhaseAvg() throws GetException
      Get the cavity phase relative to the beam (deg) and publish it to all the rf gaps associated with this cavity note the cavity phase = klystron phase + phaseOffset where phaseOffset is a calibration factor determined experimentally
      Throws:
      GetException
    • toCavPhaseAvgFromCA

      public double toCavPhaseAvgFromCA(double rawValue)
      Convert the raw channel access value to get the cavity phase in degrees.
      Parameters:
      rawValue - the raw channel value
      Returns:
      the cavity phase in degrees
    • toCAFromCavPhaseAvg

      public double toCAFromCavPhaseAvg(double value)
      Convert the cavity phase to channel access.
      Parameters:
      value - the cavity phase
      Returns:
      the channel access value
    • getDfltCavAmp

      public double getDfltCavAmp()
      Returns:
      default (design) cavity amplitude (MV)
    • getDfltCavPhase

      public double getDfltCavPhase()
      Returns:
      default (design) cavity phase (deg)
    • setDfltCavAmp

      public void setDfltCavAmp(double value)
    • setDfltCavPhase

      public void setDfltCavPhase(double value)
    • getDfltAvgCavPhase

      public double getDfltAvgCavPhase()
      Returns:
      default (design) average cavity phase (averaged over all RF gaps in the cavity)
    • getDfltAvgCavTTF

      public double getDfltAvgCavTTF()
      CKA - Never used
      Returns:
      default (design) average cavity TTF (averaged over all RF gaps in the cavity)
    • getRFLength

      public double getRFLength()
      get the length of the active RF accelerating structure in this cavity (m)
    • toAvgCavPhaseFromCavPhase

      public double toAvgCavPhaseFromCavPhase(double cavityPhase)
      Convert the cavity phase (phase at entrance to cavity) to average cavity phase by averaging the phase over the gaps.
      Parameters:
      cavityPhase - the phase at the start of the cavity.
      Returns:
      the average phase of the cavity
    • toCenterAvgCavPhaseFromCavPhase

      public double toCenterAvgCavPhaseFromCavPhase(double cavityPhase)
      Calculate the average phase of the gaps at the center of the cavity from the phase at the entrance to the cavity.
      Parameters:
      cavityPhase - the phase at the start of the cavity.
      Returns:
      the average phase of the cavity
    • setCavAmp

      public void setCavAmp(double newAmp) throws PutException
      Set the cavity amplitude [MV] note the cavity amp [MV] = klystron amp * ampFactor where ampFactor is a calibration factor determined experimentally
      Throws:
      PutException
    • setCavPhase

      public void setCavPhase(double newPhase) throws PutException
      Set the cavity phase relative to the beam (deg) note the cavity phase = klystron phase + phaseOffset where phaseOffset is a calibration factor determined experimentally
      Throws:
      PutException
    • getCavAmpSetPoint

      public double getCavAmpSetPoint() throws GetException
      return the present live set point for the amplitude
      Throws:
      GetException
    • getCavPhaseSetPoint

      public double getCavPhaseSetPoint() throws GetException
      return the present live set point for the phase
      Throws:
      GetException
    • getBlankBeam

      public boolean getBlankBeam() throws GetException
      Determine whether the beam is blanked
      Returns:
      true if the beam is blanked and false if not
      Throws:
      GetException
    • setBlankBeam

      public void setBlankBeam(boolean mode) throws PutException
      Blank the beam
      Parameters:
      mode - true to blank the beam and false for continuous on
      Throws:
      PutException
    • getGaps

      public Collection<RfGap> getGaps()
      method to return the gaps associated with this cavity
    • getGapsAsList

      public List<RfGap> getGapsAsList()
      method to return the gaps associated with this cavity as a List
    • updateDesignPhase

      public void updateDesignPhase(double phase)
      Set the design phase
      Parameters:
      phase - new design phase (deg)
    • updateDesignAmp

      public void updateDesignAmp(double amp)
      method to set the design amplitude
      Parameters:
      amp - new design amplitude (MV)
    • getTTFFit

      public RealUnivariatePolynomial getTTFFit()
      return a polynomial fit of the transit time factor as a function of beta
    • getTTFPrimeFit

      public RealUnivariatePolynomial getTTFPrimeFit()
      return a polynomial fit of the transit time factor prime as a function of beta
    • getSTFFit

      public RealUnivariatePolynomial getSTFFit()
      return a polynomial fit of the "S" transit time factor as a function of beta
    • getSTFPrimeFit

      public RealUnivariatePolynomial getSTFPrimeFit()
      return a polynomial fit of the "S" transit time factor prime as a function of beta
    • getTTFFitEnd

      public RealUnivariatePolynomial getTTFFitEnd()
      return a polynomial fit of the transit time factor for end cells as a function of beta
    • getTTFPrimeFitEnd

      public RealUnivariatePolynomial getTTFPrimeFitEnd()
      return a polynomial fit of the transit time factor prime for end cells as a function of beta
    • getSTFFitEnd

      public RealUnivariatePolynomial getSTFFitEnd()
      return a polynomial fit of the "S" transit time factor for end cells as a function of beta
    • getSTFPrimeFitEnd

      public RealUnivariatePolynomial getSTFPrimeFitEnd()
      return a polynomial fit of the "S" transit time factor prime for end cells as a function of beta
    • getStructureMode

      public double getStructureMode()
      returns 0 if the gap is part of a 0 mode cavity structure (e.g. DTL) returns 1 if the gap is part of a pi mode cavity (e.g. CCL, Superconducting)
    • getCavFreq

      public double getCavFreq()
      Get RF cavity frequency.
      Returns:
      RF cavity frequency (MHz)