Help with generating sdds_bunch

Moderators: cyao, michael_borland

Post Reply
Neeraj
Posts: 23
Joined: 24 May 2018, 10:42

Help with generating sdds_bunch

Post by Neeraj » 12 Jun 2018, 09:56

Hi all,

I have the phase space of bunches after degradation and collimation, generated by Geant4 code (in .root, .csv or .txt format). I need a little help feeding these distributions to sdds_bunch to track them through a transport line. Is there a conversion tool or C++ library that can convert CSV files to sdds format? Or is there a manual way to go about it by imitating the parameter and column names?

Thanks
-Neeraj
-Neeraj

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

Re: Help with generating sdds_bunch

Post by michael_borland » 12 Jun 2018, 13:13

Neeraj,

You can use the program csv2sdds for comma-separated-values data, or plaindata2sdds for more general data. Following that, you will probably need to use sddsprocess to convert to the quantities and units needed by elegant
  • t --- arrival time in seconds
  • p --- momentum (beta*gamma)
  • x, y --- horizontal and vertical coordinates in meters
  • xp, yp --- horizontal and vertical slopes (dx/dz, dy/dz). Dimensionless.
--Michael

Neeraj
Posts: 23
Joined: 24 May 2018, 10:42

Re: Help with generating sdds_bunch

Post by Neeraj » 14 Jun 2018, 09:04

Michael,

Thanks for the instructions. I have converted a csv file into sdds with the column names and units as specified in the csv2sdds section of the sdds toolkit manual. However, loading the bunch to elegant file gives me problems. I get the error:
------------
File bunch1.sdds opened and checked.
Read page 1 from file
0 particle ID slots per bunch
60 rows in page 1
File bunch1.sdds was used up and closed.
a total of 60 data points were read

No particles left in input file(s)
error: no particles in input file
------------

I do not have a particle ID column. Could this be the problem?
Truncated versions of files and scripts that I am using are attached.
In my text file (bunch1.txt), the columns are: TOF [s], p[beta*gamma], x[m], xp, y[m], yp, z[m], zp

Best,
Neeraj
Attachments
sddsBeamHelp.tar.gz
(7.15 KiB) Downloaded 256 times
-Neeraj

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

Re: Help with generating sdds_bunch

Post by michael_borland » 15 Jun 2018, 08:43

Neeraj,

The problem is with our .ele file. You need to set reuse_bunch=1 in the &sdds_beam command, so that the optimization tracking will use the same page of the file repeatedly.

--Michael

Neeraj
Posts: 23
Joined: 24 May 2018, 10:42

Re: Help with generating sdds_bunch

Post by Neeraj » 18 Jun 2018, 03:26

It works now. Thanks Michael.
-Neeraj

Akhyani
Posts: 16
Joined: 26 Jun 2018, 08:09

Re: Help with generating sdds_bunch

Post by Akhyani » 09 Mar 2019, 04:31

Dear Michael,

I have faced the same issue while I wanted to scan bunch current for multi-bunch tracking. I added reuse_bunch = 1 in &sdds_beam. Everything is OK, but it sticks in tracking the particles, writing:

tracking 1400000 particles

and nothing happens then. I attached the files for you. Any help will be appreciated.
Attachments
MBTracking.rar
(9.4 MiB) Downloaded 226 times

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

Re: Help with generating sdds_bunch

Post by michael_borland » 11 Mar 2019, 11:05

Reusing the bunch is incompatible with duplicating the bunch for multi-bunch tracking; I'll try to fix this for the next release in a few months.

However, since multi-bunch tracking is very time-consuming, I suggest breaking the run up into several runs. The easy way to do this is with the macro substitution option. E.g., instead of

Code: Select all

&vary_element name=Q, item=TOTAL, enumeration_file = scan1.sdds, enumeration_column = I, index_number=0, index_limit=6 &end
use

Code: Select all

&alter_elements name=Q, item=TOTAL, value="(<QnC> 1e9 /)" &end
then

Code: Select all

mpiexec -np 128 Pelegant MBITemplate.ele -macro=QnC=176
See attached file.

--Michael
Attachments
MBITemplate.ele
(1.12 KiB) Downloaded 235 times

Akhyani
Posts: 16
Joined: 26 Jun 2018, 08:09

Re: Help with generating sdds_bunch

Post by Akhyani » 12 Mar 2019, 10:16

Hi Michael,

Thank you very much. It worked.

--Mina

Post Reply