Class AlgorithmFactory
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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic EnvelopeBacktrackerConvenience method: Creates a newEnvelopeBacktrackerinstance by calling the class methodwith the returned class type.createTrackerFor(AcceleratorSeq, Class)static EnvelopeTrackercreateEnvelopeTracker(AcceleratorSeq smfSeq) Convenience method: Creates a newEnvelopeTrackerinstance by calling the class methodwith the returned class type.createTrackerFor(AcceleratorSeq, Class)static EnvelopeTrackerPmqDipoleConvenience method: Creates a newEnvelopeTrackerPmqDipoleinstance by calling the class methodwith the returned class type.createTrackerFor(AcceleratorSeq, Class)static EnvTrackerAdaptcreateEnvTrackerAdapt(AcceleratorSeq smfSeq) Convenience method: Creates a newEnvTrackerAdaptinstance by calling the class methodwith the returned class type.createTrackerFor(AcceleratorSeq, Class)static ParticleTrackercreateParticleTracker(AcceleratorSeq smfSeq) Convenience method: Creates a newParticleTrackerinstance by calling the class methodwith the returned class type.createTrackerFor(AcceleratorSeq, Class)static SynchronousTrackerConvenience method: Creates a newSynchronousTrackerinstance by calling the class methodwith the returned class type.createTrackerFor(AcceleratorSeq, Class)static Trace3dTrackercreateTrace3dTracker(AcceleratorSeq smfSeq) Convenience method: Creates a newTrace3dTrackerinstance by calling the class methodwith the returned class type.createTrackerFor(AcceleratorSeq, Class)static <T extends Tracker>
TcreateTrackerFor(AcceleratorSeq smfSeq, Class<T> clsTkr) Creates a newTrackerderived algorithm instance and initializes it with parameters specified in the edit context of the given accelerator sequence object.static TransferMapTrackerConvenience method: Creates a newTransferMapTrackerinstance by calling the class methodwith the returned class type.createTrackerFor(AcceleratorSeq, Class)static TwissTrackercreateTwissTracker(AcceleratorSeq smfSeq) Convenience method: Creates a newTwissTrackerinstance by calling the class methodwith the returned class type.createTrackerFor(AcceleratorSeq, Class)static TwissTrackerPmqcreateTwissTrackerPmq(AcceleratorSeq smfSeq) Convenience method: Creates a newTwissTrackerPmqinstance by calling the class methodwith the returned class type.createTrackerFor(AcceleratorSeq, Class)
-
Field Details
-
NODETAG_ALG
data node label for algorithm data- See Also:
-
ATTRTAG_TYPE
attribute label for type string identifier- See Also:
-
-
Method Details
-
createSynchronousTracker
public static SynchronousTracker createSynchronousTracker(AcceleratorSeq smfSeq) throws InstantiationException Convenience method: Creates a new
SynchronousTrackerinstance by calling the class methodwith the returned class type.createTrackerFor(AcceleratorSeq, Class)The new algorithm instance is initialized with parameters specified in the edit context of the given accelerator sequence object. The returned
SynchronousTrackeralgorithm will propagate aSynchronousProbeobject.- 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
ParticleTrackerinstance by calling the class methodwith the returned class type.createTrackerFor(AcceleratorSeq, Class)The new algorithm instance is initialized with parameters specified in the edit context of the given accelerator sequence object. The returned
ParticleTrackeralgorithm will propagate aParticleProbeobject.- 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
TransferMapTrackerinstance by calling the class methodwith the returned class type.createTrackerFor(AcceleratorSeq, Class)The new algorithm instance is initialized with parameters specified in the edit context of the given accelerator sequence object. The returned
TransferMapTrackeralgorithm will propagate aTransferMapProbeobject.- 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
Convenience method: Creates a new
TwissTrackerinstance by calling the class methodwith the returned class type.createTrackerFor(AcceleratorSeq, Class)The new algorithm instance is initialized with parameters specified in the edit context of the given accelerator sequence object. The returned
TwissTrackeralgorithm will propagate aTwissProbeobject.- 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
TwissTrackerPmqinstance by calling the class methodwith the returned class type.createTrackerFor(AcceleratorSeq, Class)The new algorithm instance is initialized with parameters specified in the edit context of the given accelerator sequence object. The returned
TwissTrackerPmqalgorithm will propagate aTwissProbeobject.- 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
Trace3dTrackerinstance by calling the class methodwith the returned class type.createTrackerFor(AcceleratorSeq, Class)The new algorithm instance is initialized with parameters specified in the edit context of the given accelerator sequence object. The returned
Trace3dTrackeralgorithm will propagate anEnvelopeProbeobject.NOTES:
· The
Trace3dTrackeralgorithm 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
EnvelopeTrackerinstance by calling the class methodwith the returned class type.createTrackerFor(AcceleratorSeq, Class)The new algorithm instance is initialized with parameters specified in the edit context of the given accelerator sequence object. The returned
EnvelopeTrackeralgorithm will propagate anEnvelopeProbeobject.- 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
EnvelopeBacktrackerinstance by calling the class methodwith the returned class type.createTrackerFor(AcceleratorSeq, Class)The new algorithm instance is initialized with parameters specified in the edit context of the given accelerator sequence object. The returned
EnvelopeBacktrackeralgorithm will propagate anEnvelopeProbeobject.- 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
EnvTrackerAdaptinstance by calling the class methodwith the returned class type.createTrackerFor(AcceleratorSeq, Class)The new algorithm instance is initialized with parameters specified in the edit context of the given accelerator sequence object. The returned
EnvTrackerAdaptalgorithm will propagate anEnvelopeProbeobject.- 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
EnvelopeTrackerPmqDipoleinstance by calling the class methodwith the returned class type.createTrackerFor(AcceleratorSeq, Class)The new algorithm instance is initialized with parameters specified in the edit context of the given accelerator sequence object. The returned
EnvelopeTrackerPmqalgorithm will propagate anEnvelopeProbeobject.- 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 newTrackerderived 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 fromTracker- Parameters:
smfSeq- accelerator sequence object indirectly containing the edit context through its associated acceleratorclsTkr- 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:
-