touschek_scatter

Moderators: cyao, michael_borland

NicolaCarmignani
Posts: 8
Joined: 20 Dec 2012, 08:33

touschek_scatter

Post by NicolaCarmignani » 20 Jun 2013, 06:43

Hello,
I'd like to use the touschek_scatter Elegant command, but I don't understand how it works.
In the Elegant examples directory there are not examples about that command. Could someone post an input file?
Thanks
Nicola

xiaoam
Posts: 17
Joined: 12 Jun 2008, 09:27

Re: touschek_scatter

Post by xiaoam » 20 Jun 2013, 10:24

Nicola,

We will post an example shortly to the example site. Here is a quick apply.
Input file needed: *.lte *.mmap (calculated from "momentum_aperture" command)

1. Add TSCATTER element to your beamline if you don't have it in your *.lte file. If you use this command you have to run step 4 at least (or most) once. Example shows adding TSCATTER after each Quad, Bend and Sext element.
&insert_elements
name = *,
type = *[QSB]*,
skip = 1,
element_def = "TEST: TSCATTER",
&end
2. Set up run
&run_control
n_steps = 1,
n_passes=10,
&end
3. Calculate Twiss
&twiss_output
filename=%s.twi,
matched = 1,
radiation_integrals = 1,
concat_order=2
&end
4. Calculate momentum (You need to run this step at least once to include TSCATTER element to the *.mmap file. Once you have the file, you can omit this step)
&momentum_aperture
...
&end
5. Setup touschek_scatter calculation (Try different values to understand how each option works)
&touschek_scatter
charge = 1.565e-08,
frequency = 6.517227347826086e+06
emit_x = 3e-09,
emit_y = 3e-11,
sigma_dp = 9.6e-04,
sigma_s = 6e-03,
distribution_cutoff[0] = 3.000000000000000e+00, 3.000000000000000e+00, 3.000000000000000e+00,
Momentum_Aperture = <*.mmap>, (your momentum aperture file here)
Momentum_Aperture_scale = 1,
bunch = %s-%03ld.bun,
! loss = %s-%03ld.los,
distribution = %s-%03ld.dis,
initial = %s-%03ld.ini,
! n_simulated = 500,
! output = %s-%03ld.out,
nbins = 100,
ignored_portion = 5.000000000000000e-03,
i_start = 1,
i_end = 15,
do_track = 0,
verbosity = 1,
&end

aimin

NicolaCarmignani
Posts: 8
Joined: 20 Dec 2012, 08:33

Re: touschek_scatter

Post by NicolaCarmignani » 20 Jun 2013, 12:13

Thanks Aimin.
I'd like to track the scattered particles up to when they are lost, to see where the particles are lost, but I think it is not possible, because you can track just for one turn.

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

Re: touschek_scatter

Post by michael_borland » 21 Jun 2013, 08:07

Nicola,

You can track for many turns. In Aimin's example, she set the tracking for 10 turns (n_passes = 10).

--Michael

NicolaCarmignani
Posts: 8
Joined: 20 Dec 2012, 08:33

Re: touschek_scatter

Post by NicolaCarmignani » 21 Jun 2013, 08:22

Michael,
in the guide there is written:
Scattered particles can be tracked through the entire beamline (one pass only)
I will try with many passes.
Thanks
Nicola

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

Re: touschek_scatter

Post by michael_borland » 21 Jun 2013, 08:26

Nicola,

The guide seems to be wrong. I checked the code and it should track n_passes turns.

--Michael

marlibgin
Posts: 54
Joined: 15 Mar 2011, 12:43

Re: touschek_scatter

Post by marlibgin » 06 Mar 2014, 11:36

Dear All
is there a working example on touschek_scatter? how/where to place t he TSCATTER element?, I have been trying to follow the given
instructions but can't make it work at all.
I am surely doing something silly and an example would probably help a lot.
Thanks in advance and kind regards

Marco

xiaoam
Posts: 17
Joined: 12 Jun 2008, 09:27

Re: touschek_scatter

Post by xiaoam » 06 Mar 2014, 12:18

Macro,

See attached example. Since Touschek scattering rate depends on local optical function, you should insert the element at places that make a good sample of the variation.

aimin
Attachments
touschekExample.zip
(199.38 KiB) Downloaded 820 times

marlibgin
Posts: 54
Joined: 15 Mar 2011, 12:43

Re: touschek_scatter

Post by marlibgin » 07 Mar 2014, 07:14

Dear Aimin,
thanks very much for your reply, your example worked on my machine and gave me a good flavour on what I expect to obtain,
however I am still struggling a bit with my case. Namely, when I try to produce an .mmap file and THEN a tosuchek_scattering
output file I get this

error: Momentum aperture file ends earlier than required
Program trace-back:

if it's not much of a hassle, I have uploaded my case. Expand the usual way, tar -zxvf touscat.tgz and you should have a directory
with all the relevant files:
-rw-rw-r-- 1 xph53246 dls_staff 12877 Mar 7 10:39 touscat_chamber.sdds
-rw-rw-r-- 1 xph53246 dls_staff 2338 Mar 7 10:39 touscat.ele
-rw-rw-r-- 1 xph53246 dls_staff 40312 Mar 7 10:38 touscat.lte
-rw-rw-r-- 1 xph53246 dls_staff 139778 Mar 7 10:59 touscat.mag
-rw-rw-r-- 1 xph53246 dls_staff 11889 Mar 7 10:59 touscat.mmap
-rw-rw-r-- 1 xph53246 dls_staff 869987 Mar 7 10:40 touscat.paramOpt
-rw-rw-r-- 1 xph53246 dls_staff 417402 Mar 7 10:40 touscat.twi

if you try and run elegant touscat.ele you should reproduce the error.
Thanks a lot for you kind attention
Attachments
touscat.tgz
tarball with touschek scatter test
(267.04 KiB) Downloaded 753 times

xiaoam
Posts: 17
Joined: 12 Jun 2008, 09:27

Re: touschek_scatter

Post by xiaoam » 07 Mar 2014, 12:21

Macro,

The code guard the possible error that beamlines in run_setup and .mmap file are different. In your case, when you calculate .mmap, the beamline doesn't include the tscatter element. So, the code think you are using different lines for the calculation which is wrong. The problem can be solved:
1. Add &insert_elements block following every &run_setup block (the best way)
2. Add "match_position_only = 1" in the &touschek_scatter block (Disable detail beamline check and just do rough position check, not recommended unless you are very sure what you are doing)

Another issue I have seen in your .ele file is you mixed output file flavor with %s-%03ld.dis (each tscatter element has a different output file) and touscat.ini (a single output file, each tscatter element has a different output page). The code allows only one or the other, not a mixture.

aimin

Post Reply