Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed collimation examples #12

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
82f4304
Merge pull request #1 from PyORBIT-Collaboration/master
khilde May 13, 2020
427f2f1
first commit of InjectionRegion example
khilde Oct 7, 2020
06c1eac
first commit of InjectionRegion example
khilde Oct 7, 2020
c945631
restructed the optimizer so that the teapott lattice is only created …
khilde Oct 12, 2020
27a24e5
first commit of full ring code
khilde Nov 5, 2020
9149c71
updated to do stripping
khilde Jan 20, 2021
5e79c2c
adding stripping
khilde Jan 20, 2021
907960c
before fixing stripping function
khilde Mar 8, 2021
a7a8b82
before fixing stripping function
khilde Mar 8, 2021
3019bd5
before correcting for second dipole
khilde Mar 22, 2021
6ae7b42
added Waste beam
khilde Jun 2, 2021
f6655d1
added waste beam
khilde Jun 2, 2021
9dc34f0
latest version prior to onsite
khilde Jun 4, 2021
40fdc02
added in pencil beam stripping
khilde Jun 8, 2021
1a58b36
commit before cleaning up code, added being able to set initial bunch
khilde Jun 11, 2021
bb4b562
cleaned up code. changed the way stripper node is created (put alot o…
khilde Jun 11, 2021
9817e85
updated finding closed orbit scaling for chicanes to include new stri…
khilde Jun 15, 2021
6387cd1
updated
khilde Jun 29, 2021
b03347e
added tests, updated emit file to include average pz
khilde Jul 6, 2021
606d21b
added in new emmit calculation that removes dispresion from calculati…
khilde Jul 12, 2021
2879740
updated steering scripts for 3rd trajectory
khilde Jul 12, 2021
3de91a4
introduced optimizer that takes into account injected beam
khilde Jul 16, 2021
5a6c496
commiting before changing how magnetic field is setup
khilde Jul 20, 2021
d2432e2
First commit of new Generaly steering macro that reads config file
khilde Jul 22, 2021
db94320
added new Magnetic field files
khilde Jul 23, 2021
99ff285
completed general optimizer. commit before testing
khilde Jul 26, 2021
85db9a5
updated General to allow for configure files to work
khilde Jul 27, 2021
88a3631
added method 2 and 3. fixed reading in the inital angles from the chi…
khilde Aug 2, 2021
0211b89
added config script for running optimizer without strippers in closed…
khilde Aug 3, 2021
bee85d8
fixed script to allow for stripers to be excluded from closed lattice…
khilde Aug 6, 2021
028961f
created new optimizer that allows for more than 2 stripper dipole nodes
khilde Aug 10, 2021
0550475
added array config optimizer and trajectories
khilde Aug 13, 2021
04d29f8
added foil test
khilde Aug 18, 2021
83983cf
introduced method4 as well as allowing magnets to be offset. as well …
khilde Aug 20, 2021
14ca1e2
updated to PPU numbers
khilde Aug 26, 2021
2165cb5
Merge branch 'PyORBIT-Collaboration:master' into master
khilde Aug 30, 2021
2da5e29
fixed the collimation examples. Added position to creation of the col…
khilde Aug 30, 2021
a1fc49e
added sync particle test
khilde Sep 21, 2021
e5e7225
created script for adding weighted bunches together.
khilde Oct 5, 2021
0d6588c
updated emmitance growth
khilde Oct 15, 2021
22807cc
created readmes
khilde Nov 1, 2021
01eaf2f
Merge pull request #2 from khilde/development
khilde Nov 1, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Collimation/collimatebunch.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
d = 0
angle = 0

collimator =Collimator(length, ma, density_fac, shape, a, b, c, d, angle)
collimator =Collimator(length, ma, density_fac, shape, a, b, c, d, angle,0)

#------------------------------
#Main Bunch init
Expand Down
512 changes: 245 additions & 267 deletions Collimation/collimatedbunch.dat

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Collimation/lattice_with_collimator_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
d = 0
angle = 0

collimator = TeapotCollimatorNode(length, ma, density_fac, shape, a, b, c, d, angle, "Collimator 1")
collimator = TeapotCollimatorNode(length, ma, density_fac, shape, a, b, c, d, angle,0, "Collimator 1")

addTeapotCollimatorNode(teapot_latt, 18.5,collimator)
print "===========Lattice modified ======================================="
Expand Down
1,498 changes: 760 additions & 738 deletions Collimation/lostbunch.dat

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion FullSNSExample/snsring.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,14 +335,22 @@
i = 0
for node in nodes:
print i, " node=", node.getName()," s start,stop = %4.3f %4.3f "%teapot_latt.getNodePositionsDict()[node]
#if node.getName().strip() == "DH_A12":
#print node.getnParts()
print "nParts=",node.getnParts()
print "There are ", node.getNumberOfBodyChildren()," child nodes."
j=0
for childNode in node.getAllChildren():
print " ",j, " child node=", childNode.getName()
j=j+1
i=i+1

#================Do some turns===========================================

teapot_latt.trackBunch(b, paramsDict)
bunch_pyorbit_to_orbit(teapot_latt.getLength(), b, "mainbunch_1.dat")

b.dumpBunch()
sys.exit(0)
for i in xrange(99):
teapot_latt.trackBunch(b, paramsDict)

Expand Down
57 changes: 57 additions & 0 deletions InjectionRegion/BeamLatticeFiles/ClosedBeam.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#lattice info
lattice=MAD_Injection_Region_Lattice/InjectionRegionOnly_Chicane_Replaced_With_Kickers_ClosedWaste.LAT

pencilBeam=False

#whether or not to use Strippers
doDipoleStrippers=True
#whether or not stripper node can strip
firstStripperIsStripper=False
secondStripperIsStripper=False

firstStripperPositionArray=1
firstStripperPositionMax=1

#secondStripperPositionArray=-1,0
secondStripperPositionArray=-1
secondStripperPositionMax=0

useFoil=False
#adds foil to end of the indexed lattice (index starts at 0)
latticeToAddFoilTo=0

#useChicaneScaleFile=True
useChicaneScaleFile=True
chicaneScaleFile_UseScales=True
chicaneScaleFile_UsePX=False
chicaneScaleFile_UsePX_Position=6
chicaneScaleFile_UsePY=False
chicaneScaleFile_UsePY_Position=7

#would prefer to make a foil node that changes the charge or a child node that does this but this is how it done currently (using this variable)
latticeIndexToMakeBunchChargePlusOneAtEndOf=-1

#beam info
#GeV
e_kin_ini=1.3
mass=0.93827231
initial_charge=1
nParts=10000

#units [m/rad]
xOffset=0
pxOffset=0
yOffset=0
pyOffset=0

alphaZ=0.0196
betaZ=0.5844
emittZ=0.24153

alphaX=.224
betaX=10.5
emittX=1.445

alphaY=.224
betaY=10.5
emittY=1.445
57 changes: 57 additions & 0 deletions InjectionRegion/BeamLatticeFiles/ClosedBeam_Method1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#lattice info
lattice=MAD_Injection_Region_Lattice/InjectionRegionOnly_Chicane_Replaced_With_Kickers_ClosedWaste.LAT

pencilBeam=False

#whether or not to use Strippers
doDipoleStrippers=True
#whether or not stripper node can strip
firstStripperIsStripper=False
secondStripperIsStripper=False

firstStripperPositionArray=1
firstStripperPositionMax=1

#secondStripperPositionArray=-1,0
secondStripperPositionArray=-1
secondStripperPositionMax=0

useFoil=False
#adds foil to end of the indexed lattice (index starts at 0)
latticeToAddFoilTo=0

#useChicaneScaleFile=True
useChicaneScaleFile=True
chicaneScaleFile_UseScales=True
chicaneScaleFile_UsePX=False
chicaneScaleFile_UsePX_Position=6
chicaneScaleFile_UsePY=False
chicaneScaleFile_UsePY_Position=7

#would prefer to make a foil node that changes the charge or a child node that does this but this is how it done currently (using this variable)
latticeIndexToMakeBunchChargePlusOneAtEndOf=-1

#beam info
#GeV
e_kin_ini=1.3
mass=0.93827231
initial_charge=1
nParts=10000

#units [m/rad]
xOffset=0
pxOffset=0
yOffset=0
pyOffset=0

alphaZ=0.0196
betaZ=0.5844
emittZ=0.24153

alphaX=.224
betaX=10.5
emittX=1.445

alphaY=.224
betaY=10.5
emittY=1.445
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#lattice info
lattice=MAD_Injection_Region_Lattice/InjectionRegionOnly_Chicane_Replaced_With_Kickers_ClosedWaste.LAT

pencilBeam=False

#whether or not to use Strippers
doDipoleStrippers=False
#whether or not stripper node can strip
firstStripperIsStripper=False
secondStripperIsStripper=False

firstStripperPositionArray=1
firstStripperPositionMax=1

#secondStripperPositionArray=-1,0
secondStripperPositionArray=-1
secondStripperPositionMax=0

useFoil=False
#adds foil to end of the indexed lattice (index starts at 0)
latticeToAddFoilTo=0

#useChicaneScaleFile=True
useChicaneScaleFile=True
chicaneScaleFile_UseScales=True
chicaneScaleFile_UsePX=False
chicaneScaleFile_UsePX_Position=6
chicaneScaleFile_UsePY=False
chicaneScaleFile_UsePY_Position=7

#would prefer to make a foil node that changes the charge or a child node that does this but this is how it done currently (using this variable)
latticeIndexToMakeBunchChargePlusOneAtEndOf=-1

#beam info
#GeV
e_kin_ini=1.3
mass=0.93827231
initial_charge=1
nParts=10000

#units [m/rad]
xOffset=0
pxOffset=0
yOffset=0
pyOffset=0

alphaZ=0.0196
betaZ=0.5844
emittZ=0.24153

alphaX=.224
betaX=10.5
emittX=1.445

alphaY=.224
betaY=10.5
emittY=1.445
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#lattice info
lattice=MAD_Injection_Region_Lattice/InjectionRegionOnly_Chicane_Replaced_With_Kickers_ClosedWaste.LAT

pencilBeam=False

#whether or not to use Strippers
doDipoleStrippers=False
#whether or not stripper node can strip

useFoil=False
#adds foil to end of the indexed lattice (index starts at 0)
latticeToAddFoilTo=0

#useChicaneScaleFile=True
useChicaneScaleFile=True
chicaneScaleFile_UseScales=True
chicaneScaleFile_UsePX=False
chicaneScaleFile_UsePX_Position=6
chicaneScaleFile_UsePY=False
chicaneScaleFile_UsePY_Position=7

#would prefer to make a foil node that changes the charge or a child node that does this but this is how it done currently (using this variable)
latticeIndexToMakeBunchChargePlusOneAtEndOf=-1

#beam info
#GeV
e_kin_ini=1.3
mass=0.93827231
initial_charge=1
nParts=10000

#units [m/rad]
xOffset=0
pxOffset=0
yOffset=0
pyOffset=0

alphaZ=0.0196
betaZ=0.5844
emittZ=0.24153

alphaX=.224
betaX=10.5
emittX=1.445

alphaY=.224
betaY=10.5
emittY=1.445
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#lattice info
lattice=MAD_Injection_Region_Lattice/InjectionRegionOnly_Chicane_Replaced_With_Kickers_ClosedWaste.LAT

pencilBeam=False

#whether or not to use Strippers
doDipoleStrippers=False
#whether or not stripper node can strip

useFoil=False
#adds foil to end of the indexed lattice (index starts at 0)
latticeToAddFoilTo=0

#useChicaneScaleFile=True
useChicaneScaleFile=True
chicaneScaleFile_UseScales=True
chicaneScaleFile_UsePX=False
chicaneScaleFile_UsePX_Position=6
chicaneScaleFile_UsePY=False
chicaneScaleFile_UsePY_Position=7

#would prefer to make a foil node that changes the charge or a child node that does this but this is how it done currently (using this variable)
latticeIndexToMakeBunchChargePlusOneAtEndOf=-1

#beam info
#GeV
e_kin_ini=1.3
mass=0.93827231
initial_charge=1
nParts=10000

#units [m/rad]
xOffset=0
pxOffset=0
yOffset=0
pyOffset=0

alphaZ=0.0196
betaZ=0.5844
emittZ=0.24153

alphaX=.224
betaX=10.5
emittX=1.445

alphaY=.224
betaY=10.5
emittY=1.445
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#lattice info
lattice=MAD_Injection_Region_Lattice/InjectionRegionOnly_Chicane_Replaced_With_Kickers_ClosedWaste.LAT

pencilBeam=False

#whether or not to use Strippers
doDipoleStrippers=False
#whether or not stripper node can strip

useFoil=False
#adds foil to end of the indexed lattice (index starts at 0)
latticeToAddFoilTo=0

#useChicaneScaleFile=True
useChicaneScaleFile=True
chicaneScaleFile_UseScales=True
chicaneScaleFile_UsePX=False
chicaneScaleFile_UsePX_Position=6
chicaneScaleFile_UsePY=False
chicaneScaleFile_UsePY_Position=7

#would prefer to make a foil node that changes the charge or a child node that does this but this is how it done currently (using this variable)
latticeIndexToMakeBunchChargePlusOneAtEndOf=-1

#beam info
#GeV
e_kin_ini=1.3
mass=0.93827231
initial_charge=1
nParts=10000

#units [m/rad]
xOffset=0
pxOffset=0
yOffset=0
pyOffset=0

alphaZ=0.0196
betaZ=0.5844
emittZ=0.24153

alphaX=.224
betaX=10.5
emittX=1.445

alphaY=.224
betaY=10.5
emittY=1.445
Loading