Problem 1882 - Impossible to define a new custom command in class extending G4VUserPrimaryGeneratorAction
Summary: Impossible to define a new custom command in class extending G4VUserPrimaryGe...
Status: RESOLVED WONTFIX
Alias: None
Product: Geant4
Classification: Unclassified
Component: intercoms (show other problems)
Version: 10.2
Hardware: All All
: P4 normal
Assignee: asai
URL:
Depends on:
Blocks:
 
Reported: 2016-08-26 12:10 CEST by Dan Ciubotaru
Modified: 2016-10-25 11:57 CEST (History)
2 users (show)

See Also:


Attachments
reproducible test case (54.52 KB, application/x-tar)
2016-08-26 12:10 CEST, Dan Ciubotaru
Details

Note You need to log in before you can comment on or make changes to this problem.
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