Optical photon distribution

_Geant4 Version:_10.0.7
_Operating System:_linux
_CMake Version:_3.25.1

I am simulating a scintillator detector with 1 MeV gamma. I am getting the corrected energy spectra when 1 MeV gamma deposits its energy in the crystal. I am able to visualize the optical photon generated in a single event.
But i am not getting the correct time distribution when I am collecting the optical photons in cathode. Instead of distribution I am getting only one arrival time in each event.
Here is the code:
const G4String currentPhysicalName
= aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName();

if (currentPhysicalName == “Cathode”){

		   const G4String particleName
= aStep->GetTrack()->GetDefinition()->GetParticleName();
if (particleName == "opticalphoton"){ 
            fEventAction->absTime = aStep -> GetPreStepPoint() -> GetGlobalTime();

Every time this line runs, absTime is reset. You probably want a histogram here instead.

I have wrapped the scintillator material with teflon reflector. Now I want to know which model must use for reflection mechanism ? For realistic mechanism we must use Unified model (accrding to the Manual of Geant4).
I have checked people used Unified model with SetType(dielectric_metal).
However, Physics Processes — Book For Application Developers 11.2 documentation , here it was mentioned that UNIFIED model applies to dielectric-dielectric interfaces.
Can anyone clarify this ?

The Unified model works for both dielectric-dielectric and dielectric-metal interfaces.

@dsawkey I have added this line as optical properties. However, I found that the results does not change when I vary the SCINTILLATIONRISETIME.

Another problem is that , the results remain same whether I add this above line or not. Can you please tell me what is going on?

In addition to this I am getting few warning on the terminal, although I am getting correct results,
-------- WWWW ------- G4Exception-START -------- WWWW -------
***** G4Exception : Optical0021**
** issued by : G4OpticalPhysics**
Method G4OpticalPhysics::SetScintillationYieldFactor is deprecated.
Use G4OpticalParameters::SetScintYieldFactor(G4double) instead.
***** This is just a warning message. *****
-------- WWWW -------- G4Exception-END --------- WWWW -------

-------- WWWW ------- G4Exception-START -------- WWWW -------
***** G4Exception : Optical0021**
** issued by : G4OpticalPhysics**
Method G4OpticalPhysics::SetScintillationExcitationRatio is deprecated.
Use G4OpticalParameters::SetScintExcitationRatio(G4double) instead.
***** This is just a warning message. *****
-------- WWWW -------- G4Exception-END --------- WWWW -------

-------- WWWW ------- G4Exception-START -------- WWWW -------
***** G4Exception : Optical0021**
** issued by : G4OpticalPhysics**
Method G4OpticalPhysics::SetTrackSecondariesFirst is deprecated.
Use G4OpticalParameters::Set[Cerenkov/Scint]TrackSecondariesFirst(G4bool) instead.
***** This is just a warning message. *****
-------- WWWW -------- G4Exception-END --------- WWWW -------

** was defined in terms of KineticEnergy: 1GeV**
** is now defined in terms Momentum: 0GeV/c**
### Birks coefficients used in run time
<<< Geant4 Physics List simulation engine: FTFP_BERT

-------- WWWW ------- G4Exception-START -------- WWWW -------
***** G4Exception : Run0201**
** issued by : G4VModularPhysicsList::RegisterPhysics**
Geant4 kernel is not PreInit state : Method ignored.
***** This is just a warning message. *****

@dsawkey I tried to fix the issue with opticalPhysics->SetFiniteRiseTime(true); in my physicslist , but it showing error.

I guess you mean 10.7? At any rate, the library has evolved since 10.X versions and I think you are using documentation (or pre-existing code) from a different Geant4 version than you are compiling against.

The best way of starting with optical physics is to follow what is in the extended/optical examples. That is, use G4OpticalPhysics and change parameters with G4OpticalParameters.

This message:

tells me the physics is configured incorrectly in main(). After that, nothing is likely to work correctly.

1 Like

Dear @dsawkey , I have followed your instructions and I have included this prosecces in my physicslist and getting no warning like before, thank you so much.

RegisterPhysics(new G4EmStandardPhysics());
G4OpticalPhysics* opticalPhysics = new G4OpticalPhysics();

G4OpticalParameters *opticalParams= G4OpticalParameters::Instance();

When I add this line opticalParams->SetScintFiniteRiseTime(true); Still there is no warning.
However, when I do /run/beamOn 10 its showing

-------- EEEE ------- G4Exception-START -------- EEEE -------
***** G4Exception : mat202**
** issued by : G4MaterialPropertiesTable::GetConstProperty()**
Constant Material Property Index 13 not found.
***** Fatal Exception *** core dump *****
G4Track (0x5584256c25e0) - track ID = 1, parent ID = 0
** Particle type : gamma - creator process : not available**

Please tell me how to include rise time ? I am using Geant4 version : geant4-10-07-patch-03.
I have read the documentation by Alexander Howard, here it says setFiniteRiseTime can be included through macro command in Geant4 version 10.7 and previous.

I added this line ** /process/optical/scintillation/setFiniteRiseTime true** in vis.mac , however its showing
-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : mat202
issued by : G4MaterialPropertiesTable::GetConstProperty()
Constant Material Property Index 13 not found.
*** Fatal Exception *** core dump ***
G4Track (0x55db9398cc00) - track ID = 1, parent ID = 0
Particle type : gamma - creator process : not available
Kinetic energy : 0 eV - Momentum direction : (-0.0581339,-0.484746,-0.872721)
Step length : 779.873 um - total energy deposit : 6.5133 keV
@dsawkey this line /process/optical/scintillation/setFiniteRiseTime true also benn there in OpNovice2 example of Geant4 version : geant4-10-07-patch-03.

The error occurs because a process is expecting a material property to be defined by you, but it is not.

(“Constant” means independent of energy.) The error only tells you that it expects property #13 to be defined. You need to go the where these are defined:


and count. Looks like DIFFUSION, which is not related to optical physics.

In the latest version of Geant4, 11.2, the error message says the name of the missing property.

Did you define the rise time in your material properties? See the optical examples.


Yes. I have defined rise time in material properties. You can see here
mpt->AddConstProperty(“RESOLUTIONSCALE”,1.0); //
mpt->AddConstProperty(“FASTTIMECONSTANT”, 19.ns);
Now , the code is running without no error. However, there was no change in result when I vary the SCINTILLATIONRISETIME.
After that, I have added this line /process/optical/scintillation/setFiniteRiseTime true in vis.mac. Then I am getting the error “Constant Material Property Index 13 not found.”
When I do write /process/optical/scintillation/setFiniteRiseTime false then there is no error. Hope you understand my problem. Enabling the finite rise time making problems.

This isn’t the correct name.

We’ve slowly been trying to improve the user interface, and with Geant4 11.0 and later this statement will give an error.

@dsawkey well, I am using Geant4 version 10.7 .

And, I could see that this property name been defined in the link you shared .

Another point is that, If I use mpt->AddConstProperty(“FASTSCINTILLATIONRISETIME”,0.7*ns); I am not getting any error like before. Also results changes if I vary this parameter.

I don’t understand the physical difference between FASTSCINTILLATIONRISETIME and SCINTILLATIONRISETIME.

No, it’s not. Check very carefully. And notice the “1” at the end.

In version 10.6 there were FAST and SLOW channels. In 11.0 there are channels 1,2 and 3. There is no physical difference, but obviously there are more of them now. In 10.7 you have the choice of using either system. It doesn’t make sense to mix them as you are doing. This is described in detail in the Book for Application Developers. :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.