Skip to content

Xcoll release 0.4.0

Choose a tag to compare

@freddieknets freddieknets released this 29 May 01:52
· 603 commits to main since this release
f67379d

What's Changed

  • CollimatorManager has been deprecated. This is a profound change; all its functionalities have been ported as independent functions in Xcoll:
    • Collimators can be installed in a line by using xcoll.install_elements() though they can also be managed by (a simplified version of) the CollimatorDatabase (which can be initialised manually or from a *.yaml file)
    • Optics need to be attached to the individual collimator BeamElements (using xcoll.assign_optics_to_collimators()). This ensures an easy syncing between gap and jaw. Other useful functions are xcoll.open_collimators() and xcoll.send_to_parking() to fully open / send to parking all collimators (or a subset), and xcoll.enable_scattering() and xcoll.disable_scattering() to activate Everest scattering for all relevant elements in the line
    • Initial conditions can be generated by xcoll.generate_pencil_on_collimator() and xcoll.generate_delta_from_dispersion() (InitialPart by @simoneotelie in #53; Test for initial_distribution.py by @simoneotelie in #62). This is still rather slow and needs to be optimised.
    • New LossMap class to analyse losses on collimators and the aperture (Loss map by @simoneotelie in #41). The next step is to port plotting from the lossmaps package
    • No more manager! by @freddieknets in #73
  • Collimator gaps ( in sigma) are centred around the closed orbit, while the jaws (in meters) are centred around the reference frame:
  • Scattering code has been split between geometry and material interaction. This allows for much easier code maintenance and development, and new features have been added.
    • Geometry is defined at the C level in a very generic way (and collected in an XcollGeometry object). Collimators are represented as 2D objects, consisting of a set of Segments. So far, three Segment types exist: a LineSegment, a HalfOpenLineSegment, and a CircularSegment. It is rather trivial to extend these. Concerning objects, we have a collimator jaw, a generic polygon, and a crystal layout (First crystal geometry by @freddieknets in #71). Different methods are provided to find the crossings of a particle trajectory with these objects, potentially including a height restriction. It is rather trivial to add new objects (hence this is a step closer to adding the jaw flatness).
    • The exact same geometry code is used for the BlackAbsorber as for the EverestCollimator. So the tests of the former represent tests of the geometry code as well.
    • Added casting to unsigned int to ensure positive value for malloc by @simoneotelie in #72
  • The Everest material interaction code has been completely rewritten, for readability, maintability, and bugfixes; though a few open points / questions / TODOs remain
  • In particular for the crystal, this release accumulates almost one year of work on the crystal material interaction routine. Several bugfixes have been deployed, and the structural logic flow has been updated to allow for long crystals. A few open points / questions / TODOs remain
  • The API of the crystal has changed: the attributes no longer have the _L / _R distinction (gap instead of gap_L, jaw_U instead of jaw_LU, etc)
  • Final implementation of an impact table: InteractionRecord which keeps track of all touches and all interactions inside (both can be activated and deactivated independently). This is missing some dedicated tests and examples.
  • Release 0.4.0 by @freddieknets in #74

Develop Updates

  • BaseCrystal is the new abstract parent for all crystals (and it does not inherit from BaseCollimator due to the different API)
  • BlackCrystal is the crystal variant of the BlackAbsorber. This is useful for testing and debugging (to find which particles hit the crystal and where)
  • Lots of improvements on all tests (both in execution speed and reliability)
  • All examples are updated to the new API
  • Removed inactive front and back, and renamed active_length as length
  • Adapted code to be compatible with latest Xtrack releases

New Contributors

Full Changelog: v0.3.6...v0.4.0