Links

Content Skeleton

This Page

Previous topic

muon_simulation

Next topic

Muon Simulation Optimization Tricks

Tasks

Geant4 Profiling [DONE]

  • verify expectations of where CPU time is spent, check what the potential gains really are
  • base

Convert Detector Geometry from Solid to Surface representation

Requirement

Convert Geant4 geometry representation of solids and materials into surfaces (triangles) with inside/outside materials for each triangle. This simpler representation is needed in order to bring geometry onto GPU.

Geant4 Exports [DONE]

Learn details of existing Geant4 geometry functionality, to see what can be reused.

  • geant4 export VRML2 with VRML2FILE driver into a .wrl file
    • VRML2
    • precision issues in export observed
      • TODO: check if already fixed in later geant4, otherwise submit patch
  • geant4 export GDML
    • DONE GDML
    • truncation of volume names observed+fixed
      • TODO: check if already fixed in later geant4, otherwise submit patch

Geant4 Collada exporter [PURSUING]

Create Geant4 Collada(widely supported 3D format) exporter. Using a form of geometry representation that can easily be converted to the STL(a very simple 3D format) needed by Chroma.

  • Actually probably pycollada can be used to allow Chroma to directly access triangles from .dae files

Collada is in some sense intermediate to VRML2 and GDML, so the new exporter can draw upon those existing exporters.

Alternatives [ON HOLD]

Alternate workflows for G4 export and mesh conversion

  • HepRep ?
  • other geometry libraries: CGAL, BRL-CAD, ...

Decided that best to start from Geant4 and develop in that context initially.

Meshlab [ON HOLD]

Although meshlab can convert VRML2 into STL, this misses the material information.

  • meshlab import VRML2 MESHLAB
  • meshlab export STL
  • mesh visualization with meshlab, blender, freewrl

Geometry Validation

  • visualisation with meshlab, blender
  • surface properties, retaining volume/surface identity into a mesh representation

Chroma Installation

Need an easily reproducible installation approach for NuWa+Chroma and its many dependencies http://chroma.bitbucket.org/install/details.html Extending dybinst and NuWa/LCG_Builders presumably the way to go,

  • probably the CUDA toolkit needs to be excluded, using the local installs

Chroma is aggressive about versions, how critical these are is unknown

  • GEANT4.9.5 or later [lots of work needed to bring all of geant4 up to 4.9.5, maybe just patches for issues?]
  • ROOT 5.32 or later

Geant4/Chroma integration

grab cohort of optical photons

StackAction better than TrackingAction (currently used), advantages:

  • “interestingness” optimisation, only propagate OP for interesting events
  • delay OP tracks, collecting their parameters then give them back modified to be just before step onto sensitive detector volumes

parallel GPU transport

give back to G4 at sensitive detectors

Need seemless integration with the rest of the reconstruction chain

maybe more general approach

Drop in replacement for some Geant4 classes which provide the GPU acceleration with minimal disturbance. Perhaps:

  • processes/transportation/src/G4Transportation.cc
  • geometry/navigation/src/G4TransportationManager.cc

Usual Geant4 API approach of eg providing UserStackingAction requires custom handling. Complications: geometry conversion.

CUDA/Chroma testing

  • test hardware
  • perform standalone Chroma operation tests

Chroma vs G4 Optical Process Validation

  • establish statistical equivalence between Chroma and G4

Glossary

OP
Geant4 Optical Photons are distinct from Gammas, assigned special PDG code 20022