For multi-threaded version, define G4VUserPrimaryGeneratorAction in G4VUserActionInitialization.

Hello,

I am currently trying to read in particles from a input GENIE root file using Geant4 11.0.1. I have ActionInitialization defined and implemented. In my ActionInitialization::Build(), I call SetUserAction(new PrimaryGeneration);

void ActionInitialization::Build() const
{
  SetUserAction(new PrimaryGeneration);
  SetUserAction(new RunAction);
  SetUserAction(new EventAction);
  SetUserAction(new TrackingAction);
  SetUserAction(new SteppingAction);
}

At runtime, Geant4 complains with

*** G4Exception : Run0123
      issued by : G4MTRunManager::SetUserAction()
For multi-threaded version, define G4VUserPrimaryGeneratorAction in G4VUserActionInitialization.
*** Fatal Exception *** core dump ***
**** Track information is not available at this moment
**** Step information is not available at this moment

This shouldn’t happen because the ActionInitialization::SetUserAction() should handle things properly.

Any suggestions?

Dave

I’ve been trying to help Dave with this. In my simulation framework, with essentially the same Build() function (more like exampleB1’s), I do not see this error with Geant4 10.6 or 10.7.

Has the procedure for registering actions changed with the G4 11 release?

What you do in your ActionInitialization is correct.
Could you check if there still remains a code in your main() that instantiates PrimaryAction and sets directly to RunManager?

Thanks for the reply, Makoto! I’ve checked the version of main() that is “supposed” to be getting compiled, and it does have all the old SetUserAction() calls removed. I have a question out to Dave if there’s any chance that his build script is pick up the wrong source directory.