Skip to content

Touschek#191

Open
gbrogginess wants to merge 61 commits into
xsuite:mainfrom
gbrogginess:touschek
Open

Touschek#191
gbrogginess wants to merge 61 commits into
xsuite:mainfrom
gbrogginess:touschek

Conversation

@gbrogginess

Copy link
Copy Markdown
Contributor

Description

This PR introduces the possibility to perform Monte Carlo simulations of Touschek scattering in xfields.

It provides:

  • a new TouschekScattering beam element implementing a Monte Carlo Touschek scattering kernel,

  • a TouschekManager that configures Touschek scattering centers using optics and a supplied local momentum aperture profile,

  • a TouschekCalculator that evaluates Piwinski Touschek scattering rates and integrated per-section rates, used to correctly weight scattered macroparticles.

This enables end-to-end Touschek studies within Xsuite, including generation of Touschek-scattered particles, tracking, Touschek loss maps analysis, and Touschek lifetime evaluations.

Checklist

Mandatory:

  • I have added tests to cover my changes
  • All the tests are passing, including my new ones
  • I described my changes in this PR description

Optional:

  • The code I wrote follows good style practices (see PEP 8 and PEP 20).
  • I have updated the docs in relation to my changes, if applicable
  • I have tested also GPU contexts

When a line is generated through MAD-X sequence conversion, the line end up having markers sequencename$start and sequencename$end. In the line table these are present, but they do not have an associated s position and this causes an error!
Prevented sampling of particles with |δ|>LMA in Touschek MC by reducing the
longitudinal cutoff per element where needed:

    nz_eff = min(nz, 0.9 * min(|δN|, δP) / σδ)

This ensures sampled δ stays strictly within the LMA,
avoiding pathological small-angle events with huge weights that distorted
RMC/RP and Touschek lifetime estimates.

- Adjustment is local: only elements with tight acceptance are clamped
- Prints a warning when nz_eff < nz
- Restores stable RMC/RP≈1 and meaningful lifetime results
Comment thread examples/006_touschek/000_touschek_toy_ring.py Outdated
Comment thread examples/006_touschek/000_touschek_toy_ring.py Outdated
Comment thread examples/006_touschek/000_touschek_toy_ring.py Outdated
Comment thread examples/006_touschek/000_touschek_toy_ring.py Outdated
Comment thread examples/006_touschek/000_touschek_toy_ring.py
Comment thread third_party/elegant/LICENSE Outdated
Comment thread xfields/touschek/README.md Outdated
Comment thread xfields/touschek/README.md Outdated
Comment thread MANIFEST.in Outdated
Comment thread MANIFEST.in

@giadarol giadarol left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a Touscheck chapter in Physics Guide

Comment thread xfields/touschek/manager.py
Comment thread xfields/touschek/manager.py
@gbrogginess

Copy link
Copy Markdown
Contributor Author

All requested changes have been applied.

I will open a pull request in xsuite to include information about Touschek in the Xsuite documentation and in the Xsuite physics guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants