From 8d9f7e1fc9b45e2d6ace6b890a1906e739c5f680 Mon Sep 17 00:00:00 2001 From: shishlo Date: Wed, 27 Dec 2023 10:33:28 -0500 Subject: [PATCH 1/2] The Bunch Wrapper nodes were added to the Body of any node as child nodes. That created a problem for changing the number of parts in the node even right after the lattice creation. It was wrong. Now the Bunch Wrappers added to the entrance and exit of all non-zero length nodes. --- py/orbit/teapot/teapot.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/py/orbit/teapot/teapot.py b/py/orbit/teapot/teapot.py index 67874a98..a0bcd4fb 100755 --- a/py/orbit/teapot/teapot.py +++ b/py/orbit/teapot/teapot.py @@ -165,9 +165,14 @@ def _addChildren(self): """ TEAPOT_Lattice.initialize(self) for node in self.getNodes(): - bunchwrapper = BunchWrapTEAPOT("Bunch Wrap") - bunchwrapper.getParamsDict()["ring_length"] = self.getLength() - node.addChildNode(bunchwrapper, AccNode.BODY) + length = node.getLength() + if(length > 0.): + bunchwrapper = BunchWrapTEAPOT(node.getName()+":Bunch_Wrap:Entrance") + bunchwrapper.getParamsDict()["ring_length"] = self.getLength() + node.addChildNode(bunchwrapper, AccNode.ENTRANCE) + bunchwrapper = BunchWrapTEAPOT(node.getName()+":Bunch_Wrap:Exit") + bunchwrapper.getParamsDict()["ring_length"] = self.getLength() + node.addChildNode(bunchwrapper, AccNode.EXIT) #---- adding turn counter node at the end of lattice turn_counter = TurnCounterTEAPOT() self.getNodes().append(turn_counter) From d9af1ccf7956e77134eed14dc128700b99b0990e Mon Sep 17 00:00:00 2001 From: shishlo Date: Thu, 28 Dec 2023 09:38:36 -0500 Subject: [PATCH 2/2] Update TEAPOT_Ring class in teapot.py We do not need 2 bunch wrapping at once The Bunch Ring Wrapping node at the entrance of the acc. element was removed, because wrapping will be done at the entrance of the next acc. node. --- py/orbit/teapot/teapot.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/py/orbit/teapot/teapot.py b/py/orbit/teapot/teapot.py index a0bcd4fb..63c3d6fb 100755 --- a/py/orbit/teapot/teapot.py +++ b/py/orbit/teapot/teapot.py @@ -167,9 +167,6 @@ def _addChildren(self): for node in self.getNodes(): length = node.getLength() if(length > 0.): - bunchwrapper = BunchWrapTEAPOT(node.getName()+":Bunch_Wrap:Entrance") - bunchwrapper.getParamsDict()["ring_length"] = self.getLength() - node.addChildNode(bunchwrapper, AccNode.ENTRANCE) bunchwrapper = BunchWrapTEAPOT(node.getName()+":Bunch_Wrap:Exit") bunchwrapper.getParamsDict()["ring_length"] = self.getLength() node.addChildNode(bunchwrapper, AccNode.EXIT)