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(); |
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]
k4geo/plugins/SCEPCal_MainSDAction.cpp
Line 65 in f19536d
[4]
k4geo/plugins/DRCaloFastSimModel.h
Line 273 in f19536d