Skip to content

Geant4 open points #175

@freddieknets

Description

@freddieknets

TODO (short-term):

  • Tracking:
    • Check the preselection in C (and make it optional)
    • Double-check post-processing (virtual energy can result in negative numbers!)
    • Need a direct benchmark to a pure Geant4 model and tracking
    • Ions have issues: very weird return distribution (see dedicated issue)
    • Returned masses have weird variations (for the same particle type). This should not happen. Investigate and fix
    • test_geant4_many_particles.py::test_lead[hit-geant4] fails sometimes for (acc ion loss not accounted for, or something like that?)
    • Jaw accuracy is up to 5e-9 (bad), though only a few random particles (and only on the inside) following a tilted slope in (x, px)
    • Should _accumulated_ion_loss not be a collimator property, but use a dedicated particle state (one particle per collimator representing this)?
    • Upstream s position is shifted 250um. Is this valid? Double-check, and verify downstream s position
  • Implement Geant4Crystal
  • Implement Geant4Block
  • Should Geant4CollimatorTip really be a separate element?
  • Make compatible with prebuild kernels: how to resolve the dependency on pybind11?
  • Implement BdsimCollimator in pure python using the new python links in BDSIM
  • Code compatibility with new Material
  • Return particle type selections
  • Better control over physics processes in Geant4, return types, and cuts etc
  • Two engines in parallel (e.g. some FLUKA elements and some Geant4 elements) cause issues (different cwd)!
  • Sometimes many_particles test fails as the energy does not sum while there is no Eacc, Evirtual, Emassless, nor Eout. This is weird and not understood. Example (100 Pb208):
 >           assert np.isclose(E0*alive_before, Edead + Eacc + Evirtual + Emassless + Eout, atol=100*tol, rtol=tol)
E           assert np.False_
E            +  where np.False_ = <function isclose at 0x1118bd430>((np.float64(557600033653993.8) * np.int64(100)), ((((LinkedArrayCpu(5.55454199e+16) + np.float64(0.0)) + LinkedArrayCpu(0.)) + LinkedArrayCpu(0.)) + LinkedArrayCpu(0.)), atol=(100 * 1e-12), rtol=1e-12)
E            +    where <function isclose at 0x1118bd430> = np.isclose

TODO (long-term):

  • Translate C++ code (previous collimasim) into extern C { } to avoid dependency on pybind11 and get smooth Xsuite-C
  • Implement generic geometry in GMAD

Ideas:

  • Can we make the Geant4 elements OpenMP-compatible?
  • Maybe the engines should not be global, such that multiple connections can be ran in parallel in the same Python session? As a solution for OpenMP?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions