| Summary: | G4WrapperProcess crashes with Geant4 10.0 | ||
|---|---|---|---|
| Product: | Bugzilla | Reporter: | Soon <whokion> |
| Component: | general | Assignee: | Koichi Murakami <Koichi.Murakami> |
| Status: | RESOLVED MOVED | ||
| Severity: | normal | CC: | andrea.dotti |
| Priority: | P5 | ||
| Version: | other | ||
| Hardware: | PC | ||
| OS: | Linux | ||
*** Problem 1624 has been marked as a duplicate of this problem. *** Reported the problem in the wrong category and move to process/biasing |
G4WrapperProcess is broken with 10.0 since masterProcess has a null pointer (for example inside G4VEnergyLossProcess when tried to implement a wrapper process for G4eBremsstrahung or G4eIonization). The same application runs fine with 9.6.p03. Following is a possible cure suggested by Andrea Dotti: When using a wrapper around a class of type G4VPRocess, with version 10.0 there is an important point to take into account. A new G4VProcess (base class) interface should be used to set correctly the pointer to the master. virtual void G4VProcess::SetMasterProcess( G4VProcess* masterP ); This method is called by G4 kernel passing the master pointer of the same process (in this case an instance of G4WrapperProcess) to the worker thread. G4WrapperProcess should forward this call to the underlying process, implementing the following line of code: virtual void SetMasterProcess(G4VProcess* masterP) { pRegProcess->SetMasterProcess(static_cast<G4WrapperProcess*> (masterP)->GetRegisteredProcess() ); };