Phasing and two bunches

Moderators: cyao, michael_borland

Post Reply
simona.bettoni
Posts: 45
Joined: 06 Jul 2011, 03:14

Phasing and two bunches

Post by simona.bettoni » 05 Aug 2014, 06:22

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.

michael_borland
Posts: 1927
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Phasing and two bunches

Post by michael_borland » 05 Aug 2014, 08:30

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
Attachments
twoBunchPhasing.zip
(1.81 KiB) Downloaded 165 times

simona.bettoni
Posts: 45
Joined: 06 Jul 2011, 03:14

Re: Phasing and two bunches

Post by simona.bettoni » 05 Aug 2014, 09:56

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.

michael_borland
Posts: 1927
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Phasing and two bunches

Post by michael_borland » 05 Aug 2014, 10:09

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

simona.bettoni
Posts: 45
Joined: 06 Jul 2011, 03:14

Re: Phasing and two bunches

Post by simona.bettoni » 05 Aug 2014, 10:11

Perfect!
Many thanks,
Simona.

Post Reply