Xcoll release 0.6.0
What's Changed
- Important physics changes in Everest:
- Nuclear kick was sampled horizontally and vertically independently, but this distorts the distribution (the correct way is to sample polar)
- This change has a strong impact on the output angle distribution after scattering. Loss map simulations aren't really influenced, but individual particle tracks are!
- For crystals, the transition region from VR to AM is restored, but shorter ([tb, tb + tc]) to be in line with the Geant4 model. The original transition implementation can be activated with a compiler flag
- The ionisation loss calculation has been updated; fixed an issue in the excitation energy, and ionisation loss is now correctly applied stepwise. Also, straggling (with two Gaussians to approximate a Landau distribution) was added
- Crystal channelling output angle is restricted to [-tc, +tc] as expected from physics (though the distribution is still Gaussian)
- Optimised tilt assign logic in BaseCollimator by @lisepauwels in #135
- New elements
TransparentCollimatorandTransparentCrystal: these do not scatter particles, but can be used to log impacts LossMaphas been completely restructured. It can be loaded from json (and multiple jsons can be combined) and/or created fromParticles. Energy variables are now included by default. Ansshift can be introduced if wished, and loss maps without interpolation now work- New class
MultiLossMapthat combines different loss map types (e.g. beam 1 / beam 2 for off-momentum loss maps, or at different timestamps, or ...) LossMapobjects now have built-in plotting functions- The pencil distribution is calculated jaw-by-jaw, also whether or not each jaw individually converges or diverges with respect to the beam divergence
- The
XcollCollimatorAPIandXcollScatteringAPIhave been expanded into accessors. This provides the following new functionalities:line.collimators.namesandline.collimators.familieslist individual collimator names resp. a dict of collimator names per familyline.collimators.gapwill give a dict of all collimator names and their gaps. This can also be used as a setter, and works for any attributeline.collimators['tcp7'].gapwill list the gap of all collimators in the family'tcp7'. As all these have the same gap, only the value will be shown (instead of a dict). Similarly, line.collimators['tcp7'].gap = 8` will set the gap of all collimators in this family to 8 sigma. This too works for any attribute.for coll in line.collimators:will loop over the elementslen(line.collimators)gives the number of collimators in the line, andlen(line.collimators['tcp7')the number of collimators in that familyline.collimators.items(),line.collimators.keys(), andline.collimators.values()give it dict-like behaviour
Develop Updates
- Fix random seeds in non-deterministic tests by @szymonlopaciuk in #125
- Added kwargs to
pencilcalls (such that e.g. method='4d' can be passed) BaseEngineandBaseEnvironmentare adapted to be more robust and generic- Added string attributes to
_noexpr_fields - Use
pcas the base tracking quantity instead of energy in Everest - Correctly handle
record_impactsetc in initialisation RFSweepcan be reset, and automatically resets when initialised (for leftover sweeps from before with lingering values in theZetaShift)- Updated poetry api in pyproject.toml to be ready for its deprecation
- Code that was announced to be deprecated (like the
CollimatorManager) is now removed
New Contributors
- @lisepauwels made their first contribution in #135
Full Changelog: v0.5.12...v0.6.0