How to activate optical photons

Dear all,

I am taking images of a spherical ball with a fast neutron detector (OPPAC). I am able to detect protons and record positions and every without problems. Now I want to activate optical photons in my detector but I cannot detect any optical photons. In my physics I have this hoping it can help me create optical photons but I still cannot see any optical photons produce. Does anyone have an idea how to do this?

“”
// Neutron Physics
RegisterPhysics( new NeutronHPphysics(“neutronHP”));
// Optical Physics
RegisterPhysics(new G4EmStandardPhysics_option4());
G4OpticalPhysics* opticalPhysics = new G4OpticalPhysics();
RegisterPhysics(opticalPhysics);

“”

Geant4 Version: geant4-v11.1.3

_Operating System: Ubuntu 20.04.6 LTS
_Compiler/Version: c++
_CMake Version: VERSION 2.6 FATAL_ERROR

Dear Harriet,

The physics looks fine.

In order to transport the optical photons, materials must have defined a refractive index, see for example the detector constructor of this example provided by Geant4.

There are other optical properties that may be of interest for your application, as explained in the docs.

Since version 11, some optical properties are predefined for you, as explained here.

Usually the scintillators are in contact with a reflective surface, so definition of such boundary is also needed.

In addition to the official documentation, optical physics is also covered during the Geant4 advance course, e.g. 2023 edition. The recording of the session are available as well in CDS or indico.

I hope this helps.

Best,
Alvaro

thank you for your responds I did define the parameters following the guide but I still cant detect optical photons. this is the part I have in my construction.

“”
const G4int iNbEntries_1 = 3;
G4double CF4PhotonMomentum_1[iNbEntries_1] = {200eV,500eV,700*eV};
G4double CF4RefractiveIndex[iNbEntries_1] = {1.004,1.004,1.004};
G4double CF4AbsorbtionLength[iNbEntries_1] = {100.*cm, 100.*cm, 100.*cm};
G4double CF4ScatteringLength[iNbEntries_1] = {30.*cm, 30.*cm, 30.*cm};
G4MaterialPropertiesTable *CF4PropertiesTable = new G4MaterialPropertiesTable();
CF4PropertiesTable->AddProperty(“FASTCOMPONENT”, CF4PhotonMomentum, CF4Scintillation_Fast, iNbEntries,true);
CF4PropertiesTable->AddProperty(“SLOWCOMPONENT”, CF4PhotonMomentum, CF4Scintillation_Slow, iNbEntries,true);
CF4PropertiesTable->AddProperty(“RINDEX”, CF4PhotonMomentum_1, CF4RefractiveIndex, iNbEntries_1);
CF4PropertiesTable->AddProperty(“ABSLENGTH”, CF4PhotonMomentum_1, CF4AbsorbtionLength, iNbEntries_1);
CF4PropertiesTable->AddProperty(“RAYLEIGH”, CF4PhotonMomentum_1, CF4ScatteringLength, iNbEntries_1);
CF4PropertiesTable->AddConstProperty(“SCINTILLATIONYIELD”, 2500./keV,true); // for electron recoil
CF4PropertiesTable->AddConstProperty(“RESOLUTIONSCALE”, 1.0);
CF4PropertiesTable->AddConstProperty(“FASTTIMECONSTANT”, 3.*ns,true);
CF4PropertiesTable->AddConstProperty(“SLOWTIMECONSTANT”, 10.*ns,true);
CF4PropertiesTable->AddConstProperty(“YIELDRATIO”, 1.0,true);
CF4->SetMaterialPropertiesTable(CF4PropertiesTable);
“”

Can you enable /tracking/verbose 2 to see if the photons are created?

If the photons are created and transported properly, the issue may be in the detection method.

When I have to deal with these situations I like to enable the Qt interface, to see with my own eyes where the optical photons are going.

Best,
Alvaro

1 Like


this is what I see I do not see any photons created just protons, neutrons and electrons.

May I suggest to use the builtin physics list? (for the sake of reproducibility)

For example, in your main function, you may setup the physics by doing:

G4VModularPhysicsList* physicsList = new FTFP_BERT_EMZ_HP;
physicsList->RegisterPhysics( new G4OpticalPhysics );
runManager->SetUserInitialization( physicsList );

EMZ is the most accurate EM physics, HP for neutrons, FTFpBert for hadronic processes.

It is a bit rare that 100 keV neutrons are not doing anything :slight_smile:

sorry for the late reply but I get error when I tried to add this.

/home/harriet/Geant4/neutron_example/Neutron_optical_detector/sim.cc:19:10: fatal error: FTFP_BERT_EMZ_HP.hh: No such file or directory
19 | #include “FTFP_BERT_EMZ_HP.hh”
| ^~~~~~~~~~~~~~~~~~~~~

Sorry, may you try with the Physics Lists Factory, as explained in this example?

// To be able to use and combine the refrence physics lists
#include "G4PhysListFactory.hh"
#include "G4ThermalNeutrons.hh"
...
int main()
...
    const G4String plName = "FTFP_BERT_EMZ";
    G4PhysListFactory plFactory;
    G4VModularPhysicsList *pl = plFactory.GetReferencePhysList( plName );
    runManager->SetUserInitialization( pl );

Best,
Alvaro

sorry in my main code. I have this.

G4VModularPhysicsList* physicsList = new FTFP_BERT_HP;
//physicsList->ReplacePhysics(new G4EmStandardPhysics_option4());
//auto opticalPhysics = new G4OpticalPhysics();
const G4String plName = “FTFP_BERT_EMZ”;
G4PhysListFactory plFactory;
G4VModularPhysicsList *pl = plFactory.GetReferencePhysList( plName );
runManager->SetUserInitialization( pl );

physicsList->RegisterPhysics(new G4OpticalPhysics);
runManager->SetUserInitialization(physicsList);

is that ok?

Hi,

sorry, Optical Physics has to be registered into the G4VModularPhysicsList object before registering the Physics list into the run manager,

// To be able to use and combine the refrence physics lists
#include "G4PhysListFactory.hh"
#include "G4ThermalNeutrons.hh"
...
int main()
...
    const G4String plName = "FTFP_BERT_EMZ";
    G4PhysListFactory plFactory;
    G4VModularPhysicsList *pl = plFactory.GetReferencePhysList( plName );
    pl->RegisterPhysics(new G4OpticalPhysics);
    runManager->SetUserInitialization( pl );