-
Notifications
You must be signed in to change notification settings - Fork 99
Correct a bug because of adding particles to Geant4 (fMC is null) #858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hi @kgertsenberger, which version of Geant4 do you use? I am asking because I haven't seen the problem so far. |
|
Good Day. |
|
We use Geant4 10..2.1 version.
But the error occurs only when a user adds new particles via FairRunSim::AddParticle function. We add New particles in our generator LAQGSM. The genarators integrated in FaiRoot do not add own particles manually.
I also have some generator adding new particles. What is the behaviour when using the old code? Is it code simply crashing or are the particles not added to Geant4?
…
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
|
We manually add some new particles in our LAQGSMGenerator class via g4config.C calls TGeant4 constructor which calls FairMCApplication::AddPatrticles with fMC zero pointer, because fMC will be initialized in fApp->InitMC. The following exception happens on the line "fMC->DefineParticle(particle->GetPDG(), ..." |
The exception occurs when a user adds new particles to Geant4 to transport
Geant 4 calls AddParticles() function (FairMCApplication class) in own constructor but fMC pointer is initialized later in FairRunSim (fApp->InitMC).
fMC pointer (which is 0x00 in the case) was replaced by TVirtualMC::GetMC in FairMCApplication::AddParticles(), and some cosmetic modifications were made to simplify reading the function.