Skip to content

Optimize process lookup using Geant4 model catalog #537

Description

@atolosadelgado

Dear developers,

Please consider using the Geant4 model catalog [1] to identify the process responsible for creating the particle from the G4Track object [2].

This approach is expected to improve simulation performance, as comparing an integer identifier from G4Track is more efficient than comparing the process name [3] or performing multiple levels of indirection [4].

Best,
Alvaro

[1] https://github.com/Geant4/geant4/blob/a499fb82e9d3310f83c34f52806127561bdaab40/source/global/management/src/G4PhysicsModelCatalog.cc
[2] https://github.com/Geant4/geant4/blob/a499fb82e9d3310f83c34f52806127561bdaab40/source/track/include/G4Track.hh#L224
[3]

auto procName = track->GetCreatorProcess()->GetProcessName();

[4]
G4ProcessManager* pm = track->GetDefinition()->GetProcessManager();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions