gov.sns.xal.smf.impl
Class RfGap

java.lang.Object
  |
  +--gov.sns.xal.smf.AcceleratorNode
        |
        +--gov.sns.xal.smf.impl.RfGap
All Implemented Interfaces:
DataListener, ElementType, IModelDataSource, RfGapDataSource

public class RfGap
extends AcceleratorNode
implements RfGapDataSource

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.


Field Summary
protected  RfGapBucket m_bucRfGap
          The rf gap bucket containing the length, ampFactor, phaseFactor and TTF
static java.lang.String s_strType
           
 
Fields inherited from class gov.sns.xal.smf.AcceleratorNode
channelSuite, m_bolIsSoft, m_bolStatus, m_bolValid, m_bucAlign, m_bucAper, m_bucTwiss, m_dblLen, m_dblPos, m_mapAttrs, m_objAccel, m_seqParent, m_strId
 
Constructor Summary
RfGap(java.lang.String strId)
           
 
Method Summary
 void addBucket(AttributeBucket buc)
          Override AcceleratorNode implementation to check for a RfGapBucket
 double getDesignEnergyGain()
          Computes and returns the design value of the energy gain for this gap.
 double getGapAmpAvg()
          return the RF amplitude in the gap (kV/m).
 double getGapDfltAmp()
          return the RF amplitude in the gap (kV/m)
 double getGapDfltE0TL()
          return the E0TL product (kV) This is the product of the field * gap length * TTF
 double getGapDfltFrequency()
          return the RF fundamental frequency
 double getGapDfltPhase()
          return the RF phase in the gap (deg)
 double getGapE0TL()
          return the E0TL product (kV) This is the product of the field * gap length * TTF
 double getGapLength()
          return Rf Gap Length
 double getGapOffset()
          returns the offset of the gap center from the cell center (m) these may be different e.g.
 double getGapPhaseAvg()
          return the RF phase in the gap (deg).
 double getGapTTF()
          return TTF
 RfGapBucket getRfGap()
           
 UnivariateRealPolynomial getSFit()
          return a polynomial fit of the S factor as a function of beta
 UnivariateRealPolynomial getSPrimeFit()
          return a polynomial fit of the S-prime factor as a function of beta
 double getStructureMode()
          returns 0 if the gap is part of a 0 mode cavity structure (e.g.
 UnivariateRealPolynomial getTTFFit()
          return a polynomial fit of the transit time factor as a function of beta
 UnivariateRealPolynomial getTTFPrimeFit()
          return a polynomial fit of the TTF-prime factor as a function of beta
 java.lang.String getType()
          Override to provide type signature
 boolean isEndCell()
          returns whether this is the first gap of a cavity string
 boolean isFirstGap()
          returns whether this is the first gap of a cavity string
 void setFirstGap(boolean tf)
          sets the flag indicating whether this is the first gap in a cavity
 void 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 setRfGap(RfGapBucket buc)
           
 
Methods inherited from class gov.sns.xal.smf.AcceleratorNode
channelSuite, clear, dataLabel, getAccelerator, getAlign, getAndConnectChannel, getAper, getBucket, getBuckets, getChannel, getHandles, getId, getLength, getParent, getPosition, getStatus, getTwiss, getValid, hasBucket, hasParent, isKindOf, isMagnet, lazilyGetAndConnect, removeFromParent, setAccelerator, setAlign, setAper, setLength, setParent, setPosition, setStatus, setTwiss, setValid, toString, update, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

s_strType

public static final java.lang.String s_strType
See Also:
Constant Field Values

m_bucRfGap

protected RfGapBucket m_bucRfGap
The rf gap bucket containing the length, ampFactor, phaseFactor and TTF

Constructor Detail

RfGap

public RfGap(java.lang.String strId)
Method Detail

getType

public java.lang.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 ConnectionException,
                           GetException
return the RF amplitude in the gap (kV/m). Note, this method should probably be modified

ConnectionException
GetException

getGapDfltAmp

public double getGapDfltAmp()
return the RF amplitude in the gap (kV/m)


getGapPhaseAvg

public double getGapPhaseAvg()
                      throws ConnectionException,
                             GetException
return the RF phase in the gap (deg). This includes the calibration offset factor if it has been set

ConnectionException
GetException

getGapE0TL

public double getGapE0TL()
                  throws ConnectionException,
                         GetException
return the E0TL product (kV) This is the product of the field * gap length * TTF

ConnectionException
GetException

getGapDfltE0TL

public double getGapDfltE0TL()
return the E0TL product (kV) This is the product of the field * gap length * TTF


getGapDfltPhase

public double getGapDfltPhase()
return the RF phase in the gap (deg)


getGapDfltFrequency

public double getGapDfltFrequency()
return the RF fundamental frequency


getGapLength

public double getGapLength()
return Rf Gap Length

Specified by:
getGapLength in interface RfGapDataSource

getGapTTF

public double getGapTTF()
return TTF


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)


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)


getTTFFit

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

Specified by:
getTTFFit in interface RfGapDataSource

getTTFPrimeFit

public UnivariateRealPolynomial getTTFPrimeFit()
return a polynomial fit of the TTF-prime factor as a function of beta

Specified by:
getTTFPrimeFit in interface RfGapDataSource

getSFit

public UnivariateRealPolynomial getSFit()
return a polynomial fit of the S factor as a function of beta

Specified by:
getSFit in interface RfGapDataSource

getSPrimeFit

public UnivariateRealPolynomial getSPrimeFit()
return a polynomial fit of the S-prime factor as a function of beta

Specified by:
getSPrimeFit in interface RfGapDataSource

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)

Specified by:
getStructureMode in interface RfGapDataSource

getGapOffset

public double getGapOffset()
returns the offset of the gap center from the cell center (m) these may be different e.g. for a DTL cavity

Specified by:
getGapOffset in interface RfGapDataSource

setFirstGap

public void setFirstGap(boolean tf)
sets the flag indicating whether this is the first gap in a cavity


isFirstGap

public boolean isFirstGap()
returns whether this is the first gap of a cavity string

Specified by:
isFirstGap in interface RfGapDataSource

isEndCell

public boolean isEndCell()
returns whether this is the first 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 dW=q E0 T L cos(phi).

Returns:
design energy gain (eV) Added 10/17/02 CKA