Skip to content

Xcoll release 0.6.0

Choose a tag to compare

@freddieknets freddieknets released this 19 Jun 01:17
· 305 commits to main since this release
eef90a3

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 TransparentCollimator and TransparentCrystal: these do not scatter particles, but can be used to log impacts
  • LossMap has been completely restructured. It can be loaded from json (and multiple jsons can be combined) and/or created from Particles. Energy variables are now included by default. An s shift can be introduced if wished, and loss maps without interpolation now work
  • New class MultiLossMap that combines different loss map types (e.g. beam 1 / beam 2 for off-momentum loss maps, or at different timestamps, or ...)
  • LossMap objects 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 XcollCollimatorAPI and XcollScatteringAPI have been expanded into accessors. This provides the following new functionalities:
    • line.collimators.names and line.collimators.families list individual collimator names resp. a dict of collimator names per family
    • line.collimators.gap will give a dict of all collimator names and their gaps. This can also be used as a setter, and works for any attribute
    • line.collimators['tcp7'].gap will 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 elements
    • len(line.collimators) gives the number of collimators in the line, and len(line.collimators['tcp7') the number of collimators in that family
    • line.collimators.items(), line.collimators.keys(), and line.collimators.values() give it dict-like behaviour

Develop Updates

  • Fix random seeds in non-deterministic tests by @szymonlopaciuk in #125
  • Added kwargs to pencil calls (such that e.g. method='4d' can be passed)
  • BaseEngine and BaseEnvironment are adapted to be more robust and generic
  • Added string attributes to _noexpr_fields
  • Use pc as the base tracking quantity instead of energy in Everest
  • Correctly handle record_impacts etc in initialisation
  • RFSweep can be reset, and automatically resets when initialised (for leftover sweeps from before with lingering values in the ZetaShift)
  • 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

Full Changelog: v0.5.12...v0.6.0