Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

G4ParticleMessenger: fix incorrect GetCurrentValue implementation for G4ParticleMessenger #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

veprbl
Copy link

@veprbl veprbl commented Jun 22, 2024

This fixes a following bug:

Idle> /particle/select lambda
Idle> /particle/property/dump

--- G4ParticleDefinition ---
 Particle Name : lambda
 PDG particle code : 3122 [PDG anti-particle code: -3122]
 Mass [GeV/c2] : 1.11568     Width : 2.501e-15
 Lifetime [nsec] : 0.2631
 Charge [e]: 0
 Spin : 1/2
 Parity : 1
 Charge conjugation : 0
 Isospin : (I,Iz): (0/2 , 0/2 ) 
 GParity : 0
 MagneticMoment [MeV/T] : -1.93245e-14
 Quark contents     (d,u,s,c,b,t) : 1, 1, 1, 0, 0, 0
 AntiQuark contents               : 0, 0, 0, 0, 0, 0
 Lepton number : 0 Baryon number : 1
 Particle type : baryon [lambda]
G4DecayTable:  lambda
0:  BR:  0.639  [Phase Space]   :   proton pi-
1:  BR:  0.358  [Phase Space]   :   neutron pi0

Idle> /particle/property/decay/dump
Particle is not selected yet !! Command ignored.

The issue is that currentParticle is always nullptr, so when G4DecayTableMessenger tries to use GetCurrentStringValue with reGet=true default, it can never get a non-null particle pointer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant