Help with generating sdds_bunch
Moderators: cyao, michael_borland
Help with generating sdds_bunch
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
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
-
- Posts: 1951
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Help with generating sdds_bunch
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
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.
Re: Help with generating sdds_bunch
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
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 291 times
-Neeraj
-
- Posts: 1951
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Help with generating sdds_bunch
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
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
Re: Help with generating sdds_bunch
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.
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 267 times
-
- Posts: 1951
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Help with generating sdds_bunch
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
use
then
See attached file.
--Michael
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
Code: Select all
&alter_elements name=Q, item=TOTAL, value="(<QnC> 1e9 /)" &end
Code: Select all
mpiexec -np 128 Pelegant MBITemplate.ele -macro=QnC=176
--Michael
- Attachments
-
- MBITemplate.ele
- (1.12 KiB) Downloaded 279 times
Re: Help with generating sdds_bunch
Hi Michael,
Thank you very much. It worked.
--Mina
Thank you very much. It worked.
--Mina