Module simpa.acc

Class FrequencyAnalysis.FrequencyAnalysisBuilder

java.lang.Object
simpa.acc.api.utils.FrequencyAnalysis.FrequencyAnalysisBuilder
Enclosing class:
FrequencyAnalysis

public static class FrequencyAnalysis.FrequencyAnalysisBuilder extends Object
  • Constructor Details

    • FrequencyAnalysisBuilder

      public FrequencyAnalysisBuilder()
  • Method Details

    • setDpOp

      public FrequencyAnalysis.FrequencyAnalysisBuilder setDpOp(double dpop)
      Parameters:
      dpop - The momentum spread to be used while determining the optics for the interpolation of optics parameters.
      Returns:
      The builder object.
    • setSampleTunes

      public FrequencyAnalysis.FrequencyAnalysisBuilder setSampleTunes(List<Tune> sampleTunes)
      This method is used for setting a list of tunes corresponding to resonance free working points in the tune diagram. The tunes are used to calculate an interpolation table which is used to calculate the initial conditions for the tracking, such that the initial single particle emittances are equal to the specified values approximately.
      Parameters:
      sampleTunes - A list of tunes corresponding to resonance free working points in the tune diagram
      Returns:
      The builder object.
    • setAperture

      Parameters:
      aperture - The physical aperture to be used during the pracking.
      Returns:
      The builder object.
    • setPrototypeParticle

      public FrequencyAnalysis.FrequencyAnalysisBuilder setPrototypeParticle(Particle prototypeParticle)
      Parameters:
      prototypeParticle - A prototype for particles to be tracked. The phase space variables will be used only at the stage of constructing the Tune- TwissParameters interpolation table.
      Returns:
      The builder object.
    • setTurns

      public FrequencyAnalysis.FrequencyAnalysisBuilder setTurns(int turns)
      Parameters:
      turns - Number of turns to be used for the tracking. Must be a power of two. The default is 256.
      Returns:
      The builder object.
    • setNumberOfThreadsUsed

      public FrequencyAnalysis.FrequencyAnalysisBuilder setNumberOfThreadsUsed(int nThreads)
      By default all threads are used. Since the scan must keep a field map in memory for each thread, the memory consumption can be very high. This method can be used to keep memory consumption within the available memory size.
      Parameters:
      nThreads - Number of threads to be used during the scan.
      Returns:
      The builder object.
    • setOutDir

      Sets the output directory for the phase space coordinate files produced by the tracking during the tune scan.
      Parameters:
      outdir - The output directory
      Returns:
      The builder object.
    • setDiskRadius

      public FrequencyAnalysis.FrequencyAnalysisBuilder setDiskRadius(double diskRadius)
      Set the disk radius for the observer disk. Should be big enough to cover the aperture of the ring, but small enough to not intersect the beam region twice.
      Parameters:
      diskRadius - - The radius of the observer disk.
      Returns:
      The builder object.
    • setReferenceOrbit

      public FrequencyAnalysis.FrequencyAnalysisBuilder setReferenceOrbit(ReferenceOrbit referenceOrbit)
      Sets the reference orbit of the ring.
      Parameters:
      referenceOrbit - The reference orbit
      Returns:
      The builder object.
    • setTuneModel

      public FrequencyAnalysis.FrequencyAnalysisBuilder setTuneModel(TuneModel tuneModel)
      Sets an the tune model to be used for the frequency analysis.
      Parameters:
      tuneModel - An implementation of the TuneModel interface.
      Returns:
      The builder object.
    • setScalings

      Set the scaling map containing the elements in the ring. During the tune scan the scaling factor of the elements which are part of the TuneModel will be replaced by the scaling factors given by the TuneModel, so their value is irrelevant ( you can set to zero for example). However these elements should be also present in the map. You can save quite some memory to prepare a field map containing all elements except the elements in the TuneModel already scaled properly and add this field map to the scaling map with scaling factor one.
      Parameters:
      scalings - Field map containing all elements.
      Returns:
      The builder object.
    • setStartQh

      public FrequencyAnalysis.FrequencyAnalysisBuilder setStartQh(double startQh)
      Parameters:
      startQh - The staring horizontal tune of the tune scan. This can be the fractional of the full tune, depending how the TuneModel is implemented.
      Returns:
      The builder object.
    • setEndQh

      public FrequencyAnalysis.FrequencyAnalysisBuilder setEndQh(double endQh)
      Parameters:
      endQh - The end horizontal tune of the tune scan.This can be the fractional of the full tune, depending how the TuneModel is implemented.
      Returns:
      The builder object.
    • setStartQv

      public FrequencyAnalysis.FrequencyAnalysisBuilder setStartQv(double startQv)
      Parameters:
      startQv - The staring vertical tune of the tune scan. This can be the fractional of the full tune, depending how the TuneModel is implemented.
      Returns:
      The builder object.
    • setEndQv

      public FrequencyAnalysis.FrequencyAnalysisBuilder setEndQv(double endQv)
      Parameters:
      endQv - The staring vertical tune of the tune scan. This can be the fractional of the full tune, depending how the TuneModel is implemented.
      Returns:
      The builder object.
    • setStepsQh

      public FrequencyAnalysis.FrequencyAnalysisBuilder setStepsQh(int stepsQh)
      Parameters:
      stepsQh - Number of horizontal steps during the tune scan.
      Returns:
      The builder object.
    • setStepsQv

      public FrequencyAnalysis.FrequencyAnalysisBuilder setStepsQv(int stepsQv)
      Parameters:
      stepsQv - Number of vertical steps during the tune scan.
      Returns:
      The builder object.
    • setHEmittance

      public FrequencyAnalysis.FrequencyAnalysisBuilder setHEmittance(double hEmittance)
      Parameters:
      hEmittance - The the single particle horizontal emittance for the tune scan. This value will be kept approximately constant during the tune scan.
      Returns:
      The builder object.
    • setVEmittance

      public FrequencyAnalysis.FrequencyAnalysisBuilder setVEmittance(double vEmittance)
      Parameters:
      vEmittance - The the single particle vertical emittance for the tune scan.This value will be kept approximately constant during the tune scan.
      Returns:
      The builder object.
    • build

      public FrequencyAnalysis build() throws IOException
      Builds the FrequencyAnalysis instance.
      Returns:
      The FrequencyAnalysis instance.
      Throws:
      IOException