Page 1 of 1

Extraction data multi-bunch

Posted: 05 Apr 2022, 08:42
by simona.bettoni
Dear moderators,
I am trying to simulate a multi-bunch. I used this:

input = "distr_matched_ok.sdds",
input_type = "elegant",
center_arrival_time = 1,
sample_interval = 5,
reuse_bunch = 0,
fiducialization_bunch = 0, !I phase with respect to the first bunch
n_duplicates = 1, ! I duplicate once
duplicate_stagger[4] = 1e-12, !time distance among two subsequent bunches 3.5714e-10, but for test I put a small value to use the wakefield file I have
duplicate_stagger[1] = 20e-6, ! artificially added to check the plot of the centroid
track_pages_separately = 0,
use_bunched_mode = 1,

and I saw several bunches when I plot the .out space. I would like to know how I can extract the data for each single bunch. I guessed that there were in several pages, so I tried to use -fromPage -toPage, but clearly I was wrong.
When I plot the centroid (I added an offset just to see), I plot I think an average of the two bunches.
How should I do?
I am using Elegant on a cluster, and I do not have generateBunch installed.
Thanks in advance for any suggestion.

Re: Extraction data multi-bunch

Posted: 23 May 2022, 11:48
by michael_borland

The particles can be grouped into bunches using the particleID property.

If your beam input file has the IDSlotsPerBunch parameter, then the particleID for each successive bunch is offset by that amount. E.g., If IDSlotsPerBunch=1000, then bunch n has the particleID values offset by n*1000 relative to the values in the input file. It is the user's responsibility to ensure that the particleID values in the input file are in the range [1,1000].

If your beam input file does not have the IDSlotsPerBunch parameter, then elegant assumes IDSlotsPerBunch=(number of input particles) and applies the same method to get the particleIDs for the duplicate particles.

The WATCH element can be set up with lower and upper limits for the particleID, which allows specifying analysis or output for a bunch or group of bunches. To do this, use the START_PID and END_PID parameters. Also, you can use sddsprocess to filter particle output files according to the particle ID, e.g.,

Code: Select all

sddsprocess coordinates.sdds bunch2.sdds -define=col,Bunch,"particleID 1 - IDSlotsPerBunch / 1 + int",type=long -filter=col,Bunch,2,2
This assumes that bunch 1 has particleIDs:[1,1000], bunch 2:[1001,2000], etc.


Re: Extraction data multi-bunch

Posted: 24 May 2022, 07:14
by simona.bettoni
Dear Michael,
many thanks for your reply.
Kind regards,