Extraction data multi-bunch

Moderators: cyao, michael_borland

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

Extraction data multi-bunch

Post by simona.bettoni » 05 Apr 2022, 08:42

Dear moderators,
I am trying to simulate a multi-bunch. I used this:

&sdds_beam
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,
&end

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.

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

Re: Extraction data multi-bunch

Post by michael_borland » 23 May 2022, 11:48

Simona,

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.

--Michael

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

Re: Extraction data multi-bunch

Post by simona.bettoni » 24 May 2022, 07:14

Dear Michael,
many thanks for your reply.
Kind regards,
Simona.

Post Reply