AccNode#

class orbit.lattice.AccNode(name='no name', type_in='generic')[source]#

Bases: orbit.utils.NamedObject.NamedObject, orbit.utils.TypedObject.TypedObject, orbit.utils.ParamsDictObject.ParamsDictObject

Class. Base class of the accelerator nodes hierarchy.

Attributes Summary

AFTER

BEFORE

BODY

ENTRANCE

EXIT

Methods Summary

addChildNode(node, place[, part_index, ...])

Method.

getActivePartIndex()

Method.

getAllChildren()

It returns the list of all children of this node.

getBodyChildren()

Returns the array of direct childrens of this accelerator node that are inside the element, not before or after.

getChildNodes(place[, part_index, place_in_part])

Method.

getLength([index])

Method.

getNumberOfBodyChildren()

Returns the total number of direct childrens of this accelerator node that are inside the element, not before or after.

getNumberOfChildren()

Returns the total number of direct children of this accelerator node.

getnParts()

Method.

initialize()

Abstract method.

reverseOrder()

This method is used for a lattice reversal and a bunch backtracking.

reverseOrderNodeSpecific()

This method is used for a lattice reversal and a bunch backtracking This is a node type specific method.

setActivePartIndex(activePartIndex)

Method.

setLength([L, index])

Method.

setnParts([n])

Method.

structureToText([txt, txt_shift])

This method write the structure of the node to the text variable recursively.

trackActions(actionsContainer[, paramsDict])

Method.

Attributes Documentation

AFTER = 1#
BEFORE = 0#
BODY = 1#
ENTRANCE = 0#
EXIT = 2#

Methods Documentation

addChildNode(node, place, part_index=0, place_in_part=0)[source]#

Method. Adds a child node to the list defined by place and (maybe) part index and place in the part (before or after). The action of the child occurs after the action of the parent at the entrance and before at the exit.

getActivePartIndex()[source]#

Method. Returns the active part index of the node.

getAllChildren()[source]#

It returns the list of all children of this node. The list includes children at entance, in body, and at exit.

getBodyChildren()[source]#

Returns the array of direct childrens of this accelerator node that are inside the element, not before or after.

getChildNodes(place, part_index=0, place_in_part=0)[source]#

Method. Returns a list of all children specified by place and (maybe) part index and place in the part (before or after).

getLength(index=- 1)[source]#

Method. Returns the physical length of a node or a part if index > 0.

getNumberOfBodyChildren()[source]#

Returns the total number of direct childrens of this accelerator node that are inside the element, not before or after.

getNumberOfChildren()[source]#

Returns the total number of direct children of this accelerator node.

getnParts()[source]#

Method. Returns the number of body parts in the node.

initialize()[source]#

Abstract method. Must be implemented if the length distribution of body parts is not uniform.

reverseOrder()[source]#

This method is used for a lattice reversal and a bunch backtracking. This method will reverse the order of the children nodes and their positions in the parent node node. It will apply the reverse recursively to the all children nodes. It also will call a node specific reversal procedure that can be needed internally, like the field distribution etc. Here this node specific reversal method should be empty.

reverseOrderNodeSpecific()[source]#

This method is used for a lattice reversal and a bunch backtracking This is a node type specific method. Here it is empty. It should be redefined in the subclasses.

setActivePartIndex(activePartIndex)[source]#

Method. Sets the active part index of the node. Please, use this method with cautions, because it was not intended for a routine use.

setLength(L=0.0, index=- 1)[source]#

Method. Sets the physical length of a node or a part if index > 0.

setnParts(n=1)[source]#

Method. Sets the number of body parts of the node.

structureToText(txt='', txt_shift='')[source]#

This method write the structure of the node to the text variable recursively.

trackActions(actionsContainer, paramsDict={})[source]#

Method. Tracks the actions through the accelerator node.