java.lang.Object
simpa.acc.api.AccCli
Class that specifies all the commands that can be used in the CLI using the
CLI library apart from some extra commands.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addArbitrary
(String elementName, Double scaling, Double longiPos, String group, String etn, Map<Double, Profile> profileMap, String pathFile, org.apache.commons.math3.geometry.euclidean.threed.Vector3D localY) void
addBending
(String elementName, Double scaling, double length, double deflection, Double tilt, Double longPos, String etn, String group, Map<Double, Profile> profileMap, org.apache.commons.math3.geometry.euclidean.threed.Rotation rot, String bendingType) void
void
void
addStraight
(String elementName, Double scaling, Double tilt, Double longPos, String group, String etn, Map<Double, Profile> profileMap, org.apache.commons.math3.geometry.euclidean.threed.Rotation rot) beamFromFile
(String type, Double mom, Double lPos, Double mass, Double charge, String name, String file) bobyqaMatcher
(Integer ipn, Double initialRegion, Double stopFitness, Integer maxIter, MatchingTarget[] targets, MatchingVariable[] variables) double[]
calculateChromaticity
(String file1, String file2, Integer turns, double dpop) void
void
checkField
(TilingConfig tconfig) cmaesMatcher
(MatchingTarget[] targets, MatchingVariable[] variables, Double stopFitness, Integer maxIter, Boolean isActiveCMA, Double[] sigmas, Integer checkFeasableCount, Integer populationSize) void
convertTrajectory
(String particleName, String beamName, double diskr, String outFile, Boolean backward) void
createAccElement
(TilingConfig tconfig, Double relativeError, String solverType, Double bjar, Double bjpr, Integer sliceWidth, Integer sliceOverlap, Integer gmresRestart, Boolean debug) createBeam
(String type, Double mom, Double he, Double ve, Double lPos, Double dpOp, Double mass, Double charge, String name, String distribution, Integer nParticles, TwissParameters twiss) createBeamRegion
(Profile profile, double distance, Double ballRadius, Double extention) void
createBendingPath
(Double deflectionAngle, Double bendingRadius, Integer nSegments, Double extentionLength, String name, org.apache.commons.math3.geometry.euclidean.threed.Vector3D translation, org.apache.commons.math3.geometry.euclidean.threed.Rotation rot, String bendingType) void
createCheckpointFile
(TilingConfig tconfig, org.apache.commons.math3.geometry.euclidean.threed.Vector3D translation, Double extension, Double stepSize) createEllipseProfile
(double xrad, double yrad, int steps, Double startAngle) void
createFieldMaps
(String file, String groupName, Boolean oneByOne, int lmax, Integer pass1Lmax, Double relativeError, Boolean stat) createParticle
(String type, Double mom, Double dx, Double ax, Double dy, Double ay, Double lPos, Double dpOp, Double mass, Double charge, String name) createRectProfile
(double xmin, double xmax, double ymin, double ymax, int xsteps, int ysteps) org.apache.commons.math3.geometry.euclidean.threed.Rotation
createRotation
(org.apache.commons.math3.geometry.euclidean.threed.Vector3D v1, org.apache.commons.math3.geometry.euclidean.threed.Vector3D v2, org.apache.commons.math3.geometry.euclidean.threed.Vector3D v3, org.apache.commons.math3.geometry.euclidean.threed.Vector3D v4, Double angle) void
createSequence
(String name, Double orbitStep, Boolean circular, String str, org.apache.commons.math3.geometry.euclidean.threed.Vector3D vertical) createSingleRowCover
(double apertureRadius, double ballRadius) void
createStraightPath
(Double sx, Double sy, Double sz, Double ex, Double ey, Double ez, String elementName, Integer nSteps) createTilingConfig
(String elementName, Profile profile, String unit, double elevation, String outputFileFormat, double fieldScalingFactor, String tileType, String fieldType) createTwiss
(Double x, Double xp, Double y, Double yp, Double ha, Double va, Double hb, Double vb, Double dispH, Double dispV, Double dispPrimeH, Double dispPrimeV, Double emH, Double emV, Double muH, Double muV, Double dpop, Double lPos) createVacuumChamber
(HashMap<Object, Double[]> distances) org.apache.commons.math3.geometry.euclidean.threed.Vector3D
createVector3D
(double x, double y, double z) void
endSequence
(String outputFile, String lfFile, Integer increment, String lcFileName) void
fieldOnCurve
(Map<String, Double> map, org.apache.commons.math3.geometry.euclidean.threed.Vector3D shift, String outputFile, Boolean localFrame) static cli.api.CommandInterpreter
Method to get the CommandInterpreter object.static cli.api.CliState
getState()
void
insertChamber
(Map<Double, Profile> profileMap, BeamRegion beamRegion, Double lpos) javaCall
(String externalClassName, String internalClassName, String pathToClass, String methodName, Object[] methodParameters, Object[] constructorParameters) lineOptics
(Beam b0, Beam b1, Double stepsize, double diskRadius, String outFile, Boolean backward, Boolean writeTrajectory) static void
match
(Beam b0, Beam b1, Particle p0, Particle p1, Double diskRadius, Double stepSize, Matcher matcher, Boolean backward, String file, Double lossPenalty, TwissParameters initialTwiss) matchingTarget
(Double longiPos, String type, Double value, Double upperLimit, Double lowerLimit, Double weight) void
mirrorPath
(String inFile, String outFile, String unitString) void
orbitAtBPMs
(String hOutFile, String vOutFile) void
resamplePath
(String inFile, String outFile, Integer steps, Double[] distances, Double x, Double y, Double z) void
ringOptics
(Particle p1, Particle p2, Double stepsize, double diskRadius, String outFile, Integer turns, Boolean writeTrajectory) void
void
setIntegrator
(Double omega) void
setScalings
(Map<String, Double> map, Boolean enableExternal) void
survey
(Double x0, Double y0, Double z0, Double theta0, Double phi0, Double psi0, String file, String elementName) int
systemCall
(String command) void
track
(Particle particle, Beam beam, Integer turns, Double stepSize, Double[] phoLongiPosArray, Double diskRadius, Boolean trajectoryObserver, String sigmaFile, Boolean debug, Integer threads, Boolean backward) void
transformAccElement
(String name, org.apache.commons.math3.geometry.euclidean.threed.Rotation rot, org.apache.commons.math3.geometry.euclidean.threed.Vector3D translation, Boolean inverseRot, Boolean inverseTransl, String outName) void
updateScalings
(Map<String, Double> map) void
useSequence
(String name) void
writeSurfacePoints
(TilingConfig tconfig)
-
Constructor Details
-
AccCli
public AccCli()
-
-
Method Details
-
main
- Throws:
IOException
-
getCommandInterpreter
Method to get the CommandInterpreter object. The command interpreter can be used to execute simpa commands.- Returns:
- The command interpreter.
- Throws:
IOException
-
getState
- Returns:
- The current state of the command line interface.
- Throws:
IOException
- if the state cannot be created.
-
activeSequence
-
addArbitrary
-
addBending
-
addBPM
public void addBPM(String plane, String name, Double lpos, Map<Double, Profile> profileMap) throws IllegalArgumentException- Throws:
IllegalArgumentException
-
addMarker
public void addMarker(String name, Double lpos, Map<Double, Profile> profileMap) throws IllegalArgumentException- Throws:
IllegalArgumentException
-
addStraight
public void addStraight(String elementName, Double scaling, Double tilt, Double longPos, String group, String etn, Map<Double, Profile> profileMap, org.apache.commons.math3.geometry.euclidean.threed.Rotation rot) throws IllegalAccessException- Throws:
IllegalAccessException
-
beamFromFile
public Beam beamFromFile(String type, Double mom, Double lPos, Double mass, Double charge, String name, String file) throws OutOfApertureException, KnownFatalException, FileNotFoundException -
beamTwiss
- Throws:
IOException
-
bobyqaMatcher
public Matcher bobyqaMatcher(Integer ipn, Double initialRegion, Double stopFitness, Integer maxIter, MatchingTarget[] targets, MatchingVariable[] variables) -
calculateChromaticity
public double[] calculateChromaticity(String file1, String file2, Integer turns, double dpop) throws FileNotFoundException - Throws:
FileNotFoundException
-
calculateTunes
public void calculateTunes(String file, Integer turns, Integer startTurn, String directory, String outFile) throws FileNotFoundException - Throws:
FileNotFoundException
-
checkField
- Throws:
FileNotFoundException
NotSetException
-
cmaesMatcher
public Matcher cmaesMatcher(MatchingTarget[] targets, MatchingVariable[] variables, Double stopFitness, Integer maxIter, Boolean isActiveCMA, Double[] sigmas, Integer checkFeasableCount, Integer populationSize) -
convertTrajectory
public void convertTrajectory(String particleName, String beamName, double diskr, String outFile, Boolean backward) throws IOException - Throws:
IOException
-
createAccElement
public void createAccElement(TilingConfig tconfig, Double relativeError, String solverType, Double bjar, Double bjpr, Integer sliceWidth, Integer sliceOverlap, Integer gmresRestart, Boolean debug) throws NotSetException, PositionMismatchException -
createBeam
public Beam createBeam(String type, Double mom, Double he, Double ve, Double lPos, Double dpOp, Double mass, Double charge, String name, String distribution, Integer nParticles, TwissParameters twiss) throws OutOfApertureException, KnownFatalException -
createBeamRegion
public String createBeamRegion(Profile profile, double distance, Double ballRadius, Double extention) throws FileNotFoundException, KnownFatalException -
createBendingPath
-
createCheckpointFile
public void createCheckpointFile(TilingConfig tconfig, org.apache.commons.math3.geometry.euclidean.threed.Vector3D translation, Double extension, Double stepSize) throws FileNotFoundException, NotSetException - Throws:
FileNotFoundException
NotSetException
-
createEllipseProfile
-
createParticle
-
createRectProfile
public Profile createRectProfile(double xmin, double xmax, double ymin, double ymax, int xsteps, int ysteps) -
createRotation
public org.apache.commons.math3.geometry.euclidean.threed.Rotation createRotation(org.apache.commons.math3.geometry.euclidean.threed.Vector3D v1, org.apache.commons.math3.geometry.euclidean.threed.Vector3D v2, org.apache.commons.math3.geometry.euclidean.threed.Vector3D v3, org.apache.commons.math3.geometry.euclidean.threed.Vector3D v4, Double angle) -
createSequence
-
createSingleRowCover
-
createTilingConfig
public TilingConfig createTilingConfig(String elementName, Profile profile, String unit, double elevation, String outputFileFormat, double fieldScalingFactor, String tileType, String fieldType) throws FileNotFoundException - Throws:
FileNotFoundException
-
createStraightPath
public void createStraightPath(Double sx, Double sy, Double sz, Double ex, Double ey, Double ez, String elementName, Integer nSteps) throws IOException - Throws:
IOException
-
createTwiss
public TwissParameters createTwiss(Double x, Double xp, Double y, Double yp, Double ha, Double va, Double hb, Double vb, Double dispH, Double dispV, Double dispPrimeH, Double dispPrimeV, Double emH, Double emV, Double muH, Double muV, Double dpop, Double lPos) throws OutOfApertureException, KnownFatalException -
createVector3D
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D createVector3D(double x, double y, double z) -
endSequence
-
javaCall
-
createFieldMaps
public void createFieldMaps(String file, String groupName, Boolean oneByOne, int lmax, Integer pass1Lmax, Double relativeError, Boolean stat) throws IOException - Throws:
IOException
-
fieldOnCurve
public void fieldOnCurve(Map<String, Double> map, org.apache.commons.math3.geometry.euclidean.threed.Vector3D shift, String outputFile, Boolean localFrame) throws OutOfApertureException, KnownFatalException, IOException -
insertChamber
-
createVacuumChamber
-
lineOptics
public Optics lineOptics(Beam b0, Beam b1, Double stepsize, double diskRadius, String outFile, Boolean backward, Boolean writeTrajectory) throws IOException - Throws:
IOException
-
match
public Map<String,Double> match(Beam b0, Beam b1, Particle p0, Particle p1, Double diskRadius, Double stepSize, Matcher matcher, Boolean backward, String file, Double lossPenalty, TwissParameters initialTwiss) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
matchingTarget
public MatchingTarget matchingTarget(Double longiPos, String type, Double value, Double upperLimit, Double lowerLimit, Double weight) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
matchingVariable
public MatchingVariable matchingVariable(String fieldMapFile, String typeString, Double min, Double max, Double guess) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
mirrorPath
public void mirrorPath(String inFile, String outFile, String unitString) throws FileNotFoundException - Throws:
FileNotFoundException
-
orbitAtBPMs
- Throws:
IOException
-
resamplePath
public void resamplePath(String inFile, String outFile, Integer steps, Double[] distances, Double x, Double y, Double z) throws FileNotFoundException - Throws:
FileNotFoundException
-
ringOptics
public void ringOptics(Particle p1, Particle p2, Double stepsize, double diskRadius, String outFile, Integer turns, Boolean writeTrajectory) throws IOException - Throws:
IOException
-
sequenceSourcesToFile
-
setIntegrator
-
setScalings
- Throws:
Exception
-
survey
-
systemCall
- Throws:
Exception
-
track
public void track(Particle particle, Beam beam, Integer turns, Double stepSize, Double[] phoLongiPosArray, Double diskRadius, Boolean trajectoryObserver, String sigmaFile, Boolean debug, Integer threads, Boolean backward) throws KnownFatalException, IOException - Throws:
KnownFatalException
IOException
-
transformAccElement
public void transformAccElement(String name, org.apache.commons.math3.geometry.euclidean.threed.Rotation rot, org.apache.commons.math3.geometry.euclidean.threed.Vector3D translation, Boolean inverseRot, Boolean inverseTransl, String outName) throws IOException - Throws:
IOException
-
twiss
- Throws:
IOException
-
updateScalings
- Throws:
Exception
-
useSequence
-
writeSurfacePoints
- Throws:
NotSetException
-