BNLNPPS / esi-g4ox

0 stars 0 forks source link

Error from G4StackManager::PushOneTrack #16

Closed plexoos closed 2 months ago

plexoos commented 2 months ago

While running simg4ox as

./build/src/simg4ox -g esi-g4ox/geom/raindrop.gdml

the following exception is raised:

-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : Event10051
      issued by : G4StackManager::PushOneTrack
A track without proper process manager is pushed            into the track stack.
 Particle name : opticalphoton -- creaded by unknown process.
*** Fatal Exception *** core dump ***
 **** Track information is not available at this moment
 Step length : 0 fm  - total energy deposit : 0 eV 
Segmentation fault (core dumped)
plexoos commented 2 months ago

@ggalgoczi Have you seen this error in Geant4?

plexoos commented 2 months ago

What physics list should one be using for our optical photon simulation? I am currently using a generic one:

https://github.com/BNLNPPS/esi-g4ox/blob/43ba4c195b2c545241c415715aba02878e8873e1/src/simg4ox.cpp#L122-L123

ggalgoczi commented 2 months ago

Let me check. For some reason when I try to run the code I get, do you know why?: NP::load Failed to load from path out/photons.npy

I ran from /esi/esi-g4ox ./build/src/simg4ox -g geom/raindrop.gdml

I did run opticks-full-prepare

And got

<<< Geant4 Physics List simulation engine: G4GenericPhysicsList

G4GDML: Reading 'geom/raindrop.gdml'...
G4GDML: Reading definitions...
G4GDML: Reading materials...
G4GDML: Reading solids...
G4GDML: Reading structure...
G4GDML: Reading setup...
G4GDML: Reading 'geom/raindrop.gdml' done!
Stripping off GDML names of materials, solids and volumes ...
read photons
NP::load Failed to load from path out/photons.npy

root@npps0:~/esi-g4ox# pwd
/esi/esi-g4ox
plexoos commented 2 months ago

Just run ./build/src/simtox before the simg4ox command

Thanks for checking!

plexoos commented 2 months ago

simtox creates a npy file with initial random photons (opticks/sysrap/sphotons.h) coming from a torch (opticks/sysrap/storch.h) simg4ox reads those photons in and tries to start a Geant4 simulation

ggalgoczi commented 2 months ago

You were right, that the physics needed to be changed. I did that.

However also G4VUserActionInitialization needed to be defined since the G4VUserPrimaryGeneratorAction can only be assigned to G4VUserActionInitialization not UserInitialization.

(Also primgen should be a PrimaryGenerator type not G4VUserPrimaryGeneratorAction)

Here is the revised code, it runs for me without errors. Let me know if you need any further help with this! https://drive.google.com/file/d/1anGIMSIvFYuJQcoO7ywS1aIlGA6LuqO7/view?usp=drive_link