My step and track lengths are infinite - cause unknown

Geant4 Version: 10.07 Patch 3
Operating System: Slurm-environment Cluster
Compiler/Version: Unknown
CMake Version: 3.22.2


Hi everyone,

I’m new to the forum, and looking forward to meeting everybody. I am building a scintillation simulation that fires a 0.6617 MeV gamma particle into a scintillator inside a perfect reflector. For simplicity, the gamma is “fired” inside the scintillator mass.

My issue is that when I run the executable, the step and track length approach infinity. I manually set my cuts to 1mm, but to no avail. I’m at the end of my expertise, and suspect I must have missed something simple.

Where should I look to fix this issue? Is there a debugging tactic I should implement?

What is the scintillator material supposed to be? It seems like it might be vacuum. What physics list are you using?

Hi @Hayden_Nelson

I have seen this problem when using the shapes Gen Trap or twisted tube, they had a problem in the navigation functions. May I ask which shapes are you using?

I would be happy to debug it if you provide a stand alone Geant4 application that reproduces the problem.

Best,
Alvaro

Hi John,

I’m modeling my scintillator after EJ-200, or commercial doped-PVT. I chose to define my material using a custom G4MAterialPropertiesTable because I did not know if I could add additional properties to a predefined G4Material. Perhaps I made an error when defining my material? Here’s how I defined my EJ-200:

Here is my Physics List code, or at least that relevant to scintillation.

If you can offer any further guidance, I’d be deeply grateful.

Hi atolosad,

I am not running anything fancy, just a few nested G4Box’s.

Thank you for your offer to debug. How is the best way to go about providing you an application? Do you just need the compiled executable, or the CMakeList and all the build files?

I have made progress:

The infinite step-length has been corrected. I think it was because my ‘cuts’ method was not implemented properly. My steps are still too large -I want something along the lines of 0.5 mm per step. Any clue where I should look? Here’s my ‘setCuts’ methodology, if that helps:

image

Now I have an issue where the G4OpticalSurface between my ‘World’ and ‘Aluminum’ volumes will not reflect the gamma photons, nor have I observed any scintillation events. The ‘Aluminum’ volume is the mother volume for all my detectors and scintillators, and is supposed to trap the gamma rays I spawn inside the scintillator volume and any optical photons that originate there until they enter a detector volume and are killed.

NOTE: I added a 0.6617 MeV photon energy to my energy array, hoping that would solve the issue, but to no avail.

Hi,

I would need the whole project, cmake plus the source and headers please.

I think there is something weird going on, because I thought gammas would ignore the optical properties of the material, but it seems they are fooled by the world optical surface :S

Thank you for your time.

Best,
Alvaro

I cannot see anything obviously wrong with the material optical properties set up.

I see no obvious errors with the optical physics list. However, I am curious why you didn’t simply use one of the prebuilt physics lists like in the distribution example OpNovice:

  // Physics list
  G4VModularPhysicsList* physicsList = new FTFP_BERT;
  physicsList->ReplacePhysics(new G4EmStandardPhysics_option4());
  auto opticalPhysics = new G4OpticalPhysics();
  physicsList->RegisterPhysics(opticalPhysics);
  runManager->SetUserInitialization(physicsList);

I had no idea there was such an option, thank you for showing me. I’m still learning about best practices with Geant4, so I’ll see what these prebuilt physics lists offer.

I came across this topic and noticed you did not add an element nor material to your G4Material. I wonder if that wouldn’t be (part of) the problem. I suggest you try the following:

G4Material* EJ200 = new G4Material("EJ200", 1.023 * g/cm3, 2);
EJ200->AddMaterial("G4_PLASTIC_SC_VINYLTOLUENE");