Download presentation
Presentation is loading. Please wait.
Published byScot Spencer Modified over 9 years ago
1
12/3/2015J-PARC1 High Level Physics Applications XAL – An Accelerator Hierarchy Day 1: Accelerator View from the Physicist
2
June 16-27, 2008USPAS2 Tree Structure Data Representation Commonly used structure in computer science
3
Accelerator Hierarchy Accelerator hierarchy from the accelerator physicist point-of-view
4
Advantages to using Accelerator Hierarchies Straightforward to create general purpose applications that can applied to multiple parts of the accelerator Getting ready for commissioning new parts of the accelerator just requires creating the definition of the new sequences Allows writing applications from the “physicist or commissioner’s point of view As opposed to creating many specific applications, each pertinent to only one special part of the accelerator Easily adaptable Can add new sequences, nodes, etc.
5
Accelerator Hierarchies The concept of using an Accelerator hierarchy is not unique: UAL (Java - http://www.ual.bnl.gov)http://www.ual.bnl.gov Online and offline accelerator modeling Used at BNL CDeV (http://www.jlab.org/cdev/)http://www.jlab.org/cdev/ Developed at JLab Interface to control system MAD 8 (http://hansg.home.cern.ch/hansg/mad/mad8/mad8.html ) MAD with C++ Class structure Used for optics modeling LEGO SLAC (beamline modeling, C++) Many others We will use XAL as the vehicle for exploring accelerator class structures – see JavaDoc
6
Accelerator Tree The accelerator can be a big mess – a collection of many different linear accelerators, transport lines, rings, etc.
7
The Accelerator (gov.sns.xal.smf.Accelerator) The accelerator is the highest level interface to information you need This object contains everything you want to know, but were afraid to ask, about the accelerator Typically all this information is stored in a permanent, semi-static data source (e.g. a database). At SNS the database schema does not directly reflect the XAL class structure – it must meet the needs of many other groups In XAL, we use an XML representation of the accelerator as the immediate data source for applications The XML can be automatically generated from a database – recommended This file reflects the class structure used in XAL Details on the XML file specifics will be covered later
8
XML Accelerator Representation (To be covered in more detail later) XML is a convenient text form to represent structured data Fast enough to parse an entire accelerator (35 k lines) ~ 1 second XML file is generated from a database representation for SNS Can easily add temporary “bad status” flags for broken equipment that may be quickly repaired. Databases tend to be more tightly configuration controlled
9
Getting the Accelerator in XAL From an XML file, use methods in the class gov.sns.xal.smf.data.XMLDataManager If you have set a default accelerator using the optics switcher application: Accelerator accelerator = XMLDataManager.loadDefaultAccelerator()loadDefaultAccelerator Or manually read an accelerator from a file: Accelerator accel = XMLDataManager.acceleratorWithPath(java.lang.String filePath)acceleratorWithPath + many other options
10
Accelerator Sequence (gov.sns.xal.smf.AcceleratorSeq )gov.sns.xal.smf.AcceleratorSeq Sequences are contiguous sections of beamline that are logically related They are defined so that they may conveniently pasted together, e.g. whenever there is a “fork in the road”, create a new sequence Longer sequences can be composed as collections of connected sequences Sequences have names, lengths and allowed predecessors Each colored section can be a different sequence
11
Getting a Sequence from an Accelerator Get a single specified sequence you are interested in: AcceleratorSeq sequence = accelerator.getSequence(“seqName”) Or you can paste together a collection of sequences # Make a list containing sequences we'd like to paste together list = ArrayList(); list.add(lebt) list.add(rfq); list.add(mebt); list.add(dtl1); # make the new "combo" sequence containing the stuff we want: newSeq = AcceleratorSeqCombo("testSeq", list);
12
Sequences Sequences are the component that many applications work with Display a beam trajectory through a part of the machine Set the RF phase and amplitude for a Drift Tube Linac Tank Make a bump in the beam trajectory in a section General purpose application will first select a sequence and then perform its function on this piece of accelerator See gov.sns.xal.samples.xalSeqs.py for example usage
13
Sequences contain Nodes (gov.sns.xal.smf.AcceleratorNode) A node is an abstract representation of a beamline element that you’d likely be interested in using when writing a high level application: Magnet, RF cavity, diagnostic device, … Nodes are real pieces of equipment, typically in or near a beamline No drift spaces are included – these are calculated later – stay tuned Drift spaces between pieces of equipment are NOT included (stay tuned for the lattice view) Nodes have properties including name, distance from start of the sequence, status, etc. Location refers to the longitudinal center of the device Nodes can be at the same location E.g. Quadrupole magnet with dipole corrector windings The same device can be in two sequences Nodes have methods that can be used to get/put information directly to/from the machine
14
Node types (see interface gov.sns.xal.smf.AcceleratorSeq ) gov.sns.xal.smf.AcceleratorSeq Magnets – to affect the transverse dynamics of the beam RF cavities – to affect the longitudinal dynamics of the beam Beam Position Monitor (BPM) – to measure the transverse (and sometimes longitudinal) position of the beam Beam Current Monitor (BCM) – to measure the beam intensity See gov.sns.xal.samples.xalNodes.py for example usage
15
XAL Node Types used at SNS Bend BLM BPM CCL CurrentMonitor CvgGauge Dipole DTLTank Electromagnet ExtractionKicker GenericNode HDipoleCorr IonGauge Magnet MagnetMainSupply MagnetPowerSupply MagnetTrimSupply Marker NeutronDetector PermanentMagnet PermQuadrupole ProfileFit ProfileMonitor Quadrupole ReBuncher RfCavity RfGap RingBPM SCLCavity Sextupole Solenoid TrimmedQuadrupole Vacuum VDipoleCorr
16
What should be an AcceleratorNode ? A single piece of hardware may contain several components that affect the beam in different ways At SNS we have a “quadrupole” with dipole windings and a BPM inside it Treat it as 3 separate items – all at the same location Quadrupole Dipole corrector BPM Nodes are “hardware” devices No drift spaces are included in the accelerator XML description – this comes later with the model view creation
17
Getting a Node Node types have identification strings (e.g. “Q” for quad) Nodes can be selected from a sequence by type quads = sequence.getNodesOfType("Q") Magnets = sequence.getNodesOfType(“magnet") You can use and create filters (and / or etc.) Package gov.sns.xal.smf.impl.qualify See gov.sns.xal.samples.Qualifier.py for usage examples Many nodes have convienience methods to directly perform operations BPM – get beam position Magnet – get magnetic field Typically blocking actions
18
Name Conventions Hardware devices in accelerators typically follow a naming convention This is a good thing Typical naming pattern = Sequence:device_type:instance Control system signals extend from this The class hierarchy (Accelerator / Sequence / Node) allows structuring with no name convention requirement Relying on a name convention to specify a hierarchy is error prone You will likely end up with exceptions High maintenance
19
How are Nodes Connected to Signals in XAL? A Node can have a “ChannelSuite” – a collection of control system channels associated with this node Each element of the suite is a handle-signal pair, where the handle is used in XAL, and the pair is created in the XML file Thus if a control system channel is changed, the XAL software does not have to change Example: …
20
XAL Nodes Often have Transparent Machine Interfaces Many node types have convenience methods to get information directly from the machine without using Channel Access Magnets: getField(), setField() BPMs: getXAvg(), getYAvg() All the connection details are hidden The connections are blocking however – so use with care
21
Getting a Channel from a Node Sometimes it is useful to work directly with channels rather than use the convienience methods Example accelerator= XMLDataManager.loadDefaultAccelerator() sequence = accelerator.getSequence(“DTL5”) node = sequence.getNode(“DTL_Mag:DCH513”) channel = node.getChannel(“fieldRB”) value = channel.getValueRecord().doubleValue()
22
Magnet Nodes Magnets are the primary means on beam manipulation in the transverse plane in accelerators Some issues concerning organization / class structure Permanent magnets, electro magnets Dipoles for bending, quadrupoles for focusing, sextupoles for chromaticity correction Main magnets, corrector or trim magnets Several magnets may be on a common power supply, magnets on a single power supply
23
Magnet Nodes Methods for getting and setting field levels Details of channel connection are taken care of getField() – returns the field (XAL uses MKS units, i.e. T/m n, where n = 0 for dipole, 1 for quad, etc.) setField(xxx) Also are methods for current etc.
24
Magnet Perspectives From the beam’s point of view: A magnet produces a field(s) of a certain multipole(s) May also include a trim power supply Usually field readback is the proper value to use (includes the effects of all power supplies connected to this magnet) From the machine/physicist or operator’s point of view You adjust a power supply to change magnetic fields Multiple magnets may be connected to a power supply Power Supplies have a setpoint that controls all magnets associated with them in both the real world and XAL
25
Power Supplies and Magnets The user interacts with power supplies to affect the beam – this may actually modify the field in multiple magnets though – be careful!!! More than one power supply may be connected to the same Magnet ! Power supplies have limits (e.g. max. current, max. field) In XAL these limits are the most constraining of the power-supply itself, any magnet that may be connected to it, the cable/bus-bar, etc. The power supply contains limits that may be useful in model calculations Most of the power supply limit methods are aliased through the Magnet devices themselves
26
Power Supplies Power Supplies have setpoints and readbacks (current + Field) A P.S. field value is an average of all magnets connected to it A trim power supply is usually attached to a single magnet The field and surrent associated with the Trim methods are only the contributions of the Trim Power Supply See gov.sns.xal.smf.MagnetPowerSupply.java, gov.sns.xal.smf.MagnetMainPowerSupply.java, gov.sns.xal.smf.MagnetTrimPowerSupply.java
27
BPMs (diagnostic example) The most fundamental information a beam position monitor returns is the beam position getXAvg(), getYAvg() – returns the beam position as last measured by the BPM in meters All control system connection details are hidden. Note: Users usually deal with position in mm – so many applications convert to mm for input /output When collecting many BPM signals (e.g. to calculate the beam trajectory) you need to consider verifying that the results are correlated (i.e. all from the same beam pulse, or for the same conditions). Use low beam rep-rate Use the correlator tool to compare timestamps on the signals
28
Summary: Hierarchal View of an Accelerator The organization follows the natural working view of the machine This structure facilitates the writing of general purpose software Many applications can share the same accelerator browsing methods, look and feel. Provides a natural framework to build on Is configurable from a single data-source (e.g. database) This is a view of the hardware devices – not yet appropriate for a model
29
XAL Package Organization (More than just Accelerator Hierarchy) ItemPackage (Location) Accelerator Hierarchygov.sns.xal.smf Application Frameworkgov.sns.application Channel Accessgov.sns.ca General Toolsgov.sns.tools Scriptsgov/sns/scripts Applicationsgov.sns.apps Online Modelgov.sns.xal.model Servicesgov.sns.services
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.