JeffersonLab / HDGeant4

Geant4 simulation for the GlueX experiment
4 stars 4 forks source link

Bug in GEANT4 10.04.p02 brakes command '/particle/select <particle>' #214

Closed bgrube closed 1 year ago

bgrube commented 1 year ago

I would like to use GEANT's command interface to modify some branching fractions that GEANT uses to decay particles. For this, I first have to select the particle I want to modify with /particle/select <particle> (in my case, the particles are eta and eta_prime). It turns out that there is a bug in GEANT4 10.04.p02, which makes all calls to /particle/select <particle> after the first one to set an invalid decay table so that GEANT complains that "The particle has no decay table !! Command ignored." although the table clearly exists.

The problem is a missing closing brace after line https://github.com/Geant4/geant4/blob/4873be17004e263ad19e7319b63f52246fd7f211/source/particles/management/src/G4DecayTableMessenger.cc#L170. This is known and was fixed e.g. in GEANT4 10.06.p01 (cf. https://github.com/Geant4/geant4/blob/b14d73978beaee6f5b6694ddbfe0dd54c7cdcf19/source/particles/management/src/G4DecayTableMessenger.cc#L170).

If possible, it would be good to backport this fix into GlueX's GEANT4 10.04.p02 installation. It seems that a mechanism to do this is already in place in form of the https://github.com/JeffersonLab/HDGeant4/tree/master/src/G4.10.04.p02fixes directory. However, I'm not sure how to use it correctly. Any input would be appreciated.

rjones30 commented 1 year ago

Hello Boris, this patch has been added to HDGeant4/src/G4.10.04.p02fixes in the master branch. As soon as the build is updated on the jlab machines, you should see the fix installed in the nightly build release. -Richard Jones

On Mon, Feb 27, 2023 at 5:12 PM Boris Grube @.***> wrote:

I would like to use GEANT's command interface to modify some branching fractions that GEANT uses to decay particles. For this, I first have to select the particle I want to modify with /particle/select (in my case, the particles are eta and eta_prime). It turns out that there is a bug in GEANT4 10.04.p02, which makes all calls to /particle/select

after the first one to set an invalid decay table so that GEANT complains that "The particle has no decay table !! Command ignored." although the table clearly exists. The problem is a missing closing brace after line https://github.com/Geant4/geant4/blob/4873be17004e263ad19e7319b63f52246fd7f211/source/particles/management/src/G4DecayTableMessenger.cc#L170. This is known and was fixed e.g. in GEANT4 10.06.p01 (cf. https://github.com/Geant4/geant4/blob/b14d73978beaee6f5b6694ddbfe0dd54c7cdcf19/source/particles/management/src/G4DecayTableMessenger.cc#L170 ). If possible, it would be good to backport this fix into GlueX's GEANT4 10.04.p02 installation. It seems that a mechanism to do this is already in place in form of the https://github.com/JeffersonLab/HDGeant4/tree/master/src/G4.10.04.p02fixes directory. However, I'm not sure how to use it correctly. Any input would be appreciated. — Reply to this email directly, view it on GitHub , or unsubscribe . You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
bgrube commented 1 year ago

Great! Thank you very much, Richard!

bgrube commented 1 year ago

Hey Richard! I tested the nightly from today and it works. Thanks again for your fast response!