Problem 1882

Summary: Impossible to define a new custom command in class extending G4VUserPrimaryGeneratorAction
Product: Geant4 Reporter: Dan Ciubotaru <dan.andrei.ciubotaru>
Component: intercomsAssignee: asai
Status: RESOLVED WONTFIX    
Severity: normal CC: pere.mato, Witold.Pokorski
Priority: P4    
Version: 10.2   
Hardware: All   
OS: All   
Attachments: reproducible test case

Description Dan Ciubotaru 2016-08-26 12:10:33 CEST
Created attachment 409 [details]
reproducible test case

We spent some time to figure out why our custom action was not working. It seems when we declare a custom command in a class extending G4VUserPrimaryGeneratorAction the associate method is not called.

The problem can be always reproduced and attached you find a very simple reproducible test case (base on example B5) you can use to figure it out.

In our test case we modified the files:
B5PrimaryGeneratorAction.hh
B5PrimaryGeneratorAction.cc

Calling the command:
/B5/generator/echo 5

We expect to receive "The command was successfully called with value 5 param !!!" but we get nothing. In other classes, it runs without any problem.

Best regards
Dan
Comment 1 Witold.Pokorski 2016-09-16 09:22:29 CEST
Hi Dan,

I have installed your code and run the echo command, and I do see the correct output:

/B5/generator/echo 5
The command was successfully called with value 5 param !!!

So, unfortunately I can't reproduce the problem...
I am running on my MacOS laptop. 

What is your platform?
Do you call the /B5/generator/echo 5 interactively (from G4 prompt) or you run some .mac file? 
For me it works OK in both cases, but if you run with a .mac file, please send it, so I can also try.

Cheers,
Witek
Comment 2 Dan Ciubotaru 2016-09-19 15:00:47 CEST
It seems it is a problem of geant4.10.02.p02.
With the last beta version (geant4-10.03.b01) the problem is resolved.

You can close the bug if you think the fix does not need to be back-ported.
Regards