Page 1 of 1
Phasing and two bunches
Posted: 05 Aug 2014, 06:22
by simona.bettoni
Hello,
I have a distribution which is given by two different bunches. These are both in the same file. I would like to phase all the linac with respect to one of the two. I think I have to use the command first_is_fiducial, but I need to say to Elegant which is the first bunch. Have I to put the bunches in two pages? I do not find how to do it.
Thanks in advance,
Simona.
Re: Phasing and two bunches
Posted: 05 Aug 2014, 08:30
by michael_borland
Simona,
This is a bit tricky to set up. You have to use both first_is_fiducial=1 and reset_rf_for_each_step=0 in &run_setup, along with track_pages_separately=1 in &sdds_beam. The linac will be phased to the first bunch (there's no straightforward way in elegant to phase it to the second).
See attached example.
--Michael
Re: Phasing and two bunches
Posted: 05 Aug 2014, 09:56
by simona.bettoni
Thanks for your answer and the example. If I correctly understood you defined 3 gaussians of 1000 particles each. I have an Astra simulations with two "deformed" gaussian coming out and I do not know how to say to Elegant that one is bunch 1 and that the other one is bunch 2. I can separate them in time for sure and generate two files, but, how can I do the two pages? Is it enough I put two headers: one before each bunch or have I to do it differently?
Thanks again,
Simona.
Re: Phasing and two bunches
Posted: 05 Aug 2014, 10:09
by michael_borland
Simona,
I generated two bunches (n_steps=2 in &run_control in makeBeam.ele).
For your case, try the following:
Code: Select all
sddssort astraOutput.sdds -pipe=out -column=t \
| sddsbreak -pipe=in astraOutput2Page.sdds -gapin=t,amount=10e-12
This sorts the particles into time order, then breaks the file into pages when there is a gap of 10 ps in the time values. The file astraOutput2Page.sdds would be used with &sdds_beam. Adjust the 10e-12 value to suit your particular case.
If you already have the two bunches in two files, you can combine them using
Code: Select all
sddscombine file1.sdds file2.sdds file3.sdds
then use file3.sdds with &sdds_beam
Alternatively, use
Code: Select all
&sdds_beam
input_list = "file1.sdds file2.sdds"
track_pages_separately = 1
&end
--Michael
Re: Phasing and two bunches
Posted: 05 Aug 2014, 10:11
by simona.bettoni
Perfect!
Many thanks,
Simona.