Class AlgorithmFactory

java.lang.Object
xal.sim.scenario.AlgorithmFactory

public final class AlgorithmFactory extends Object

Factory class for instantiating and initializing algorithm objects for the XAL online model. Algorithm classes are typically derived from the Tracker base class and must expose the IAlgorithm interface. We take the initialization parameters from the XAL "model.params" file, using the edit context mechanism in XAL. (An EditContext object is associated with each Accelerator object.) The file contains data tables which are structured for the different types of algorithms. Each algorithm may have many different tables, typically different parameters for different locations along the beamline. The table label data is typically defined in the source file for the algorithm, whereas the specific table name is given by the accelerator sequence identifier where the algorithm starts.

Each algorithm will support the propagation of one type of simulation probe, however, each probe class may accept multiple types of algorithms for its propagation. It is the responsibility of the developer to create and use the appropriate algorithm object for the given probe type.

Since:
Oct 25, 2012
Author:
Christopher K. Allen
See Also:
  • Field Details

  • Method Details

    • createSynchronousTracker

      public static SynchronousTracker createSynchronousTracker(AcceleratorSeq smfSeq) throws InstantiationException

      Convenience method: Creates a new SynchronousTracker instance by calling the class method createTrackerFor(AcceleratorSeq, Class) with the returned class type.

      The new algorithm instance is initialized with parameters specified in the edit context of the given accelerator sequence object. The returned SynchronousTracker algorithm will propagate a SynchronousProbe object.

      Parameters:
      smfSeq - Accelerator sequence object indirectly containing the edit context through its associated accelerator
      Returns:
      newly instantiated algorithm that was initialized from the given accelerator sequence's edit context.
      Throws:
      InstantiationException - unable to instantiate the object due to constructor access violation or the class has no nullary constructor
      Since:
      Oct 26, 2012
      See Also:
    • createParticleTracker

      public static ParticleTracker createParticleTracker(AcceleratorSeq smfSeq) throws InstantiationException

      Convenience method: Creates a new ParticleTracker instance by calling the class method createTrackerFor(AcceleratorSeq, Class) with the returned class type.

      The new algorithm instance is initialized with parameters specified in the edit context of the given accelerator sequence object. The returned ParticleTracker algorithm will propagate a ParticleProbe object.

      Parameters:
      smfSeq - Accelerator sequence object indirectly containing the edit context through its associated accelerator
      Returns:
      newly instantiated algorithm that was initialized from the given accelerator sequence's edit context.
      Throws:
      InstantiationException - unable to instantiate the object due to constructor access violation or the class has no nullary constructor
      Since:
      Oct 26, 2012
      See Also:
    • createTransferMapTracker

      public static TransferMapTracker createTransferMapTracker(AcceleratorSeq smfSeq) throws InstantiationException

      Convenience method: Creates a new TransferMapTracker instance by calling the class method createTrackerFor(AcceleratorSeq, Class) with the returned class type.

      The new algorithm instance is initialized with parameters specified in the edit context of the given accelerator sequence object. The returned TransferMapTracker algorithm will propagate a TransferMapProbe object.

      Parameters:
      smfSeq - Accelerator sequence object indirectly containing the edit context through its associated accelerator
      Returns:
      newly instantiated algorithm that was initialized from the given accelerator sequence's edit context.
      Throws:
      InstantiationException - unable to instantiate the object due to constructor access violation or the class has no nullary constructor
      Since:
      Oct 26, 2012
      See Also:
    • createTwissTracker

      public static TwissTracker createTwissTracker(AcceleratorSeq smfSeq) throws InstantiationException

      Convenience method: Creates a new TwissTracker instance by calling the class method createTrackerFor(AcceleratorSeq, Class) with the returned class type.

      The new algorithm instance is initialized with parameters specified in the edit context of the given accelerator sequence object. The returned TwissTracker algorithm will propagate a TwissProbe object.

      Parameters:
      smfSeq - Accelerator sequence object indirectly containing the edit context through its associated accelerator
      Returns:
      newly instantiated algorithm that was initialized from the given accelerator sequence's edit context.
      Throws:
      InstantiationException - unable to instantiate the object due to constructor access violation or the class has no nullary constructor
      Since:
      Oct 26, 2012
      See Also:
    • createTwissTrackerPmq

      public static TwissTrackerPmq createTwissTrackerPmq(AcceleratorSeq smfSeq) throws InstantiationException

      Convenience method: Creates a new TwissTrackerPmq instance by calling the class method createTrackerFor(AcceleratorSeq, Class) with the returned class type.

      The new algorithm instance is initialized with parameters specified in the edit context of the given accelerator sequence object. The returned TwissTrackerPmq algorithm will propagate a TwissProbe object.

      Parameters:
      smfSeq - Accelerator sequence object indirectly containing the edit context through its associated accelerator
      Returns:
      newly instantiated algorithm that was initialized from the given accelerator sequence's edit context.
      Throws:
      InstantiationException - unable to instantiate the object due to constructor access violation or the class has no nullary constructor
      Since:
      Oct 29, 2012
      See Also:
    • createTrace3dTracker

      public static Trace3dTracker createTrace3dTracker(AcceleratorSeq smfSeq) throws InstantiationException

      Convenience method: Creates a new Trace3dTracker instance by calling the class method createTrackerFor(AcceleratorSeq, Class) with the returned class type.

      The new algorithm instance is initialized with parameters specified in the edit context of the given accelerator sequence object. The returned Trace3dTracker algorithm will propagate an EnvelopeProbe object.

      NOTES:

      · The Trace3dTracker algorithm is all but deprecated. Use of this method is discouraged except for benchmarking purposes.

      Parameters:
      smfSeq - Accelerator sequence object indirectly containing the edit context through its associated accelerator
      Returns:
      newly instantiated algorithm that was initialized from the given accelerator sequence's edit context.
      Throws:
      InstantiationException - unable to instantiate the object due to access violation or the class has no nullary constructor
      Since:
      Oct 25, 2012
      See Also:
    • createEnvelopeTracker

      public static EnvelopeTracker createEnvelopeTracker(AcceleratorSeq smfSeq) throws InstantiationException

      Convenience method: Creates a new EnvelopeTracker instance by calling the class method createTrackerFor(AcceleratorSeq, Class) with the returned class type.

      The new algorithm instance is initialized with parameters specified in the edit context of the given accelerator sequence object. The returned EnvelopeTracker algorithm will propagate an EnvelopeProbe object.

      Parameters:
      smfSeq - Accelerator sequence object indirectly containing the edit context through its associated accelerator
      Returns:
      newly instantiated algorithm that was initialized from the given accelerator sequence's edit context.
      Throws:
      InstantiationException - unable to instantiate the object due to access violation or the class has no nullary constructor
      Since:
      Oct 24, 2012
      See Also:
    • createEnvelopeBacktracker

      public static EnvelopeBacktracker createEnvelopeBacktracker(AcceleratorSeq smfSeq) throws InstantiationException

      Convenience method: Creates a new EnvelopeBacktracker instance by calling the class method createTrackerFor(AcceleratorSeq, Class) with the returned class type.

      The new algorithm instance is initialized with parameters specified in the edit context of the given accelerator sequence object. The returned EnvelopeBacktracker algorithm will propagate an EnvelopeProbe object.

      Parameters:
      smfSeq - Accelerator sequence object indirectly containing the edit context through its associated accelerator
      Returns:
      newly instantiated algorithm that was initialized from the given accelerator sequence's edit context.
      Throws:
      InstantiationException - unable to instantiate the object due to access violation or the class has no nullary constructor
      Since:
      Oct 24, 2012
      See Also:
    • createEnvTrackerAdapt

      public static EnvTrackerAdapt createEnvTrackerAdapt(AcceleratorSeq smfSeq) throws InstantiationException

      Convenience method: Creates a new EnvTrackerAdapt instance by calling the class method createTrackerFor(AcceleratorSeq, Class) with the returned class type.

      The new algorithm instance is initialized with parameters specified in the edit context of the given accelerator sequence object. The returned EnvTrackerAdapt algorithm will propagate an EnvelopeProbe object.

      Parameters:
      smfSeq - Accelerator sequence object indirectly containing the edit context through its associated accelerator
      Returns:
      newly instantiated algorithm that was initialized from the given accelerator sequence's edit context.
      Throws:
      InstantiationException - unable to instantiate the object due to access violation or the class has no nullary constructor
      Since:
      Oct 24, 2012
      See Also:
    • createEnvelopeTrackerPmqDipole

      public static EnvelopeTrackerPmqDipole createEnvelopeTrackerPmqDipole(AcceleratorSeq smfSeq) throws InstantiationException

      Convenience method: Creates a new EnvelopeTrackerPmqDipole instance by calling the class method createTrackerFor(AcceleratorSeq, Class) with the returned class type.

      The new algorithm instance is initialized with parameters specified in the edit context of the given accelerator sequence object. The returned EnvelopeTrackerPmq algorithm will propagate an EnvelopeProbe object.

      Parameters:
      smfSeq - Accelerator sequence object indirectly containing the edit context through its associated accelerator
      Returns:
      newly instantiated algorithm that was initialized from the given accelerator sequence's edit context.
      Throws:
      InstantiationException - unable to instantiate the object due to access violation or the class has no nullary constructor
      Since:
      Oct 24, 2012
      See Also:
    • createTrackerFor

      public static <T extends Tracker> T createTrackerFor(AcceleratorSeq smfSeq, Class<T> clsTkr) throws InstantiationException
      Creates a new Tracker derived algorithm instance and initializes it with parameters specified in the edit context of the given accelerator sequence object. These parameters are located in the "model.params" file which is part of the XAL configuration initialization. Within the file are data tables for initializing algorithms, the labels of these tables are particular to the algorithm type being instantiated (typically they are defined within the algorithm source file). The actual table name from which the initialization parameters are taken is given by the sequence id of the provided accelerator sequence. If there are no tables with that name then the mechanism automatically defers to the table named "default".
      Type Parameters:
      T - Type of the algorithm to be instantiated, must be derived from Tracker
      Parameters:
      smfSeq - accelerator sequence object indirectly containing the edit context through its associated accelerator
      clsTkr - the class type of the algorithm to be instantiated
      Returns:
      newly instantiated algorithm that was initialized from the given accelerator sequence's edit context.
      Throws:
      InstantiationException - unable to instantiate the tracker object due to access violation or the class has no nullary constructor
      Since:
      Oct 24, 2012
      See Also: